From b0dd10f8171945e0c1f3527dd1e9d18b043e01a7 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Aug 2006 17:25:49 +0000 Subject: [PATCH 0001/2544] Initial Import --- index.php | 81 + license.txt | 52 + system/application/config/autoload.php | 101 + system/application/config/config.php | 244 +++ system/application/config/database.php | 57 + system/application/config/index.html | 15 + system/application/config/mimes.php | 103 + system/application/config/routes.php | 49 + system/application/controllers/index.html | 15 + system/application/controllers/welcome.php | 15 + system/application/errors/error_404.php | 35 + system/application/errors/error_db.php | 34 + system/application/errors/error_general.php | 34 + system/application/errors/error_php.php | 10 + system/application/errors/index.html | 15 + system/application/models/index.html | 15 + system/application/scripts/index.html | 15 + system/application/views/index.html | 15 + system/application/views/welcome_message.php | 62 + system/cache/index.html | 15 + system/codeigniter/Base4.php | 58 + system/codeigniter/Base5.php | 62 + system/codeigniter/CodeIgniter.php | 256 +++ system/codeigniter/Common.php | 238 +++ system/codeigniter/index.html | 15 + system/drivers/DB_active_record.php | 875 +++++++++ system/drivers/DB_driver.php | 948 +++++++++ system/drivers/DB_mssql.php | 472 +++++ system/drivers/DB_mysql.php | 495 +++++ system/drivers/DB_mysqli.php | 496 +++++ system/drivers/DB_odbc.php | 468 +++++ system/drivers/DB_postgre.php | 476 +++++ system/drivers/DB_sqlite.php | 501 +++++ system/drivers/index.html | 15 + system/fonts/index.html | 15 + system/fonts/texb.ttf | Bin 0 -> 143830 bytes system/helpers/array_helper.php | 47 + system/helpers/cookie_helper.php | 77 + system/helpers/date_helper.php | 530 +++++ system/helpers/directory_helper.php | 69 + system/helpers/file_helper.php | 139 ++ system/helpers/form_helper.php | 382 ++++ system/helpers/html_helper.php | 76 + system/helpers/index.html | 15 + system/helpers/security_helper.php | 112 ++ system/helpers/string_helper.php | 154 ++ system/helpers/text_helper.php | 386 ++++ system/helpers/typography_helper.php | 490 +++++ system/helpers/url_helper.php | 487 +++++ system/helpers/xml_helper.php | 55 + system/init/index.html | 15 + system/init/init_calendar.php | 19 + system/init/init_email.php | 24 + system/init/init_encrypt.php | 18 + system/init/init_image_lib.php | 24 + system/init/init_pagination.php | 24 + system/init/init_parser.php | 19 + system/init/init_session.php | 18 + system/init/init_trackback.php | 18 + system/init/init_unit_test.php | 18 + system/init/init_upload.php | 24 + system/init/init_validation.php | 18 + system/init/init_xmlrpc.php | 24 + system/init/init_xmlrpcs.php | 27 + system/language/english/calendar_lang.php | 49 + system/language/english/date_lang.php | 49 + system/language/english/db_lang.php | 15 + system/language/english/email_lang.php | 21 + system/language/english/imglib_lang.php | 21 + system/language/english/index.html | 15 + system/language/english/scaffolding_lang.php | 15 + system/language/english/unit_test_lang.php | 22 + system/language/english/upload_lang.php | 16 + system/language/english/validation_lang.php | 15 + system/language/index.html | 15 + system/libraries/Benchmark.php | 117 ++ system/libraries/Calendar.php | 473 +++++ system/libraries/Config.php | 181 ++ system/libraries/Controller.php | 445 +++++ system/libraries/Email.php | 1740 +++++++++++++++++ system/libraries/Encrypt.php | 378 ++++ system/libraries/Exceptions.php | 165 ++ system/libraries/Hooks.php | 237 +++ system/libraries/Image_lib.php | 1550 +++++++++++++++ system/libraries/Input.php | 585 ++++++ system/libraries/Language.php | 113 ++ system/libraries/Loader.php | 611 ++++++ system/libraries/Log.php | 117 ++ system/libraries/Model.php | 72 + system/libraries/Output.php | 241 +++ system/libraries/Pagination.php | 207 ++ system/libraries/Parser.php | 178 ++ system/libraries/Router.php | 318 +++ system/libraries/Session.php | 499 +++++ system/libraries/Sha1.php | 254 +++ system/libraries/Trackback.php | 561 ++++++ system/libraries/URI.php | 243 +++ system/libraries/Unit_test.php | 331 ++++ system/libraries/Upload.php | 775 ++++++++ system/libraries/Validation.php | 692 +++++++ system/libraries/Xmlrpc.php | 1409 +++++++++++++ system/libraries/Xmlrpcs.php | 492 +++++ system/libraries/index.html | 15 + system/logs/index.html | 15 + system/plugins/captcha_pi.php | 346 ++++ system/plugins/index.html | 15 + system/plugins/js_calendar_pi.php | 604 ++++++ system/scaffolding/Scaffolding.php | 285 +++ system/scaffolding/images/background.jpg | Bin 0 -> 410 bytes system/scaffolding/images/index.html | 15 + system/scaffolding/images/logo.jpg | Bin 0 -> 4518 bytes system/scaffolding/index.html | 15 + system/scaffolding/views/add.php | 30 + system/scaffolding/views/delete.php | 7 + system/scaffolding/views/edit.php | 31 + system/scaffolding/views/footer.php | 10 + system/scaffolding/views/header.php | 31 + system/scaffolding/views/index.html | 15 + system/scaffolding/views/no_data.php | 6 + system/scaffolding/views/stylesheet.css | 143 ++ system/scaffolding/views/view.php | 25 + user_guide/general/alternative_php.html | 142 ++ user_guide/general/ancillary_classes.html | 122 ++ user_guide/general/autoloader.html | 106 + user_guide/general/base_classes.html | 127 ++ user_guide/general/caching.html | 119 ++ user_guide/general/changelog.html | 248 +++ user_guide/general/controllers.html | 317 +++ user_guide/general/creating_libraries.html | 222 +++ user_guide/general/credits.html | 96 + user_guide/general/errors.html | 142 ++ user_guide/general/helpers.html | 140 ++ user_guide/general/hooks.html | 184 ++ user_guide/general/index.html | 95 + user_guide/general/libraries.html | 111 ++ user_guide/general/models.html | 256 +++ user_guide/general/multiple_apps.html | 116 ++ user_guide/general/plugins.html | 125 ++ user_guide/general/quick_reference.html | 83 + user_guide/general/requirements.html | 88 + user_guide/general/routing.html | 163 ++ user_guide/general/scaffolding.html | 153 ++ user_guide/general/scripts.html | 115 ++ user_guide/general/security.html | 159 ++ user_guide/general/urls.html | 159 ++ user_guide/general/views.html | 249 +++ user_guide/helpers/array_helper.html | 111 ++ user_guide/helpers/cookie_helper.html | 133 ++ user_guide/helpers/date_helper.html | 340 ++++ user_guide/helpers/directory_helper.html | 145 ++ user_guide/helpers/file_helper.html | 144 ++ user_guide/helpers/form_helper.html | 343 ++++ user_guide/helpers/html_helper.html | 117 ++ user_guide/helpers/index.html | 131 ++ user_guide/helpers/security_helper.html | 131 ++ user_guide/helpers/string_helper.html | 144 ++ user_guide/helpers/text_helper.html | 197 ++ user_guide/helpers/typography_helper.html | 129 ++ user_guide/helpers/url_helper.html | 269 +++ user_guide/helpers/xml_helper.html | 110 ++ user_guide/images/appflowchart.gif | Bin 0 -> 25276 bytes user_guide/images/arrow.gif | Bin 0 -> 123 bytes user_guide/images/ci_logo.jpg | Bin 0 -> 5602 bytes user_guide/images/ci_logo_mini.jpg | Bin 0 -> 2198 bytes user_guide/images/ci_quick_ref.png | Bin 0 -> 94476 bytes user_guide/images/file.gif | Bin 0 -> 370 bytes user_guide/images/folder.gif | Bin 0 -> 570 bytes user_guide/images/nav_bg.jpg | Bin 0 -> 441 bytes user_guide/images/nav_separator.jpg | Bin 0 -> 305 bytes user_guide/images/nav_toggle.jpg | Bin 0 -> 3076 bytes user_guide/images/transparent.gif | Bin 0 -> 43 bytes user_guide/index.html | 106 + user_guide/installation/downloads.html | 97 + user_guide/installation/index.html | 116 ++ user_guide/installation/upgrade_120.html | 98 + user_guide/installation/upgrade_130.html | 209 ++ user_guide/installation/upgrade_131.html | 108 + user_guide/installation/upgrade_132.html | 106 + user_guide/installation/upgrade_133.html | 118 ++ user_guide/installation/upgrade_140.html | 111 ++ user_guide/installation/upgrade_b11.html | 150 ++ user_guide/installation/upgrading.html | 95 + user_guide/libraries/benchmark.html | 160 ++ user_guide/libraries/calendar.html | 258 +++ user_guide/libraries/config.html | 158 ++ .../libraries/database/active_record.html | 610 ++++++ .../libraries/database/call_function.html | 123 ++ .../libraries/database/configuration.html | 144 ++ user_guide/libraries/database/connecting.html | 172 ++ user_guide/libraries/database/examples.html | 183 ++ user_guide/libraries/database/fields.html | 144 ++ user_guide/libraries/database/index.html | 99 + user_guide/libraries/database/queries.html | 180 ++ user_guide/libraries/database/results.html | 235 +++ user_guide/libraries/database/table_data.html | 116 ++ user_guide/libraries/email.html | 294 +++ user_guide/libraries/encryption.html | 187 ++ user_guide/libraries/file_uploading.html | 429 ++++ user_guide/libraries/image_lib.html | 669 +++++++ user_guide/libraries/input.html | 207 ++ user_guide/libraries/language.html | 130 ++ user_guide/libraries/loader.html | 171 ++ user_guide/libraries/output.html | 112 ++ user_guide/libraries/pagination.html | 218 +++ user_guide/libraries/parser.html | 214 ++ user_guide/libraries/sessions.html | 283 +++ user_guide/libraries/trackback.html | 251 +++ user_guide/libraries/unit_testing.html | 210 ++ user_guide/libraries/uri.html | 220 +++ user_guide/libraries/validation.html | 674 +++++++ user_guide/libraries/xmlrpc.html | 485 +++++ user_guide/license.html | 113 ++ user_guide/overview/appflow.html | 101 + user_guide/overview/at_a_glance.html | 168 ++ user_guide/overview/features.html | 122 ++ user_guide/overview/goals.html | 103 + user_guide/overview/index.html | 89 + user_guide/overview/mvc.html | 105 + user_guide/scripts/hacks.txt | 9 + user_guide/scripts/moo.fx.js | 119 ++ user_guide/scripts/moo.fx.pack.js | 241 +++ user_guide/scripts/nav.js | 116 ++ user_guide/scripts/prototype.lite.js | 127 ++ user_guide/toc.html | 182 ++ user_guide/userguide.css | 406 ++++ 225 files changed, 41458 insertions(+) create mode 100644 index.php create mode 100644 license.txt create mode 100644 system/application/config/autoload.php create mode 100644 system/application/config/config.php create mode 100644 system/application/config/database.php create mode 100644 system/application/config/index.html create mode 100644 system/application/config/mimes.php create mode 100644 system/application/config/routes.php create mode 100644 system/application/controllers/index.html create mode 100644 system/application/controllers/welcome.php create mode 100644 system/application/errors/error_404.php create mode 100644 system/application/errors/error_db.php create mode 100644 system/application/errors/error_general.php create mode 100644 system/application/errors/error_php.php create mode 100644 system/application/errors/index.html create mode 100644 system/application/models/index.html create mode 100644 system/application/scripts/index.html create mode 100644 system/application/views/index.html create mode 100644 system/application/views/welcome_message.php create mode 100644 system/cache/index.html create mode 100644 system/codeigniter/Base4.php create mode 100644 system/codeigniter/Base5.php create mode 100644 system/codeigniter/CodeIgniter.php create mode 100644 system/codeigniter/Common.php create mode 100644 system/codeigniter/index.html create mode 100644 system/drivers/DB_active_record.php create mode 100644 system/drivers/DB_driver.php create mode 100644 system/drivers/DB_mssql.php create mode 100644 system/drivers/DB_mysql.php create mode 100644 system/drivers/DB_mysqli.php create mode 100644 system/drivers/DB_odbc.php create mode 100644 system/drivers/DB_postgre.php create mode 100644 system/drivers/DB_sqlite.php create mode 100644 system/drivers/index.html create mode 100644 system/fonts/index.html create mode 100644 system/fonts/texb.ttf create mode 100644 system/helpers/array_helper.php create mode 100644 system/helpers/cookie_helper.php create mode 100644 system/helpers/date_helper.php create mode 100644 system/helpers/directory_helper.php create mode 100644 system/helpers/file_helper.php create mode 100644 system/helpers/form_helper.php create mode 100644 system/helpers/html_helper.php create mode 100644 system/helpers/index.html create mode 100644 system/helpers/security_helper.php create mode 100644 system/helpers/string_helper.php create mode 100644 system/helpers/text_helper.php create mode 100644 system/helpers/typography_helper.php create mode 100644 system/helpers/url_helper.php create mode 100644 system/helpers/xml_helper.php create mode 100644 system/init/index.html create mode 100644 system/init/init_calendar.php create mode 100644 system/init/init_email.php create mode 100644 system/init/init_encrypt.php create mode 100644 system/init/init_image_lib.php create mode 100644 system/init/init_pagination.php create mode 100644 system/init/init_parser.php create mode 100644 system/init/init_session.php create mode 100644 system/init/init_trackback.php create mode 100644 system/init/init_unit_test.php create mode 100644 system/init/init_upload.php create mode 100644 system/init/init_validation.php create mode 100644 system/init/init_xmlrpc.php create mode 100644 system/init/init_xmlrpcs.php create mode 100644 system/language/english/calendar_lang.php create mode 100644 system/language/english/date_lang.php create mode 100644 system/language/english/db_lang.php create mode 100644 system/language/english/email_lang.php create mode 100644 system/language/english/imglib_lang.php create mode 100644 system/language/english/index.html create mode 100644 system/language/english/scaffolding_lang.php create mode 100644 system/language/english/unit_test_lang.php create mode 100644 system/language/english/upload_lang.php create mode 100644 system/language/english/validation_lang.php create mode 100644 system/language/index.html create mode 100644 system/libraries/Benchmark.php create mode 100644 system/libraries/Calendar.php create mode 100644 system/libraries/Config.php create mode 100644 system/libraries/Controller.php create mode 100644 system/libraries/Email.php create mode 100644 system/libraries/Encrypt.php create mode 100644 system/libraries/Exceptions.php create mode 100644 system/libraries/Hooks.php create mode 100644 system/libraries/Image_lib.php create mode 100644 system/libraries/Input.php create mode 100644 system/libraries/Language.php create mode 100644 system/libraries/Loader.php create mode 100644 system/libraries/Log.php create mode 100644 system/libraries/Model.php create mode 100644 system/libraries/Output.php create mode 100644 system/libraries/Pagination.php create mode 100644 system/libraries/Parser.php create mode 100644 system/libraries/Router.php create mode 100644 system/libraries/Session.php create mode 100644 system/libraries/Sha1.php create mode 100644 system/libraries/Trackback.php create mode 100644 system/libraries/URI.php create mode 100644 system/libraries/Unit_test.php create mode 100644 system/libraries/Upload.php create mode 100644 system/libraries/Validation.php create mode 100644 system/libraries/Xmlrpc.php create mode 100644 system/libraries/Xmlrpcs.php create mode 100644 system/libraries/index.html create mode 100644 system/logs/index.html create mode 100644 system/plugins/captcha_pi.php create mode 100644 system/plugins/index.html create mode 100644 system/plugins/js_calendar_pi.php create mode 100644 system/scaffolding/Scaffolding.php create mode 100644 system/scaffolding/images/background.jpg create mode 100644 system/scaffolding/images/index.html create mode 100644 system/scaffolding/images/logo.jpg create mode 100644 system/scaffolding/index.html create mode 100644 system/scaffolding/views/add.php create mode 100644 system/scaffolding/views/delete.php create mode 100644 system/scaffolding/views/edit.php create mode 100644 system/scaffolding/views/footer.php create mode 100644 system/scaffolding/views/header.php create mode 100644 system/scaffolding/views/index.html create mode 100644 system/scaffolding/views/no_data.php create mode 100644 system/scaffolding/views/stylesheet.css create mode 100644 system/scaffolding/views/view.php create mode 100644 user_guide/general/alternative_php.html create mode 100644 user_guide/general/ancillary_classes.html create mode 100644 user_guide/general/autoloader.html create mode 100644 user_guide/general/base_classes.html create mode 100644 user_guide/general/caching.html create mode 100644 user_guide/general/changelog.html create mode 100644 user_guide/general/controllers.html create mode 100644 user_guide/general/creating_libraries.html create mode 100644 user_guide/general/credits.html create mode 100644 user_guide/general/errors.html create mode 100644 user_guide/general/helpers.html create mode 100644 user_guide/general/hooks.html create mode 100644 user_guide/general/index.html create mode 100644 user_guide/general/libraries.html create mode 100644 user_guide/general/models.html create mode 100644 user_guide/general/multiple_apps.html create mode 100644 user_guide/general/plugins.html create mode 100644 user_guide/general/quick_reference.html create mode 100644 user_guide/general/requirements.html create mode 100644 user_guide/general/routing.html create mode 100644 user_guide/general/scaffolding.html create mode 100644 user_guide/general/scripts.html create mode 100644 user_guide/general/security.html create mode 100644 user_guide/general/urls.html create mode 100644 user_guide/general/views.html create mode 100644 user_guide/helpers/array_helper.html create mode 100644 user_guide/helpers/cookie_helper.html create mode 100644 user_guide/helpers/date_helper.html create mode 100644 user_guide/helpers/directory_helper.html create mode 100644 user_guide/helpers/file_helper.html create mode 100644 user_guide/helpers/form_helper.html create mode 100644 user_guide/helpers/html_helper.html create mode 100644 user_guide/helpers/index.html create mode 100644 user_guide/helpers/security_helper.html create mode 100644 user_guide/helpers/string_helper.html create mode 100644 user_guide/helpers/text_helper.html create mode 100644 user_guide/helpers/typography_helper.html create mode 100644 user_guide/helpers/url_helper.html create mode 100644 user_guide/helpers/xml_helper.html create mode 100644 user_guide/images/appflowchart.gif create mode 100644 user_guide/images/arrow.gif create mode 100644 user_guide/images/ci_logo.jpg create mode 100644 user_guide/images/ci_logo_mini.jpg create mode 100644 user_guide/images/ci_quick_ref.png create mode 100644 user_guide/images/file.gif create mode 100644 user_guide/images/folder.gif create mode 100644 user_guide/images/nav_bg.jpg create mode 100644 user_guide/images/nav_separator.jpg create mode 100644 user_guide/images/nav_toggle.jpg create mode 100644 user_guide/images/transparent.gif create mode 100644 user_guide/index.html create mode 100644 user_guide/installation/downloads.html create mode 100644 user_guide/installation/index.html create mode 100644 user_guide/installation/upgrade_120.html create mode 100644 user_guide/installation/upgrade_130.html create mode 100644 user_guide/installation/upgrade_131.html create mode 100644 user_guide/installation/upgrade_132.html create mode 100644 user_guide/installation/upgrade_133.html create mode 100644 user_guide/installation/upgrade_140.html create mode 100644 user_guide/installation/upgrade_b11.html create mode 100644 user_guide/installation/upgrading.html create mode 100644 user_guide/libraries/benchmark.html create mode 100644 user_guide/libraries/calendar.html create mode 100644 user_guide/libraries/config.html create mode 100644 user_guide/libraries/database/active_record.html create mode 100644 user_guide/libraries/database/call_function.html create mode 100644 user_guide/libraries/database/configuration.html create mode 100644 user_guide/libraries/database/connecting.html create mode 100644 user_guide/libraries/database/examples.html create mode 100644 user_guide/libraries/database/fields.html create mode 100644 user_guide/libraries/database/index.html create mode 100644 user_guide/libraries/database/queries.html create mode 100644 user_guide/libraries/database/results.html create mode 100644 user_guide/libraries/database/table_data.html create mode 100644 user_guide/libraries/email.html create mode 100644 user_guide/libraries/encryption.html create mode 100644 user_guide/libraries/file_uploading.html create mode 100644 user_guide/libraries/image_lib.html create mode 100644 user_guide/libraries/input.html create mode 100644 user_guide/libraries/language.html create mode 100644 user_guide/libraries/loader.html create mode 100644 user_guide/libraries/output.html create mode 100644 user_guide/libraries/pagination.html create mode 100644 user_guide/libraries/parser.html create mode 100644 user_guide/libraries/sessions.html create mode 100644 user_guide/libraries/trackback.html create mode 100644 user_guide/libraries/unit_testing.html create mode 100644 user_guide/libraries/uri.html create mode 100644 user_guide/libraries/validation.html create mode 100644 user_guide/libraries/xmlrpc.html create mode 100644 user_guide/license.html create mode 100644 user_guide/overview/appflow.html create mode 100644 user_guide/overview/at_a_glance.html create mode 100644 user_guide/overview/features.html create mode 100644 user_guide/overview/goals.html create mode 100644 user_guide/overview/index.html create mode 100644 user_guide/overview/mvc.html create mode 100644 user_guide/scripts/hacks.txt create mode 100755 user_guide/scripts/moo.fx.js create mode 100755 user_guide/scripts/moo.fx.pack.js create mode 100644 user_guide/scripts/nav.js create mode 100755 user_guide/scripts/prototype.lite.js create mode 100644 user_guide/toc.html create mode 100644 user_guide/userguide.css diff --git a/index.php b/index.php new file mode 100644 index 00000000..7c910e1e --- /dev/null +++ b/index.php @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 00000000..cd779972 --- /dev/null +++ b/license.txt @@ -0,0 +1,52 @@ +Copyright (c) 2006, pMachine, Inc. +All rights reserved. + +This license is a legal agreement between you and pMachine Inc. for the use +of Code Igniter 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 Code Igniter in their documentation and/or other + materials provided with the distribution. + +6. Products derived from the Software may not be called "Code Igniter", + nor may "Code Igniter" appear in their name, without prior written + permission from pMachine, 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. diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php new file mode 100644 index 00000000..a3ce4108 --- /dev/null +++ b/system/application/config/autoload.php @@ -0,0 +1,101 @@ + \ No newline at end of file diff --git a/system/application/config/config.php b/system/application/config/config.php new file mode 100644 index 00000000..0b4f33f4 --- /dev/null +++ b/system/application/config/config.php @@ -0,0 +1,244 @@ + \ No newline at end of file diff --git a/system/application/config/database.php b/system/application/config/database.php new file mode 100644 index 00000000..610f6081 --- /dev/null +++ b/system/application/config/database.php @@ -0,0 +1,57 @@ + \ No newline at end of file diff --git a/system/application/config/index.html b/system/application/config/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/config/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/config/mimes.php b/system/application/config/mimes.php new file mode 100644 index 00000000..06bfcc67 --- /dev/null +++ b/system/application/config/mimes.php @@ -0,0 +1,103 @@ + 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel'), + 'doc' => 'application/msword', + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'class' => 'application/octet-stream', + 'psd' => 'application/x-photoshop', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => array('application/excel', 'application/vnd.ms-excel'), + 'ppt' => 'application/powerpoint', + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => array('application/zip', 'application/x-zip-compressed'), + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => array('text/plain', 'text/x-log'), + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'xl' => 'application/excel', + 'eml' => 'message/rfc822' + ); + + +?> \ No newline at end of file diff --git a/system/application/config/routes.php b/system/application/config/routes.php new file mode 100644 index 00000000..622bf88e --- /dev/null +++ b/system/application/config/routes.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/system/application/controllers/index.html b/system/application/controllers/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/controllers/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php new file mode 100644 index 00000000..7f7296d8 --- /dev/null +++ b/system/application/controllers/welcome.php @@ -0,0 +1,15 @@ +load->view('welcome_message'); + } +} +?> \ No newline at end of file diff --git a/system/application/errors/error_404.php b/system/application/errors/error_404.php new file mode 100644 index 00000000..e5fa8f9d --- /dev/null +++ b/system/application/errors/error_404.php @@ -0,0 +1,35 @@ + + + +404 Page Not Found + + + +

+

+ +
+ + \ No newline at end of file diff --git a/system/application/errors/error_db.php b/system/application/errors/error_db.php new file mode 100644 index 00000000..5aab8907 --- /dev/null +++ b/system/application/errors/error_db.php @@ -0,0 +1,34 @@ + + +Database Error + + + +
+

+ +
+ + \ No newline at end of file diff --git a/system/application/errors/error_general.php b/system/application/errors/error_general.php new file mode 100644 index 00000000..213b8353 --- /dev/null +++ b/system/application/errors/error_general.php @@ -0,0 +1,34 @@ + + +Error + + + +
+

+ +
+ + \ No newline at end of file diff --git a/system/application/errors/error_php.php b/system/application/errors/error_php.php new file mode 100644 index 00000000..2fb3f2b2 --- /dev/null +++ b/system/application/errors/error_php.php @@ -0,0 +1,10 @@ +
+ +

A PHP Error was encountered

+ +

Severity:

+

Message:

+

Filename:

+

Line Number:

+ +
diff --git a/system/application/errors/index.html b/system/application/errors/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/errors/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/models/index.html b/system/application/models/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/models/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/scripts/index.html b/system/application/scripts/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/scripts/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/views/index.html b/system/application/views/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/views/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php new file mode 100644 index 00000000..815bef4d --- /dev/null +++ b/system/application/views/welcome_message.php @@ -0,0 +1,62 @@ + + +Welcome to Code Igniter + + + + + +

Welcome to Code Igniter!

+ +

The page you are looking at is being generated dynamically by Code Igniter.

+ +

If you would like to edit this page you'll find it located at:

+system/application/views/welcome_message.php + +

The corresponding controller for this page is found at:

+system/application/controllers/welcome.php + +

If you are exploring Code Igniter for the very first time, you should start by reading the User Guide.

+ + +


Page rendered in {elapsed_time} seconds

+ + + \ No newline at end of file diff --git a/system/cache/index.html b/system/cache/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/cache/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php new file mode 100644 index 00000000..5d945c26 --- /dev/null +++ b/system/codeigniter/Base4.php @@ -0,0 +1,58 @@ +load =& $this; + $OBJ = $this->load; + } +} + +function &get_instance() +{ + global $OBJ, $CI; + + if (is_object($CI)) + { + return $CI; + } + else + { + return $OBJ->load; + } +} + +?> \ No newline at end of file diff --git a/system/codeigniter/Base5.php b/system/codeigniter/Base5.php new file mode 100644 index 00000000..ef3fc67f --- /dev/null +++ b/system/codeigniter/Base5.php @@ -0,0 +1,62 @@ +set_instance($this); + } +} + +class Instance { + public static $instance; + + public function set_instance(&$object) + { + self::$instance =& $object; + } + + public function &get_instance() + { + return self::$instance; + } +} + +function &get_instance() +{ + $instance =& _load_class('Instance'); + return $instance->get_instance(); +} + +?> \ No newline at end of file diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php new file mode 100644 index 00000000..aef7618e --- /dev/null +++ b/system/codeigniter/CodeIgniter.php @@ -0,0 +1,256 @@ +mark('code_igniter_start'); + +/* + * ------------------------------------------------------ + * Instantiate the hooks classe + * ------------------------------------------------------ + */ + +$EXT =& _load_class('CI_Hooks'); + +/* + * ------------------------------------------------------ + * Is there a "pre_system" hook? + * ------------------------------------------------------ + */ +if ($EXT->_hook_exists('pre_system')) +{ + $EXT->_call_hook('pre_system'); +} + +/* + * ------------------------------------------------------ + * Instantiate the base classes + * ------------------------------------------------------ + */ + +$CFG =& _load_class('CI_Config'); +$RTR =& _load_class('CI_Router'); +$OUT =& _load_class('CI_Output'); + +/* + * ------------------------------------------------------ + * Is there a valid cache file? If so, we're done... + * ------------------------------------------------------ + */ + +if ($EXT->_hook_exists('cache_override')) +{ + $EXT->_call_hook('cache_override'); +} +else +{ + if ($OUT->_display_cache() == TRUE) + { + exit; + } +} + +/* + * ------------------------------------------------------ + * Does the requested controller exist? + * ------------------------------------------------------ + */ +if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_class().EXT)) +{ + show_404(); +} + +/* + * ------------------------------------------------------ + * Load the remaining base classes + * ------------------------------------------------------ + */ + +$IN =& _load_class('CI_Input'); +$URI =& _load_class('CI_URI'); +$LANG =& _load_class('CI_Language'); + +/* + * ------------------------------------------------------ + * Load the app controller and local controller + * ------------------------------------------------------ + * + * Note: Due to the poor object handling in PHP 4 we'll + * contditionally load different versions of the base + * class. Retaining PHP 4 compatibility requires a bit of a hack. + * + * Note: The Loader class needs to be included first + * + */ + + +_load_class('CI_Loader'); + +if (floor(phpversion()) < 5) +{ + require(BASEPATH.'codeigniter/Base4'.EXT); +} +else +{ + require(BASEPATH.'codeigniter/Base5'.EXT); +} + +_load_class('CI_Controller'); + +require(APPPATH.'controllers/'.$RTR->fetch_class().EXT); + +/* + * ------------------------------------------------------ + * Security check + * ------------------------------------------------------ + * + * None of the functions in the app controller or the + * loader class can be called via the URI, nor can + * controller functions that begin with an underscore + */ +$class = $RTR->fetch_class(); +$method = $RTR->fetch_method(); + +if ( ! class_exists($class) + OR $method == 'controller' + OR substr($method, 0, 1) == '_' + OR in_array($method, get_class_methods('Controller')) + ) +{ + show_404(); +} + +/* + * ------------------------------------------------------ + * Is there a "pre_controller" hook? + * ------------------------------------------------------ + */ +if ($EXT->_hook_exists('pre_controller')) +{ + $EXT->_call_hook('pre_controller'); +} + +/* + * ------------------------------------------------------ + * Instantiate the controller and call requested method + * ------------------------------------------------------ + */ +$CI = new $class(); + +if ($RTR->scaffolding_request === TRUE) +{ + if ($EXT->_hook_exists('scaffolding_override')) + { + $EXT->_call_hook('scaffolding_override'); + } + else + { + $CI->_ci_scaffolding(); + } +} +else +{ + if ( ! method_exists($CI, $method)) + { + show_404(); + } + + $CI->$method(); +} + +/* + * ------------------------------------------------------ + * Is there a "post_controller" hook? + * ------------------------------------------------------ + */ +if ($EXT->_hook_exists('post_controller')) +{ + $EXT->_call_hook('post_controller'); +} + +/* + * ------------------------------------------------------ + * Send the final rendered output to the browser + * ------------------------------------------------------ + */ + +if ($EXT->_hook_exists('display_override')) +{ + $EXT->_call_hook('display_override'); +} +else +{ + $OUT->_display(); +} + +/* + * ------------------------------------------------------ + * Is there a "post_system" hook? + * ------------------------------------------------------ + */ +if ($EXT->_hook_exists('post_system')) +{ + $EXT->_call_hook('post_system'); +} + +/* + * ------------------------------------------------------ + * Close the DB connection of one exists + * ------------------------------------------------------ + */ +if ($CI->_ci_is_loaded('db')) +{ + $CI->db->close(); +} + + +?> \ No newline at end of file diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php new file mode 100644 index 00000000..2ec1c3d3 --- /dev/null +++ b/system/codeigniter/Common.php @@ -0,0 +1,238 @@ +show_error('An Error Was Encountered', $message); + exit; +} + + +/** +* 404 Page Handler +* +* This function is similar to the show_error() function above +* However, instead of the standard error template it displays +* 404 errors. +* +* @access public +* @return void +*/ +function show_404($page = '') +{ + if ( ! class_exists('CI_Exceptions')) + { + include_once(BASEPATH.'libraries/Exceptions.php'); + } + + $error = new CI_Exceptions(); + $error->show_404($page); + exit; +} + + +/** +* Error Logging Interface +* +* We use this as a simple mechanism to access the logging +* class and send messages to be logged. +* +* @access public +* @return void +*/ +function log_message($level = 2, $message, $php_error = FALSE) +{ + $config =& _get_config(); + if ($config['log_errors'] === FALSE) + { + return; + } + + if ( ! class_exists('CI_Log')) + { + include_once(BASEPATH.'libraries/Log.php'); + } + + if ( ! isset($LOG)) + { + $LOG = new CI_Log( + $config['log_path'], + $config['log_threshold'], + $config['log_date_format'] + ); + } + + $LOG->write_log($level, $message, $php_error); +} + + +/** +* Exception Handler +* +* This is the custom exception handler we defined at the +* top of this file. The main reason we use this is permit +* PHP errors to be logged in our own log files since we may +* not have access to server logs. Since this function +* effectively intercepts PHP errors, however, we also need +* to display errors based on the current error_reporting level. +* We do that with the use of a PHP error template. +* +* @access private +* @return void +*/ +function _exception_handler($severity, $message, $filepath, $line) +{ + // We don't bother with "strict" notices since they will fill up + // the log file with information that isn't normally very + // helpful. For example, if you are running PHP 5 and you + // use version 4 style class functions (without prefixes + // like "public", "private", etc.) you'll get notices telling + // you that these have been deprecated. + + if ($severity == E_STRICT) + { + return; + } + + // Send the PHP error to the log file... + if ( ! class_exists('CI_Exceptions')) + { + include_once(BASEPATH.'libraries/Exceptions.php'); + } + $error = new CI_Exceptions(); + + // Should we display the error? + // We'll get the current error_reporting level and add its bits + // with the severity bits to find out. + + if (($severity & error_reporting()) == $severity) + { + $error->show_php_error($severity, $message, $filepath, $line); + } + + // Should we log the error? No? We're done... + $config =& _get_config(); + if ($config['log_errors'] === FALSE) + { + return; + } + + $error->log_exception($severity, $message, $filepath, $line); +} + + +?> \ No newline at end of file diff --git a/system/codeigniter/index.html b/system/codeigniter/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/codeigniter/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/drivers/DB_active_record.php b/system/drivers/DB_active_record.php new file mode 100644 index 00000000..373c0f62 --- /dev/null +++ b/system/drivers/DB_active_record.php @@ -0,0 +1,875 @@ +ar_select[] = $val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * DISTINCT + * + * Sets a flag which tells the query string compiler to add DISTINCT + * + * @access public + * @param bool + * @return object + */ + function distinct($val = TRUE) + { + $this->ar_distinct = (is_bool($val)) ? $val : TRUE; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * From + * + * Generates the FROM portion of the query + * + * @access public + * @param mixed can be a string or array + * @return object + */ + function from($from) + { + foreach ((array)$from as $val) + { + $this->ar_from[] = $this->dbprefix.$val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Join + * + * Generates the JOIN portion of the query + * + * @access public + * @param string + * @param string the join condition + * @param string the type of join + * @return object + */ + function join($table, $cond, $type = '') + { + if ($type != '') + { + $type = strtoupper(trim($type)); + + if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) + { + $type = ''; + } + else + { + $type .= ' '; + } + } + + $this->ar_join[] = $type.'JOIN '.$table.' ON '.$cond; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function where($key, $value = NULL) + { + return $this->_where($key, $value, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * OR Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function orwhere($key, $value = NULL) + { + return $this->_where($key, $value, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Called by where() or orwhere() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _where($key, $value = NULL, $type = 'AND ') + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_where) == 0) ? '' : $type; + + if ( ! is_null($v)) + { + if ( ! $this->_has_operator($k)) + { + $k .= ' ='; + } + + $v = ' '.$this->escape($v); + } + + $this->ar_where[] = $prefix.$k.$v; + } + return $this; + } + + + + // -------------------------------------------------------------------- + + /** + * Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function like($field, $match = '') + { + return $this->_like($field, $match, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * OR Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function orlike($field, $match = '') + { + return $this->_like($field, $match, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Like + * + * Called by like() or olike() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _like($field, $match = '', $type = 'AND ') + { + if ( ! is_array($field)) + { + $field = array($field => $match); + } + + foreach ($field as $k => $v) + { + $prefix = (count($this->ar_like) == 0) ? '' : $type; + + $v = $this->escape_str($v); + + $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * GROUP BY + * + * @access public + * @param string + * @return object + */ + function groupby($by) + { + if (is_string($by)) + { + $by = explode(',', $by); + } + + foreach ($by as $val) + { + $val = trim($val); + + if ($val != '') + $this->ar_groupby[] = $val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the HAVING value + * + * Separates multiple calls with AND + * + * @access public + * @param string + * @param string + * @return object + */ + function having($key, $value = '') + { + return $this->_having($key, $value, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * Sets the OR HAVING value + * + * Separates multiple calls with OR + * + * @access public + * @param string + * @param string + * @return object + */ + function orhaving($key, $value = '') + { + return $this->_having($key, $value, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Sets the OR HAVING value + * + * Called by having() or orhaving() + * + * @access private + * @param string + * @param string + * @return object + */ + function _having($key, $value = '', $type = 'AND ') + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_having) == 0) ? '' : $type; + + if ($v != '') + { + $v = ' '.$this->escape($v); + } + + $this->ar_having[] = $prefix.$k.$v; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the ORDER BY value + * + * @access public + * @param string + * @param string direction: asc or desc + * @return object + */ + function orderby($orderby, $direction = '') + { + if (trim($direction) != '') + { + $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'))) ? ' '.$direction : ' ASC'; + } + + $this->ar_orderby[] = $orderby.$direction; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the LIMIT value + * + * @access public + * @param integer the limit value + * @param integer the offset value + * @return object + */ + function limit($value, $offset = '') + { + $this->ar_limit = $value; + + if ($offset != '') + $this->ar_offset = $offset; + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the OFFSET value + * + * @access public + * @param integer the offset value + * @return object + */ + function offset($value) + { + $this->ar_offset = $value; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * The "set" function. Allows key/value pairs to be set for inserting or updating + * + * @access public + * @param mixed + * @param string + * @return object + */ + function set($key, $value = '') + { + $key = $this->_object_to_array($key); + + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $this->ar_set[$k] = $this->escape($v); + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Get + * + * Compiles the select statement based on the other functions called + * and runs the query + * + * @access public + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function get($table = '', $limit = null, $offset = null) + { + if ($table != '') + { + $this->from($table); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $this->_reset_select(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * GetWhere + * + * Allows the where clause, limit and offset to be added directly + * + * @access public + * @param string the where clause + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function getwhere($table = '', $where = null, $limit = null, $offset = null) + { + if ($table != '') + { + $this->from($table); + } + + if ( ! is_null($where)) + { + $this->where($where); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $this->_reset_select(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Insert + * + * Compiles an insert string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of insert values + * @return object + */ + function insert($table = '', $set = NULL) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + $sql = $this->_insert($this->dbprefix.$table, array_keys($this->ar_set), array_values($this->ar_set)); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * Compiles an update string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of update values + * @param mixed the where clause + * @return object + */ + function update($table = '', $set = NULL, $where = null) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + if ($where != null) + { + $this->where($where); + } + + $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * Compiles a delete string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param mixed the where clause + * @return object + */ + function delete($table = '', $where = '') + { + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + if ($where != '') + { + $this->where($where); + } + + if (count($this->ar_where) == 0) + { + if ($this->debug) + { + return $this->display_error('db_del_must_use_where'); + } + return FALSE; + } + + $sql = $this->_delete($this->dbprefix.$table, $this->ar_where); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Use Table - DEPRECATED + * + * @deprecated use $this->db->from instead + */ + function use_table($table) + { + return $this->from($table); + return $this; + } + + // -------------------------------------------------------------------- + + /** + * ORDER BY - DEPRECATED + * + * @deprecated use $this->db->orderby() instead + */ + function order_by($orderby, $direction = '') + { + return $this->orderby($orderby, $direction); + } + + // -------------------------------------------------------------------- + + /** + * Tests whether the string has an SQL operator + * + * @access private + * @param string + * @return bool + */ + function _has_operator($str) + { + $str = trim($str); + if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str)) + { + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Compile the SELECT statement + * + * Generates a query string based on which functions were used. + * Should not be called directly. The get() function calls it. + * + * @access private + * @return string + */ + function _compile_select() + { + $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; + + $sql .= (count($this->ar_select) == 0) ? '*' : implode(', ', $this->ar_select); + + if (count($this->ar_from) > 0) + { + $sql .= "\nFROM "; + $sql .= implode(', ', $this->ar_from); + } + + if (count($this->ar_join) > 0) + { + $sql .= "\n"; + $sql .= implode("\n", $this->ar_join); + } + + if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) + { + $sql .= "\nWHERE "; + } + + $sql .= implode("\n", $this->ar_where); + + if (count($this->ar_like) > 0) + { + if (count($this->ar_where) > 0) + { + $sql .= " AND "; + } + + $sql .= implode("\n", $this->ar_like); + } + + if (count($this->ar_groupby) > 0) + { + $sql .= "\nGROUP BY "; + $sql .= implode(', ', $this->ar_groupby); + } + + if (count($this->ar_having) > 0) + { + $sql .= "\nHAVING "; + $sql .= implode("\n", $this->ar_having); + } + + if (count($this->ar_orderby) > 0) + { + $sql .= "\nORDER BY "; + $sql .= implode(', ', $this->ar_orderby); + + if ($this->ar_order !== FALSE) + { + $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; + } + } + + if (ctype_digit($this->ar_limit)) + { + $sql .= "\n"; + $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and convers the class variables to array key/vals + * + * @access public + * @param object + * @return array + */ + function _object_to_array($object) + { + if ( ! is_object($object)) + { + return $object; + } + + $array = array(); + foreach (get_object_vars($object) as $key => $val) + { + if ( ! is_object($val) AND ! is_array($val)) + { + $array[$key] = $val; + } + } + + return $array; + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record values. Called by the get() function + * + * @access private + * @return void + */ + function _reset_select() + { + $this->ar_select = array(); + $this->ar_distinct = FALSE; + $this->ar_from = array(); + $this->ar_join = array(); + $this->ar_where = array(); + $this->ar_like = array(); + $this->ar_groupby = array(); + $this->ar_having = array(); + $this->ar_limit = FALSE; + $this->ar_offset = FALSE; + $this->ar_order = FALSE; + $this->ar_orderby = array(); + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record "write" values. + * + * Called by the insert() or update() functions + * + * @access private + * @return void + */ + function _reset_write() + { + $this->ar_set = array(); + $this->ar_from = array(); + $this->ar_where = array(); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php new file mode 100644 index 00000000..ed18d54e --- /dev/null +++ b/system/drivers/DB_driver.php @@ -0,0 +1,948 @@ +initialize($params); + log_message('debug', 'Database Driver Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Database Settings + * + * @access private Called by the constructor + * @param mixed + * @return void + */ + function initialize($params = '') + { + if (is_array($params)) + { + foreach (array('hostname' => '', 'username' => '', 'password' => '', 'database' => '', 'dbdriver' => 'mysql', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => FALSE) as $key => $val) + { + $this->$key = ( ! isset($params[$key])) ? $val : $params[$key]; + } + } + elseif (strpos($params, '://')) + { + if (FALSE === ($dsn = @parse_url($params))) + { + log_message('error', 'Invalid DB Connection String'); + + if ($this->debug) + { + return $this->display_error('db_invalid_connection_str'); + } + return FALSE; + } + + $this->hostname = ( ! isset($dsn['host'])) ? '' : rawurldecode($dsn['host']); + $this->username = ( ! isset($dsn['user'])) ? '' : rawurldecode($dsn['user']); + $this->password = ( ! isset($dsn['pass'])) ? '' : rawurldecode($dsn['pass']); + $this->database = ( ! isset($dsn['path'])) ? '' : rawurldecode(substr($dsn['path'], 1)); + } + + if ($this->pconnect == FALSE) + { + $this->conn_id = $this->db_connect(); + } + else + { + $this->conn_id = $this->db_pconnect(); + } + + if ( ! $this->conn_id) + { + log_message('error', 'Unable to connect to the database'); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_connect'); + } + } + else + { + if ( ! $this->db_select()) + { + log_message('error', 'Unable to select database: '.$this->database); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_select', $this->database); + } + } + } + } + + // -------------------------------------------------------------------- + + /** + * Database Version Number. Returns a string containing the + * version of the database being used + * + * @access public + * @return string + */ + function version() + { + if (FALSE === ($sql = $this->_version())) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $query = $this->query($sql); + $row = $query->row(); + return $row->ver; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * Accepts an SQL string as input and returns a result object upon + * successful execution of a "read" type query. Returns boolean TRUE + * upon successful execution of a "write" type query. Returns boolean + * FALSE upon failure, and if the $db_debug variable is set to TRUE + * will raise an error. + * + * @access public + * @param string An SQL query string + * @param array An array of binding data + * @return mixed + */ + function query($sql, $binds = FALSE) + { + if ( ! $this->conn_id) + { + $this->initialize(); + } + + if ($sql == '') + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$sql); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } + + // Compile binds if needed + if ($binds !== FALSE) + { + $sql = $this->compile_binds($sql, $binds); + } + + // Start the Query Timer + $time_start = list($sm, $ss) = explode(' ', microtime()); + + // Save the query for debugging + $this->queries[] = $sql; + + // Run the Query + if (FALSE === ($this->result_id = $this->execute($sql, $this->conn_id))) + { + if ($this->db_debug) + { + log_message('error', 'Query error: '.$this->error_message()); + return $this->display_error( + array( + 'Error Number: '.$this->error_number(), + $this->error_message(), + $sql + ) + ); + } + + return FALSE; + } + + // Stop and aggregate the query time results + $time_end = list($em, $es) = explode(' ', microtime()); + $this->benchmark += ($em + $es) - ($sm + $ss); + + // Increment the query counter + $this->query_count++; + + // Was the query a "write" type? + // If so we'll return simply return true + if ($this->is_write_type($sql) === TRUE) + { + return TRUE; + } + + // Instantiate and return the DB result object + $result = 'CI_DB_'.$this->dbdriver.'_result'; + + $RES = new $result(); + $RES->conn_id = $this->conn_id; + $RES->db_debug = $this->db_debug; + $RES->result_id = $this->result_id; + + return $RES; + } + + // -------------------------------------------------------------------- + + /** + * Enables a native PHP function to be run, using a platform agnostic wrapper. + * + * @access public + * @param string the function name + * @param mixed any parameters needed by the function + * @return mixed + */ + function call_function($function) + { + $driver = ($this->dbdriver == 'postgre') ? 'pg_' : $this->dbdriver.'_'; + + if (FALSE === strpos($driver, $function)) + { + $function = $driver.$function; + } + + if ( ! function_exists($function)) + { + if ($this->debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + else + { + $args = (func_num_args() > 1) ? array_shift(func_get_args()) : null; + + return call_user_func_array($function, $args); + } + } + + // -------------------------------------------------------------------- + + /** + * Determines if a query is a "write" type. + * + * @access public + * @param string An SQL query string + * @return boolean + */ + function is_write_type($sql) + { + if ( ! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) + { + return FALSE; + } + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Calculate the aggregate query elapsed time + * + * @access public + * @param intiger The number of decimal places + * @return integer + */ + function elapsed_time($decimals = 6) + { + return number_format($this->benchmark, $decimals); + } + + // -------------------------------------------------------------------- + + /** + * Returns the total number of queries + * + * @access public + * @return integer + */ + function total_queries() + { + return $this->query_count; + } + + // -------------------------------------------------------------------- + + /** + * Returns the last query that was executed + * + * @access public + * @return void + */ + function last_query() + { + return end($this->queries); + } + + // -------------------------------------------------------------------- + + /** + * "Smart" Escape String + * + * Escapes data based on type + * Sets boolean and null types + * + * @access public + * @param string + * @return integer + */ + function escape($str) + { + if ( ! ctype_digit($str)) // bug fix to ensure that numbers are not treated as strings. + { + switch (gettype($str)) + { + case 'string' : $str = "'".$this->escape_str($str)."'"; + break; + case 'boolean' : $str = ($str === FALSE) ? 0 : 1; + break; + default : $str = ($str === NULL) ? 'NULL' : $str; + break; + } + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Returns an array of table names + * + * @access public + * @return array + */ + function tables() + { + if (FALSE === ($sql = $this->_show_tables())) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $retval = array(); + $query = $this->query($sql); + + if ($query->num_rows() > 0) + { + foreach($query->result_array() as $row) + { + $retval[] = array_shift($row); + } + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Determine if a particular table exists + * @access public + * @return boolean + */ + function table_exists($table_name) + { + return ( ! in_array($this->dbprefix.$table_name, $this->tables())) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch MySQL Field Names + * + * @access public + * @param string the table name + * @return array + */ + function field_names($table = '') + { + if ($table == '') + { + if ($this->debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + if (FALSE === ($sql = $this->_show_columns($this->dbprefix.$table))) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $query = $this->query($sql); + + $retval = array(); + foreach($query->result_array() as $row) + { + if ($this->dbdriver == 'mssql' AND isset($row['COLUMN_NAME'])) + { + $retval[] = $row['COLUMN_NAME']; + } + else + { + $retval[] = current($row); + } + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Returns an object with field data + * + * @access public + * @param string the table name + * @return object + */ + function field_data($table = '') + { + if ($table == '') + { + if ($this->debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + return $this->_field_data($this->dbprefix.$table); + } + + // -------------------------------------------------------------------- + + /** + * Primary + * + * Retrieves the primary key. It assumes that the row in the first + * position is the primary key + * + * @access public + * @param string the table name + * @return string + */ + function primary($table = '') + { + $fields = $this->field_names($table); + + if ( ! is_array($fields)) + { + return FALSE; + } + + return current($fields); + } + + // -------------------------------------------------------------------- + + /** + * Compile Bindings + * + * @access public + * @param string the sql statement + * @param array an array of bind data + * @return string + */ + function compile_binds($sql, $binds) + { + if (FALSE === strpos($sql, $this->bind_marker)) + { + return $sql; + } + + if ( ! is_array($binds)) + { + $binds = array($binds); + } + + foreach ($binds as $val) + { + $val = $this->escape($val); + + // Just in case the replacement string contains the bind + // character we'll temporarily replace it with a marker + $val = str_replace($this->bind_marker, '{%bind_marker%}', $val); + $sql = preg_replace("#".preg_quote($this->bind_marker)."#", $val, $sql, 1); + } + + return str_replace('{%bind_marker%}', $this->bind_marker, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Generate an insert string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @return string + */ + function insert_string($table, $data) + { + $fields = array(); + $values = array(); + + foreach($data as $key => $val) + { + $fields[] = $key; + $values[] = $this->escape($val); + } + + return $this->_insert($this->dbprefix.$table, $fields, $values); + } + + // -------------------------------------------------------------------- + + /** + * Generate an update string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @param mixed the "where" statement + * @return string + */ + function update_string($table, $data, $where) + { + if ($where == '') + return false; + + $fields = array(); + foreach($data as $key => $val) + { + $fields[$key] = $this->escape($val); + } + + if ( ! is_array($where)) + { + $dest = array($where); + } + else + { + $dest = array(); + foreach ($where as $key => $val) + { + $prefix = (count($dest) == 0) ? '' : ' AND '; + + if ($val != '') + { + if ( ! $this->_has_operator($key)) + { + $key .= ' ='; + } + + $val = ' '.$this->escape($val); + } + + $dest[] = $prefix.$key.$val; + } + } + + return $this->_update($this->dbprefix.$table, $fields, $dest); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @return void + */ + function close() + { + if (is_resource($this->conn_id)) + { + $this->destroy($this->conn_id); + } + $this->conn_id = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Display an error message + * + * @access public + * @param string the error message + * @param string any "swap" values + * @param boolean whether to localize the message + * @return string sends the application/errror_db.php template + */ + function display_error($error = '', $swap = '', $native = FALSE) + { + $LANG = new CI_Language(); + $LANG->load('db'); + + $heading = 'MySQL Error'; + + if ($native == TRUE) + { + $message = $error; + } + else + { + $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; + } + + if ( ! class_exists('CI_Exceptions')) + { + include_once(BASEPATH.'libraries/Exceptions.php'); + } + + $error = new CI_Exceptions(); + echo $error->show_error('An Error Was Encountered', $message, 'error_db'); + exit; + + } + + // -------------------------------------------------------------------- + + /** + * Field Data - old version - DEPRECATED + * + * @deprecated use $this->db->field_data() instead + */ + function fields($table = '') + { + return $this->field_data($table); + } + + // -------------------------------------------------------------------- + + /** + * Smart Escape String - old version - DEPRECATED + * + * @deprecated use $this->db->escape() instead + */ + function smart_escape_str($str) + { + return $this->escape($str); + } +} + + +/** + * Database Result Class + * + * This is the platform-independent result class. + * This class will not be called directly. Rather, the adapter + * class for the specific database will extend and instantiate it. + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_result { + + var $conn_id = FALSE; + var $result_id = FALSE; + var $db_debug = FALSE; + var $result_array = array(); + var $result_object = array(); + var $current_row = 0; + + /** + * Query result. Acts as a wrapper function for the following functions. + * + * @access public + * @param string can be "object" or "array" + * @return mixed either a result object or array + */ + function result($type = 'object') + { + return ($type == 'object') ? $this->result_object() : $this->result_array(); + } + + // -------------------------------------------------------------------- + + /** + * Query result. "object" version. + * + * @access public + * @return object + */ + function result_object() + { + if (count($this->result_object) > 0) + { + return $this->result_object; + } + + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + + if (count($this->result_object) == 0) + { + return FALSE; + } + + return $this->result_object; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + + if (count($this->result_array) == 0) + { + return FALSE; + } + + return $this->result_array; + } + + // -------------------------------------------------------------------- + + /** + * Query result. Acts as a wrapper function for the following functions. + * + * @access public + * @param string can be "object" or "array" + * @return mixed either a result object or array + */ + function row($n = 0, $type = 'object') + { + return ($type == 'object') ? $this->row_object($n) : $this->row_array($n); + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - object version + * + * @access public + * @return object + */ + function row_object($n = 0) + { + if (FALSE === ($result = $this->result_object())) + { + return FALSE; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - array version + * + * @access public + * @return array + */ + function row_array($n = 0) + { + if (FALSE === ($result = $this->result_array())) + { + return FALSE; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "next" row + * + * @access public + * @return object + */ + function next_row($type = 'object') + { + if (FALSE === ($result = $this->result($type))) + { + return FALSE; + } + + if (isset($result[$this->current_row + 1])) + { + ++$this->current_row; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "previous" row + * + * @access public + * @return object + */ + function previous_row($type = 'object') + { + if (FALSE === ($result = $this->result($type))) + { + return FALSE; + } + + if (isset($result[$this->current_row - 1])) + { + --$this->current_row; + } + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "first" row + * + * @access public + * @return object + */ + function first_row($type = 'object') + { + if (FALSE === ($result = $this->result($type))) + { + return FALSE; + } + return $result[0]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "last" row + * + * @access public + * @return object + */ + function last_row($type = 'object') + { + if (FALSE === ($result = $this->result($type))) + { + return FALSE; + } + return $result[count($result) -1]; + } + +} + + + +/** + * Database Field Class + * + * This class will contain the field meta-data. It + * is called by one of the field result functions + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_field { + var $name; + var $type; + var $default; + var $max_length; + var $primary_key; +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_mssql.php b/system/drivers/DB_mssql.php new file mode 100644 index 00000000..6156ec3c --- /dev/null +++ b/system/drivers/DB_mssql.php @@ -0,0 +1,472 @@ +hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return mssql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mssql_select_db($this->database, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @mssql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // MS SQL doesn't require escaping + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + mssql_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mssql_rows_affected($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + // Not supported in MS SQL? + return 0; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + // Are errros even supported in MS SQL? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + // Are error numbers supported? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT TOP 1 FROM ".$this->escape_table($table); + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->escape_table($table)."'"; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $i = $limit + $offset; + + return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); + } + +} + + + +/** + * MS SQL Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_mssql_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @mssql_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mssql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $F = new CI_DB_field(); + $F->name = $field->name; + $F->type = $field->type; + $F->max_length = $field->max_length; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mssql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mssql_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_mysql.php b/system/drivers/DB_mysql.php new file mode 100644 index 00000000..18c080b2 --- /dev/null +++ b/system/drivers/DB_mysql.php @@ -0,0 +1,495 @@ +hostname, $this->username, $this->password, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return mysql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysql_select_db($this->database, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @mysql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + return mysql_real_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + mysql_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysql_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysql_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + return mysql_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + return mysql_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT * FROM ".$this->escape_table($table)." LIMIT 1"; + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + +} + + +/** + * MySQL Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_mysql_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @mysql_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysql_fetch_field($this->result_id)) + { + $F = new CI_DB_field(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = $field->primary_key; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysql_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php new file mode 100644 index 00000000..f8cb19db --- /dev/null +++ b/system/drivers/DB_mysqli.php @@ -0,0 +1,496 @@ +hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return $this->db_connect(); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysqli_select_db($this->conn_id, $this->database); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @mysqli_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + return mysqli_real_escape_string($this->conn_id, $str); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + mysqli_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysqli_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysqli_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + return mysqli_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + return mysqli_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT * FROM ".$this->escape_table($table)." LIMIT 1"; + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + +} + + + +/** + * MySQLi Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_mysqli_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @mysqli_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysqli_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysqli_fetch_field($this->result_id)) + { + $F = new CI_DB_field(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = 0; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysqli_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysqli_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_odbc.php b/system/drivers/DB_odbc.php new file mode 100644 index 00000000..fac44904 --- /dev/null +++ b/system/drivers/DB_odbc.php @@ -0,0 +1,468 @@ +database, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return odbc_pconnect($this->database, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for ODBC + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @odbc_exec($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // ODBC doesn't require escaping + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + odbc_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @odbc_num_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @odbc_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + return odbc_errormsg($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + return odbc_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT TOP 1 FROM ".$this->escape_table($table); + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + // Does ODBC doesn't use the LIMIT clause? + return $sql; + } + +} + + +/** + * ODBC Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_odbc_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @odbc_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @odbc_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new CI_DB_field(); + $F->name = odbc_field_name($this->result_id, $i); + $F->type = odbc_field_type($this->result_id, $i); + $F->max_length = odbc_field_len($this->result_id, $i); + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return odbc_fetch_array($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return odbc_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php new file mode 100644 index 00000000..01d4b3df --- /dev/null +++ b/system/drivers/DB_postgre.php @@ -0,0 +1,476 @@ +hostname." dbname=".$this->database." user=".$this->username." password=".$this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return pg_pconnect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for Postgre so we'll return TRUE + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @pg_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + return pg_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + pg_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @pg_affected_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return pg_last_oid($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + return pg_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT * FROM ".$this->escape_table($table)." LIMIT 1"; + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$this->escape_table($table)."'"; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + +} + + + +/** + * Postgres Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_postgre_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @pg_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @pg_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new CI_DB_field(); + $F->name = pg_field_name($this->result_id, $i); + $F->type = pg_field_type($this->result_id, $i); + $F->max_length = pg_field_size($this->result_id, $i); + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return pg_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return pg_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/DB_sqlite.php b/system/drivers/DB_sqlite.php new file mode 100644 index 00000000..6428dd5b --- /dev/null +++ b/system/drivers/DB_sqlite.php @@ -0,0 +1,501 @@ +database, 0666, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ( ! $conn_id = sqlite_popen($this->database, 0666, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function execute($sql) + { + $sql = $this->_prep_query($sql); + return @sqlite_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function &_prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + return sqlite_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function destroy($conn_id) + { + sqlite_close($conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return sqlite_changes($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @sqlite_last_insert_rowid($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access public + * @return string + */ + function error_message() + { + return sqlite_error_string(sqlite_last_error($this->conn_id)); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access public + * @return integer + */ + function error_number() + { + return sqlite_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function version() + { + return sqlite_libversion(); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access public + * @param string the table name + * @return string + */ + function escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + $sql = "SELECT * FROM ".$this->escape_table($table)." LIMIT 1"; + $query = $this->query($sql); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access public + * @return string + */ + function _show_tables() + { + return "SELECT name from sqlite_master WHERE type='table'"; + } + + // -------------------------------------------------------------------- + + /** + * Show columnn query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _show_columns($table = '') + { + // Not supported + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + +} + + +/** + * SQLite Result Class + * + * This class extends the parent result class: CI_DB_result + * + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/libraries/database/ + */ +class CI_DB_sqlite_result extends CI_DB_result { + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + return @sqlite_num_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @sqlite_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new CI_DB_field(); + $F->name = sqlite_field_name($this->result_id, $i); + $F->type = 'varchar'; + $F->max_length = 0; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return sqlite_fetch_array($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return sqlite_fetch_object($this->result_id); + } + +} + +?> \ No newline at end of file diff --git a/system/drivers/index.html b/system/drivers/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/drivers/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/fonts/index.html b/system/fonts/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/fonts/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/fonts/texb.ttf b/system/fonts/texb.ttf new file mode 100644 index 0000000000000000000000000000000000000000..383c88b86b7c17e2e284732af48b2bfc359647ae GIT binary patch literal 143830 zcmcG%34ml(c{W_il{&<709mpO2M~UwQR4 z@7=v(myaoCd_MIlA7KsVlRh5jzKO4)RfWbY`wrhFjOp_+jKK07&#-9ijjuk9OX5eO ze>NVvX3m%KWq!-?e=`3kq$b|LTsPq(3kwT$FMb#w?FXMPgnqy~62q^6U+>GM*XGB@ z3wGjGydX-lqH6v?P&Z5~WIN$VG!{=JQ|XMG&E*TlQn}LBUhU}Y>h9^S_4N-7t{55~ zSvfj3KCx+&v)TP zzQf17eYakA`7M{6zRl;m$>+P~6u!FR_|dsTH{;F4mwE@BxccO^*In=PUFm)D`EI}C z#v{$Q%U`Zq_JL#QNWR~9+9&ureW!en`QGJwFQns1-^YAU`#$aayze`{v%Y`!y-0e< zc9vx&*3TMjiS1=qu#d5yW}jid!VzvWw>1;WBr|TNH}h>*cP-a(BW}X&cOP{><$lKf zTlZU8UzW}CSt+Y#^{kbRWmDNgwmrKtJCU8r&SW=c4`vT#Z^_<~eRcM}?4#NDWS`A` zKKu7MHP@EU7Cv0~MB!6~&lUc<@Ppz-#VcQ2_$}v+Y^K@XKSO(;YPR>=UVHxw?cK)u zSe{jy?Hy$AXWxbPeg^H;(OxT)$Yg$}z4yDHbf0m*=CzkWdquCkW;UEnqP-=ry_3!M zUYxx#dwcdSwD*DRJH7UPCnx19=d}0v;=$sv7hn3V52EDiY)_xy#= z?|pvv^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HLk%ik#Pl>9S2%DGV8&L4r(9X@noAwkS z&{eN|-K9`XvOAYcw?Zv-HOhTmP5xeiLtRa$W^m`$5ulTi3cHetL(Z%|sTAGNsTAGN zseIg!Be{mII+fA_Ie9~mf`x`23?5^Ho0T4vN+}RYrINy?kv;MZA(=`k=t!j$u%%MH n`i \ No newline at end of file diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php new file mode 100644 index 00000000..24e243dd --- /dev/null +++ b/system/helpers/cookie_helper.php @@ -0,0 +1,77 @@ + 0) + { + $expire = time() + $expire; + } + else + { + $expire = 0; + } + } + + setcookie($prefix.$name, $value, $expire, $path, $domain, 0); +} + +?> \ No newline at end of file diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php new file mode 100644 index 00000000..2a3d5085 --- /dev/null +++ b/system/helpers/date_helper.php @@ -0,0 +1,530 @@ +config->item('time_reference')) == 'gmt') + { + $now = time(); + $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + + if (strlen($system_time) < 10) + { + $system_time = time(); + log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); + } + + return $system_time; + } + else + { + return time(); + } +} + +// ------------------------------------------------------------------------ + +/** + * Convert MySQL Style Datecodes + * + * This function is identical to PHPs date() function, + * except that it allows date codes to be formatted using + * the MySQL style, where each code letter is preceded + * with a percent sign: %Y %m %d etc... + * + * The benefit of doing dates this way is that you don't + * have to worry about escaping your text letters that + * match the date codes. + * + * @access public + * @param string + * @param integer + * @return integer + */ +function mdate($datestr = '', $time = '') +{ + if ($datestr == '') + return ''; + + if ($time == '') + $time = now(); + + $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); + return date($datestr, $time); +} + +// ------------------------------------------------------------------------ + +/** + * Convert MySQL Style Datecodes + * + * Returns a span of seconds in this format: + * 10 days 14 hours 36 minutes 47 seconds + * + * @access public + * @param integer a number of seconds + * @param integer Unix timestamp + * @return integer + */ +function timespan($seconds = 1, $time = '') +{ + $obj =& get_instance(); + $obj->lang->load('date'); + + if ( ! is_numeric($seconds)) + { + $seconds = 1; + } + + if ( ! is_numeric($time)) + { + $time = time(); + } + + if ($time <= $seconds) + { + $seconds = 1; + } + else + { + $seconds = $time - $seconds; + } + + $str = ''; + $years = floor($seconds / 31536000); + + if ($years > 0) + { + $str .= $years.' '.$obj->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; + } + + $seconds -= $years * 31536000; + $months = floor($seconds / 2628000); + + if ($years > 0 OR $months > 0) + { + if ($months > 0) + { + $str .= $months.' '.$obj->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; + } + + $seconds -= $months * 2628000; + } + + $weeks = floor($seconds / 604800); + + if ($years > 0 OR $months > 0 OR $weeks > 0) + { + if ($weeks > 0) + { + $str .= $weeks.' '.$obj->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; + } + + $seconds -= $weeks * 604800; + } + + $days = floor($seconds / 86400); + + if ($months > 0 OR $weeks > 0 OR $days > 0) + { + if ($days > 0) + { + $str .= $days.' '.$obj->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; + } + + $seconds -= $days * 86400; + } + + $hours = floor($seconds / 3600); + + if ($days > 0 OR $hours > 0) + { + if ($hours > 0) + { + $str .= $hours.' '.$obj->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; + } + + $seconds -= $hours * 3600; + } + + $minutes = floor($seconds / 60); + + if ($days > 0 OR $hours > 0 OR $minutes > 0) + { + if ($minutes > 0) + { + $str .= $minutes.' '.$obj->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minutes')).', '; + } + + $seconds -= $minutes * 60; + } + + if ($str == '') + { + $str .= $seconds.' '.$obj->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; + } + + return substr(trim($str), 0, -1); +} + +// ------------------------------------------------------------------------ + +/** + * Number of days in a month + * + * Takes a month/year as input and returns the number of days + * for the given month/year. Takes leap years into consideration. + * + * @access public + * @param integer a numeric month + * @param integer a numeric year + * @return integer + */ +function days_in_month($month = 0, $year = '') +{ + if ($month < 1 OR $month > 12) + { + return 0; + } + + if ( ! ctype_digit($year) OR strlen($year) != 4) + { + $year = date('Y'); + } + + if ($month == 2) + { + if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) + { + return 29; + } + } + + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + return $days_in_month[$month - 1]; +} + +// ------------------------------------------------------------------------ + +/** + * Converts a local Unix timestamp to GMT + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +function local_to_gmt($time = '') +{ + if ($time == '') + $time = time(); + + return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); +} + +// ------------------------------------------------------------------------ + +/** + * Converts GMT time to a localized value + * + * Takes a Unix timestamp (in GMT) as input, and returns + * at the local value based on the timezone and DST setting + * submitted + * + * @access public + * @param integer Unix timestamp + * @param string timezone + * @param bool whether DST is active + * @return integer + */ +function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) +{ + if ($time == '') + { + return now(); + } + + $time += timezones($timezone) * 3600; + + if ($dst == TRUE) + { + $time += 3600; + } + + return $time; +} + +// ------------------------------------------------------------------------ + +/** + * Converts a MySQL Timestamp to Unix + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +function mysql_to_unix($time = '') +{ + // We'll remove certain characters for backward compatibility + // since the formatting changed with MySQL 4.1 + // YYYY-MM-DD HH:MM:SS + + $time = str_replace('-', '', $time); + $time = str_replace(':', '', $time); + $time = str_replace(' ', '', $time); + + // YYYYMMDDHHMMSS + return mktime( + substr($time, 8, 2), + substr($time, 10, 2), + substr($time, 12, 2), + substr($time, 4, 2), + substr($time, 6, 2), + substr($time, 0, 4) + ); +} + +// ------------------------------------------------------------------------ + +/** + * Unix to "Human" + * + * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM + * + * @access public + * @param integer Unix timestamp + * @param bool whether to show seconds + * @param string format: us or euro + * @return string + */ +function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') +{ + $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; + + if ($fmt == 'us') + { + $r .= date('h', $time).':'.date('i', $time); + } + else + { + $r .= date('H', $time).':'.date('i', $time); + } + + if ($seconds) + { + $r .= ':'.date('s', $time); + } + + if ($fmt == 'us') + { + $r .= ' '.date('A', $time); + } + + return $r; +} + +// ------------------------------------------------------------------------ + +/** + * Convert "human" date to GMT + * + * Reverses the above process + * + * @access public + * @param string format: us or euro + * @return integer + */ +function human_to_unix($datestr = '') +{ + if ($datestr == '') + { + return FALSE; + } + + $datestr = trim($datestr); + $datestr = preg_replace("/\040+/", "\040", $datestr); + + if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr)) + { + return FALSE; + } + + $split = preg_split("/\040/", $datestr); + + $ex = explode("-", $split['0']); + + $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; + $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + + $ex = explode(":", $split['1']); + + $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; + $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + + if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) + { + $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + } + else + { + // Unless specified, seconds get set to zero. + $sec = '00'; + } + + if (isset($split['2'])) + { + $ampm = strtolower($split['2']); + + if (substr($ampm, 0, 1) == 'p' AND $hour < 12) + $hour = $hour + 12; + + if (substr($ampm, 0, 1) == 'a' AND $hour == 12) + $hour = '00'; + + if (strlen($hour) == 1) + $hour = '0'.$hour; + } + + return mktime($hour, $min, $sec, $month, $day, $year); +} + +// ------------------------------------------------------------------------ + +/** + * Timezone Menu + * + * Generates a drop-down menu of timezones. + * + * @access public + * @param string timezone + * @param string classname + * @param string menu name + * @return string + */ +function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') +{ + $obj =& get_instance(); + $obj->lang->load('date'); + + if ($default == 'GMT') + $default = 'UTC'; + + $menu = '"; + + return $menu; +} + +// ------------------------------------------------------------------------ + +/** + * Timezones + * + * Returns an array of timezones. This is a helper function + * for varios other ones in this library + * + * @access public + * @param string timezone + * @return string + */ +function timezones($tz = '') +{ + // Note: Don't change the order of these even though + // some items appear to be in the wrong order + + $zones = array( + 'UM12' => -12, + 'UM11' => -11, + 'UM10' => -10, + 'UM9' => -9, + 'UM8' => -8, + 'UM7' => -7, + 'UM6' => -6, + 'UM5' => -5, + 'UM4' => -4, + 'UM25' => -2.5, + 'UM3' => -3, + 'UM2' => -2, + 'UM1' => -1, + 'UTC' => 0, + 'UP1' => +1, + 'UP2' => +2, + 'UP3' => +3, + 'UP25' => +2.5, + 'UP4' => +4, + 'UP35' => +3.5, + 'UP5' => +5, + 'UP45' => +4.5, + 'UP6' => +6, + 'UP7' => +7, + 'UP8' => +8, + 'UP9' => +9, + 'UP85' => +8.5, + 'UP10' => +10, + 'UP11' => +11, + 'UP12' => +12 + ); + + if ($tz == '') + { + return $zones; + } + + if ($tz == 'GMT') + $tz = 'UTC'; + + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; +} + + +?> \ No newline at end of file diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php new file mode 100644 index 00000000..69eb13d1 --- /dev/null +++ b/system/helpers/directory_helper.php @@ -0,0 +1,69 @@ + \ No newline at end of file diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php new file mode 100644 index 00000000..93bddb02 --- /dev/null +++ b/system/helpers/file_helper.php @@ -0,0 +1,139 @@ + 0) + { + $data = fread($fp, filesize($file)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + return $data; +} + +// ------------------------------------------------------------------------ + +/** + * Write File + * + * Writes data to the file specified in the path. + * Creats a new file if non-existant. + * + * @access public + * @param string path to file + * @param string file data + * @return bool + */ +function write_file($path, $data) +{ + if ( ! $fp = @fopen($path, 'wb')) + { + return FALSE; + } + + flock($fp, LOCK_EX); + fwrite($fp, $data); + flock($fp, LOCK_UN); + fclose($fp); + + return TRUE; +} + +// ------------------------------------------------------------------------ + +/** + * Delete Files + * + * Deletes all files contained in the supplied directory path. + * Files must be writable or owned by the system in order to be deleted. + * If the second parameter is set to TRUE, any direcotries contained + * within the supplied base directory will be nuked as well. + * + * @access public + * @param string path to file + * @param bool whether to delete any directories found in the path + * @return bool + */ +function delete_files($path, $del_dir = FALSE) +{ + // Trim the trailing slahs + $path = preg_replace("|^(.+?)/*$|", "\\1", $path); + + if ( ! $current_dir = @opendir($path)) + return; + + while(FALSE !== ($filename = @readdir($current_dir))) + { + if ($filename != "." and $filename != "..") + { + if (is_dir($path.'/'.$filename)) + { + delete_files($path.'/'.$filename, $del_dir); + } + else + { + unlink($path.'/'.$filename); + } + } + } + @closedir($current_dir); + + if ($del_dir == TRUE) + { + @rmdir($path); + } +} + + +?> \ No newline at end of file diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php new file mode 100644 index 00000000..f82ad01a --- /dev/null +++ b/system/helpers/form_helper.php @@ -0,0 +1,382 @@ +config->site_url($action).'"'; + + if (is_array($attributes) AND count($attributes) > 0) + { + foreach ($attributes as $key => $val) + { + $form .= ' '.$key.'="'.$val.'"'; + } + } + + $form .= '>'; + + if (is_array($hidden) AND count($hidden > 0)) + { + $form .= form_hidden($hidden); + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Form Declaration - Multipart type + * + * Creates the opening portion of the form, but with "multipart/form-data". + * + * @access public + * @param string the URI segments of the form destination + * @param array a key/value pair of attributes + * @param array a key/value pair hidden data + * @return string + */ +function form_open_multipart($action, $attributes = array(), $hidden = array()) +{ + $attributes['enctype'] = 'multipart/form-data'; + return form_open($action, $attributes, $hidden); +} + +// ------------------------------------------------------------------------ + +/** + * Hidden Input Field + * + * Generates hidden fields. You can pass a simple key/value string or an associative + * array with multiple values. + * + * @access public + * @param mixed + * @param string + * @return string + */ +function form_hidden($name, $value = '') +{ + if ( ! is_array($name)) + { + return ''; + } + + $form = ''; + foreach ($name as $name => $value) + { + $form .= ''; + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Text Input Field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_input($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Password Field + * + * Identical to the input function but adds the "password" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_password($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'password'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Upload Field + * + * Identical to the input function but adds the "file" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_upload($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'file'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Textarea field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_textarea($data = '', $value = '', $extra = '') +{ + $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); + + $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Dropdown Menu + * + * @access public + * @param string + * @param array + * @param string + * @param string + * @return string + */ +function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') +{ + if ($extra != '') $extra = ' '.$extra; + + $form = ''; + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Checkbox Field + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') +{ + $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + if (isset($data['checked'])) + { + $checked = $data['checked']; + + if ($checked == FALSE) + unset($data['checked']); + } + + if ($checked == TRUE) + $defaults['checked'] = ' checked="checked"'; + else + unset($defaults['checked']); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Radio Button + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'radio'; + return form_checkbox($data, $value, $checked, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Submit Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_submit($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Form Close Tag + * + * @access public + * @param string + * @return string + */ +function form_close($extra = '') +{ + return "\n".$extra; +} + +// ------------------------------------------------------------------------ + +/** + * Form Prep + * + * Formats text so that it can be safely placed in a form field in the event it has HTML tags. + * + * @access public + * @param string + * @return string + */ +function form_prep($str = '') +{ + if ($str == '') + { + return ''; + } + + return str_replace(array("'", '"'), array("'", """), htmlspecialchars($str)); +} + +// ------------------------------------------------------------------------ + +/** + * Parse the form attributes + * + * Helper function used by some of the form helpers + * + * @access private + * @param array + * @parm array + * @return string + */ +function parse_form_attributes($attributes, $default) +{ + if (is_array($attributes)) + { + foreach ($default as $key => $val) + { + if (isset($attributes[$key])) + { + $default[$key] = $attributes[$key]; + unset($attributes[$key]); + } + } + + if (count($attributes) > 0) + { + $default = array_merge($default, $attributes); + } + } + + $att = ''; + foreach ($default as $key => $val) + { + if ($key == 'value') + { + $val = form_prep($val); + } + + $att .= $key . '="' . $val . '" '; + } + + return $att; +} + +?> \ No newline at end of file diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php new file mode 100644 index 00000000..1c97dda5 --- /dev/null +++ b/system/helpers/html_helper.php @@ -0,0 +1,76 @@ +".$data.""; +} + +// ------------------------------------------------------------------------ + +/** + * Generates HTML BR tags based on number supplied + * + * @access public + * @param integer + * @return string + */ +function br($num = 1) +{ + return str_repeat("
", $num); +} + +// ------------------------------------------------------------------------ + +/** + * Generates non-breaking space entities based on number supplied + * + * @access public + * @param integer + * @return string + */ +function nbs($num = 1) +{ + return str_repeat(" ", $num); +} + + + +?> \ No newline at end of file diff --git a/system/helpers/index.html b/system/helpers/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/helpers/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php new file mode 100644 index 00000000..918e4ae9 --- /dev/null +++ b/system/helpers/security_helper.php @@ -0,0 +1,112 @@ +input->xss_clean($str, $charset); +} + +// -------------------------------------------------------------------- + +/** + * Hash encode a string + * + * @access public + * @param string + * @return string + */ +function hash($str, $type = 'sha1') +{ + if ($type == 'sha1') + { + if ( ! function_exists('sha1')) + { + if ( ! function_exists('mhash')) + { + require_once(BASEPATH.'libraries/Sha1'.EXT); + $SH = new CI_SHA; + return $SH->generate($str); + } + else + { + return bin2hex(mhash(MHASH_SHA1, $str)); + } + } + else + { + return sha1($str); + } + } + else + { + return md5($str); + } +} + +// ------------------------------------------------------------------------ + +/** + * Strip Image Tags + * + * @access public + * @parm string + * @return string + */ +function strip_image_tags($str) +{ + $str = preg_replace("##", "\\1", $str); + $str = preg_replace("##", "\\1", $str); + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Convert PHP tags to entities + * + * @access public + * @parm string + * @return string + */ +function encode_php_tags($str) +{ + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); +} + +?> \ No newline at end of file diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php new file mode 100644 index 00000000..d5a3591f --- /dev/null +++ b/system/helpers/string_helper.php @@ -0,0 +1,154 @@ + \ No newline at end of file diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php new file mode 100644 index 00000000..15b5573b --- /dev/null +++ b/system/helpers/text_helper.php @@ -0,0 +1,386 @@ += $n) + { + return trim($out).$end_char; + } + } +} + +// ------------------------------------------------------------------------ + +/** + * High ASCII to Entities + * + * Converts High ascii text and MS Word special characters to character entities + * + * @access public + * @param string + * @return string + */ +function ascii_to_entities($str) +{ + $count = 1; + $out = ''; + $temp = array(); + + for ($i = 0, $s = strlen($str); $i < $s; $i++) + { + $ordinal = ord($str[$i]); + + if ($ordinal < 128) + { + $out .= $str[$i]; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + + $out .= '&#'.$number.';'; + $count = 1; + $temp = array(); + } + } + } + + return $out; +} + +// ------------------------------------------------------------------------ + +/** + * Entities to ASCII + * + * Converts character entities back to ASCII + * + * @access public + * @param string + * @param bool + * @return string + */ +function entities_to_ascii($str, $all = TRUE) +{ + if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) + { + for ($i = 0, $s = count($matches['0']); $i < $s; $i++) + { + $digits = $matches['1'][$i]; + + $out = ''; + + if ($digits < 128) + { + $out .= chr($digits); + + } + elseif ($digits < 2048) + { + $out .= chr(192 + (($digits - ($digits % 64)) / 64)); + $out .= chr(128 + ($digits % 64)); + } + else + { + $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)); + $out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)); + $out .= chr(128 + ($digits % 64)); + } + + $str = str_replace($matches['0'][$i], $out, $str); + } + } + + if ($all) + { + $str = str_replace(array("&", "<", ">", """, "'", "-"), + array("&","<",">","\"", "'", "-"), + $str); + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Word Censoring Function + * + * Supply a string and an array of disallowed words and any + * matched words will be converted to #### or to the replacement + * word you've submitted. + * + * @access public + * @param string the text string + * @param string the array of censoered words + * @param string the optional replacement value + * @return string + */ +function word_censor($str, $censored, $replacement = '') +{ + if ( ! is_array($censored)) + { + return $str; + } + + $str = ' '.$str.' '; + foreach ($censored as $badword) + { + if ($replacement != '') + { + $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str); + } + else + { + $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str); + } + } + + return trim($str); +} + +// ------------------------------------------------------------------------ + +/** + * Code Highlighter + * + * Colorizes code strings + * + * @access public + * @param string the text string + * @return string + */ +function highlight_code($str) +{ + // The highlight string function encodes and highlights + // brackets so we need them to start raw + $str = str_replace(array('<', '>'), array('<', '>'), $str); + + // Replace any existing PHP tags to temporary markers so they don't accidentally + // break the string out of PHP, and thus, thwart the highlighting. + + $str = str_replace(array('<?php', '?>', '\\'), array('phptagopen', 'phptagclose', 'backslashtmp'), $str); + + // The highlight_string function requires that the text be surrounded + // by PHP tags. Since we don't know if A) the submitted text has PHP tags, + // or B) whether the PHP tags enclose the entire string, we will add our + // own PHP tags around the string along with some markers to make replacement easier later + + $str = ''; // '), array(''), $str); + $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); + } + + // Remove our artificially added PHP + $str = preg_replace("#\.+?//tempstart\
\#is", "\n", $str); + $str = preg_replace("#\.+?//tempstart\
#is", "\n", $str); + $str = preg_replace("#//tempend.+#is", "
\n", $str); + + // Replace our markers back to PHP tags. + $str = str_replace(array('phptagopen', 'phptagclose', 'backslashtmp'), array('<?php', '?>', '\\'), $str); //', $tag_close = '') +{ + if ($str == '') + { + return ''; + } + + if ($phrase != '') + { + return preg_replace('/('.preg_quote($phrase).')/i', $tag_open."\\1".$tag_close, $str); + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Word Wrap + * + * Wraps text at the specified character. Maintains the integrity of words. + * + * @access public + * @param string the text string + * @param integer the number of characters to wrap at + * @return string + */ +function word_wrap($str, $chars = '76') +{ + if ( ! ctype_digit($chars)) + $chars = 76; + + $str = preg_replace("/(\r\n|\r|\n)/", "\n", $str); + $lines = split("\n", $str); + + $output = ""; + while (list(, $thisline) = each($lines)) + { + if (strlen($thisline) > $chars) + { + $line = ""; + $words = split(" ", $thisline); + while(list(, $thisword) = each($words)) + { + while((strlen($thisword)) > $chars) + { + $cur_pos = 0; + for($i=0; $i < $chars - 1; $i++) + { + $output .= $thisword[$i]; + $cur_pos++; + } + + $output .= "\n"; + $thisword = substr($thisword, $cur_pos, (strlen($thisword) - $cur_pos)); + } + + if ((strlen($line) + strlen($thisword)) > $chars) + { + $output .= $line."\n"; + $line = $thisword." "; + } + else + { + $line .= $thisword." "; + } + } + + $output .= $line."\n"; + } + else + { + $output .= $thisline."\n"; + } + } + + return $output; +} + +?> \ No newline at end of file diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php new file mode 100644 index 00000000..6a549523 --- /dev/null +++ b/system/helpers/typography_helper.php @@ -0,0 +1,490 @@ +",$str); + $ct = count($ex); + + $newstr = ""; + for ($i = 0; $i < $ct; $i++) + { + if (($i % 2) == 0) + { + $newstr .= nl2br($ex[$i]); + } + else + { + $newstr .= $ex[$i]; + } + + if ($ct - 1 != $i) + $newstr .= "pre>"; + } + + return $newstr; +} + +// ------------------------------------------------------------------------ + +/** + * Auto Typography Wrapper Function + * + * + * @access public + * @parm string + * @return string + */ +function auto_typography($str) +{ + $TYPE = new Auto_typography(); + return $TYPE->convert($str); +} + +// ------------------------------------------------------------------------ + +/** + * Auto Typography Class + * + * + * @access private + * @category Helpers + * @author Rick Ellis + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/helpers/ + */ +class Auto_typography { + + // Block level elements that should not be wrapped inside

tags + var $block_elements = 'div|blockquote|pre|code|h\d|script|ol|un'; + + // Elements that should not have

and
tags within them. + var $skip_elements = 'pre|ol|ul'; + + // Tags we want the parser to completely ignore when splitting the string. + var $ignore_elements = 'a|b|i|em|strong|span|img|li'; + + + /** + * Main Processing Function + * + */ + function convert($str) + { + if ($str == '') + { + return ''; + } + + $str = ' '.$str.' '; + + // Standardize Newlines to make matching easier + $str = preg_replace("/(\r\n|\r)/", "\n", $str); + + /* + * Reduce line breaks + * + * If there are more than two consecutive line + * breaks we'll compress them down to a maximum + * of two since there's no benefit to more. + * + */ + $str = preg_replace("/\n\n+/", "\n\n", $str); + + /* + * Convert quotes within tags to tempoarary marker + * + * We don't want quotes converted within + * tags so we'll temporarily convert them to + * {{{DQ}}} and {{{SQ}}} + * + */ + if (preg_match_all("#\<.+?>#si", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $str = str_replace($matches['0'][$i], + str_replace(array("'",'"'), array('{{{SQ}}}', '{{{DQ}}}'), $matches['0'][$i]), + $str); + } + } + + /* + * Convert "ignore" tags to tempoarary marker + * + * The parser splits out the string at every tag + * it encounters. Certain inline tags, like image + * tags, links, span tags, etc. will be adversely + * affected if they are split out so we'll convert + * the opening < temporarily to: {{{tag}}} + * + */ + $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{{{tag}}}\\1\\2", $str); + + /* + * Split the string at every tag + * + * This creates an array with this prototype: + * + * [array] + * { + * [0] = + * [1] = Content contained between the tags + * [2] = + * Etc... + * } + * + */ + $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); + + /* + * Build our finalized string + * + * We'll cycle through the array, skipping tags, + * and processing the contained text + * + */ + $str = ''; + $process = TRUE; + foreach ($chunks as $chunk) + { + /* + * Are we dealing with a tag? + * + * If so, we'll skip the processing for this cycle. + * Well also set the "process" flag which allows us + * to skip

 tags and a few other things.
+			 *
+			 */			
+			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match)) 
+			{
+				if (preg_match("#".$this->skip_elements."#", $match['2']))
+				{
+					$process =  ($match['1'] == '/') ? TRUE : FALSE;		
+				}
+		
+				$str .= $chunk;
+				continue;
+			}
+		
+			if ($process == FALSE)
+			{
+				$str .= $chunk;
+				continue;
+			}
+			
+			//  Convert Newlines into 

and
tags + $str .= $this->format_newlines($chunk); + } + + // Convert Quotes and other characters + $str = $this->format_characters($str); + + // We'll swap our temporary markers back and do some clean up. + $str = preg_replace('#(

\n*

)#', '', $str); + $str = preg_replace('#()

#', "\\1", $str); + + $str = str_replace( + array('

', '

', '{{{tag}}}', '{{{DQ}}}', '{{{SQ}}}'), + array('

', '

', '<', '"', "'"), + $str + ); + + return trim($str); + } + + // -------------------------------------------------------------------- + + /** + * Format Characters + * + * This function mainly converts double and single quotes + * to entities, but since these are directional, it does + * it based on some rules. It also converts em-dashes + * and a couple other things. + */ + function format_characters($str) + { + $table = array( + ' "' => " “", + '" ' => "” ", + " '" => " ‘", + "' " => "’ ", + + '>"' => ">“", + '"<' => "”<", + ">'" => ">‘", + "'<" => "’<", + + "\"." => "”.", + "\"," => "”,", + "\";" => "”;", + "\":" => "”:", + "\"!" => "”!", + "\"?" => "”?", + + ". " => ".  ", + "? " => "?  ", + "! " => "!  ", + ": " => ":  ", + ); + + // These deal with quotes within quotes, like: "'hi here'" + $start = 0; + $space = array("\n", "\t", " "); + + while(TRUE) + { + $current = strpos(substr($str, $start), "\"'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + + if ( ! in_array($one_after, $space) && $one_after != "<") + { + $str = str_replace( $one_before."\"'".$one_after, + $one_before."“‘".$one_after, + $str); + } + elseif ( ! in_array($one_before, $space) && (in_array($one_after, $space) OR $one_after == '<')) + { + $str = str_replace( $one_before."\"'".$one_after, + $one_before."”’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'\""); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + + if ( in_array($one_before, $space) && ! in_array($one_after, $space) && $one_after != "<") + { + $str = str_replace( $one_before."'\"".$one_after, + $one_before."‘“".$one_after, + $str); + } + elseif ( ! in_array($one_before, $space) && $one_before != ">") + { + $str = str_replace( $one_before."'\"".$one_after, + $one_before."’”".$one_after, + $str); + } + + $start = $start+$current+2; + } + + // Are there quotes within a word, as in: ("something") + if (preg_match_all("/(.)\"(\S+?)\"(.)/", $str, $matches)) + { + for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) + { + if ( ! in_array($matches['1'][$i], $space) && ! in_array($matches['3'][$i], $space)) + { + $str = str_replace( $matches['0'][$i], + $matches['1'][$i]."“".$matches['2'][$i]."”".$matches['3'][$i], + $str); + } + } + } + + if (preg_match_all("/(.)\'(\S+?)\'(.)/", $str, $matches)) + { + for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) + { + if ( ! in_array($matches['1'][$i], $space) && ! in_array($matches['3'][$i], $space)) + { + $str = str_replace( $matches['0'][$i], + $matches['1'][$i]."‘".$matches['2'][$i]."’".$matches['3'][$i], + $str); + } + } + } + + // How about one apostrophe, as in Rick's + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_before, $space) && ! in_array($one_after, $space)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + // Em-dashes + $start = 0; + while(TRUE) + { + $current = strpos(substr($str, $start), "--"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + $two_before = substr($str, $start+$current-2, 1); + $two_after = substr($str, $start+$current+3, 1); + + if (( ! in_array($one_before, $space) && ! in_array($one_after, $space)) + OR + ( ! in_array($two_before, $space) && ! in_array($two_after, $space) && $one_before == ' ' && $one_after == ' ') + ) + { + $str = str_replace( $two_before.$one_before."--".$one_after.$two_after, + $two_before.trim($one_before)."—".trim($one_after).$two_after, + $str); + } + + $start = $start+$current+2; + } + + // Ellipsis + $str = preg_replace("#(\w)\.\.\.(\s|
|

)#", "\\1…\\2", $str); + $str = preg_replace("#(\s|
|

)\.\.\.(\w)#", "\\1…\\2", $str); + + // Run the translation array we defined above + $str = str_replace(array_keys($table), array_values($table), $str); + + // If there are any stray double quotes we'll catch them here + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), '"'); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_after, $space)) + { + $str = str_replace( $one_before.'"'.$one_after, + $one_before."“".$one_after, + $str); + } + elseif( ! in_array($one_before, $space)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."”".$one_after, + $str); + } + + $start = $start+$current+2; + } + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_after, $space)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."‘".$one_after, + $str); + } + elseif( ! in_array($one_before, $space)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Format Newlines + * + * Converts newline characters into either

tags or
+ * + */ + function format_newlines($str) + { + if ($str == '') + { + return $str; + } + + if (strpos($str, "\n") === FALSE) + { + return '

'.$str.'

'; + } + + $str = str_replace("\n\n", "

\n\n

", $str); + $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
\\2\\3", $str); + + return '

'.$str.'

'; + } +} + + +?> \ No newline at end of file diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php new file mode 100644 index 00000000..d2d2a598 --- /dev/null +++ b/system/helpers/url_helper.php @@ -0,0 +1,487 @@ +config->site_url($uri); +} + +// ------------------------------------------------------------------------ + +/** + * Base URL + * + * Returns the "base_url" item from your config file + * + * @access public + * @return string + */ +function base_url() +{ + $obj =& get_instance(); + return $obj->config->item('base_url', 1); +} + +// ------------------------------------------------------------------------ + +/** + * Index page + * + * Returns the "index_page" from your config file + * + * @access public + * @return string + */ +function index_page() +{ + $obj =& get_instance(); + return $obj->config->item('index_page'); +} + +// ------------------------------------------------------------------------ + +/** + * Anchor Link + * + * Creates an anchor based on the local URL. + * + * @access public + * @param string the URL + * @param string the link title + * @param mixed any attributes + * @return string + */ +function anchor($uri = '', $title = '', $attributes = '') +{ + $site_url = site_url($uri); + + if ($title == '') + { + $title = $site_url; + } + + if ($attributes == '') + { + $attributes = ' title="'.$title.'"'; + } + else + { + if (is_array($attributes)) + { + $attributes = parse_url_attributes($attributes); + } + } + + return ''.$title.''; +} + +// ------------------------------------------------------------------------ + +/** + * Anchor Link - Pop-up version + * + * Creates an anchor based on the local URL. The link + * opens a new window based on the attributes specified. + * + * @access public + * @param string the URL + * @param string the link title + * @param mixed any attributes + * @return string + */ +function anchor_popup($uri = '', $title = '', $attributes = FALSE) +{ + $site_url = site_url($uri); + + if ($title == '') + { + $title = $site_url; + } + + if ($attributes === FALSE) + { + return "".$title.""; + } + + if ( ! is_array($attributes)) + { + $attributes = array(); + } + + foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val) + { + $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key]; + } + + return "".$title.""; +} + +// ------------------------------------------------------------------------ + +/** + * Mailto Link + * + * @access public + * @param string the email address + * @param string the link title + * @param mixed any attributes + * @return string + */ +function mailto($email, $title = '', $attributes = '') +{ + if ($title == "") + { + $title = $email; + } + + if (is_array($attributes)) + { + $attributes = parse_url_attributes($attributes); + } + + return ''.$title.''; +} + +// ------------------------------------------------------------------------ + +/** + * Encoded Mailto Link + * + * Create a spam-protected mailto link written in Javascript + * + * @access public + * @param string the email address + * @param string the link title + * @param mixed any attributes + * @return string + */ +function safe_mailto($email, $title = '', $attributes = '') +{ + if ($title == "") + { + $title = $email; + } + + for ($i = 0; $i < 16; $i++) + { + $x[] = substr(' $val) + { + $x[] = ' '.$key.'="'; + for ($i = 0; $i < strlen($val); $i++) + { + $x[] = "|".ord(substr($val, $i, 1)); + } + $x[] = '"'; + } + } + else + { + for ($i = 0; $i < strlen($attributes); $i++) + { + $x[] = substr($attributes, $i, 1); + } + } + } + + $x[] = '>'; + + $temp = array(); + for ($i = 0; $i < strlen($title); $i++) + { + $ordinal = ord($title[$i]); + + if ($ordinal < 128) + { + $x[] = "|".$ordinal; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + $x[] = "|".$number; + $count = 1; + $temp = array(); + } + } + } + + $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>'; + + $x = array_reverse($x); + ob_start(); + +?>http'. + $matches['4'][$i].'://'. + $matches['5'][$i]. + $matches['6'][$i].''. + $period, $str); + } + } + } + + if ($type != 'url') + { + if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) + { + for ($i = 0; $i < sizeof($matches['0']); $i++) + { + $period = ''; + if (preg_match("|\.$|", $matches['3'][$i])) + { + $period = '.'; + $matches['3'][$i] = substr($matches['3'][$i], 0, -1); + } + + $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); + } + + } + } + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Prep URL + * + * Simply adds the http:// part if missing + * + * @access public + * @param string the URL + * @return string + */ +function prep_url($str = '') +{ + if ($str == 'http://' OR $str == '') + { + return ''; + } + + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + { + $str = 'http://'.$str; + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Create URL Title + * + * Takes a "title" string as input and creates a + * human-friendly URL string with either a dash + * or an underscore as the word separator. + * + * @access public + * @param string the string + * @param string the separator: dash, or underscore + * @return string + */ +function url_title($str, $separator = 'dash') +{ + if ($separator == 'dash') + { + $search = '_'; + $replace = '-'; + } + else + { + $search = '-'; + $replace = '_'; + } + + $trans = array( + $search => $replace, + "\s+" => $replace, + "[^a-z0-9".$replace."]" => '', + $replace."+" => $replace, + $replace."$" => '', + "^".$replace => '' + ); + + $str = strip_tags(strtolower($str)); + + foreach ($trans as $key => $val) + { + $str = preg_replace("#".$key."#", $val, $str); + } + + return trim(stripslashes($str)); +} + +// ------------------------------------------------------------------------ + +/** + * Header Redirect + * + * Header redirect in two flavors + * + * @access public + * @param string the URL + * @param string the method: location or redirect + * @return string + */ +function redirect($uri = '', $method = 'location') +{ + switch($method) + { + case 'refresh' : header("Refresh:0;url=".site_url($uri)); + break; + default : header("location:".site_url($uri)); + break; + } + exit; +} + +// ------------------------------------------------------------------------ + +/** + * Parse out the attributes + * + * Some of the functions use this + * + * @access private + * @param array + * @param bool + * @return string + */ +function parse_url_attributes($attributes, $javascript = FALSE) +{ + $att = ''; + foreach ($attributes as $key => $val) + { + if ($javascript == TRUE) + { + $att .= $key . '=' . $val . ','; + } + else + { + $att .= ' ' . $key . '="' . $val . '"'; + } + } + + if ($javascript == TRUE) + { + $att = substr($att, 0, -1); + } + + return $att; +} + +?> \ No newline at end of file diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php new file mode 100644 index 00000000..ee3fc289 --- /dev/null +++ b/system/helpers/xml_helper.php @@ -0,0 +1,55 @@ +","\"", "'", "-"), + array("&", "<", ">", """, "'", "-"), + $str); + + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;", $str); + + return $str; +} + + +?> \ No newline at end of file diff --git a/system/init/index.html b/system/init/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/init/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/init/init_calendar.php b/system/init/init_calendar.php new file mode 100644 index 00000000..5cf66372 --- /dev/null +++ b/system/init/init_calendar.php @@ -0,0 +1,19 @@ +calendar = new CI_Calendar(); +$obj->ci_is_loaded[] = 'calendar'; + +?> \ No newline at end of file diff --git a/system/init/init_email.php b/system/init/init_email.php new file mode 100644 index 00000000..6782310e --- /dev/null +++ b/system/init/init_email.php @@ -0,0 +1,24 @@ +email = new CI_Email($config); +$obj->ci_is_loaded[] = 'email'; + +?> \ No newline at end of file diff --git a/system/init/init_encrypt.php b/system/init/init_encrypt.php new file mode 100644 index 00000000..5eae533b --- /dev/null +++ b/system/init/init_encrypt.php @@ -0,0 +1,18 @@ +encrypt = new CI_Encrypt(); +$obj->ci_is_loaded[] = 'encrypt'; + +?> \ No newline at end of file diff --git a/system/init/init_image_lib.php b/system/init/init_image_lib.php new file mode 100644 index 00000000..dcd702f0 --- /dev/null +++ b/system/init/init_image_lib.php @@ -0,0 +1,24 @@ +image_lib = new CI_Image_lib($config); +$obj->ci_is_loaded[] = 'image_lib'; + +?> \ No newline at end of file diff --git a/system/init/init_pagination.php b/system/init/init_pagination.php new file mode 100644 index 00000000..3a7d9361 --- /dev/null +++ b/system/init/init_pagination.php @@ -0,0 +1,24 @@ +pagination = new CI_Pagination($config); +$obj->ci_is_loaded[] = 'pagination'; + +?> \ No newline at end of file diff --git a/system/init/init_parser.php b/system/init/init_parser.php new file mode 100644 index 00000000..17824b56 --- /dev/null +++ b/system/init/init_parser.php @@ -0,0 +1,19 @@ +parser = new CI_Parser(); +$obj->ci_is_loaded[] = 'parser'; + + +?> \ No newline at end of file diff --git a/system/init/init_session.php b/system/init/init_session.php new file mode 100644 index 00000000..cf493e53 --- /dev/null +++ b/system/init/init_session.php @@ -0,0 +1,18 @@ +session = new CI_Session(); +$obj->ci_is_loaded[] = 'session'; + +?> \ No newline at end of file diff --git a/system/init/init_trackback.php b/system/init/init_trackback.php new file mode 100644 index 00000000..6a3778bc --- /dev/null +++ b/system/init/init_trackback.php @@ -0,0 +1,18 @@ +trackback = new CI_Trackback(); +$obj->ci_is_loaded[] = 'trackback'; + +?> \ No newline at end of file diff --git a/system/init/init_unit_test.php b/system/init/init_unit_test.php new file mode 100644 index 00000000..61d5350b --- /dev/null +++ b/system/init/init_unit_test.php @@ -0,0 +1,18 @@ +unit = new CI_Unit_test(); +$obj->ci_is_loaded[] = 'unit'; + +?> \ No newline at end of file diff --git a/system/init/init_upload.php b/system/init/init_upload.php new file mode 100644 index 00000000..495975c7 --- /dev/null +++ b/system/init/init_upload.php @@ -0,0 +1,24 @@ +upload = new CI_Upload($config); +$obj->ci_is_loaded[] = 'upload'; + +?> \ No newline at end of file diff --git a/system/init/init_validation.php b/system/init/init_validation.php new file mode 100644 index 00000000..a320c3e5 --- /dev/null +++ b/system/init/init_validation.php @@ -0,0 +1,18 @@ +validation = new CI_Validation(); +$obj->ci_is_loaded[] = 'validation'; + +?> \ No newline at end of file diff --git a/system/init/init_xmlrpc.php b/system/init/init_xmlrpc.php new file mode 100644 index 00000000..b75e9aad --- /dev/null +++ b/system/init/init_xmlrpc.php @@ -0,0 +1,24 @@ +xmlrpc = new CI_XML_RPC($config); +$obj->ci_is_loaded[] = 'xmlrpc'; + +?> \ No newline at end of file diff --git a/system/init/init_xmlrpcs.php b/system/init/init_xmlrpcs.php new file mode 100644 index 00000000..7566e382 --- /dev/null +++ b/system/init/init_xmlrpcs.php @@ -0,0 +1,27 @@ +xmlrpc = new CI_XML_RPC(); +$obj->xmlrpcs = new CI_XML_RPC_Server($config); +$obj->ci_is_loaded[] = 'xmlrpc'; +$obj->ci_is_loaded[] = 'xmlrpcs'; + +?> \ No newline at end of file diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php new file mode 100644 index 00000000..4a399af8 --- /dev/null +++ b/system/language/english/calendar_lang.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/system/language/english/date_lang.php b/system/language/english/date_lang.php new file mode 100644 index 00000000..02ebe738 --- /dev/null +++ b/system/language/english/date_lang.php @@ -0,0 +1,49 @@ + \ No newline at end of file diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php new file mode 100644 index 00000000..b210b61b --- /dev/null +++ b/system/language/english/db_lang.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php new file mode 100644 index 00000000..430ae4ab --- /dev/null +++ b/system/language/english/email_lang.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/system/language/english/imglib_lang.php b/system/language/english/imglib_lang.php new file mode 100644 index 00000000..68c5804a --- /dev/null +++ b/system/language/english/imglib_lang.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/system/language/english/index.html b/system/language/english/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/language/english/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/language/english/scaffolding_lang.php b/system/language/english/scaffolding_lang.php new file mode 100644 index 00000000..96fe167e --- /dev/null +++ b/system/language/english/scaffolding_lang.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/system/language/english/unit_test_lang.php b/system/language/english/unit_test_lang.php new file mode 100644 index 00000000..b64ea6de --- /dev/null +++ b/system/language/english/unit_test_lang.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/system/language/english/upload_lang.php b/system/language/english/upload_lang.php new file mode 100644 index 00000000..6837c8ac --- /dev/null +++ b/system/language/english/upload_lang.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/system/language/english/validation_lang.php b/system/language/english/validation_lang.php new file mode 100644 index 00000000..326fe557 --- /dev/null +++ b/system/language/english/validation_lang.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/system/language/index.html b/system/language/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/language/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php new file mode 100644 index 00000000..9dd9d4ac --- /dev/null +++ b/system/libraries/Benchmark.php @@ -0,0 +1,117 @@ +marker[$name] = microtime(); + } + // END mark() + + // -------------------------------------------------------------------- + + /** + * Calculates the time difference between two marked points. + * + * If the first parameter is empty this function instead returns the + * {elapsed_time} pseudo-variable. This permits the the full system + * execution time to be shown in a template. The output class will + * swap the real value for this variable. + * + * @access public + * @param string a paricular marked point + * @param string a paricular marked point + * @param integer the number of decimal places + * @return mixed + */ + function elapsed_time($point1 = '', $point2 = '', $decimals = 4) + { + if ($point1 == '') + { + return '{elapsed_time}'; + } + + if ( ! isset($this->marker[$point2])) + $this->marker[$point2] = microtime(); + + list($sm, $ss) = explode(' ', $this->marker[$point1]); + list($em, $es) = explode(' ', $this->marker[$point2]); + + return number_format(($em + $es) - ($sm + $ss), $decimals); + } + // END elapsed_time() + + // -------------------------------------------------------------------- + + /** + * Memory Usage + * + * This function returns the {memory_usage} pseudo-variable. + * This permits it to be put it anywhere in a template + * without the memory being calculated until the end. + * The output class will swap the real value for this variable. + * + * @access public + * @return string + */ + function memory_usage() + { + return '{memory_usage}'; + } + // END memory_usage() + +} + +// END CI_Benchmark class +?> \ No newline at end of file diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php new file mode 100644 index 00000000..013f0679 --- /dev/null +++ b/system/libraries/Calendar.php @@ -0,0 +1,473 @@ +obj =& get_instance(); + if ( ! in_array('calendar_lang'.EXT, $this->obj->lang->is_loaded)) + { + $this->obj->lang->load('calendar'); + } + + $this->local_time = time(); + log_message('debug', "Calendar Class Initialized"); + } + // END CI_Calendar() + + // -------------------------------------------------------------------- + + /** + * Initialize the user preferences + * + * Accepts an associative array as input, containing display preferences + * + * @access public + * @param array config preferences + * @return void + */ + function initialize($config = array()) + { + foreach ($config as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + // END initialize() + + // -------------------------------------------------------------------- + + /** + * Generate the calendar + * + * @access public + * @param integer the year + * @param integer the month + * @param array the data to be shown in the calendar cells + * @return string + */ + 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 = '200'.$year; + + if (strlen($year) == 2) + $year = '20'.$year; + + if (strlen($month) == 1) + $month = '0'.$month; + + $adjusted_date = $this->adjust_date($month, $year); + + $month = $adjusted_date['month']; + $year = $adjusted_date['year']; + + // Determine the total days in the month + $total_days = $this->get_total_days($month, $year); + + // Set the starting day of the week + $start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6); + $start_day = ( ! isset($start_days[$this->start_day])) ? 0 : $start_days[$this->start_day]; + + // Set the starting day number + $local_date = mktime(12, 0, 0, $month, 1, $year); + $date = getdate($local_date); + $day = $start_day + 1 - $date["wday"]; + + while ($day > 1) + { + $day -= 7; + } + + // 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); + + $is_current_month = ($cur_year == $year AND $cur_month == $month) ? TRUE : FALSE; + + // Generate the template data array + $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"; + + // "previous" month link + if ($this->show_next_prev == TRUE) + { + $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"; + } + + // 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']); + + $out .= $this->temp['heading_title_cell']; + $out .= "\n"; + + // "next" month link + if ($this->show_next_prev == TRUE) + { + $adjusted_date = $this->adjust_date($month + 1, $year); + $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"; + + $day_names = $this->get_day_names(); + + for ($i = 0; $i < 7; $i ++) + { + $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"; + + // Build the main body of the calendar + while ($day <= $total_days) + { + $out .= "\n"; + $out .= $this->temp['cal_row_start']; + $out .= "\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']; + + 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)); + } + 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']; + $out .= str_replace('{day}', $day, $temp); + } + } + else + { + // Blank cells + $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']; + $day++; + } + + $out .= "\n"; + $out .= $this->temp['cal_row_end']; + $out .= "\n"; + } + + $out .= "\n"; + $out .= $this->temp['table_close']; + + return $out; + } + // END generate() + + // -------------------------------------------------------------------- + + /** + * Get Month Name + * + * Generates a texual month name based on the numeric + * month provided. + * + * @access public + * @parm integer the month + * @return string + */ + function get_month_name($month) + { + if ($this->month_type == 'short') + { + $month_names = array('01' => 'cal_jan', '02' => 'cal_feb', '03' => 'cal_mar', '04' => 'cal_apr', '05' => 'cal_may', '06' => 'cal_jun', '07' => 'cal_jul', '08' => 'cal_aug', '09' => 'cal_sep', '10' => 'cal_oct', '11' => 'cal_nov', '12' => 'cal_dec'); + } + else + { + $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_novermber', '12' => 'cal_december'); + } + + $month = $month_names[$month]; + + if ($this->obj->lang->line($month) === FALSE) + { + return ucfirst(str_replace('cal_', '', $month)); + } + + return $this->obj->lang->line($month); + } + // END get_month_name() + + // -------------------------------------------------------------------- + + /** + * Get Day Names + * + * Returns an array of day names (Sunday, Monday, etc.) based + * on the type. Options: long, short, abrev + * + * @access public + * @param string + * @return array + */ + function get_day_names($day_type = '') + { + if ($day_type != '') + $this->day_type = $day_type; + + if ($this->day_type == 'long') + { + $day_names = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); + } + elseif ($this->day_type == 'short') + { + $day_names = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); + } + else + { + $day_names = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'); + } + + $days = array(); + foreach ($day_names as $val) + { + $days[] = ($this->obj->lang->line('cal_'.$val) === FALSE) ? ucfirst($val) : $this->obj->lang->line('cal_'.$val); + } + + return $days; + } + // END get_day_names() + + // -------------------------------------------------------------------- + + /** + * Adjust Date + * + * This function makes sure that we have a valid month/year. + * For example, if you submit 13 as the month, the year will + * increment and the month will become January. + * + * @access public + * @param integer the month + * @param integer the year + * @return array + */ + function adjust_date($month, $year) + { + $date = array(); + + $date['month'] = $month; + $date['year'] = $year; + + while ($date['month'] > 12) + { + $date['month'] -= 12; + $date['year']++; + } + + while ($date['month'] <= 0) + { + $date['month'] += 12; + $date['year']--; + } + + if (strlen($date['month']) == 1) + { + $date['month'] = '0'.$date['month']; + } + + return $date; + } + // END adjust_date() + + // -------------------------------------------------------------------- + + /** + * Total days in a given month + * + * @access public + * @param integer the month + * @param integer the year + * @return integer + */ + function get_total_days($month, $year) + { + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + + if ($month < 1 OR $month > 12) + { + return 0; + } + + if ($month == 2) + { + if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) + { + return 29; + } + } + + return $days_in_month[$month - 1]; + } + // END get_total_days() + + // -------------------------------------------------------------------- + + /** + * Set Default Template Data + * + * This is used in the event that the user has not created their own template + * + * @access public + * @return array + */ + function default_template() + { + return array ( + 'table_open' => '', + 'heading_row_start' => '', + 'heading_previous_cell' => '', + 'heading_title_cell' => '', + 'heading_next_cell' => '', + 'heading_row_end' => '', + 'week_row_start' => '', + 'week_day_cell' => '', + 'week_row_end' => '', + 'cal_row_start' => '', + 'cal_cell_start' => '', + 'cal_cell_end_today' => '', + 'cal_row_end' => '', + 'table_close' => '
<<{heading}>>
{week_day}
', + 'cal_cell_start_today' => '', + 'cal_cell_content' => '{day}', + 'cal_cell_content_today' => '{day}', + 'cal_cell_no_content' => '{day}', + 'cal_cell_no_content_today' => '{day}', + 'cal_cell_blank' => ' ', + 'cal_cell_end' => '
' + ); + } + // END default_template() + + // -------------------------------------------------------------------- + + /** + * Parse Template + * + * Harvests the data within the template {pseudo-variables} + * used to display the calendar + * + * @access public + * @return void + */ + function parse_template() + { + $this->temp = $this->default_template(); + + if ($this->template == '') + { + return; + } + + $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); + + foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) + { + if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) + { + $this->temp[$val] = $match['1']; + } + else + { + if (in_array($val, $today)) + { + $this->temp[$val] = $this->temp[str_replace('_today', '', $val)]; + } + } + } + } + // END parse_template() + +} + +// END CI_Calendar class +?> \ No newline at end of file diff --git a/system/libraries/Config.php b/system/libraries/Config.php new file mode 100644 index 00000000..85b29579 --- /dev/null +++ b/system/libraries/Config.php @@ -0,0 +1,181 @@ +config =& _get_config(); + log_message('debug', "Config Class Initialized"); + } + // END CI_Config() + + + // -------------------------------------------------------------------- + + /** + * Load Config File + * + * @access public + * @param string the config file name + * @return void + */ + function load($file = '') + { + $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); + + if (in_array($file, $this->is_loaded)) + { + return; + } + + include_once(APPPATH.'config/'.$file.EXT); + + if ( ! isset($config) OR ! is_array($config)) + { + show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.'); + } + + $this->config = array_merge($this->config, $config); + + $this->is_loaded[] = $file; + unset($config); + + log_message('debug', 'Config file loaded: config/'.$file.EXT); + } + // END load() + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item + * + * The second parameter allows a slash to be added to the end of + * the item, in the case of a path. + * + * @access public + * @param string the config item name + * @param bool + * @return string + */ + function item($item, $slash = FALSE) + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + + $pref = $this->config[$item]; + + if ($pref == '') + { + return $pref; + } + + if ($slash !== FALSE AND ereg("/$", $pref) === FALSE) + { + $pref .= '/'; + } + + return $pref; + } + // END item() + + // -------------------------------------------------------------------- + + /** + * Site URL + * + * @access public + * @param string the URI string + * @return string + */ + function site_url($uri = '') + { + if (is_array($uri)) + { + $uri = implode('/', $uri); + } + + if ($uri == '') + { + return $this->item('base_url', 1).$this->item('index_page'); + } + else + { + $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); + return $this->item('base_url', 1).$this->item('index_page', 1).preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; + } + } + // END site_url() + + // -------------------------------------------------------------------- + + /** + * System URL + * + * @access public + * @return string + */ + function system_url() + { + $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); + return $this->item('base_url', 1).end($x).'/'; + } + // END system_url() + + // -------------------------------------------------------------------- + + /** + * Set a config file item + * + * @access public + * @param string the config item key + * @param string the config item value + * @return void + */ + function set_item($item, $value) + { + $this->config[$item] = $value; + } + // END set_item() + +} + +// END CI_Config class +?> \ No newline at end of file diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php new file mode 100644 index 00000000..ec21f8d6 --- /dev/null +++ b/system/libraries/Controller.php @@ -0,0 +1,445 @@ +_ci_assign_core(); + + // Load everything specified in the autoload.php file + $this->load->_ci_autoloader($this->_ci_autoload()); + + // This allows anything loaded using $this->load (viwes, files, etc.) + // to become accessible from within the Controller class functions. + foreach ($this->ci_is_loaded as $val) + { + $this->load->$val =& $this->$val; + } + + log_message('debug', "Controller Class Initialized"); + } + // END Controller() + + // -------------------------------------------------------------------- + + /** + * Initialization Handler + * + * Looks for the existence of a handler method and calls it + * + * @access private + * @param string the item that is being loaded + * @param mixed any additional parameters + * @return void + */ + function _ci_initialize($what, $params = FALSE) + { + $method = '_ci_init_'.strtolower(str_replace(EXT, '', $what)); + + if ( ! method_exists($this, $method)) + { + $method = substr($method, 4); + + if ( ! file_exists(APPPATH.'init/'.$method.EXT)) + { + if ( ! file_exists(BASEPATH.'init/'.$method.EXT)) + { + log_message('error', "Unable to load the requested class: ".$what); + show_error("Unable to load the class: ".$what); + } + + include(BASEPATH.'init/'.$method.EXT); + } + else + { + include(APPPATH.'init/'.$method.EXT); + } + } + else + { + if ($params === FALSE) + { + $this->$method(); + } + else + { + $this->$method($params); + } + } + } + // END _ci_initialize() + + // -------------------------------------------------------------------- + + /** + * Loads and instantiates the requested model class + * + * @access private + * @param string + * @return array + */ + function _ci_load_model($model, $name = '', $db_conn = FALSE) + { + if ($name == '') + { + $name = $model; + } + + if (isset($this->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } + + $model = strtolower($model); + + if ( ! file_exists(APPPATH.'models/'.$model.EXT)) + { + show_error('Unable to locate the model you have specified: '.$model); + } + + if ($db_conn !== FALSE) + { + if ($db_conn === TRUE) + $db_conn = ''; + + $this->_ci_init_database($db_conn, FALSE, TRUE); + } + + if ( ! class_exists('Model')) + { + require_once(BASEPATH.'libraries/Model'.EXT); + } + + require_once(APPPATH.'models/'.$model.EXT); + + $model = ucfirst($model); + $this->$name = new $model(); + $this->_ci_models[] = $name; + $this->_ci_assign_to_models(); + } + // END _ci_load_model() + + + // -------------------------------------------------------------------- + + /** + * Assign to Models + * + * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) + * will be available to modles, if any exist. + * + * @access public + * @param object + * @return array + */ + function _ci_assign_to_models() + { + $obj =& get_instance(); + if (count($obj->_ci_models) == 0) + { + return; + } + foreach ($obj->_ci_models as $model) + { + $obj->$model->_assign_libraries(); + } + } + // END _ci_assign_to_models() + + + // -------------------------------------------------------------------- + + /** + * Auto-initialize Core Classes + * + * This initializes the core systems that are specified in the + * libraries/autoload.php file, as well as the systems specified in + * the $autoload class array above. + * + * It returns the "autoload" array so we can pass it to the Loader + * class since it needs to autoload plugins and helper files + * + * The config/autoload.php file contains an array that permits + * sub-systems to be loaded automatically. + * + * @access private + * @return array + */ + function _ci_autoload() + { + include_once(APPPATH.'config/autoload'.EXT); + + if ( ! isset($autoload)) + { + return FALSE; + } + + if (count($autoload['config']) > 0) + { + foreach ($autoload['config'] as $key => $val) + { + $this->config->load($val); + } + } + unset($autoload['config']); + + if ( ! is_array($autoload['core'])) + { + $autoload['core'] = array($autoload['core']); + } + + foreach ($autoload['core'] as $item) + { + $this->_ci_initialize($item); + } + + return $autoload; + } + // END _ci_autoload() + + // -------------------------------------------------------------------- + + /** + * Assign the core classes to the global $CI object + * + * By assigning all the classes instantiated by the front controller + * local class variables we enable everything to be accessible using + * $this->class->function() + * + * @access private + * @return void + */ + function _ci_assign_core() + { + foreach (array('Config', 'Input', 'Benchmark', 'URI', 'Output') as $val) + { + $class = strtolower($val); + $this->$class =& _load_class('CI_'.$val); + $this->ci_is_loaded[] = $class; + } + + $this->lang =& _load_class('CI_Language'); + $this->ci_is_loaded[] = 'lang'; + + // In PHP 4 the Controller class is a child of CI_Loader. + // In PHP 5 we run it as its own class. + if (floor(phpversion()) >= 5) + { + $this->load = new CI_Loader(); + } + + $this->ci_is_loaded[] = 'load'; + } + // END _ci_assign_core() + + // -------------------------------------------------------------------- + + /** + * Initialize Scaffolding + * + * This initializing function works a bit different than the + * others. It doesn't load the class. Instead, it simply + * sets a flag indicating that scaffolding is allowed to be + * used. The actual scaffolding function below is + * called by the front controller based on whether the + * second segment of the URL matches the "secret" scaffolding + * word stored in the application/config/routes.php + * + * @access private + * @param string the table to scaffold + * @return void + */ + function _ci_init_scaffolding($table = FALSE) + { + if ($table === FALSE) + { + show_error('You must include the name of the table you would like access when you initialize scaffolding'); + } + + $this->_ci_scaffolding = TRUE; + $this->_ci_scaff_table = $table; + } + // END _ci_init_scaffolding() + + // -------------------------------------------------------------------- + + /** + * Initialize Database + * + * @access private + * @param mixed database connection values + * @param bool whether to return the object for multiple connections + * @return void + */ + function _ci_init_database($params = '', $return = FALSE, $active_record = FALSE) + { + if ($this->_ci_is_loaded('db') == TRUE AND $return == FALSE AND $active_record == FALSE) + { + return; + } + + // Load the DB config file if needed + if (is_string($params) AND strpos($params, '://') === FALSE) + { + include(APPPATH.'config/database'.EXT); + + $group = ($params == '') ? $active_group : $params; + + if ( ! isset($db[$group])) + { + show_error('You have specified an invalid database connection group: '.$group); + } + + $params = $db[$group]; + } + + // No DB specified yet? Beat them senseless... + if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '') + { + show_error('You have not selected a database type to connect to.'); + } + + // Load the DB classes. Note: Since the active record class is optional + // we need to dynamically create a class that extends proper parent class + // based on whether we're using the active record class or not. + // Kudos to Paul for discovering this clever use of eval() + + if ($active_record == TRUE) + { + $params['active_r'] = TRUE; + } + + require_once(BASEPATH.'drivers/DB_driver'.EXT); + + if ( ! isset($params['active_r']) OR $params['active_r'] == TRUE) + { + require_once(BASEPATH.'drivers/DB_active_record'.EXT); + + if ( ! class_exists('CI_DB')) + { + eval('class CI_DB extends CI_DB_active_record { }'); + } + } + else + { + if ( ! class_exists('CI_DB')) + { + eval('class CI_DB extends CI_DB_driver { }'); + } + } + + require_once(BASEPATH.'drivers/DB_'.$params['dbdriver'].EXT); + + // Instantiate the DB adapter + $driver = 'CI_DB_'. $params['dbdriver']; + $DB = new $driver($params); + + if ($return === TRUE) + { + return $DB; + } + + $obj =& get_instance(); + $obj->ci_is_loaded[] = 'db'; + $obj->db =& $DB; + } + // END _ci_init_database() + + // -------------------------------------------------------------------- + + /** + * Returns TRUE if a class is loaded, FALSE if not + * + * @access public + * @param string the class name + * @return bool + */ + function _ci_is_loaded($class) + { + return ( ! in_array($class, $this->ci_is_loaded)) ? FALSE : TRUE; + } + // END _ci_is_loaded() + + // -------------------------------------------------------------------- + + /** + * Scaffolding + * + * Initializes the scaffolding. + * + * @access private + * @return void + */ + function _ci_scaffolding() + { + if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE) + { + show_404('Scaffolding unavailable'); + } + + if (class_exists('Scaffolding')) return; + + if ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'))) + { + $method = 'view'; + } + else + { + $method = $this->uri->segment(3); + } + + $this->_ci_init_database("", FALSE, TRUE); + + $this->_ci_initialize('pagination'); + require_once(BASEPATH.'scaffolding/Scaffolding'.EXT); + $this->scaff = new Scaffolding($this->_ci_scaff_table); + $this->scaff->$method(); + } + // END _ci_scaffolding() + +} +// END _Controller class +?> \ No newline at end of file diff --git a/system/libraries/Email.php b/system/libraries/Email.php new file mode 100644 index 00000000..96dc0014 --- /dev/null +++ b/system/libraries/Email.php @@ -0,0 +1,1740 @@ + 0) + { + $this->initialize($config); + } + + log_message('debug', "Email Class Initialized"); + } + // END CI_Email() + + // -------------------------------------------------------------------- + + /** + * Initialize preferences + * + * @access public + * @param array + * @return void + */ + function initialize($config = array()) + { + $this->clear(); + foreach ($config as $key => $val) + { + if (isset($this->$key)) + { + $method = 'set_'.$key; + + if (method_exists($this, $method)) + { + $this->$method($val); + } + else + { + $this->$key = $val; + } + } + } + $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; + $this->_safe_mode = (@ini_get("safe_mode") == 0) ? FALSE : TRUE; + } + // END initialize() + + // -------------------------------------------------------------------- + + /** + * Initialize the Email Data + * + * @access public + * @return void + */ + function clear() + { + $this->_subject = ""; + $this->_body = ""; + $this->_finalbody = ""; + $this->_header_str = ""; + $this->_replyto_flag = FALSE; + $this->_recipients = array(); + $this->_headers = array(); + $this->_debug_msg = array(); + + $this->_set_header('User-Agent', $this->useragent); + $this->_set_header('Date', $this->_set_date()); + } + // END clear() + + // -------------------------------------------------------------------- + + /** + * Set FROM + * + * @access public + * @param string + * @param string + * @return void + */ + function from($from, $name = '') + { + if (preg_match( '/\<(.*)\>/', $from, $match)) + $from = $match['1']; + + if ($this->validate) + $this->validate_email($this->_str_to_array($from)); + + if ($name != '' && substr($name, 0, 1) != '"') + { + $name = '"'.$name.'"'; + } + + $this->_set_header('From', $name.' <'.$from.'>'); + $this->_set_header('Return-Path', '<'.$from.'>'); + } + // END from() + + // -------------------------------------------------------------------- + + /** + * Set Reply-to + * + * @access public + * @param string + * @param string + * @return void + */ + function reply_to($replyto, $name = '') + { + if (preg_match( '/\<(.*)\>/', $replyto, $match)) + $replyto = $match['1']; + + if ($this->validate) + $this->validate_email($this->_str_to_array($replyto)); + + if ($name == '') + { + $name = $replyto; + } + + if (substr($name, 0, 1) != '"') + { + $name = '"'.$name.'"'; + } + + $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); + $this->_replyto_flag = TRUE; + } + // END reply_to() + + // -------------------------------------------------------------------- + + /** + * Set Recipients + * + * @access public + * @param string + * @return void + */ + function to($to) + { + $to = $this->_str_to_array($to); + $to = $this->clean_email($to); + + if ($this->validate) + $this->validate_email($to); + + if ($this->_get_protocol() != 'mail') + $this->_set_header('To', implode(", ", $to)); + + switch ($this->_get_protocol()) + { + case 'smtp' : $this->_recipients = $to; + break; + case 'sendmail' : $this->_recipients = implode(", ", $to); + break; + case 'mail' : $this->_recipients = implode(", ", $to); + break; + } + } + // END to() + + // -------------------------------------------------------------------- + + /** + * Set CC + * + * @access public + * @param string + * @return void + */ + function cc($cc) + { + $cc = $this->_str_to_array($cc); + $cc = $this->clean_email($cc); + + if ($this->validate) + $this->validate_email($cc); + + $this->_set_header('Cc', implode(", ", $cc)); + + if ($this->_get_protocol() == "smtp") + $this->_cc_array = $cc; + } + // END cc() + + // -------------------------------------------------------------------- + + /** + * Set BCC + * + * @access public + * @param string + * @param string + * @return void + */ + function bcc($bcc, $limit = '') + { + if ($limit != '' && ctype_digit($limit)) + { + $this->bcc_batch_mode = true; + $this->bcc_batch_size = $limit; + } + + $bcc = $this->_str_to_array($bcc); + $bcc = $this->clean_email($bcc); + + if ($this->validate) + $this->validate_email($bcc); + + if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) + $this->_bcc_array = $bcc; + else + $this->_set_header('Bcc', implode(", ", $bcc)); + } + // END bcc() + + // -------------------------------------------------------------------- + + /** + * Set Email Subject + * + * @access public + * @param string + * @return void + */ + function subject($subject) + { + $subject = preg_replace("/(\r\n)|(\r)|(\n)/", "", $subject); + $subject = preg_replace("/(\t)/", " ", $subject); + + $this->_set_header('Subject', trim($subject)); + } + // END subject() + + // -------------------------------------------------------------------- + + /** + * Set Body + * + * @access public + * @param string + * @return void + */ + function message($body) + { + $body = rtrim(str_replace("\r", "", $body)); + + if ($this->wordwrap === TRUE AND $this->mailtype != 'html') + $this->_body = $this->word_wrap($body); + else + $this->_body = $body; + + $this->_body = stripslashes($this->_body); + } + // END message() + + // -------------------------------------------------------------------- + + /** + * Assign file attachments + * + * @access public + * @param string + * @return string + */ + function attach($filename, $disposition = 'attachment') + { + $this->_attach_name[] = $filename; + $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); + $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters + } + // END attach() + + // -------------------------------------------------------------------- + + /** + * Add a Header Item + * + * @access public + * @param string + * @param string + * @return void + */ + function _set_header($header, $value) + { + $this->_headers[$header] = $value; + } + // END _set_header() + + // -------------------------------------------------------------------- + + /** + * Convert a String to an Array + * + * @access public + * @param string + * @return array + */ + function _str_to_array($email) + { + if ( ! is_array($email)) + { + if (ereg(',$', $email)) + $email = substr($email, 0, -1); + + if (ereg('^,', $email)) + $email = substr($email, 1); + + if (ereg(',', $email)) + { + $x = explode(',', $email); + $email = array(); + + for ($i = 0; $i < count($x); $i ++) + $email[] = trim($x[$i]); + } + else + { + $email = trim($email); + settype($email, "array"); + } + } + return $email; + } + // END _str_to_array() + + // -------------------------------------------------------------------- + + /** + * Set Multipart Value + * + * @access public + * @param string + * @return void + */ + function set_alt_message($str = '') + { + $this->alt_message = ($str == '') ? '' : $str; + } + // END set_alt_message() + + // -------------------------------------------------------------------- + + /** + * Set Mailtype + * + * @access public + * @param string + * @return void + */ + function set_mailtype($type = 'text') + { + $this->mailtype = ($type == 'html') ? 'html' : 'text'; + } + // END set_mailtype() + + // -------------------------------------------------------------------- + + /** + * Set Wordwrap + * + * @access public + * @param string + * @return void + */ + function set_wordwrap($wordwrap = TRUE) + { + $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; + } + // END set_wordwrap() + + // -------------------------------------------------------------------- + + /** + * Set Protocal + * + * @access public + * @param string + * @return void + */ + function set_protocol($protocol = 'mail') + { + $this->protocol = ( ! in_array($protocol, $this->_protocols)) ? 'mail' : strtolower($protocol); + } + // END set_protocol() + + // -------------------------------------------------------------------- + + /** + * Set Priority + * + * @access public + * @param integer + * @return void + */ + function set_priority($n = 3) + { + if ( ! ctype_digit($n)) + { + $this->priority = 3; + return; + } + + if ($n < 1 OR $n > 5) + { + $this->priority = 3; + return; + } + + $this->priority = $n; + } + // END set_priority() + + // -------------------------------------------------------------------- + + /** + * Set Newline Character + * + * @access public + * @param string + * @return void + */ + function set_newline($newline = "\n") + { + if ($newline != "\n" OR $newline != "\r\n" OR $newline != "\r") + { + $this->newline = "\n"; + return; + } + + $this->newline = $newline; + } + // END set_newline() + + // -------------------------------------------------------------------- + + /** + * Set Message Boundry + * + * @access private + * @return void + */ + function _set_boundaries() + { + $this->_alt_boundary = "B_ALT_".uniqid(''); // mulipart/alternative + $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary + } + // END _set_boundaries() + + // -------------------------------------------------------------------- + + /** + * Get the Message ID + * + * @access private + * @return string + */ + function _get_message_id() + { + $from = $this->_headers['Return-Path']; + $from = str_replace(">", "", $from); + $from = str_replace("<", "", $from); + + return "<".uniqid('').strstr($from, '@').">"; + } + // END _get_message_id() + + // -------------------------------------------------------------------- + + /** + * Get Mail Protocol + * + * @access private + * @param bool + * @return string + */ + function _get_protocol($return = true) + { + $this->protocol = strtolower($this->protocol); + $this->protocol = ( ! in_array($this->protocol, $this->_protocols)) ? 'mail' : $this->protocol; + + if ($return == true) + return $this->protocol; + } + // END _get_protocol() + + // -------------------------------------------------------------------- + + /** + * Get Mail Encoding + * + * @access private + * @param bool + * @return string + */ + function _get_encoding($return = true) + { + $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '7bit' : $this->_encoding; + + if ( ! in_array($this->charset, $this->_base_charsets)) + $this->_encoding = "8bit"; + + if ($return == true) + return $this->_encoding; + } + // END _get_encoding() + + // -------------------------------------------------------------------- + + /** + * Get content type (text/html/attachment) + * + * @access private + * @return string + */ + function _get_content_type() + { + if ($this->mailtype == 'html' && count($this->_attach_name) == 0) + return 'html'; + + elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) + return 'html-attach'; + + elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) + return 'plain-attach'; + + else return 'plain'; + } + // END _get_content_type() + + // -------------------------------------------------------------------- + + /** + * Set RFC 822 Date + * + * @access public + * @return string + */ + function _set_date() + { + $timezone = date("Z"); + $operator = (substr($timezone, 0, 1) == '-') ? '-' : '+'; + $timezone = abs($timezone); + $timezone = ($timezone/3600) * 100 + ($timezone % 3600) /60; + + return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); + } + // END _set_date() + + // -------------------------------------------------------------------- + + /** + * Mime message + * + * @access private + * @return string + */ + function _get_mime_message() + { + return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; + } + // END _get_mime_message() + + // -------------------------------------------------------------------- + + /** + * Validate Email Address + * + * @access public + * @param string + * @return bool + */ + function validate_email($email) + { + if ( ! is_array($email)) + { + $this->_set_error_message('email_must_be_array'); + return FALSE; + } + + foreach ($email as $val) + { + if ( ! $this->valid_email($val)) + { + $this->_set_error_message('email_invalid_address', $val); + return FALSE; + } + } + } + // END validate_email() + + // -------------------------------------------------------------------- + + /** + * Email Validation + * + * @access public + * @param string + * @return bool + */ + function valid_email($address) + { + if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) + return FALSE; + else + return TRUE; + } + // END valid_email() + + // -------------------------------------------------------------------- + + /** + * Clean Extended Email Address: Joe Smith + * + * @access public + * @param string + * @return string + */ + function clean_email($email) + { + if ( ! is_array($email)) + { + if (preg_match('/\<(.*)\>/', $email, $match)) + return $match['1']; + else + return $email; + } + + $clean_email = array(); + + for ($i=0; $i < count($email); $i++) + { + if (preg_match( '/\<(.*)\>/', $email[$i], $match)) + $clean_email[] = $match['1']; + else + $clean_email[] = $email[$i]; + } + + return $clean_email; + } + // END clean_email() + + // -------------------------------------------------------------------- + + /** + * Build alternative plain text message + * + * This function provides the raw message for use + * in plain-text headers of HTML-formatted emails. + * If the user hasn't specified his own alternative message + * it creates one by stripping the HTML + * + * @access private + * @return string + */ + function _get_alt_message() + { + if (eregi( '\', $this->_body, $match)) + { + $body = $match['1']; + $body = substr($body, strpos($body, ">") + 1); + } + else + { + $body = $this->_body; + } + + $body = trim(strip_tags($body)); + $body = preg_replace( '# '.$message. ' '.$filepath.' '.$line, TRUE); + } + // END log_exception() + + // -------------------------------------------------------------------- + + /** + * 404 Page Not Found Handler + * + * @access private + * @param string + * @return string + */ + function show_404($page = '') + { + $heading = "404 Page Not Found"; + $message = "The page you requested was not found."; + + log_message('error', '404 Page Not Found --> '.$page); + echo $this->show_error($heading, $message, 'error_404'); + exit; + } + // END show_404() + + // -------------------------------------------------------------------- + + /** + * General Error Page + * + * This function takes an error message as input + * (either as a string or an array) and displayes + * it using the specified template. + * + * @access private + * @param string the heading + * @param string the message + * @param string the template name + * @return string + */ + function show_error($heading, $message, $template = 'error_general') + { + $message = '

'.implode('

', ( ! is_array($message)) ? array($message) : $message).'

'; + + ob_start(); + include_once(APPPATH.'errors/'.$template.EXT); + $buffer = ob_get_contents(); + ob_end_clean(); + return $buffer; + } + // END show_error() + + + // -------------------------------------------------------------------- + + /** + * Native PHP error handler + * + * @access private + * @param string the error severity + * @param string the error string + * @param string the error filepath + * @param string the error line number + * @return string + */ + function show_php_error($severity, $message, $filepath, $line) + { + $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; + + $filepath = str_replace("\\", "/", $filepath); + + // For safety reasons we do not show the full file path + if (FALSE !== strpos($filepath, '/')) + { + $x = explode('/', $filepath); + $filepath = $x[count($x)-2].'/'.end($x); + } + + ob_start(); + include_once(APPPATH.'errors/error_php'.EXT); + $buffer = ob_get_contents(); + ob_end_clean(); + echo $buffer; + } + // END show_php_error() + +// END Exceptions Class +} +?> \ No newline at end of file diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php new file mode 100644 index 00000000..389e7ac1 --- /dev/null +++ b/system/libraries/Hooks.php @@ -0,0 +1,237 @@ +item('enable_hooks') == FALSE) + { + return; + } + + // Grab the "hooks" definition file. + // If there are no hooks, we're done. + + @include(APPPATH.'config/hooks'.EXT); + + if ( ! isset($hook) OR ! is_array($hook)) + { + return; + } + + $this->hooks =& $hook; + $this->enabled = TRUE; + } + // END CI_Hooks() + + // -------------------------------------------------------------------- + + /** + * Does a given hook exist? + * + * Returns TRUE/FALSE based on whether a given hook exists + * + * @access private + * @param string + * @return bool + */ + function _hook_exists($which = '') + { + if ( ! $this->enabled) + { + return FALSE; + } + + if ( ! isset($this->hooks[$which])) + { + return FALSE; + } + + return TRUE; + } + // END hook_exists() + + + // -------------------------------------------------------------------- + + /** + * Call Hook + * + * Calls a particular hook + * + * @access private + * @param string the hook name + * @return mixed + */ + function _call_hook($which = '') + { + if (isset($this->hooks[$which][0]) AND is_array($this->hooks[$which][0])) + { + foreach ($this->hooks[$which] as $val) + { + $this->_run_hook($val); + } + } + else + { + $this->_run_hook($this->hooks[$which]); + } + } + // END hook_exists() + + // -------------------------------------------------------------------- + + /** + * Run Hook + * + * Runs a particular hook + * + * @access private + * @param array the hook details + * @return bool + */ + function _run_hook($data) + { + if ( ! is_array($data)) + { + return FALSE; + } + + // ----------------------------------- + // Safety - Prevents run-away loops + // ----------------------------------- + + // If the script being called happens to have the same + // extension call within it a loop can happen + + if ($this->in_progress == TRUE) + { + return; + } + + // ----------------------------------- + // Set file path + // ----------------------------------- + + if ( ! isset($data['filepath']) OR ! isset($data['filename'])) + { + return FALSE; + } + + $filepath = APPPATH.$data['filepath'].'/'.$data['filename']; + + if ( ! file_exists($filepath)) + { + return FALSE; + } + + // ----------------------------------- + // Set class/function name + // ----------------------------------- + + $class = FALSE; + $function = FALSE; + $params = ''; + + if (isset($data['class']) AND $data['class'] != '') + { + $class = $data['class']; + } + + if (isset($data['function'])) + { + $function = $data['function']; + } + + if (isset($data['params'])) + { + $params = $data['params']; + } + + if ($class === FALSE AND $function === FALSE) + { + return FALSE; + } + + // ----------------------------------- + // Set the in_progress flag + // ----------------------------------- + + $this->in_progress = TRUE; + + // ----------------------------------- + // Call the requested class and/or function + // ----------------------------------- + + if ($class !== FALSE) + { + if ( ! class_exists($class)) + { + require($filepath); + } + + $HOOK = new $class; + $HOOK->$function($params); + } + else + { + if ( ! function_exists($function)) + { + require($filepath); + } + + $function($params); + } + + $this->in_progress = FALSE; + return TRUE; + } + // END _run_hook() + + +} + +// END CI_Hooks class +?> \ No newline at end of file diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php new file mode 100644 index 00000000..854f0484 --- /dev/null +++ b/system/libraries/Image_lib.php @@ -0,0 +1,1550 @@ + 0) + { + $this->initialize($props); + } + + log_message('debug', "Image Lib Class Initialized"); + } + // END CI_Image_lib() + + // -------------------------------------------------------------------- + + /** + * Initialize image properties + * + * Resets values in case this class is used in a loop + * + * @access public + * @return void + */ + 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'); + + foreach ($props as $val) + { + $this->$val = ''; + } + } + // END clear() + + // -------------------------------------------------------------------- + + /** + * initialize image preferences + * + * @access public + * @param array + * @return void + */ + function initialize($props = array()) + { + /* + * Convert array elements into class variables + */ + if (count($props) > 0) + { + foreach ($props as $key => $val) + { + $this->$key = $val; + } + } + + /* + * Is there a source image? + * + * If not, there's no reason to continue + * + */ + if ($this->source_image == '') + { + $this->set_error('imglib_source_image_required'); + return FALSE; + } + /* + * Is getimagesize() Available? + * + * We use it to determine the image properties (width/height). + * Note: We need to figure out how to determine image + * properties using ImageMagick and NetPBM + * + */ + if ( ! function_exists('getimagesize')) + { + $this->set_error('imglib_gd_required_for_props'); + return FALSE; + } + + $this->image_library = strtolower($this->image_library); + + /* + * Set the full server path + * + * The source image may or may not contain a path. + * Either way, we'll try use realpath to generate the + * full server path in order to more reliably read it. + * + */ + if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) + { + $full_source_path = str_replace("\\", "/", realpath($this->source_image)); + } + else + { + $full_source_path = $this->source_image; + } + + $x = explode('/', $full_source_path); + $this->source_image = end($x); + $this->source_folder = str_replace($this->source_image, '', $full_source_path); + + // Set the Image Propterties + if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) + { + return FALSE; + } + + /* + * Assign the "new" image name/path + * + * If the user has set a "new_image" name it means + * we are making a copy of the source image. If not + * it means we are altering the original. We'll + * set the destination filename and path accordingly. + * + */ + if ($this->new_image == '') + { + $this->dest_image = $this->source_image; + $this->dest_folder = $this->source_folder; + } + else + { + if (strpos($this->new_image, '/') === FALSE) + { + $this->dest_folder = $this->source_folder; + $this->dest_image = $this->new_image; + } + else + { + if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) + { + $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); + } + else + { + $full_dest_path = $this->new_image; + } + + // Is there a file name? + if ( ! preg_match("#[\.jpg|\.jpeg|\.gif|\.png]$#i", $full_dest_path)) + { + $this->dest_folder = $full_dest_path.'/'; + $this->dest_image = $this->source_image; + } + else + { + $x = explode('/', $full_dest_path); + $this->dest_image = end($x); + $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path); + } + } + } + + /* + * Compile the finalized filenames/paths + * + * We'll create two master strings containing the + * full server path to the source image and the + * full server path to the destination image. + * We'll also split the destination image name + * so we can insert the thumbnail marker if needed. + * + */ + if ($this->create_thumb === FALSE OR $this->thumb_marker == '') + { + $this->thumb_marker = ''; + } + + $xp = $this->explode_name($this->dest_image); + + $filename = $xp['name']; + $file_ext = $xp['ext']; + + $this->full_src_path = $this->source_folder.$this->source_image; + $this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext; + + /* + * Should we maintain image proportions? + * + * When creating thumbs or copies, the target width/height + * might not be in correct proportion with the source + * image's width/height. We'll recalculate it here. + * + */ + if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) + { + $this->image_reproportion(); + } + + /* + * Was a width and height specified? + * + * If the destination width/height was + * not submitted we will use the values + * from the actual file + * + */ + if ($this->width == '') + $this->width = $this->orig_width; + + if ($this->height == '') + $this->height = $this->orig_height; + + // Set the quality + $this->quality = trim(str_replace("%", "", $this->quality)); + + if ($this->quality == '' OR $this->quality == 0 OR ! ctype_digit($this->quality)) + $this->quality = 90; + + // Set the x/y coordinates + $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; + $this->y_axis = ($this->y_axis == '' OR ! is_numeric($this->y_axis)) ? 0 : $this->y_axis; + + // Watermark-related Stuff... + if ($this->wm_font_color != '') + { + if (strlen($this->wm_font_color) == 6) + { + $this->wm_font_color = '#'.$this->wm_font_color; + } + } + + if ($this->wm_shadow_color != '') + { + if (strlen($this->wm_shadow_color) == 6) + { + $this->wm_shadow_color = '#'.$this->wm_shadow_color; + } + } + + if ($this->wm_overlay_path != '') + { + $this->wm_overlay_path = str_replace("\\", "/", realpath($this->wm_overlay_path)); + } + + if ($this->wm_shadow_color != '') + { + $this->wm_use_drop_shadow = TRUE; + } + + if ($this->wm_font_path != '') + { + $this->wm_use_truetype = TRUE; + } + + return TRUE; + } + // END initialize() + + // -------------------------------------------------------------------- + + /** + * Image Resize + * + * This is a wrapper function that chooses the proper + * resize function based on the protocol specified + * + * @access public + * @return bool + */ + function resize() + { + $protocol = 'image_process_'.$this->image_library; + + if (eregi("gd2$", $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('resize'); + } + // END resize() + + // -------------------------------------------------------------------- + + /** + * Image Crop + * + * This is a wrapper function that chooses the proper + * cropping function based on the protocol specified + * + * @access public + * @return bool + */ + function crop() + { + $protocol = 'image_process_'.$this->image_library; + + if (eregi("gd2$", $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('crop'); + } + // END crop() + + // -------------------------------------------------------------------- + + /** + * Image Rotate + * + * This is a wrapper function that chooses the proper + * rotation function based on the protocol specified + * + * @access public + * @return bool + */ + function rotate() + { + // Allowed rotation values + $degs = array(90, 180, 270, 'vrt', 'hor'); + + if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs)) + { + $this->set_error('imglib_rotation_angle_required'); + return FALSE; + } + + // Reassign the width and height + if ($this->rotation_angle == 90 OR $this->rotation_angle == 270) + { + $this->width = $this->orig_height; + $this->height = $this->orig_width; + } + else + { + $this->width = $this->orig_width; + $this->height = $this->orig_height; + } + + + // Choose resizing function + if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm') + { + $protocol = 'image_process_'.$this->image_library; + + return $this->$protocol('rotate'); + } + + if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') + { + return $this->image_mirror_gd(); + } + else + { + return $this->image_rotate_gd(); + } + } + // END rotate() + + // -------------------------------------------------------------------- + + /** + * Image Process Using GD/GD2 + * + * This function will resize or crop + * + * @access public + * @param string + * @return bool + */ + function image_process_gd($action = 'resize') + { + $v2_override = FALSE; + + if ($action == 'crop') + { + // If the target width/height match the source then it's pointless to crop, right? + if ($this->width >= $this->orig_width AND $this->height >= $this->orig_width) + { + // We'll return true so the user thinks the process succeeded. + // It'll be our little secret... + + return TRUE; + } + + // Reassign the source width/height if cropping + $this->orig_width = $this->width; + $this->orig_height = $this->height; + + // GD 2.0 has a cropping bug so we'll test for it + if ($this->gd_version() !== FALSE) + { + $gd_version = str_replace('0', '', $this->gd_version()); + $v2_override = ($gd_version == 2) ? TRUE : FALSE; + } + } + else + { + // If the target width/height match the source, AND if + // the new file name is not equal to the old file name + // we'll simply make a copy of the original with the new name + if (($this->orig_width == $this->width AND $this->orig_height == $this->height) AND ($this->source_image != $this->dest_image)) + { + if ( ! @copy($this->full_src_path, $this->full_dst_path)) + { + $this->set_error('imglib_copy_failed'); + return FALSE; + } + + @chmod($this->full_dst_path, 0777); + return TRUE; + } + + // If resizing the x/y axis must be zero + $this->x_axis = 0; + $this->y_axis = 0; + } + + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Create The Image + if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) + { + $create = 'imagecreatetruecolor'; + $copy = 'imagecopyresampled'; + } + else + { + $create = 'imagecreate'; + $copy = 'imagecopyresized'; + } + + $dst_img = $create($this->width, $this->height); + $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + // END image_process_gd() + + // -------------------------------------------------------------------- + + /** + * Image Process Using ImageMagick + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_imagemagick($action = 'resize') + { + // Do we have a vaild library path? + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + if ( ! eregi("convert$", $this->library_path)) + { + if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; + + $this->library_path .= 'convert'; + } + + // Execute the command + $cmd = $this->library_path." -quality ".$this->quality; + + if ($action == 'crop') + { + $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 'hor' : $angle = '-flop'; + break; + case 'vrt' : $angle = '-flip'; + break; + default : $angle = '-rotate '.$this->rotation_angle; + break; + } + + $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + else // Resize + { + $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + // END image_process_imagemagick() + + // -------------------------------------------------------------------- + + /** + * Image Process Using NetPBM + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_netpbm($action = 'resize') + { + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + // Build the resizing command + switch ($this->image_type) + { + case 1 : + $cmd_in = 'giftopnm'; + $cmd_out = 'ppmtogif'; + break; + case 2 : + $cmd_in = 'jpegtopnm'; + $cmd_out = 'ppmtojpeg'; + break; + case 3 : + $cmd_in = 'pngtopnm'; + $cmd_out = 'ppmtopng'; + break; + } + + if ($action == 'crop') + { + $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 90 : $angle = 'r270'; + break; + case 180 : $angle = 'r180'; + break; + case 270 : $angle = 'r90'; + break; + case 'vrt' : $angle = 'tb'; + break; + case 'hor' : $angle = 'lr'; + break; + } + + $cmd_inner = 'pnmflip -'.$angle.' '; + } + else // Resize + { + $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; + } + + $cmd = $this->library_path.$cmd_in.' '.$this->full_src_path.' | '.$cmd_inner.' | '.$cmd_out.' > '.$this->dest_folder.'netpbm.tmp'; + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // With NetPBM we have to create a temporary image. + // If you try manipulating the original it fails so + // we have to rename the temp file. + copy ($this->dest_folder.'netpbm.tmp', $this->full_dst_path); + unlink ($this->dest_folder.'netpbm.tmp'); + @chmod($dst_image, 0777); + + return TRUE; + } + // END image_process_netpbm() + + // -------------------------------------------------------------------- + + /** + * Image Rotate Using GD + * + * @access public + * @return bool + */ + function image_rotate_gd() + { + // Is Image Rotation Supported? + // this function is only supported as of PHP 4.3 + if ( ! function_exists('imagerotate')) + { + $this->set_error('imglib_rotate_unsupported'); + return FALSE; + } + + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Set the background color + // This won't work with transparent PNG files so we are + // going to have to figure out how to determine the color + // of the alpha channel in a future release. + + $white = imagecolorallocate($src_img, 255, 255, 255); + + // Rotate it! + $dst_img = imagerotate($src_img, $this->rotation_angle, $white); + + // Save the Image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + + @chmod($this->full_dst_path, 0777); + + return true; + } + // END image_rotate_gd() + + // -------------------------------------------------------------------- + + /** + * Create Mirror Image using GD + * + * This function will flip horizontal or vertical + * + * @access public + * @return bool + */ + function image_mirror_gd() + { + if ( ! $src_img = $this->image_create_gd()) + { + return FALSE; + } + + $width = $this->orig_width; + $height = $this->orig_height; + + if ($this->rotation_angle == 'hor') + { + for ($i = 0; $i < $height; $i++) + { + $left = 0; + $right = $width-1; + + while ($left < $right) + { + $cl = imagecolorat($src_img, $left, $i); + $cr = imagecolorat($src_img, $right, $i); + + imagesetpixel($src_img, $left, $i, $cr); + imagesetpixel($src_img, $right, $i, $cl); + + $left++; + $right--; + } + } + } + else + { + for ($i = 0; $i < $width; $i++) + { + $top = 0; + $bot = $height-1; + + while ($top < $bot) + { + $ct = imagecolorat($src_img, $i, $top); + $cb = imagecolorat($src_img, $i, $bot); + + imagesetpixel($src_img, $i, $top, $cb); + imagesetpixel($src_img, $i, $bot, $ct); + + $top++; + $bot--; + } + } + } + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + // END image_mirror_gd() + + // -------------------------------------------------------------------- + + /** + * Image Watermark + * + * This is a wrapper function that chooses the type + * of watermarking based on the specified preference. + * + * @access public + * @param string + * @return bool + */ + function watermark() + { + if ($this->wm_type == 'overlay') + { + return $this->overlay_watermark(); + } + else + { + return $this->text_watermark(); + } + } + // END image_mirror_gd() + + // -------------------------------------------------------------------- + + /** + * Watermark - Graphic Version + * + * @access public + * @return bool + */ + function overlay_watermark() + { + if ( ! function_exists('imagecolortransparent')) + { + $this->set_error('imglib_gd_required'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Fetch watermark image properties + $props = $this->get_image_properties($this->wm_overlay_path, TRUE); + $wm_img_type = $props['image_type']; + $wm_width = $props['width']; + $wm_height = $props['height']; + + // Create two image resources + $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); + $src_img = $this->image_create_gd($this->full_src_path); + + // Reverse the offset if necessary + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Same with the horizontal + // offset when the image is at the right + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set the base x and y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set the vertical position + switch ($this->wm_vrt_alignment) + { + case 'T': + break; + case 'M': $y_axis += ($this->orig_height / 2) - ($wm_height / 2); + break; + case 'B': $y_axis += $this->orig_height - $wm_height; + break; + } + + // Set the horizontal position + switch ($this->wm_hor_alignment) + { + case 'L': + break; + case 'C': $x_axis += ($this->orig_width / 2) - ($wm_width / 2); + break; + case 'R': $x_axis += $this->orig_width - $wm_width; + break; + } + + // Build the finalized image + if ($wm_img_type == 3 AND function_exists('imagealphablending')) + { + @imagealphablending($src_img, TRUE); + } + + // Set RGB values for text and shadow + imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); + imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); + + // Output the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + imagedestroy($src_img); + imagedestroy($wm_img); + + return TRUE; + } + // END overlay_watermark() + + // -------------------------------------------------------------------- + + /** + * Watermark - Text Version + * + * @access public + * @return bool + */ + function text_watermark() + { + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + if ($this->wm_use_truetype == TRUE AND ! file_exists($this->wm_font_path)) + { + $this->set_error('imglib_missing_font'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Set RGB values for text and shadow + $this->wm_font_color = str_replace('#', '', $this->wm_font_color); + $this->wm_shadow_color = str_replace('#', '', $this->wm_shadow_color); + + $R1 = hexdec(substr($this->wm_font_color, 0, 2)); + $G1 = hexdec(substr($this->wm_font_color, 2, 2)); + $B1 = hexdec(substr($this->wm_font_color, 4, 2)); + + $R2 = hexdec(substr($this->wm_shadow_color, 0, 2)); + $G2 = hexdec(substr($this->wm_shadow_color, 2, 2)); + $B2 = hexdec(substr($this->wm_shadow_color, 4, 2)); + + $txt_color = imagecolorclosest($src_img, $R1, $G1, $B1); + $drp_color = imagecolorclosest($src_img, $R2, $G2, $B2); + + // Reverse the vertical offset + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Note: The horizontal + // offset flips itself automatically + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set font width and height + // These are calculated differently depending on + // whether we are using the true type font or not + if ($this->wm_use_truetype == TRUE) + { + if ($this->wm_font_size == '') + $this->wm_font_size = '17'; + + $fontwidth = $this->wm_font_size-($this->wm_font_size/4); + $fontheight = $this->wm_font_size; + $this->wm_vrt_offset += $this->wm_font_size; + } + else + { + $fontwidth = imagefontwidth($this->wm_font_size); + $fontheight = imagefontheight($this->wm_font_size); + } + + // Set base X and Y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set verticle alignment + if ($this->wm_use_drop_shadow == FALSE) + $this->wm_shadow_distance = 0; + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + switch ($this->wm_vrt_alignment) + { + case "T" : + break; + case "M": $y_axis += ($this->orig_height/2)+($fontheight/2); + break; + case "B": $y_axis += ($this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight/2)); + break; + } + + $x_shad = $x_axis + $this->wm_shadow_distance; + $y_shad = $y_axis + $this->wm_shadow_distance; + + // Set horizontal alignment + switch ($this->wm_hor_alignment) + { + case "L": + break; + case "R": + if ($this->wm_use_drop_shadow) + $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + break; + case "C": + if ($this->wm_use_drop_shadow) + $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); + $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); + break; + } + + // Add the text to the source image + if ($this->wm_use_truetype) + { + if ($this->wm_use_drop_shadow) + imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); + imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); + } + else + { + if ($this->wm_use_drop_shadow) + imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); + imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); + } + + // Output the final image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + $this->image_save_gd($src_img); + } + + imagedestroy($src_img); + + return TRUE; + } + // END text_watermark() + + // -------------------------------------------------------------------- + + /** + * Create Image - GD + * + * This simply creates an image resource handle + * based on the type of image being processed + * + * @access public + * @param string + * @return resource + */ + function image_create_gd($path = '', $image_type = '') + { + if ($path == '') + $path = $this->full_src_path; + + if ($image_type == '') + $image_type = $this->image_type; + + + switch ($image_type) + { + case 1 : + if ( ! function_exists('imagecreatefromgif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + return imagecreatefromgif($path); + break; + case 2 : + if ( ! function_exists('imagecreatefromjpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + return imagecreatefromjpeg($path); + break; + case 3 : + if ( ! function_exists('imagecreatefrompng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + return imagecreatefrompng($path); + break; + + } + + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + } + // END image_create_gd() + + // -------------------------------------------------------------------- + + /** + * Write imge file to disk - GD + * + * Takes an image resource as input and writes the file + * to the specified destination + * + * @access public + * @param resource + * @return bool + */ + function image_save_gd($resource) + { + switch ($this->image_type) + { + case 1 : + if ( ! function_exists('imagegif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + @imagegif($resource, $this->full_dst_path); + break; + case 2 : + if ( ! function_exists('imagejpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + if (phpversion() == '4.4.1') + { + @touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround + } + + @imagejpeg($resource, $this->full_dst_path, $this->quality); + break; + case 3 : + if ( ! function_exists('imagepng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + @imagepng($resource, $this->full_dst_path); + break; + default : + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + break; + } + + return TRUE; + } + // END image_save_gd() + + // -------------------------------------------------------------------- + + /** + * Dynamically ouputs an image + * + * @access public + * @param resource + * @return void + */ + function image_display_gd($resource) + { + header("Content-Disposition: filename={$this->source_image};"); + header("Content-Type: {$this->mime_type}"); + header('Content-Transfer-Encoding: binary'); + header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); + + switch ($this->image_type) + { + case 1 : imagegif($resource); + break; + case 2 : imagejpeg($resource, '', $this->quality); + break; + case 3 : imagepng($resource); + break; + default : echo 'Unable to display the image'; + break; + } + } + // END image_display_gd() + + // -------------------------------------------------------------------- + + /** + * Reproportion Image Width/Height + * + * When creating thumbs, the desired width/height + * can end up warping the image due to an incorrect + * ratio between the full-sized image and the thumb. + * + * This function lets us reproportion the width/height + * if users choose to maintain the aspect ratio when resizing. + * + * @access public + * @return void + */ + function image_reproportion() + { + if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) + return; + + if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) + return; + + $new_width = ceil($this->orig_width*$this->height/$this->orig_height); + $new_height = ceil($this->width*$this->orig_height/$this->orig_width); + + $ratio = (($this->orig_height/$this->orig_width) - ($this->height/$this->width)); + + if ($this->master_dim != 'width' AND $this->master_dim != 'height') + { + $this->master_dim = ($ratio < 0) ? 'width' : 'height'; + } + + if (($this->width != $new_width) AND ($this->height != $new_height)) + { + if ($this->master_dim == 'height') + { + $this->width = $new_width; + } + else + { + $this->height = $new_height; + } + } + } + // END image_reproportion() + + // -------------------------------------------------------------------- + + /** + * Get image properties + * + * A helper function that gets info about the file + * + * @access public + * @param string + * @return mixed + */ + 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 + + if ($path == '') + $path = $this->full_src_path; + + if ( ! file_exists($path)) + { + $this->set_error('imglib_invalid_path'); + return FALSE; + } + + $vals = @getimagesize($path); + + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg'; + + if ($return == TRUE) + { + $v['width'] = $vals['0']; + $v['height'] = $vals['1']; + $v['image_type'] = $vals['2']; + $v['size_str'] = $vals['3']; + $v['mime_type'] = $mime; + + return $v; + } + + $this->orig_width = $vals['0']; + $this->orig_height = $vals['1']; + $this->image_type = $vals['2']; + $this->size_str = $vals['3']; + $this->mime_type = $mime; + + return TRUE; + } + // END get_image_properties() + + // -------------------------------------------------------------------- + + /** + * Size calculator + * + * This function takes a known width x height and + * recalculates it to a new size. Only one + * new variable needs to be known + * + * $props = array( + * 'width' => $width, + * 'height' => $height, + * 'new_width' => 40, + * 'new_height' => '' + * ); + * + * @access public + * @param array + * @return array + */ + function size_calculator($vals) + { + if ( ! is_array($vals)) + return; + + $allowed = array('new_width', 'new_height', 'width', 'height'); + + foreach ($allowed as $item) + { + if ( ! isset($vals[$item]) OR $vals[$item] == '') + $vals[$item] = 0; + } + + if ($vals['width'] == 0 OR $vals['height'] == 0) + { + return $vals; + } + + if ($vals['new_width'] == 0) + { + $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); + } + elseif ($vals['new_height'] == 0) + { + $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); + } + + return $vals; + } + // END size_calculator() + + // -------------------------------------------------------------------- + + /** + * Explode source_image + * + * This is a helper function that extracts the extension + * from the source_image. This function lets us deal with + * source_images with multiple periods, like: my.cool.jpg + * It returns an associative array with two elements: + * $array['ext'] = '.jpg'; + * $array['name'] = 'my.cool'; + * + * @access public + * @param array + * @return array + */ + function explode_name($source_image) + { + $x = explode('.', $source_image); + $ret['ext'] = '.'.end($x); + + $name = ''; + + $ct = count($x)-1; + + for ($i = 0; $i < $ct; $i++) + { + $name .= $x[$i]; + + if ($i < ($ct - 1)) + { + $name .= '.'; + } + } + + $ret['name'] = $name; + + return $ret; + } + // END explode_name() + + // -------------------------------------------------------------------- + + /** + * Is GD Installed? + * + * @access public + * @return bool + */ + function gd_loaded() + { + if ( ! extension_loaded('gd')) + { + if ( ! dl('gd.so')) + { + return FALSE; + } + } + + return TRUE; + } + // END gd_loaded() + + // -------------------------------------------------------------------- + + /** + * Get GD version + * + * @access public + * @return mixed + */ + function gd_version() + { + if (function_exists('gd_info')) + { + $gd_version = @gd_info(); + $gd_version = preg_replace("/\D/", "", $gd_version['GD Version']); + + return $gd_version; + } + + return FALSE; + } + // END gd_version() + + // -------------------------------------------------------------------- + + /** + * Set error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + $obj =& get_instance(); + $obj->lang->load('imglib'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + + $msg = ($obj->lang->line($val) == FALSE) ? $val : $obj->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($obj->lang->line($msg) == FALSE) ? $msg : $obj->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + // END set_error() + + // -------------------------------------------------------------------- + + /** + * Show error messages + * + * @access public + * @param string + * @return string + */ + function display_errors($open = '

', $close = '

') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + // END display_errors() +} +// END Image_lib Class +?> \ No newline at end of file diff --git a/system/libraries/Input.php b/system/libraries/Input.php new file mode 100644 index 00000000..6aba5dd4 --- /dev/null +++ b/system/libraries/Input.php @@ -0,0 +1,585 @@ +use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; + $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; + + log_message('debug', "Input Class Initialized"); + $this->_sanitize_globals(); + } + // END CI_Input() + + // -------------------------------------------------------------------- + + /** + * Sanitize Globals + * + * This function does the folowing: + * + * Unsets $_GET data (if query strings are not enabled) + * + * Unsets all globals if register_globals is enabled + * + * Standardizes newline characters to \n + * + * @access private + * @return void + */ + function _sanitize_globals() + { + // Unset globals. This is effectively the same as register_globals = off + foreach (array($_GET, $_POST, $_COOKIE) as $global) + { + if ( ! is_array($global)) + { + unset($$global); + } + else + { + foreach ($global as $key => $val) + { + unset($$key); + } + } + } + + // Is $_GET data allowed? + if ($this->allow_get_array == FALSE) + { + $_GET = array(); + } + + // Clean $_POST Data + if (is_array($_POST) AND count($_POST) > 0) + { + foreach($_POST as $key => $val) + { + if (is_array($val)) + { + foreach($val as $k => $v) + { + $_POST[$this->_clean_input_keys($key)][$this->_clean_input_keys($k)] = $this->_clean_input_data($v); + } + } + else + { + $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + } + + // Clean $_COOKIE Data + if (is_array($_COOKIE) AND count($_COOKIE) > 0) + { + foreach($_COOKIE as $key => $val) + { + $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + + log_message('debug', "Global POST and COOKIE data sanitized"); + } + // END _sanitize_globals() + + // -------------------------------------------------------------------- + + /** + * Clean Intput Data + * + * This is a helper function. It escapes data and + * standardizes newline characters to \n + * + * @access private + * @param string + * @return string + */ + function _clean_input_data($str) + { + if (is_array($str)) + { + $new_array = array(); + foreach ($str as $key => $val) + { + $new_array[$key] = $this->_clean_input_data($val); + } + return $new_array; + } + + if ($this->use_xss_clean === TRUE) + { + $str = $this->xss_clean($str); + } + + return preg_replace("/\015\012|\015|\012/", "\n", $str); + } + // END _clean_input_data() + + // -------------------------------------------------------------------- + + /** + * Clean Keys + * + * This is a helper function. To prevent malicious users + * from trying to exploit keys we make sure that keys are + * only named with alpha-numeric text and a few other items. + * + * @access private + * @param string + * @return string + */ + function _clean_input_keys($str) + { + if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) + { + exit('Disallowed Key Characters: '.$str); + } + + if ( ! get_magic_quotes_gpc()) + { + return addslashes($str); + } + + return $str; + } + // END _clean_input_keys() + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the POST array + * + * @access public + * @param string + * @return string + */ + function post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_POST[$index])) + { + return FALSE; + } + else + { + if ($xss_clean === TRUE) + { + return $this->xss_clean($_POST[$index]); + } + else + { + return $_POST[$index]; + } + } + } + // END post() + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @return string + */ + function cookie($index = '', $xss_clean = FALSE) + { + if ( ! isset($_COOKIE[$index])) + { + return FALSE; + } + else + { + if ($xss_clean === TRUE) + { + return $this->xss_clean($_COOKIE[$index]); + } + else + { + return $_COOKIE[$index]; + } + } + } + // END cookie() + + // -------------------------------------------------------------------- + + /** + * Fetch the IP Address + * + * @access public + * @return string + */ + function ip_address() + { + if ($this->ip_address !== FALSE) + { + return $this->ip_address; + } + + $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_address = $cip; + elseif ($rip) $this->ip_address = $rip; + elseif ($cip) $this->ip_address = $cip; + elseif ($fip) $this->ip_address = $fip; + + if (strstr($this->ip_address, ',')) + { + $x = explode(',', $this->ip_address); + $this->ip_address = end($x); + } + + if ( ! $this->valid_ip($this->ip_address)) + { + $this->ip_address = '0.0.0.0'; + } + + unset($cip); + unset($rip); + unset($fip); + + return $this->ip_address; + } + // END ip_address() + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; + } + // END valid_ip() + + // -------------------------------------------------------------------- + + /** + * User Agent + * + * @access public + * @return string + */ + function user_agent() + { + if ($this->user_agent !== FALSE) + { + return $this->user_agent; + } + + $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; + + return $this->user_agent; + } + // END user_agent() + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented.Ê This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts.Ê Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission.Ê It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @access public + * @param string + * @return string + */ + function xss_clean($str, $charset = 'ISO-8859-1') + { + /* + * Remove Null Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + */ + $str = preg_replace('/\0+/', '', $str); + $str = preg_replace('/(\\\\0)+/', '', $str); + + /* + * Validate standard character entites + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$str); + + /* + * Validate UTF16 two byte encodeing (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x*)([0-9A-F]+);*#iu',"\\1\\2;",$str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * Google + * + * Note: Normally urldecode() would be easier but it removes plus signs + * + */ + $str = preg_replace("/%u0([a-z0-9]{3})/i", "&#x\\1;", $str); + $str = preg_replace("/%([a-z0-9]{2})/i", "&#x\\1;", $str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + + if (preg_match_all("/<(.+?)>/si", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $str = str_replace($matches['1'][$i], + $this->_html_entity_decode($matches['1'][$i], $charset), + $str); + } + } + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * Note: we deal with spaces between characters later. + * + */ + $str = preg_replace("#\t+#", " ", $str); + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * '), array('<?php', '<?PHP', '<?', '?>'), $str); // .*?#si", "", $str); + $str = preg_replace("##si", "", $str); + $str = preg_replace("#<(script|xss).*?\>#si", "", $str); + + /* + * Remove JavaScript Event Handlers + * + * Note: This code is a little blunt. It removes + * the event handler and anything up to the closing >, + * but it's unlkely to be a problem. + * + */ + $str = preg_replace('#(<[^>]+.*?)(onblur|onchange|onclick|onfocus|onload|onmouseover|onmouseup|onmousedown|onselect|onsubmit|onunload|onkeypress|onkeydown|onkeyup|onresize)[^>]*>#iU',"\\1>",$str); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: + * Becomes: <blink> + * + */ + $str = preg_replace('#<(/*\s*)(alert|applet|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|xml|xss)([^>]*)>#is', "<\\1\\2\\3>", $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code unexecutable. + * + * For example: eval('some code') + * Becomes: eval('some code') + * + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + /* + * Final clean up + * + * This adds a bit of extra precaution in case + * something got through the above filters + * + */ + $bad = array( + 'document.cookie' => '', + 'document.write' => '', + 'window.location' => '', + "javascript\s*:" => '', + "Redirect\s+302" => '', + '' => '-->' + ); + + foreach ($bad as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + + log_message('debug', "XSS Filtering completed"); + return $str; + } + // END xss_clean() + + + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * @access private + * @param string + * @param string + * @return string + */ + /* ------------------------------------------------- + /* Replacement for html_entity_decode() + /* -------------------------------------------------*/ + + /* + NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + character set, and the PHP developers said they were not back porting the + fix to versions other than PHP 5.x. + */ + function _html_entity_decode($str, $charset='ISO-8859-1') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) + { + $str = html_entity_decode($str, ENT_COMPAT, $charset); + $str = preg_replace('~&#x([0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); + return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); + } + + // Numeric Entities + $str = preg_replace('~&#x([0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; + } + +} +// END Input class +?> \ No newline at end of file diff --git a/system/libraries/Language.php b/system/libraries/Language.php new file mode 100644 index 00000000..b668aa06 --- /dev/null +++ b/system/libraries/Language.php @@ -0,0 +1,113 @@ +is_loaded)) + { + return; + } + + if ($idiom == '') + { + $obj =& get_instance(); + $deft_lang = $obj->config->item('language'); + $idiom = ($deft_lang == '') ? 'english' : $deft_lang; + } + + if ( ! file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) + { + show_error('Unable to load the requested language file: language/'.$langfile.EXT); + } + + include_once(BASEPATH.'language/'.$idiom.'/'.$langfile); + + if ( ! isset($lang)) + { + log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); + return; + } + + if ($return == TRUE) + { + return $lang; + } + + $this->is_loaded[] = $langfile; + $this->language = array_merge($this->language, $lang); + unset($lang); + + log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); + return TRUE; + } + // END load() + + // -------------------------------------------------------------------- + + /** + * Fetch a single line of text from the language array + * + * @access public + * @param string the language line + * @return string + */ + function line($line = '') + { + return ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; + } + // END line() + +} +// END Language Class +?> \ No newline at end of file diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php new file mode 100644 index 00000000..e2467fa6 --- /dev/null +++ b/system/libraries/Loader.php @@ -0,0 +1,611 @@ +view_path = APPPATH.'views/'; + $this->ob_level = ob_get_level(); + + log_message('debug', "Loader Class Initialized"); + } + // END CI_Loader() + + // -------------------------------------------------------------------- + + /** + * Class Loader + * + * This function lets users load and instantiate classes. + * It is designed to be called from a user's app controllers. + * + * @access public + * @param string the name of the class + * @param mixed any initialization parameters + * @return void + */ + function library($class, $param = FALSE) + { + if ($class == '') + return; + + $obj =& get_instance(); + $obj->_ci_initialize($class, $param); + $obj->_ci_assign_to_models(); + } + // END library() + + // -------------------------------------------------------------------- + + /** + * Model Loader + * + * This function lets users load and instantiate models. + * + * @access public + * @param string the name of the class + * @param mixed any initialization parameters + * @return void + */ + function model($model, $name = '', $db_conn = FALSE) + { + if ($model == '') + return; + + $obj =& get_instance(); + $obj->_ci_load_model($model, $name, $db_conn); + } + // END library() + + // -------------------------------------------------------------------- + + /** + * Database Loader + * + * @access public + * @param string the DB credentials + * @param bool whether to return the DB object + * @param bool whether to enable active record (this allows us to override the config setting) + * @return mixed + */ + function database($db = '', $return = FALSE, $active_record = FALSE) + { + $obj =& get_instance(); + + if ($return === TRUE) + { + return $obj->_ci_init_database($db, TRUE, $active_record); + } + else + { + $obj->_ci_init_database($db, FALSE, $active_record); + $obj->_ci_assign_to_models(); + } + } + // END database() + + // -------------------------------------------------------------------- + + /** + * Scaffolding Loader + * + * @access public + * @param string + * @return void + */ + function scaffolding($table = '') + { + if ($table == FALSE) + { + show_error('You must include the name of the table you would like access when you initialize scaffolding'); + } + + $obj =& get_instance(); + $obj->_ci_init_scaffolding($table); + } + // END scaffolding() + + // -------------------------------------------------------------------- + + /** + * Load View + * + * This function is used to load a "view" file. It has three parameters: + * + * 1. The name of the "view" file to be included. + * 2. An associative array of data to be extracted for use in the view. + * 3. TRUE/FALSE - whether to return the data or load it. In + * some cases it's advantageous to be able to retun data so that + * a developer can process it in some way. + * + * @access public + * @param string + * @param array + * @param bool + * @return void + */ + function view($view, $vars = array(), $return = FALSE) + { + return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); + } + // END view() + + // -------------------------------------------------------------------- + + /** + * Load File + * + * This is a generic file loader + * + * @access public + * @param string + * @param bool + * @return string + */ + function file($path, $return = FALSE) + { + return $this->_ci_load(array('path' => $path, 'return' => $return)); + } + // END file() + + // -------------------------------------------------------------------- + + /** + * Set Variables + * + * Once variables are set they become availabe within + * the controller class and its "view" files. + * + * @access public + * @param array + * @return void + */ + function vars($vars = array()) + { + $vars = $this->_ci_object_to_array($vars); + + if (is_array($vars) AND count($vars) > 0) + { + foreach ($vars as $key => $val) + { + $this->cached_vars[$key] = $val; + } + } + } + // END vars() + + // -------------------------------------------------------------------- + + /** + * Load Helper + * + * This function loads the specified helper file. + * + * @access public + * @param mixed + * @return void + */ + function helper($helpers = array()) + { + if ( ! is_array($helpers)) + { + $helpers = array($helpers); + } + + foreach ($helpers as $helper) + { + if (isset($this->helpers[$helper])) + { + continue; + } + + $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); + + if ( ! file_exists(BASEPATH.'helpers/'.$helper.EXT)) + { + show_error('Unable to load the requested file: helpers/'.$helper.EXT); + } + + include_once(BASEPATH.'helpers/'.$helper.EXT); + + $this->helpers[$helper] = TRUE; + } + + log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); + } + // END helper() + + // -------------------------------------------------------------------- + + /** + * Load Helpers + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function helpers($helpers = array()) + { + $this->helper($helpers); + } + // END helpers() + + // -------------------------------------------------------------------- + + /** + * Load Plugin + * + * This function loads the specified plugin. + * + * @access public + * @param array + * @return void + */ + function plugin($plugins = array()) + { + if ( ! is_array($plugins)) + { + $plugins = array($plugins); + } + + foreach ($plugins as $plugin) + { + if (isset($this->plugins[$plugin])) + { + continue; + } + + $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); + + if ( ! file_exists(BASEPATH.'plugins/'.$plugin.EXT)) + { + show_error('Unable to load the requested file: plugins/'.$plugin.EXT); + } + + include_once(BASEPATH.'plugins/'.$plugin.EXT); + + $this->plugins[$plugin] = TRUE; + } + + log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); + } + // END plugin() + + // -------------------------------------------------------------------- + + /** + * Load Script + * + * This function loads the specified include file from the + * application/scripts/ folder + * + * @access public + * @param array + * @return void + */ + function script($scripts = array()) + { + if ( ! is_array($scripts)) + { + $scripts = array($scripts); + } + + foreach ($scripts as $script) + { + if (isset($this->scripts[$script])) + { + continue; + } + + $script = strtolower(str_replace(EXT, '', $script)); + + if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) + { + show_error('Unable to load the requested script: scripts/'.$script.EXT); + } + + include_once(APPPATH.'scripts/'.$script.EXT); + + $this->scripts[$script] = TRUE; + } + + log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); + } + // END script() + + // -------------------------------------------------------------------- + + /** + * Load Plugins + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function plugins($plugins = array()) + { + $this->plugin($plugins); + } + // END plugins() + + // -------------------------------------------------------------------- + + /** + * Loads a language file + * + * @access public + * @param string + * @return void + */ + function language($file = '', $lang = '', $return = FALSE) + { + $obj =& get_instance(); + return $obj->lang->load($file, $lang, $return); + } + // END language() + + // -------------------------------------------------------------------- + + /** + * Loads a config file + * + * @access public + * @param string + * @return void + */ + function config($file = '') + { + $obj =& get_instance(); + $obj->config->load($file); + } + // END config() + + // -------------------------------------------------------------------- + + /** + * Set the Path to the "views" folder + * + * @access private + * @param string + * @return void + */ + function _ci_set_view_path($path) + { + $this->view_path = $path; + } + // END _ci_set_view_path() + + // -------------------------------------------------------------------- + + /** + * Loader + * + * This function isn't called directly. It's called from + * the two functions above. It's used to load views and files + * + * @access private + * @param array + * @return void + */ + function _ci_load($data) + { + $OUT =& _load_class('CI_Output'); + + // This allows anything loaded using $this->load (viwes, files, etc.) + // to become accessible from within the Controller and Model functions. + $obj =& get_instance(); + foreach ($obj->ci_is_loaded as $val) + { + if ( ! isset($this->$val)) + { + $this->$val =& $obj->$val; + } + } + + // Set the default data variables + foreach (array('view', 'vars', 'path', 'return') as $val) + { + $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; + } + + /* + * Extract and cached variables + * + * You can either set variables using the dedicated + * $this->load_vars() function or via the second + * parameter of this function. We'll + * merge the two types and cache them so that + * views that are embedded within other views + * can have access to these variables. + * + */ + + if (is_array($vars)) + { + $this->cached_vars = array_merge($this->cached_vars, $vars); + } + extract($this->cached_vars); + + // Set the path to the requested file + if ($path == '') + { + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.EXT : $view; + $path = $this->view_path.$file; + } + else + { + $x = explode('/', $path); + $file = end($x); + } + + /* + * Buffer the output + * + * We buffer the output for two reasons: + * 1. Speed. You get a significant speed boost. + * 2. So that the final rendered template can be + * post-processed by the output class. Why do we + * need post processing? For one thing, in order to + * show the elapsed page load time. Unless we + * can intercept the content right before it's sent to + * the browser and then stop the timer, it won't be acurate. + * + */ + + if ( ! file_exists($path)) + { + show_error('Unable to load the requested file: '.$file); + } + + ob_start(); + + include($path); + log_message('debug', 'File loaded: '.$path); + + // Return the file data if requested to + if ($return === TRUE) + { + $buffer = ob_get_contents(); + ob_end_clean(); + + return $buffer; + } + + /* + * Flush the buffer... or buff the flusher? + * + * In order to permit templates (views) to be nested within + * other views, we need to flush the content back out whenever + * we are beyond the first level of output buffering so that + * it can be seen and included properly by the first included + * template and any subsequent ones. Oy! + * + */ + if (ob_get_level() > $this->ob_level + 1) + { + ob_end_flush(); + } + else + { + $OUT->set_output(ob_get_contents()); + ob_end_clean(); + } + } + // END _load() + + // -------------------------------------------------------------------- + + /** + * Autoloader + * + * The config/autoload.php file contains an array that permits sub-systems, + * plugins, and helpers to be loaded automatically. + * + * @access private + * @param array + * @return void + */ + function _ci_autoloader($autoload) + { + if ($autoload === FALSE) + { + return; + } + + foreach (array('helper', 'plugin', 'script') as $type) + { + if (isset($autoload[$type])) + { + if ( ! is_array($autoload[$type])) + { + $autoload[$type] = array($autoload[$type]); + } + + foreach ($autoload[$type] as $item) + { + $this->$type($item); + } + } + } + } + // END _ci_autoloader() + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and convers the class variables to array key/vals + * + * @access public + * @param object + * @return array + */ + function _ci_object_to_array($object) + { + if ( ! is_object($object)) + { + return $object; + } + + $array = array(); + foreach (get_object_vars($object) as $key => $val) + { + $array[$key] = $val; + } + + return $array; + } + +} +// END Loader Class +?> \ No newline at end of file diff --git a/system/libraries/Log.php b/system/libraries/Log.php new file mode 100644 index 00000000..35e30b64 --- /dev/null +++ b/system/libraries/Log.php @@ -0,0 +1,117 @@ + '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); + + /** + * Constructor + * + * @access public + * @param string the log file path + * @param string the error threshold + * @param string the date formatting codes + */ + function CI_Log($path = '', $threshold = '', $date_fmt = '') + { + $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; + + if ( ! is_dir($this->log_path) OR ! is_writable($this->log_path)) + { + $this->_enabled = FALSE; + } + + if (ctype_digit($threshold)) + { + $this->_threshold = $threshold; + } + + if ($date_fmt != '') + { + $this->_date_fmt = $date_fmt; + } + } + // END CI_Log() + + // -------------------------------------------------------------------- + + /** + * Write Log File + * + * Generally this function will be called using the global log_message() function + * + * @access public + * @param string the error level + * @param string the error message + * @param bool whether the error is a native PHP error + * @return bool + */ + function write_log($level = 'error', $msg, $php_error = FALSE) + { + if ($this->_enabled === FALSE) + { + return FALSE; + } + + $level = strtoupper($level); + + if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) + { + return FALSE; + } + + $filepath = $this->log_path.'log-'.date('Y-m-d').'.php'; + $message = ''; + + if ( ! file_exists($filepath)) + { + $message .= "<"."?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; + } + + if ( ! $fp = @fopen($filepath, "a")) + { + return FALSE; + } + + $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; + + flock($fp, LOCK_EX); + fwrite($fp, $message); + flock($fp, LOCK_UN); + fclose($fp); + + @chmod($filepath, 0666); + return TRUE; + } + // END write_log() +} +// END Log Class +?> \ No newline at end of file diff --git a/system/libraries/Model.php b/system/libraries/Model.php new file mode 100644 index 00000000..9834f827 --- /dev/null +++ b/system/libraries/Model.php @@ -0,0 +1,72 @@ +_assign_libraries(FALSE); + log_message('debug', "Model Class Initialized"); + } + // END Model() + + /** + * Assign Libraries + * + * Creates local references to all currently instantiated objects + * so that any syntax that can be legally used in a controller + * can be used within models. + * + * @access private + */ + function _assign_libraries($use_reference = TRUE) + { + $obj =& get_instance(); + foreach ($obj->ci_is_loaded as $val) + { + if ( ! isset($this->$val)) + { + if ($use_reference === TRUE) + { + $this->$val =& $obj->$val; + } + else + { + $this->$val = $obj->$val; + } + } + } + } + // END _assign_libraries() + +} +// END Model Class +?> \ No newline at end of file diff --git a/system/libraries/Output.php b/system/libraries/Output.php new file mode 100644 index 00000000..f5db3e0d --- /dev/null +++ b/system/libraries/Output.php @@ -0,0 +1,241 @@ +final_output; + } + + // -------------------------------------------------------------------- + + /** + * Set Output + * + * Sets the output string + * + * @access public + * @param string + * @return void + */ + function set_output($output) + { + $this->final_output = $output; + } + + // -------------------------------------------------------------------- + + /** + * Set Cache + * + * @access public + * @param integer + * @return void + */ + function cache($time) + { + $this->cache_expiration = ( ! ctype_digit($time)) ? 0 : $time; + } + + // -------------------------------------------------------------------- + + /** + * Display Output + * + * All "view" data is automatically put into this variable + * by the controller class: + * + * $this->final_output + * + * This function simply echos the variable out. It also does the following: + * + * Stops the benchmark timer so the page rendering speed can be shown. + * + * Determines if the "memory_get_usage' function is available so that + * the memory usage can be shown. + * + * @access public + * @return void + */ + function _display($output = '') + { + $BM =& _load_class('CI_Benchmark'); + + if ($output == '') + { + $output =& $this->final_output; + } + + if ($this->cache_expiration > 0) + { + $this->_write_cache($output); + } + + $elapsed = $BM->elapsed_time('code_igniter_start', 'code_igniter_end'); + $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; + + $output = str_replace('{memory_usage}', $memory, $output); + $output = str_replace('{elapsed_time}', $elapsed, $output); + + echo $output; + + log_message('debug', "Final output sent to browser"); + log_message('debug', "Total execution time: ".$elapsed); + } + + // -------------------------------------------------------------------- + + /** + * Write a Cache File + * + * @access public + * @return void + */ + function _write_cache($output) + { + $obj =& get_instance(); + $path = $obj->config->item('cache_path'); + + $cache_path = ($path == '') ? BASEPATH.'cache/' : $path; + + if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) + { + return; + } + + $uri = $obj->config->item('base_url', 1). + $obj->config->item('index_page'). + $obj->uri->uri_string(); + + $cache_path .= md5($uri); + + if ( ! $fp = @fopen($cache_path, 'wb')) + { + log_message('error', "Unable to write ache file: ".$cache_path); + return; + } + + $expire = time() + ($this->cache_expiration * 60); + + flock($fp, LOCK_EX); + fwrite($fp, $expire.'TS--->'.$output); + flock($fp, LOCK_UN); + fclose($fp); + @chmod($cache_path, 0777); + + log_message('debug', "Cache file written: ".$cache_path); + } + + // -------------------------------------------------------------------- + + /** + * Update/serve a cached file + * + * @access public + * @return void + */ + function _display_cache() + { + $CFG =& _load_class('CI_Config'); + $RTR =& _load_class('CI_Router'); + + $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); + + if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) + { + return FALSE; + } + + // Build the file path. The file name is an MD5 hash of the full URI + $uri = $CFG->item('base_url', 1).$CFG->item('index_page').$RTR->uri_string; + + $filepath = $cache_path.md5($uri); + + if ( ! @file_exists($filepath)) + { + return FALSE; + } + + if ( ! $fp = @fopen($filepath, 'rb')) + { + return FALSE; + } + + flock($fp, LOCK_SH); + + $cache = ''; + if (filesize($filepath) > 0) + { + $cache = fread($fp, filesize($filepath)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + // Strip out the embedded timestamp + if ( ! preg_match("/(\d+TS--->)/", $cache, $match)) + { + return FALSE; + } + + // Has the file expired? If so we'll delete it. + if (time() >= trim(str_replace('TS--->', '', $match['1']))) + { + @unlink($filepath); + log_message('debug', "Cache file has expired. File deleted"); + return FALSE; + } + + // Display the cache + $this->_display(str_replace($match['0'], '', $cache)); + log_message('debug', "Cache file is current. Sending it to browser."); + return TRUE; + } + +} +// END Output Class +?> \ No newline at end of file diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php new file mode 100644 index 00000000..0bbb577a --- /dev/null +++ b/system/libraries/Pagination.php @@ -0,0 +1,207 @@ +'; + var $cur_tag_close = '
'; + var $next_tag_open = ' '; + var $next_tag_close = ' '; + var $prev_tag_open = ' '; + var $prev_tag_close = ''; + var $num_tag_open = ' '; + var $num_tag_close = ''; + + /** + * Constructor + * + * @access public + * @param array initialization parameters + */ + function CI_Pagination($params = array()) + { + if (count($params) > 0) + { + $this->initialize($params); + } + + log_message('debug', "Pagination Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Preferences + * + * @access public + * @param array initialization parameters + * @return void + */ + function initialize($params = array()) + { + if (count($params) > 0) + { + foreach ($params as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + } + + // -------------------------------------------------------------------- + + /** + * Generate the pagination links + * + * @access public + * @return string + */ + 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) + { + return ''; + } + + // Calculate the total number of pages + $num_pages = intval($this->total_rows / $this->per_page); + + // Use modulus to see if our division has a remainder.If so, add one to our page number. + if ($this->total_rows % $this->per_page) + { + $num_pages++; + } + + // Is there only one page? Hm... nothing more to do here then. + if ($num_pages == 1) + { + return ''; + } + + // Determine the current page number. + $obj =& get_instance(); + if ($obj->uri->segment($this->uri_segment) != 0) + { + $this->cur_page = $obj->uri->segment($this->uri_segment); + } + + if ( ! ctype_digit($this->cur_page)) + { + $this->cur_page = 0; + } + + $uri_page_number = $this->cur_page; + $this->cur_page = floor(($this->cur_page/$this->per_page) + 1); + + // Calculate the start and end numbers. These determine + // which number to start and end the digit links with + $start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1; + $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; + + // Add a trailing slash to the base URL if needed + $this->base_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->base_url); + + // And here we go... + $output = ''; + + // Render the "First" link + if ($this->cur_page > $this->num_links) + { + $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; + } + + // Render the "previous" link + if (($this->cur_page - $this->num_links) >= 0) + { + $i = $uri_page_number - $this->per_page; + if ($i == 0) $i = ''; + $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; + } + + // Write the digit links + for ($loop = $start -1; $loop <= $end; $loop++) + { + $i = ($loop * $this->per_page) - $this->per_page; + + if ($i >= 0) + { + if ($this->cur_page == $loop) + { + $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page + } + else + { + $n = ($i == 0) ? '' : $i; + $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; + } + } + } + + // Render the "next" link + if ($this->cur_page < $num_pages) + { + $output .= $this->next_tag_open.''.$this->next_link.''.$this->next_tag_close; + } + + // Render the "Last" link + if (($this->cur_page + $this->num_links) < $num_pages) + { + $i = (($num_pages * $this->per_page) - $this->per_page); + $output .= $this->last_tag_open.''.$this->last_link.''.$this->last_tag_close; + } + + // Kill double slashes. Note: Sometimes we can end up with a double slash + // in the penultimate link so we'll kill all double shashes. + $output = preg_replace("#([^:])//+#", "\\1/", $output); + + // Add the wrapper HTML if exists + $output = $this->full_tag_open.$output.$this->full_tag_close; + + return $output; + } +} +// END Pagination Class +?> \ No newline at end of file diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php new file mode 100644 index 00000000..9f6a814a --- /dev/null +++ b/system/libraries/Parser.php @@ -0,0 +1,178 @@ +load->view($template, '', TRUE); + + if ($template == '') + { + return FALSE; + } + + foreach ($data as $key => $val) + { + if ( ! is_array($val)) + { + $template = $this->_parse_single($key, $val, $template); + } + else + { + $template = $this->_parse_pair($key, $val, $template); + } + } + + if ($return == FALSE) + { + $OUT->final_output = $template; + } + + return $template; + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Set the left/right variable delimiters + * + * @access public + * @param string + * @param string + * @return void + */ + function set_delimiters($l = '{', $r = '}') + { + $this->l_delim = $l; + $this->r_delim = $r; + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Parse a single key/value + * + * @access private + * @param string + * @param string + * @param string + * @return string + */ + function _parse_single($key, $val, $string) + { + return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Parse a tag pair + * + * Parses tag pairs: {some_tag} string... {/some_tag} + * + * @access private + * @param string + * @param array + * @param string + * @return string + */ + function _parse_pair($variable, $data, $string) + { + if (FALSE === ($match = $this->_match_pair($string, $variable))) + { + return $string; + } + + $str = ''; + foreach ($data as $row) + { + $temp = $match['1']; + foreach ($row as $key => $val) + { + if ( ! is_array($val)) + { + $temp = $this->_parse_single($key, $val, $temp); + } + else + { + $temp = $this->_parse_pair($key, $val, $temp); + } + } + + $str .= $temp; + } + + return str_replace($match['0'], $str, $string); + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Matches a variable pair + * + * @access private + * @param string + * @param string + * @return mixed + */ + function _match_pair($string, $variable) + { + if ( ! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match)) + { + return FALSE; + } + + return $match; + } + // END _match_pair() + +} +// END Parser Class +?> \ No newline at end of file diff --git a/system/libraries/Router.php b/system/libraries/Router.php new file mode 100644 index 00000000..abc253ef --- /dev/null +++ b/system/libraries/Router.php @@ -0,0 +1,318 @@ +config =& _load_class('CI_Config'); + $this->_set_route_mapping(); + log_message('debug', "Router Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set the route mapping + * + * This function determies what should be served based on the URI request, + * as well as any "routes" that have been set in the routing config file. + * + * @access private + * @return void + */ + function _set_route_mapping() + { + // Are query strings enabled? If so we're done... + if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) + { + $this->set_class($_GET[$this->config->item('controller_trigger')]); + + if (isset($_GET[$this->config->item('function_trigger')])) + { + $this->set_method($_GET[$this->config->item('function_trigger')]); + } + + return; + } + + // Load the routes.php file + include_once(APPPATH.'config/routes'.EXT); + $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; + unset($route); + + // Set the default controller + $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); + + // Fetch the URI string Depending on the server, + // the URI will be available in one of two globals + switch ($this->config->item('uri_protocol')) + { + case 'path_info' : $this->uri_string = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + break; + case 'query_string' : $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + break; + default : + $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + + if ($path_info != '' AND $path_info != "/".SELF) + { + $this->uri_string = $path_info; + } + else + { + $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + } + break; + } + + // Is there a URI string? If not, the default controller specified + // by the admin in the "routes" file will be shown. + if ($this->uri_string == '') + { + if ($this->default_controller === FALSE) + { + show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); + } + + $this->set_class($this->default_controller); + $this->set_method('index'); + + log_message('debug', "No URI present. Default controller set."); + return; + } + + // Do we need to remove the suffix specified in the config file? + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + + // Explode the URI Segments. The individual segments will + // be stored in the $this->segments array. + $this->_compile_segments(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string))); + + + // Remap the class/method if a route exists + unset($this->routes['default_controller']); + + if (count($this->routes) > 0) + { + $this->_parse_routes(); + } + } + // END _set_route_mapping() + + // -------------------------------------------------------------------- + + /** + * Compile Segments + * + * This function takes an array of URI segments as + * input, and puts it into the $this->segments array. + * It also sets the current class/method + * + * @access private + * @param array + * @param bool + * @return void + */ + function _compile_segments($segs, $route = FALSE) + { + $segments = array(); + + $i = 1; + foreach($segs as $val) + { + $val = trim($this->_filter_uri($val)); + + if ($val != '') + $segments[$i++] = $val; + } + + $this->set_class($segments['1']); + + if (isset($segments['2'])) + { + // A scaffolding request. No funny business with the URL + if ($this->routes['scaffolding_trigger'] == $segments['2'] AND $segments['2'] != '_ci_scaffolding') + { + $this->scaffolding_request = TRUE; + unset($this->routes['scaffolding_trigger']); + } + else + { + // A standard method request + $this->set_method($segments['2']); + } + } + + if ($route == FALSE) + { + $this->segments = $segments; + } + + unset($segments); + } + // END _compile_segments() + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ( ! preg_match("/^[a-z0-9~\s\%\.:_-]+$/i", $str)) + { + exit('The URI you submitted has disallowed characters: '.$str); + } + + return $str; + } + // END _filter_uri() + + // -------------------------------------------------------------------- + + /** + * Set the class name + * + * @access public + * @param string + * @return void + */ + function set_class($class) + { + $this->class = $class; + } + // END _filter_uri() + + // -------------------------------------------------------------------- + + /** + * Fetch the current class + * + * @access public + * @return string + */ + function fetch_class() + { + return $this->class; + } + // END _filter_uri() + + // -------------------------------------------------------------------- + + /** + * Set the method name + * + * @access public + * @param string + * @return void + */ + function set_method($method) + { + $this->method = $method; + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Fetch the current method + * + * @access public + * @return string + */ + function fetch_method() + { + return $this->method; + } + // END set_method() + + // -------------------------------------------------------------------- + + /** + * Parse Routes + * + * This function matches any routes that may exist in + * the config/routes.php file against the URI to + * determine if the class/method need to be remapped. + * + * @access private + * @return void + */ + function _parse_routes() + { + // Turn the segment array into a URI string + $uri = implode('/', $this->segments); + $num = count($this->segments); + + // Is there a literal match? If so we're done + if (isset($this->routes[$uri])) + { + $this->_compile_segments(explode('/', $this->routes[$uri]), TRUE); + return; + } + + // Loop through the route array looking for wildcards + foreach ($this->routes as $key => $val) + { + if (count(explode('/', $key)) != $num) + continue; + + if (preg_match("|".str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key))."$|", $uri)) + { + $this->_compile_segments(explode('/', $val), TRUE); + break; + } + } + } + // END set_method() +} +// END Router Class +?> \ No newline at end of file diff --git a/system/libraries/Session.php b/system/libraries/Session.php new file mode 100644 index 00000000..4f08cf69 --- /dev/null +++ b/system/libraries/Session.php @@ -0,0 +1,499 @@ +object =& get_instance(); + + log_message('debug', "Session Class Initialized"); + $this->sess_run(); + } + // END display_errors() + + // -------------------------------------------------------------------- + + /** + * Run the session routines + * + * @access public + * @return void + */ + function sess_run() + { + /* + * Set the "now" time + * + * It can either set to GMT or time(). The pref + * is set in the config file. If the developer + * is doing any sort of time localization they + * might want to set the session time to GMT so + * they can offset the "last_activity" and + * "last_visit" times based on each user's locale. + * + */ + if (strtolower($this->object->config->item('time_reference')) == 'gmt') + { + $now = time(); + $this->now = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + + if (strlen($this->now) < 10) + { + $this->now = time(); + log_message('error', 'The session class could not set a proper GMT timestamp so the local time() value was used.'); + } + } + else + { + $this->now = time(); + } + + /* + * Set the session length + * + * If the session expiration is set to zero in + * the config file we'll set the expiration + * two years from now. + * + */ + $expiration = $this->object->config->item('sess_expiration'); + + if (ctype_digit($expiration)) + { + if ($expiration > 0) + { + $this->sess_length = $this->object->config->item('sess_expiration'); + } + else + { + $this->sess_length = (60*60*24*365*2); + } + } + + // Do we need encryption? + $this->encryption = $this->object->config->item('sess_encrypt_cookie'); + + if ($this->encryption == TRUE) + { + $this->object->load->library('encrypt'); + } + + // Are we using a database? + if ($this->object->config->item('sess_use_database') === TRUE AND $this->object->config->item('sess_table_name') != '') + { + $this->use_database = TRUE; + $this->session_table = $this->object->config->item('sess_table_name'); + $this->object->load->database(); + } + + // Set the cookie name + if ($this->object->config->item('sess_cookie_name') != FALSE) + { + $this->sess_cookie = $this->object->config->item('cookie_prefix').$this->object->config->item('sess_cookie_name'); + } + + /* + * Fetch the current session + * + * If a session doesn't exist we'll create + * a new one. If it does, we'll update it. + * + */ + if ( ! $this->sess_read()) + { + $this->sess_create(); + } + else + { + // We only update the session every five minutes + if (($this->userdata['last_activity'] + 300) < $this->now) + { + $this->sess_update(); + } + } + + // Delete expired sessions if necessary + if ($this->use_database === TRUE) + { + $this->sess_gc(); + } + } + // END sess_run() + + // -------------------------------------------------------------------- + + /** + * Fetch the current session data if it exists + * + * @access public + * @return void + */ + function sess_read() + { + // Fetch the cookie + $session = $this->object->input->cookie($this->sess_cookie); + + if ($session === FALSE) + { + log_message('debug', 'A session cookie was not found.'); + return FALSE; + } + + // Decrypt and unserialize the data + if ($this->encryption == TRUE) + { + $session = $this->object->encrypt->decode($session); + } + + $session = @unserialize($this->strip_slashes($session)); + + if ( ! is_array($session) OR ! isset($session['last_activity'])) + { + log_message('error', 'The session cookie data did not contain a valid array. This could be a possible hacking attempt.'); + return FALSE; + } + + // Is the session current? + if (($session['last_activity'] + $this->sess_length) < $this->now) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the IP Match? + if ($this->object->config->item('sess_match_ip') == TRUE AND $session['ip_address'] != $this->object->input->ip_address()) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the User Agent Match? + if ($this->object->config->item('sess_match_useragent') == TRUE AND $session['user_agent'] != substr($this->object->input->user_agent(), 0, 50)) + { + $this->sess_destroy(); + return FALSE; + } + + // Is there a corresponding session in the DB? + if ($this->use_database === TRUE) + { + $this->object->db->where('session_id', $session['session_id']); + + if ($this->object->config->item('sess_match_ip') == TRUE) + { + $this->object->db->where('ip_address', $session['ip_address']); + } + + if ($this->object->config->item('sess_match_useragent') == TRUE) + { + $this->object->db->where('user_agent', $session['user_agent']); + } + + $query = $this->object->db->get($this->session_table); + + if ($query->num_rows() == 0) + { + $this->sess_destroy(); + return FALSE; + } + else + { + $row = $query->row(); + if (($row->last_activity + $this->sess_length) < $this->now) + { + $this->object->db->where('session_id', $session['session_id']); + $this->object->db->delete($this->session_table); + $this->sess_destroy(); + return FALSE; + } + } + } + + // Session is valid! + $this->userdata = $session; + unset($session); + + return TRUE; + } + // END sess_read() + + // -------------------------------------------------------------------- + + /** + * Write the session cookie + * + * @access public + * @return void + */ + function sess_write() + { + $cookie_data = serialize($this->userdata); + + if ($this->encryption == TRUE) + { + $cookie_data = $this->object->encrypt->encode($cookie_data); + } + + setcookie( + $this->sess_cookie, + $cookie_data, + $this->sess_length + $this->now, + $this->object->config->item('cookie_path'), + $this->object->config->item('cookie_domain'), + 0 + ); + } + // END sess_read() + + // -------------------------------------------------------------------- + + /** + * Create a new session + * + * @access public + * @return void + */ + function sess_create() + { + $sessid = ''; + while (strlen($sessid) < 32) + { + $sessid .= mt_rand(0, mt_getrandmax()); + } + + $this->userdata = array( + 'session_id' => md5(uniqid($sessid, TRUE)), + 'ip_address' => $this->object->input->ip_address(), + 'user_agent' => substr($this->object->input->user_agent(), 0, 50), + 'last_activity' => $this->now + ); + + + // Save the session in the DB if needed + if ($this->use_database === TRUE) + { + $this->object->db->query($this->object->db->insert_string($this->session_table, $this->userdata)); + } + + // Write the cookie + $this->userdata['last_visit'] = 0; + $this->sess_write(); + } + // END sess_read() + + // -------------------------------------------------------------------- + + /** + * Update an existing session + * + * @access public + * @return void + */ + function sess_update() + { + if (($this->userdata['last_activity'] + $this->sess_length) < $this->now) + { + $this->userdata['last_visit'] = $this->userdata['last_activity']; + } + + $this->userdata['last_activity'] = $this->now; + + // Update the session in the DB if needed + if ($this->use_database === TRUE) + { + $this->object->db->query($this->object->db->update_string($this->session_table, array('last_activity' => $this->now), array('session_id' => $this->userdata['session_id']))); + } + + // Write the cookie + $this->sess_write(); + } + // END sess_update() + + // -------------------------------------------------------------------- + + /** + * Destroy the current session + * + * @access public + * @return void + */ + function sess_destroy() + { + setcookie( + $this->sess_cookie, + addslashes(serialize(array())), + ($this->now - 31500000), + $this->object->config->item('cookie_path'), + $this->object->config->item('cookie_domain'), + 0 + ); + } + // END sess_destroy() + + // -------------------------------------------------------------------- + + /** + * Garbage collection + * + * This deletes expired session rows from database + * if the probability percentage is met + * + * @access public + * @return void + */ + function sess_gc() + { + srand(time()); + if ((rand() % 100) < $this->gc_probability) + { + $expire = $this->now - $this->sess_length; + + $this->object->db->where("last_activity < {$expire}"); + $this->object->db->delete($this->session_table); + + log_message('debug', 'Session garbage collection performed.'); + } + } + // END sess_destroy() + + // -------------------------------------------------------------------- + + /** + * Fetch a specific item form the session array + * + * @access public + * @param string + * @return string + */ + function userdata($item) + { + return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; + } + // END sess_destroy() + + // -------------------------------------------------------------------- + + /** + * Add or change data in the "userdata" array + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_userdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $this->userdata[$key] = $val; + } + } + + $this->sess_write(); + } + // END set_userdata() + + // -------------------------------------------------------------------- + + /** + * Delete a session variable from the "userdata" array + * + * @access array + * @return void + */ + function unset_userdata($newdata = array()) + { + if (is_string($newdata)) + { + $newdata = array($newdata => ''); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + unset($this->userdata[$key]); + } + } + + $this->sess_write(); + } + // END set_userdata() + + // -------------------------------------------------------------------- + + /** + * Strip slashes + * + * @access public + * @param mixed + * @return mixed + */ + function strip_slashes($vals) + { + if (is_array($vals)) + { + foreach ($vals as $key=>$val) + { + $vals[$key] = $this->strip_slashes($val); + } + } + else + { + $vals = stripslashes($vals); + } + + return $vals; + } + // END strip_slashes() +} +// END Session Class +?> \ No newline at end of file diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php new file mode 100644 index 00000000..13196eb6 --- /dev/null +++ b/system/libraries/Sha1.php @@ -0,0 +1,254 @@ +> 6) + 1; + + for ($i = 0; $i < $n * 16; $i++) + { + $x[$i] = 0; + } + + for ($i = 0; $i < strlen($str); $i++) + { + $x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8); + } + + $x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8); + + $x[$n * 16 - 1] = strlen($str) * 8; + + $a = 1732584193; + $b = -271733879; + $c = -1732584194; + $d = 271733878; + $e = -1009589776; + + for ($i = 0; $i < sizeof($x); $i += 16) + { + $olda = $a; + $oldb = $b; + $oldc = $c; + $oldd = $d; + $olde = $e; + + for($j = 0; $j < 80; $j++) + { + if ($j < 16) + { + $w[$j] = $x[$i + $j]; + } + else + { + $w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1); + } + + $t = $this->_safe_add($this->_safe_add($this->_rol($a, 5), $this->_ft($j, $b, $c, $d)), $this->_safe_add($this->_safe_add($e, $w[$j]), $this->_kt($j))); + + $e = $d; + $d = $c; + $c = $this->_rol($b, 30); + $b = $a; + $a = $t; + } + + $a = $this->_safe_add($a, $olda); + $b = $this->_safe_add($b, $oldb); + $c = $this->_safe_add($c, $oldc); + $d = $this->_safe_add($d, $oldd); + $e = $this->_safe_add($e, $olde); + } + + return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e); + } + // END generate() + + // -------------------------------------------------------------------- + + /** + * Convert a decimal to hex + * + * @access private + * @param string + * @return string + */ + function _hex($str) + { + $str = dechex($str); + + if (strlen($str) == 7) + { + $str = '0'.$str; + } + + return $str; + } + // END _hex() + + // -------------------------------------------------------------------- + + /** + * Return result based on iteration + * + * @access private + * @return string + */ + function _ft($t, $b, $c, $d) + { + if ($t < 20) + return ($b & $c) | ((~$b) & $d); + if ($t < 40) + return $b ^ $c ^ $d; + if ($t < 60) + return ($b & $c) | ($b & $d) | ($c & $d); + + return $b ^ $c ^ $d; + } + // END _ft() + + // -------------------------------------------------------------------- + + /** + * Determine the additive constant + * + * @access private + * @return string + */ + function _kt($t) + { + if ($t < 20) + { + return 1518500249; + } + else if ($t < 40) + { + return 1859775393; + } + else if ($t < 60) + { + return -1894007588; + } + else + { + return -899497514; + } + } + // END _kt() + + // -------------------------------------------------------------------- + + /** + * Add integers, wrapping at 2^32 + * + * @access private + * @return string + */ + function _safe_add($x, $y) + { + $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); + $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); + + return ($msw << 16) | ($lsw & 0xFFFF); + } + // END _safe_add() + + // -------------------------------------------------------------------- + + /** + * Bitwise rotate a 32-bit number + * + * @access private + * @return integer + */ + function _rol($num, $cnt) + { + return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt); + } + + // -------------------------------------------------------------------- + + /** + * Pad string with zero + * + * @access private + * @return string + */ + function _zero_fill($a, $b) + { + $bin = decbin($a); + + if (strlen($bin) < $b) + { + $bin = 0; + } + else + { + $bin = substr($bin, 0, strlen($bin) - $b); + } + + for ($i=0; $i < $b; $i++) + { + $bin = "0".$bin; + } + + return bindec($bin); + } +} +// END CI_SHA +?> \ No newline at end of file diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php new file mode 100644 index 00000000..583c6d28 --- /dev/null +++ b/system/libraries/Trackback.php @@ -0,0 +1,561 @@ + '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => ''); + var $convert_ascii = TRUE; + var $response = ''; + var $error_msg = array(); + + /** + * Constructor + * + * @access public + */ + function CI_Trackback() + { + log_message('debug', "Trackback Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Send Trackback + * + * @access public + * @param array + * @return bool + */ + function send($tb_data) + { + if ( ! is_array($tb_data)) + { + $this->set_error('The send() method must be passed an array'); + return FALSE; + } + + // Pre-process the Trackback Data + foreach (array('url', 'title', 'excerpt', 'blog_name', 'ping_url') as $item) + { + if ( ! isset($tb_data[$item])) + { + $this->set_error('Required item missing: '.$item); + return FALSE; + } + + switch ($item) + { + case 'ping_url' : $$item = $this->extract_urls($tb_data[$item]); + break; + case 'excerpt' : $$item = $this->limit_characters($this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); + break; + case 'url' : $$item = str_replace('-', '-', $this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); + break; + default : $$item = $this->convert_xml(strip_tags(stripslashes($tb_data[$item]))); + break; + } + + // Convert High ASCII Characters + if ($this->convert_ascii == TRUE) + { + if ($item == 'excerpt') + { + $$item = $this->convert_ascii($$item); + } + elseif ($item == 'title') + { + $$item = $this->convert_ascii($$item); + } + elseif($item == 'blog_name') + { + $$item = $this->convert_ascii($$item); + } + } + } + + // Build the Trackback data string + $charset = ( ! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset']; + + $data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt)."&charset=".rawurlencode($charset); + + // Send Trackback(s) + $return = TRUE; + if (count($ping_url) > 0) + { + foreach ($ping_url as $url) + { + if ($this->process($url, $data) == FALSE) + { + $return = FALSE; + } + } + } + + return $return; + } + // END send() + + // -------------------------------------------------------------------- + + /** + * Receive Trackback Data + * + * This function simply validates the incoming TB data. + * It returns false on failure and true on success. + * If the data is valid it is set to the $this->data array + * so that it can be inserted into a database. + * + * @access public + * @return bool + */ + function receive() + { + foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) + { + if ( ! isset($_POST[$val]) OR $_POST[$val] == '') + { + $this->set_error('The following required POST variable is missing: '.$val); + return FALSE; + } + + $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset'])); + + if ($val != 'url' && function_exists('mb_convert_encoding')) + { + $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']); + } + + $_POST[$val] = ($val != 'url') ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]); + + if ($val == 'excerpt') + { + $_POST['excerpt'] = $this->limit_characters($_POST['excerpt']); + } + + $this->data[$val] = $_POST[$val]; + } + + return TRUE; + } + // END receive() + + // -------------------------------------------------------------------- + + /** + * Send Trackback Error Message + * + * Allows custom errros to be set. By default it + * sends the "incomplete information" error, as that's + * the most common one. + * + * @access public + * @param string + * @return void + */ + function send_error($message = 'Incomplete Information') + { + echo "\n\n1\n".$message."\n"; + exit; + } + // END send_error() + + // -------------------------------------------------------------------- + + /** + * Send Trackback Success Message + * + * This should be called when a trackback has been + * successfully received and inserted. + * + * @access public + * @return void + */ + function send_success() + { + echo "\n\n0\n"; + exit; + } + // END send_success() + + // -------------------------------------------------------------------- + + /** + * Fetch a particular item + * + * @access public + * @param string + * @return string + */ + function data($item) + { + return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; + } + // END data() + + // -------------------------------------------------------------------- + + /** + * Process Trackback + * + * Opens a socket connection and passes the data to + * the server. Returns true on success, false on failure + * + * @access public + * @param string + * @param string + * @return bool + */ + function process($url, $data) + { + $target = parse_url($url); + + // Open the socket + if ( ! $fp = @fsockopen($target['host'], 80)) + { + $this->set_error('Invalid Connection: '.$url); + return FALSE; + } + + // Build the path + $ppath = ( ! isset($target['path'])) ? $url : $target['path']; + + $path = (isset($target['query']) && $target['query'] != "") ? $ppath.'?'.$target['query'] : $ppath; + + // Add the Trackback ID to the data string + if ($id = $this->get_id($url)) + { + $data = "tb_id=".$id."&".$data; + } + + // Transfer the data + fputs ($fp, "POST " . $path . " HTTP/1.0\r\n" ); + fputs ($fp, "Host: " . $target['host'] . "\r\n" ); + fputs ($fp, "Content-type: application/x-www-form-urlencoded\r\n" ); + fputs ($fp, "Content-length: " . strlen($data) . "\r\n" ); + fputs ($fp, "Connection: close\r\n\r\n" ); + fputs ($fp, $data); + + // Was it successful? + $this->response = ""; + + while(!feof($fp)) + { + $this->response .= fgets($fp, 128); + } + @fclose($fp); + + if ( ! eregi("0", $this->response)) + { + $message = 'An unknown error was encountered'; + + if (preg_match("/(.*?)<\/message>/is", $this->response, $match)) + { + $message = trim($match['1']); + } + + $this->set_error($message); + return FALSE; + } + + return TRUE; + } + // END process() + + // -------------------------------------------------------------------- + + /** + * Extract Trackback URLs + * + * This function lets multiple trackbacks be sent. + * It takes a string of URLs (separated by comma or + * space) and puts each URL into an array + * + * @access public + * @param string + * @return string + */ + function extract_urls($urls) + { + // Remove the pesky white space and replace with a comma. + $urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls); + + // If they use commas get rid of the doubles. + $urls = str_replace(",,", ",", $urls); + + // Remove any comma that might be at the end + if (substr($urls, -1) == ",") + { + $urls = substr($urls, 0, -1); + } + + // Break into an array via commas + $urls = preg_split('/[,]/', $urls); + + // Removes duplicates + $urls = array_unique($urls); + + array_walk($urls, array($this, 'validate_url')); + + return $urls; + } + // END extract_urls() + + // -------------------------------------------------------------------- + + /** + * Validate URL + * + * Simply adds "http://" if missing + * + * @access public + * @param string + * @return string + */ + function validate_url($url) + { + $url = trim($url); + + if (substr($url, 0, 4) != "http") + { + $url = "http://".$url; + } + } + // END validate_url() + + // -------------------------------------------------------------------- + + /** + * Find the Trackback URL's ID + * + * @access public + * @param string + * @return string + */ + function get_id($url) + { + $tb_id = ""; + + if (strstr($url, '?')) + { + $tb_array = explode('/', $url); + $tb_end = $tb_array[count($tb_array)-1]; + + if ( ! ctype_digit($tb_end)) + { + $tb_end = $tb_array[count($tb_array)-2]; + } + + $tb_array = explode('=', $tb_end); + $tb_id = $tb_array[count($tb_array)-1]; + } + else + { + if (ereg("/$", $url)) + { + $url = substr($url, 0, -1); + } + + $tb_array = explode('/', $url); + $tb_id = $tb_array[count($tb_array)-1]; + + if ( ! ctype_digit($tb_id)) + { + $tb_id = $tb_array[count($tb_array)-2]; + } + } + + if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) + { + return false; + } + else + { + return $tb_id; + } + } + // END get_id() + + // -------------------------------------------------------------------- + + /** + * Convert Reserved XML characters to Entities + * + * @access public + * @param string + * @return string + */ + function convert_xml($str) + { + $temp = '__TEMP_AMPERSANDS__'; + + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + $str = str_replace(array("&","<",">","\"", "'", "-"), + array("&", "<", ">", """, "'", "-"), + $str); + + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;", $str); + + return $str; + } + // END get_id() + + // -------------------------------------------------------------------- + + /** + * Character limiter + * + * Limits the string based on the character count. Will preserve complete words. + * + * @access public + * @param string + * @param integer + * @param string + * @return string + */ + function limit_characters($str, $n = 500, $end_char = '…') + { + if (strlen($str) < $n) + { + return $str; + } + + $str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str)); + + if (strlen($str) <= $n) + { + return $str; + } + + $out = ""; + foreach (explode(' ', trim($str)) as $val) + { + $out .= $val.' '; + if (strlen($out) >= $n) + { + return trim($out).$end_char; + } + } + } + // END get_id() + + // -------------------------------------------------------------------- + + /** + * High ASCII to Entities + * + * Converts Hight ascii text and MS Word special chars + * to character entities + * + * @access public + * @param string + * @return string + */ + function convert_ascii($str) + { + $count = 1; + $out = ''; + $temp = array(); + + for ($i = 0, $s = strlen($str); $i < $s; $i++) + { + $ordinal = ord($str[$i]); + + if ($ordinal < 128) + { + $out .= $str[$i]; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + + $out .= '&#'.$number.';'; + $count = 1; + $temp = array(); + } + } + } + + return $out; + } + // END convert_ascii() + + // -------------------------------------------------------------------- + + /** + * Set error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + log_message('error', $msg); + $this->error_msg[] = $msg; + } + // END convert_ascii() + + // -------------------------------------------------------------------- + + /** + * Show error messages + * + * @access public + * @param string + * @param string + * @return string + */ + function display_errors($open = '

', $close = '

') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + // END display_errors() +} +// END Trackback Class +?> \ No newline at end of file diff --git a/system/libraries/URI.php b/system/libraries/URI.php new file mode 100644 index 00000000..4c2fa9c7 --- /dev/null +++ b/system/libraries/URI.php @@ -0,0 +1,243 @@ +uri =& _load_class('CI_Router'); + log_message('debug', "URI Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment + * + * This function returns the URI segment based on the number provided. + * + * @access public + * @param integer + * @param bool + * @return string + */ + function segment($n, $no_result = FALSE) + { + return ( ! isset($this->uri->segments[$n])) ? $no_result : $this->uri->segments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string + * + * This function generates and associative array of URI data starting + * at the supplied segment. For example, if this is your URI: + * + * www.your-site.com/user/search/name/joe/location/UK/gender/male + * + * You can use this function to generate an array with this prototype: + * + * array ( + * name => joe + * location => UK + * gender => male + * ) + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + */ + function uri_to_assoc($n = 3, $default = array()) + { + if ( ! ctype_digit($n)) + { + return $default; + } + + if (isset($this->keyval[$n])) + { + return $this->keyval[$n]; + } + + if ($this->total_segments() < $n) + { + if (count($default) == 0) + { + return array(); + } + + $retval = array(); + foreach ($default as $val) + { + $retval[$val] = FALSE; + } + return $default; + } + + $segments = array_slice($this->segment_array(), ($n - 1)); + + $i = 0; + $lastval = ''; + $retval = array(); + foreach ($segments as $seg) + { + if ($i % 2) + { + $retval[$lastval] = $seg; + } + else + { + $retval[$seg] = FALSE; + $lastval = $seg; + } + + $i++; + } + + if (count($default) > 0) + { + foreach ($default as $val) + { + if ( ! array_key_exists($val, $retval)) + { + $retval[$val] = FALSE; + } + } + } + + // Cache the array for reuse + $this->keyval[$n] = $retval; + return $retval; + } + + /** + * Generate a URI string from an associative array + * + * + * @access public + * @param array an associative array of key/values + * @return array + */ function assoc_to_uri($array) + { + $temp = array(); + foreach ((array)$array as $key => $val) + { + $temp[] = $key; + $temp[] = $val; + } + + return implode('/', $temp); + } + + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_segment($n, $where = 'trailing') + { + if ($where == 'trailing') + { + $trailing = '/'; + $leading = ''; + } + elseif ($where == 'leading') + { + $leading = '/'; + $trailing = ''; + } + else + { + $leading = '/'; + $trailing = '/'; + } + return ( ! isset($this->uri->segments[$n])) ? '' : $leading.$this->uri->segments[$n].$trailing; + } + + // -------------------------------------------------------------------- + + /** + * Segment Array + * + * @access public + * @return array + */ + function segment_array() + { + return $this->uri->segments; + } + + // -------------------------------------------------------------------- + + /** + * Total number of segments + * + * @access public + * @return integer + */ + function total_segments() + { + return count($this->uri->segments); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the entire URI string + * + * @access public + * @return string + */ + function uri_string() + { + return $this->uri->uri_string; + } + +} +// END URI Class +?> \ No newline at end of file diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php new file mode 100644 index 00000000..bf50350a --- /dev/null +++ b/system/libraries/Unit_test.php @@ -0,0 +1,331 @@ +active == FALSE) + return; + + if (in_array($expected, array('is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'))) + { + $expected = str_replace('is_float', 'is_double', $expected); + $result = ($expected($test)) ? TRUE : FALSE; + $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); + } + else + { + if ($this->strict == TRUE) + $result = ($test === $expected) ? TRUE : FALSE; + else + $result = ($test == $expected) ? TRUE : FALSE; + + $extype = gettype($expected); + } + + $back = $this->_backtrace(); + + $report[] = array ( + 'test_name' => $test_name, + 'test_datatype' => gettype($test), + 'res_datatype' => $extype, + 'result' => ($result === TRUE) ? 'passed' : 'failed', + 'file' => $back['file'], + 'line' => $back['line'] + ); + + $this->results[] = $report; + + return($this->report($this->result($report))); + } + + // -------------------------------------------------------------------- + + /** + * Generate a report + * + * Displays a table with the test data + * + * @access public + * @return string + */ + function report($result = array()) + { + if (count($result) == 0) + { + $result = $this->result(); + } + + $this->_parse_template(); + + $r = ''; + foreach ($result as $res) + { + $table = ''; + + foreach ($res as $key => $val) + { + $temp = $this->_template_rows; + $temp = str_replace('{item}', $key, $temp); + $temp = str_replace('{result}', $val, $temp); + $table .= $temp; + } + + $r .= str_replace('{rows}', $table, $this->_template); + } + + return $r; + } + + // -------------------------------------------------------------------- + + /** + * Use strict comparison + * + * Causes the evaluation to use === rather then == + * + * @access public + * @param bool + * @return null + */ + function use_strict($state = TRUE) + { + $this->strict = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Make Unit testing active + * + * Enables/disables unit testing + * + * @access public + * @param bool + * @return null + */ + function active($state = TRUE) + { + $this->active = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Result Array + * + * Returns the raw result data + * + * @access public + * @return array + */ + function result($results = array()) + { + $obj =& get_instance(); + $obj->load->language('unit_test'); + + if (count($results) == 0) + { + $results = $this->results; + } + + $retval = array(); + foreach ($results as $result) + { + $temp = array(); + foreach ($result as $key => $val) + { + if (is_array($val)) + { + foreach ($val as $k => $v) + { + if (FALSE !== ($line = $obj->lang->line(strtolower('ut_'.$v)))) + { + $v = $line; + } + $temp[$obj->lang->line('ut_'.$k)] = $v; + } + } + else + { + if (FALSE !== ($line = $obj->lang->line(strtolower('ut_'.$val)))) + { + $val = $line; + } + $temp[$obj->lang->line('ut_'.$key)] = $val; + } + } + + $retval[] = $temp; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Set the template + * + * This lets us set the template to be used to display results + * + * @access public + * @params string + * @return void + */ + function set_template($tempalte) + { + $this->_template = $tempalte; + } + + // -------------------------------------------------------------------- + + /** + * Generate a backtrace + * + * This lets us show file names and line numbers + * + * @access private + * @return array + */ + function _backtrace() + { + if (function_exists('debug_backtrace')) + { + $back = debug_backtrace(); + + $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; + $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; + + return array('file' => $file, 'line' => $line); + } + return array('file' => 'Unknown', 'line' => 'Unknown'); + } + + // -------------------------------------------------------------------- + + /** + * Get Default Template + * + * @access private + * @return string + */ + function _default_template() + { + $this->_template = ' +
+ + {rows} +
'; + + $this->_template_rows = ' + + {item} + {result} + + '; + } + + // -------------------------------------------------------------------- + + /** + * Parse Template + * + * Harvests the data within the template {pseudo-variables} + * + * @access private + * @return void + */ + function _parse_template() + { + if ( ! is_null($this->_template_rows)) + { + return; + } + + if (is_null($this->_template)) + { + $this->_default_template(); + return; + } + + if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) + { + $this->_default_template(); + return; + } + + $this->_template_rows = $match['1']; + $this->_template = str_replace($match['0'], '{rows}', $this->_template); + } + +} +// END Unit_test Class + +/** + * Helper functions to test boolean true/false + * + * + * @access private + * @return bool + */ +function is_true($test) +{ + return (is_bool($test) AND $test === TRUE) ? TRUE : FALSE; +} +function is_false($test) +{ + return (is_bool($test) AND $test === FALSE) ? TRUE : FALSE; +} + +?> \ No newline at end of file diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php new file mode 100644 index 00000000..6d12dbcd --- /dev/null +++ b/system/libraries/Upload.php @@ -0,0 +1,775 @@ + 0) + { + $this->initialize($props); + } + + log_message('debug', "Upload Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize preferences + * + * @access public + * @param array + * @return void + */ + function initialize($config = array()) + { + foreach ($config as $key => $val) + { + $method = 'set_'.$key; + if (method_exists($this, $method)) + { + $this->$method($val); + } + else + { + $this->$key = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Perform the file upload + * + * @access public + * @return bool + */ + function do_upload() + { + // Is $_FILES['userfile'] set? If not, no reason to continue. + if ( ! isset($_FILES['userfile'])) + { + $this->set_error('upload_userfile_not_set'); + return FALSE; + } + + // Is the upload path valid? + if ( ! $this->validate_upload_path()) + { + return FALSE; + } + + // Was the file able to be uploaded? If not, determine the reason why. + if ( ! is_uploaded_file($_FILES['userfile']['tmp_name'])) + { + $error = ( ! isset($_FILES['userfile']['error'])) ? 4 : $_FILES['userfile']['error']; + + switch($error) + { + case 1 : $this->set_error('upload_file_exceeds_limit'); + break; + case 3 : $this->set_error('upload_file_partial'); + break; + case 4 : $this->set_error('upload_no_file_selected'); + break; + default : $this->set_error('upload_no_file_selected'); + break; + } + + return FALSE; + } + + // Set the uploaded data as class variables + $this->file_temp = $_FILES['userfile']['tmp_name']; + $this->file_name = $_FILES['userfile']['name']; + $this->file_size = $_FILES['userfile']['size']; + $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES['userfile']['type']); + $this->file_type = strtolower($this->file_type); + $this->file_ext = $this->get_extension($_FILES['userfile']['name']); + + // Convert the file size to kilobytes + if ($this->file_size > 0) + { + $this->file_size = round($this->file_size/1024, 2); + } + + // Is the file type allowed to be uploaded? + if ( ! $this->is_allowed_filetype()) + { + $this->set_error('upload_invalid_filetype'); + return FALSE; + } + + // Is the file size within the allowed maximum? + if ( ! $this->is_allowed_filesize()) + { + $this->set_error('upload_invalid_filesize'); + return FALSE; + } + + // Are the image dimensions within the allowed size? + // Note: This can fail if the server has an open_basdir restriction. + if ( ! $this->is_allowed_dimensions()) + { + $this->set_error('upload_invalid_dimensions'); + return FALSE; + } + + // Sanitize the file name for security + $this->file_name = $this->clean_file_name($this->file_name); + + // Remove white spaces in the name + if ($this->remove_spaces == TRUE) + { + $this->file_name = preg_replace("/\s+/", "_", $this->file_name); + } + + /* + * Validate the file name + * This function appends an number onto the end of + * the file if one with the same name already exists. + * If it returns false there was a problem. + */ + $this->orig_name = $this->file_name; + + if ($this->overwrite == FALSE) + { + $this->file_name = $this->set_filename($this->file_path, $this->file_name); + + if ($this->file_name === FALSE) + { + return FALSE; + } + } + + /* + * Move the file to the final destination + * To deal with different server configurations + * we'll attempt to use copy() first. If that fails + * we'll use move_uploaded_file(). One of the two should + * reliably work in most environments + */ + if ( ! @copy($this->file_temp, $this->file_path.$this->file_name)) + { + if ( ! @move_uploaded_file($this->file_temp, $this->file_path.$this->file_name)) + { + $this->set_error('upload_destination_error'); + return FALSE; + } + } + + /* + * Run the file through the XSS hacking filter + * This helps prevent malicious code from being + * embedded within a file. Scripts can easily + * be disguised as images or other file types. + */ + if ($this->xss_clean == TRUE) + { + $this->do_xss_clean(); + } + + /* + * Set the finalized image dimensions + * This sets the image width/height (assuming the + * file was an image). We use this information + * in the "data" function. + */ + $this->set_image_properties($this->file_path.$this->file_name); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Finalized Data Array + * + * Returns an associative array containing all of the information + * related to the upload, allowing the developer easy access in one array. + * + * @access public + * @return array + */ + function data() + { + return array ( + 'file_name' => $this->file_name, + 'file_type' => $this->file_type, + 'file_path' => $this->file_path, + 'full_path' => $this->file_path.$this->file_name, + 'raw_name' => str_replace($this->file_ext, '', $this->file_name), + 'orig_name' => $this->orig_name, + 'file_ext' => $this->file_ext, + 'file_size' => $this->file_size, + 'is_image' => $this->is_image(), + 'image_width' => $this->image_width, + 'image_height' => $this->image_height, + 'image_type' => $this->image_type, + 'image_size_str' => $this->image_size_str, + ); + } + + // -------------------------------------------------------------------- + + /** + * Set Upload Path + * + * @access public + * @param string + * @return void + */ + function set_upload_path($path) + { + $this->file_path = $path; + } + + // -------------------------------------------------------------------- + + /** + * Set the file name + * + * This function takes a filename/path as input and looks for the + * existnace of a file with the same name. If found, it will append a + * number to the end of the filename to avoid overwritting a pre-existing file. + * + * @access public + * @param string + * @param string + * @return string + */ + function set_filename($path, $filename) + { + if ($this->encrypt_name == TRUE) + { + mt_srand(); + $filename = md5(uniqid(mt_rand())).$this->file_ext; + } + + if ( ! file_exists($path.$filename)) + { + return $filename; + } + + $filename = str_replace($this->file_ext, '', $filename); + + $new_filename = ''; + for ($i = 1; $i < 100; $i++) + { + if ( ! file_exists($path.$filename.$i.$this->file_ext)) + { + $new_filename = $filename.$i.$this->file_ext; + break; + } + } + + if ($new_filename == '') + { + $this->set_error('upload_bad_filename'); + return FALSE; + } + else + { + return $new_filename; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum File Size + * + * @access public + * @param integer + * @return void + */ + function set_max_filesize($n) + { + $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Width + * + * @access public + * @param integer + * @return void + */ + function set_max_width($n) + { + $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Height + * + * @access public + * @param integer + * @return void + */ + function set_max_height($n) + { + $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Allowed File Types + * + * @access public + * @param string + * @return void + */ + function set_allowed_types($types) + { + $this->allowed_types = explode('|', $types); + } + + // -------------------------------------------------------------------- + + /** + * Set Image Properties + * + * Uses GD to determine the width/height/type of image + * + * @access public + * @param string + * @return void + */ + function set_image_properties($path = '') + { + if ( ! $this->is_image()) + { + return; + } + + if (function_exists('getimagesize')) + { + if (FALSE !== ($D = @getimagesize($path))) + { + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $this->image_width = $D['0']; + $this->image_height = $D['1']; + $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']]; + $this->image_size_str = $D['3']; // string containing height and width + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set XSS Clean + * + * Enables the XSS flag so that the file that was uploaded + * will be run through the XSS filter. + * + * @access public + * @param bool + * @return void + */ + function set_xss_clean($flag = FALSE) + { + $this->xss_clean = ($flag == TRUE) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Validate the image + * + * @access public + * @return bool + */ + function is_image() + { + $img_mimes = array( + 'image/gif', + 'image/jpg', + 'image/jpe', + 'image/jpeg', + 'image/pjpeg', + 'image/png', + 'image/x-png' + ); + + + return (in_array($this->file_type, $img_mimes)) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the filetype is allowed + * + * @access public + * @return bool + */ + function is_allowed_filetype() + { + if (count($this->allowed_types) == 0) + { + $this->set_error('upload_no_file_types'); + return FALSE; + } + + foreach ($this->allowed_types as $val) + { + $mime = $this->mimes_types(strtolower($val)); + + if (is_array($mime)) + { + if (in_array($this->file_type, $mime)) + { + return TRUE; + } + } + else + { + if ($mime == $this->file_type) + { + return TRUE; + } + } + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the file is within the allowed size + * + * @access public + * @return bool + */ + function is_allowed_filesize() + { + if ($this->max_size != 0 AND $this->file_size > $this->max_size) + { + return FALSE; + } + else + { + return TRUE; + } + } + + // -------------------------------------------------------------------- + + /** + * Verify that the image is within the allowed width/height + * + * @access public + * @return bool + */ + function is_allowed_dimensions() + { + if ( ! $this->is_image()) + { + return TRUE; + } + + if (function_exists('getimagesize')) + { + $D = @getimagesize($this->file_temp); + + if ($this->max_width > 0 AND $D['0'] > $this->max_width) + { + return FALSE; + } + + if ($this->max_height > 0 AND $D['1'] > $this->max_height) + { + return FALSE; + } + + return TRUE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * VAlidate Upload Path + * + * Verifies that it is a valid upload path with proper permissions. + * + * + * @access public + * @return bool + */ + function validate_upload_path() + { + if ($this->file_path == '') + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if (function_exists('realpath') AND @realpath($this->file_path) !== FALSE) + { + $this->file_path = str_replace("\\", "/", realpath($this->file_path)); + } + + if ( ! @is_dir($this->file_path)) + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if ( ! is_writable($this->file_path)) + { + $this->set_error('upload_not_writable'); + return FALSE; + } + + $this->file_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->file_path); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Extract the file extension + * + * @access public + * @param string + * @return string + */ + function get_extension($filename) + { + $x = explode('.', $filename); + return '.'.end($x); + } + + // -------------------------------------------------------------------- + + /** + * Clean the file name for security + * + * @access public + * @param string + * @return string + */ + function clean_file_name($filename) + { + $bad = array( + "", + "'", + "<", + ">", + '"', + '&', + '$', + '=', + ';', + '?', + '/', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + foreach ($bad as $val) + { + $filename = str_replace($val, '', $filename); + } + + return $filename; + } + + // -------------------------------------------------------------------- + + /** + * Runs the file through the XSS clean function + * + * This prevents people from embedding malicious code in their files. + * I'm not sure that it won't negatively affect certain files in unexpected ways, + * but so far I haven't found that it causes trouble. + * + * @access public + * @return void + */ + function do_xss_clean() + { + $file = $this->file_path.$this->file_name; + + if (filesize($file) == 0) + { + return FALSE; + } + + if ( ! $fp = @fopen($file, 'rb')) + { + return FALSE; + } + + flock($fp, LOCK_EX); + + $data = fread($fp, filesize($file)); + + $obj =& get_instance(); + $data = $obj->input->xss_clean($data); + + fwrite($fp, $data); + flock($fp, LOCK_UN); + fclose($fp); + } + + // -------------------------------------------------------------------- + + /** + * Set an error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + $obj =& get_instance(); + $obj->lang->load('upload'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + $msg = ($obj->lang->line($val) == FALSE) ? $val : $obj->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($obj->lang->line($msg) == FALSE) ? $msg : $obj->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + + // -------------------------------------------------------------------- + + /** + * Display the error message + * + * @access public + * @param string + * @param string + * @return string + */ + function display_errors($open = '

', $close = '

') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * List of Mime Types + * + * This is a list of mime types. We use it to validate + * the "allowed types" set by the developer + * + * @access public + * @param string + * @return string + */ + function mimes_types($mime) + { + if (count($this->mimes) == 0) + { + if (@include(APPPATH.'config/mimes'.EXT)) + { + $this->mimes = $mimes; + unset($mimes); + } + } + + return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; + } + +} +// END Upload Class +?> \ No newline at end of file diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php new file mode 100644 index 00000000..df8c70ee --- /dev/null +++ b/system/libraries/Validation.php @@ -0,0 +1,692 @@ +'; + var $_error_suffix = '

'; + var $obj; + + + /** + * Constructor + * + */ + function CI_Validation() + { + $this->obj =& get_instance(); + log_message('debug', "Validation Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set Fields + * + * This function takes an array of field names as input + * and generates class variables with the same name, which will + * either be blank or contain the $_POST value corresponding to it + * + * @access public + * @param string + * @param string + * @return void + */ + function set_fields($data = '', $field = '') + { + if ($data == '') + return; + + if ( ! is_array($data)) + { + if ($field == '') + return; + + $data = array($data => $field); + } + + $this->_fields = $data; + + foreach($this->_fields as $key => $val) + { + $this->$key = ( ! isset($_POST[$key]) OR is_array($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]); + + $error = $key.'_error'; + if ( ! isset($this->$error)) + { + $this->$error = ''; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set Rules + * + * This function takes an array of field names and validation + * rules as input ad simply stores is for use later. + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_rules($data, $rules = '') + { + if ( ! is_array($data)) + { + if ($rules == '') + return; + + $data[$data] = $rules; + } + + foreach ($data as $key => $val) + { + $this->_rules[$key] = $val; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Error Message + * + * Lets users set their own error messages on the fly. Note: The key + * name has to match the function name that it corresponds to. + * + * @access public + * @param string + * @param string + * @return string + */ + function set_message($lang, $val = '') + { + if ( ! is_array($lang)) + { + $lang = array($lang => $val); + } + + $this->_error_messages = array_merge($this->_error_messages, $lang); + } + + // -------------------------------------------------------------------- + + /** + * Set The Error Delimiter + * + * Permits a prefix/suffix to be added to each error message + * + * @access public + * @param string + * @param string + * @return void + */ + function set_error_delimiters($prefix = '

', $suffix = '

') + { + $this->_error_prefix = $prefix; + $this->_error_suffix = $suffix; + } + + // -------------------------------------------------------------------- + + /** + * Run the Validator + * + * This function does all the work. + * + * @access public + * @return bool + */ + function run() + { + // Do we even have any data to process? Mm? + if (count($_POST) == 0 OR count($this->_rules) == 0) + { + return FALSE; + } + + // Load the language file containing error messages + $this->obj->lang->load('validation'); + + // Cycle through the rules and test for errors + foreach ($this->_rules as $field => $rules) + { + //Explode out the rules! + $ex = explode('|', $rules); + + // Is the field required? If not, if the field is blank we'll move on to the next text + if ( ! in_array('required', $ex)) + { + if ( ! isset($_POST[$field]) OR $_POST[$field] == '') + { + continue; + } + } + + /* + * Are we dealing with an "isset" rule? + * + * Before going further, we'll see if one of the rules + * is to check whether the item is set (typically this + * applies only to checkboxes). If so, we'll + * test for it here since there's not reason to go + * further + */ + if ( ! isset($_POST[$field])) + { + if (in_array('isset', $ex) OR in_array('required', $ex)) + { + if ( ! isset($this->messages['isset'])) + { + if (FALSE === ($line = $this->obj->lang->line('isset'))) + { + $line = 'The field was not set'; + } + } + else + { + $line = $this->_error_messages['isset']; + } + + $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $this->_error_array[] = sprintf($line, $field); + } + + continue; + } + + /* + * Set the current field + * + * The various prepping functions need to know the + * current field name so they can do this: + * + * $_POST[$this->_current_field] == 'bla bla'; + */ + $this->_current_field = $field; + + // Cycle through the rules! + foreach ($ex As $rule) + { + + // Is the rule a callback? + $callback = FALSE; + if (substr($rule, 0, 9) == 'callback_') + { + $rule = substr($rule, 9); + $callback = TRUE; + } + + // Strip the parameter (if exists) from the rule + // Rules can contain a parameter: max_length[5] + $param = FALSE; + if (preg_match("/.*?(\[.*?\]).*/", $rule, $match)) + { + $param = substr(substr($match['1'], 1), 0, -1); + $rule = str_replace($match['1'], '', $rule); + } + + // Call the function that corresponds to the rule + if ($callback === TRUE) + { + if ( ! method_exists($this->obj, $rule)) + { + continue; + } + + $result = $this->obj->$rule($_POST[$field], $param); + } + else + { + if ( ! method_exists($this, $rule)) + { + /* + * Run the native PHP function if called for + * + * If our own wrapper function doesn't exist we see + * if a native PHP function does. Users can use + * any native PHP function call that has one param. + */ + if (function_exists($rule)) + { + $_POST[$field] = $rule($_POST[$field]); + $this->$field = $_POST[$field]; + } + + continue; + } + + $result = $this->$rule($_POST[$field], $param); + } + + // Did the rule test negatively? If so, grab the error. + if ($result === FALSE) + { + if ( ! isset($this->_error_messages[$rule])) + { + if (FALSE === ($line = $this->obj->lang->line($rule))) + { + $line = 'Unable to access an error message corresponding to your field name.'; + } + } + else + { + $line = $this->_error_messages[$rule];; + } + + // Build the error message + $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param]; + $message = sprintf($line, $mfield, $mparam); + + // Set the error variable. Example: $this->username_error + $error = $field.'_error'; + $this->$error = $this->_error_prefix.$message.$this->_error_suffix; + + // Add the error to the error array + $this->_error_array[] = $message; + continue 2; + } + } + } + + $total_errors = count($this->_error_array); + + /* + * Recompile the class variables + * + * If any prepping functions were called the $_POST data + * might now be different then the corresponding class + * variables so we'll set them anew. + */ + if ($total_errors > 0) + { + $this->_safe_form_data = TRUE; + } + + $this->set_fields(); + + // Did we end up with any errors? + if ($total_errors == 0) + { + return TRUE; + } + + // Generate the error string + foreach ($this->_error_array as $val) + { + $this->error_string .= $this->_error_prefix.$val.$this->_error_suffix."\n"; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Required + * + * @access public + * @param string + * @return bool + */ + function required($str) + { + if ( ! is_array($str)) + { + return (trim($str) == '') ? FALSE : TRUE; + } + else + { + return ( ! empty($str)); + } + } + + // -------------------------------------------------------------------- + + /** + * Match one field to another + * + * @access public + * @param string + * @return bool + */ + function matches($str, $field) + { + if ( ! isset($_POST[$field])) + { + return FALSE; + } + + return ($str !== $_POST[$field]) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Minimum Length + * + * @access public + * @param string + * @return bool + */ + function min_length($str, $val) + { + if ( ! ctype_digit($val)) + { + return FALSE; + } + + return (strlen($str) < $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Max Length + * + * @access public + * @param string + * @return bool + */ + function max_length($str, $val) + { + if ( ! ctype_digit($val)) + { + return FALSE; + } + + return (strlen($str) > $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Exact Length + * + * @access public + * @param string + * @return bool + */ + function exact_length($str, $val) + { + if ( ! ctype_digit($val)) + { + return FALSE; + } + + return (strlen($str) != $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Valid Email + * + * @access public + * @param string + * @return bool + */ + function valid_email($str) + { + return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha + * + * @access public + * @param string + * @return bool + */ + function alpha($str) + { + return ( ! preg_match("/^([-a-z])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric + * + * @access public + * @param string + * @return bool + */ + function alpha_numeric($str) + { + return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric with underscores and dashes + * + * @access public + * @param string + * @return bool + */ + function alpha_dash($str) + { + return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Numeric + * + * @access public + * @param string + * @return bool + */ + function numeric($str) + { + return ( ! ctype_digit($str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set Select + * + * Enables pull-down lists to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_select($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' selected="selected"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Radio + * + * Enables radio buttons to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_radio($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' checked="checked"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Checkbox + * + * Enables checkboxes to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_checkbox($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' checked="checked"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Prep data for form + * + * This function allows HTML to be safely shown in a form. + * Special characters are converted. + * + * @access public + * @param string + * @return string + */ + function prep_for_form($str = '') + { + if ($this->_safe_form_data == FALSE OR $str == '') + { + return $str; + } + + return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($str)); + } + + // -------------------------------------------------------------------- + + /** + * Prep URL + * + * @access public + * @param string + * @return string + */ + function prep_url($str = '') + { + if ($str == 'http://' OR $str == '') + { + $_POST[$this->_current_field] = ''; + return; + } + + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + { + $str = 'http://'.$str; + } + + $_POST[$this->_current_field] = $str; + } + + // -------------------------------------------------------------------- + + /** + * Strip Image Tags + * + * @access public + * @param string + * @return string + */ + function strip_image_tags($str) + { + $_POST[$this->_current_field] = $this->input->strip_image_tags($str); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * @access public + * @param string + * @return string + */ + function xss_clean($str) + { + $_POST[$this->_current_field] = $this->obj->input->xss_clean($str); + } + + // -------------------------------------------------------------------- + + /** + * Convert PHP tags to entities + * + * @access public + * @param string + * @return string + */ + function encode_php_tags($str) + { + $_POST[$this->_current_field] = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + } + +} +// END Validation Class +?> \ No newline at end of file diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php new file mode 100644 index 00000000..9eeb46a1 --- /dev/null +++ b/system/libraries/Xmlrpc.php @@ -0,0 +1,1409 @@ +xmlrpcName = $this->xmlrpcName; + $this->xmlrpc_backslash = chr(92).chr(92); + + // Types for info sent back and forth + $this->xmlrpcTypes = array( + $this->xmlrpcI4 => '1', + $this->xmlrpcInt => '1', + $this->xmlrpcBoolean => '1', + $this->xmlrpcString => '1', + $this->xmlrpcDouble => '1', + $this->xmlrpcDateTime => '1', + $this->xmlrpcBase64 => '1', + $this->xmlrpcArray => '2', + $this->xmlrpcStruct => '3' + ); + + // Array of Valid Parents for Various XML-RPC elements + $this->valid_parents = array('BOOLEAN' => array('VALUE'), + 'I4' => array('VALUE'), + 'INT' => array('VALUE'), + 'STRING' => array('VALUE'), + 'DOUBLE' => array('VALUE'), + 'DATETIME.ISO8601' => array('VALUE'), + 'BASE64' => array('VALUE'), + 'ARRAY' => array('VALUE'), + 'STRUCT' => array('VALUE'), + 'PARAM' => array('PARAMS'), + 'METHODNAME' => array('METHODCALL'), + 'PARAMS' => array('METHODCALL', 'METHODRESPONSE'), + 'MEMBER' => array('STRUCT'), + 'NAME' => array('MEMBER'), + 'DATA' => array('ARRAY'), + 'FAULT' => array('METHODRESPONSE'), + 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT') + ); + + + // XML-RPC Responses + $this->xmlrpcerr['unknown_method'] = '1'; + $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; + $this->xmlrpcerr['invalid_return'] = '2'; + $this->xmlrpcstr['invalid_return'] = 'The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; + $this->xmlrpcerr['incorrect_params'] = '3'; + $this->xmlrpcstr['incorrect_params'] = 'Incorrect parameters were passed to method'; + $this->xmlrpcerr['introspect_unknown'] = '4'; + $this->xmlrpcstr['introspect_unknown'] = "Cannot inspect signature for request: method unknown"; + $this->xmlrpcerr['http_error'] = '5'; + $this->xmlrpcstr['http_error'] = "Did not receive a '200 OK' response from remote server."; + $this->xmlrpcerr['no_data'] = '6'; + $this->xmlrpcstr['no_data'] ='No data received from server.'; + + $this->initialize($config); + + log_message('debug', "XML-RPC Class Initialized"); + } + + + //------------------------------------- + // Initialize Prefs + //------------------------------------- + + function initialize($config = array()) + { + if (sizeof($config) > 0) + { + foreach ($config as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + } + // END + + //------------------------------------- + // Take URL and parse it + //------------------------------------- + + function server($url, $port=80) + { + if (substr($url, 0, 4) != "http") + { + $url = "http://".$url; + } + + $parts = parse_url($url); + + $path = (!isset($parts['path'])) ? '/' : $parts['path']; + + if (isset($parts['query']) && $parts['query'] != '') + { + $path .= '?'.$parts['query']; + } + + $this->client = new XML_RPC_Client($path, $parts['host'], $port); + } + // END + + //------------------------------------- + // Set Timeout + //------------------------------------- + + function timeout($seconds=5) + { + if ( ! is_null($this->client) && is_int($seconds)) + { + $this->client->timeout = $seconds; + } + } + // END + + //------------------------------------- + // Set Methods + //------------------------------------- + + function method($function) + { + $this->method = $function; + } + // END + + //------------------------------------- + // Take Array of Data and Create Objects + //------------------------------------- + + function request($incoming) + { + if ( ! is_array($incoming)) + { + // Send Error + } + + foreach($incoming as $key => $value) + { + $this->data[$key] = $this->values_parsing($value); + } + } + // END + + + //------------------------------------- + // Set Debug + //------------------------------------- + + function set_debug($flag = TRUE) + { + $this->debug = ($flag == TRUE) ? TRUE : FALSE; + } + + //------------------------------------- + // Values Parsing + //------------------------------------- + + function values_parsing($value, $return = FALSE) + { + if (is_array($value) && isset($value['0'])) + { + if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])])) + { + $temp = new XML_RPC_Values($value['0'], 'string'); + } + elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array')) + { + while (list($k) = each($value['0'])) + { + $value['0'][$k] = $this->values_parsing($value['0'][$k], TRUE); + } + + $temp = new XML_RPC_Values($value['0'], $value['1']); + } + else + { + $temp = new XML_RPC_Values($value['0'], $value['1']); + } + } + else + { + $temp = new XML_RPC_Values($value, 'string'); + } + + return $temp; + } + // END + + + //------------------------------------- + // Sends XML-RPC Request + //------------------------------------- + + function send_request() + { + $this->message = new XML_RPC_Message($this->method,$this->data); + $this->message->debug = $this->debug; + + if ( ! $this->result = $this->client->send($this->message)) + { + $this->error = $this->result->errstr; + return FALSE; + } + elseif( ! is_object($this->result->val)) + { + $this->error = $this->result->errstr; + return FALSE; + } + + $this->response = $this->result->decode(); + + return TRUE; + } + // END + + //------------------------------------- + // Returns Error + //------------------------------------- + + function display_error() + { + return $this->error; + } + // END + + //------------------------------------- + // Returns Remote Server Response + //------------------------------------- + + function display_response() + { + return $this->response; + } + // END + + //------------------------------------- + // Sends an Error Message for Server Request + //------------------------------------- + + function send_error_message($number, $message) + { + return new XML_RPC_Response('0',$number, $message); + } + // END + + + //------------------------------------- + // Send Response for Server Request + //------------------------------------- + + function send_response($response) + { + // $response should be array of values, which will be parsed + // based on their data and type into a valid group of XML-RPC values + + $response = $this->values_parsing($response); + + return new XML_RPC_Response($response); + } + // END + +} // END XML_RPC Class + + + +/** + * XML-RPC Client class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Client extends CI_XML_RPC +{ + var $path = ''; + var $server = ''; + var $port = 80; + var $errno = ''; + var $errstring = ''; + var $timeout = 5; + var $no_multicall = false; + + function XML_RPC_Client($path, $server, $port=80) + { + parent::CI_XML_RPC(); + + $this->port = $port; + $this->server = $server; + $this->path = $path; + } + + function send($msg) + { + if (is_array($msg)) + { + // Multi-call disabled + $r = new XML_RPC_Response(0, $this->xmlrpcerr['multicall_recursion'],$this->xmlrpcstr['multicall_recursion']); + return $r; + } + + return $this->sendPayload($msg); + } + + function sendPayload($msg) + { + $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout); + + if (! is_resource($fp)) + { + error_log($this->xmlrpcstr['http_error']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']); + return $r; + } + + if(empty($msg->payload)) + { + // $msg = XML_RPC_Messages + $msg->createPayload(); + } + + $r = "\r\n"; + $op = "POST {$this->path} HTTP/1.0$r"; + $op .= "Host: {$this->server}$r"; + $op .= "Content-Type: text/xml$r"; + $op .= "User-Agent: {$this->xmlrpcName}$r"; + $op .= "Content-Length: ".strlen($msg->payload). "$r$r"; + $op .= $msg->payload; + + + if (!fputs($fp, $op, strlen($op))) + { + error_log($this->xmlrpcstr['http_error']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']); + return $r; + } + $resp = $msg->parseResponse($fp); + fclose($fp); + return $resp; + } + +} // end class XML_RPC_Client + + +/** + * XML-RPC Response class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Response +{ + var $val = 0; + var $errno = 0; + var $errstr = ''; + var $headers = array(); + + function XML_RPC_Response($val, $code = 0, $fstr = '') + { + if ($code != 0) + { + // error + $this->errno = $code; + $this->errstr = htmlentities($fstr); + } + else if (!is_object($val)) + { + // programmer error, not an object + error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); + $this->val = new XML_RPC_Values(); + } + else + { + $this->val = $val; + } + } + + function faultCode() + { + return $this->errno; + } + + function faultString() + { + return $this->errstr; + } + + function value() + { + return $this->val; + } + + function prepare_response() + { + $result = "\n"; + if ($this->errno) + { + $result .= ' + + + + faultCode + ' . $this->errno . ' + + + faultString + ' . $this->errstr . ' + + + +'; + } + else + { + $result .= "\n\n" . + $this->val->serialize_class() . + "\n"; + } + $result .= "\n"; + return $result; + } + + function decode($array=FALSE) + { + $obj =& get_instance(); + + if ($array !== FALSE && is_array($array)) + { + while (list($key) = each($array)) + { + if (is_array($array[$key])) + { + $array[$key] = $this->decode($array[$key]); + } + else + { + $array[$key] = $obj->input->xss_clean($array[$key]); + } + } + + $result = $array; + } + else + { + $result = $this->xmlrpc_decoder($this->val); + + if (is_array($result)) + { + $result = $this->decode($result); + } + else + { + $result = $obj->input->xss_clean($result); + } + } + + return $result; + } + + + + //------------------------------------- + // XML-RPC Object to PHP Types + //------------------------------------- + + function xmlrpc_decoder($xmlrpc_val) + { + $kind = $xmlrpc_val->kindOf(); + + if($kind == 'scalar') + { + return $xmlrpc_val->scalarval(); + } + elseif($kind == 'array') + { + reset($xmlrpc_val->me); + list($a,$b) = each($xmlrpc_val->me); + $size = sizeof($b); + + $arr = array(); + + for($i = 0; $i < $size; $i++) + { + $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]); + } + return $arr; + } + elseif($kind == 'struct') + { + reset($xmlrpc_val->me['struct']); + $arr = array(); + + while(list($key,$value) = each($xmlrpc_val->me['struct'])) + { + $arr[$key] = $this->xmlrpc_decoder($value); + } + return $arr; + } + } + + + //------------------------------------- + // ISO-8601 time to server or UTC time + //------------------------------------- + + function iso8601_decode($time, $utc=0) + { + // return a timet in the localtime, or UTC + $t = 0; + if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})", $time, $regs)) + { + if ($utc == 1) + $t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + else + $t = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + } + return $t; + } + +} // End Response Class + + + +/** + * XML-RPC Message class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Message extends CI_XML_RPC +{ + var $payload; + var $method_name; + var $params = array(); + var $xh = array(); + + function XML_RPC_Message($method, $pars=0) + { + parent::CI_XML_RPC(); + + $this->method_name = $method; + if (is_array($pars) && sizeof($pars) > 0) + { + for($i=0; $iparams[] = $pars[$i]; + } + } + } + + //------------------------------------- + // Create Payload to Send + //------------------------------------- + + function createPayload() + { + $this->payload = "\r\n\r\n"; + $this->payload .= '' . $this->method_name . "\r\n"; + $this->payload .= "\r\n"; + + for($i=0; $iparams); $i++) + { + // $p = XML_RPC_Values + $p = $this->params[$i]; + $this->payload .= "\r\n".$p->serialize_class()."\r\n"; + } + + $this->payload .= "\r\n\r\n"; + } + + //------------------------------------- + // Parse External XML-RPC Server's Response + //------------------------------------- + + function parseResponse($fp) + { + $data = ''; + + while($datum = fread($fp, 4096)) + { + $data .= $datum; + } + + //------------------------------------- + // DISPLAY HTTP CONTENT for DEBUGGING + //------------------------------------- + + if ($this->debug === TRUE) + { + echo "
";
+			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
+			echo "
"; + } + + //------------------------------------- + // Check for data + //------------------------------------- + + if($data == "") + { + error_log($this->xmlrpcstr['no_data']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']); + return $r; + } + + + //------------------------------------- + // Check for HTTP 200 Response + //------------------------------------- + + if(ereg("^HTTP",$data) && !ereg("^HTTP/[0-9\.]+ 200 ", $data)) + { + $errstr= substr($data, 0, strpos($data, "\n")-1); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')'); + return $r; + } + + //------------------------------------- + // Create and Set Up XML Parser + //------------------------------------- + + $parser = xml_parser_create($this->xmlrpc_defencoding); + + $this->xh[$parser] = array(); + $this->xh[$parser]['isf'] = 0; + $this->xh[$parser]['ac'] = ''; + $this->xh[$parser]['headers'] = array(); + $this->xh[$parser]['stack'] = array(); + $this->xh[$parser]['valuestack'] = array(); + $this->xh[$parser]['isf_reason'] = 0; + + xml_set_object($parser, $this); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_set_element_handler($parser, 'open_tag', 'closing_tag'); + xml_set_character_data_handler($parser, 'character_data'); + //xml_set_default_handler($parser, 'default_handler'); + + + //------------------------------------- + // GET HEADERS + //------------------------------------- + + $lines = explode("\r\n", $data); + while (($line = array_shift($lines))) + { + if (strlen($line) < 1) + { + break; + } + $this->xh[$parser]['headers'][] = $line; + } + $data = implode("\r\n", $lines); + + + //------------------------------------- + // PARSE XML DATA + //------------------------------------- + + if (!xml_parse($parser, $data, sizeof($data))) + { + $errstr = sprintf('XML error: %s at line %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser)); + //error_log($errstr); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); + xml_parser_free($parser); + return $r; + } + xml_parser_free($parser); + + // --------------------------------------- + // Got Ourselves Some Badness, It Seems + // --------------------------------------- + + if ($this->xh[$parser]['isf'] > 1) + { + if ($this->debug === TRUE) + { + echo "---Invalid Return---\n"; + echo $this->xh[$parser]['isf_reason']; + echo "---Invalid Return---\n\n"; + } + + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); + return $r; + } + elseif ( ! is_object($this->xh[$parser]['value'])) + { + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); + return $r; + } + + //------------------------------------- + // DISPLAY XML CONTENT for DEBUGGING + //------------------------------------- + + if ($this->debug === TRUE) + { + echo "
";
+			
+			if (count($this->xh[$parser]['headers'] > 0))
+			{
+				echo "---HEADERS---\n";
+				foreach ($this->xh[$parser]['headers'] as $header)
+				{
+					echo "$header\n";
+				}
+				echo "---END HEADERS---\n\n";
+			}
+			
+			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
+			
+			echo "---PARSED---\n" ;
+			var_dump($this->xh[$parser]['value']);
+			echo "\n---END PARSED---
"; + } + + //------------------------------------- + // SEND RESPONSE + //------------------------------------- + + $v = $this->xh[$parser]['value']; + + if ($this->xh[$parser]['isf']) + { + $errno_v = $v->me['struct']['faultCode']; + $errstr_v = $v->me['struct']['faultString']; + $errno = $errno_v->scalarval(); + + if ($errno == 0) + { + // FAULT returned, errno needs to reflect that + $errno = -1; + } + + $r = new XML_RPC_Response($v, $errno, $errstr_v->scalarval()); + } + else + { + $r = new XML_RPC_Response($v); + } + + $r->headers = $this->xh[$parser]['headers']; + return $r; + } + + // ------------------------------------ + // Begin Return Message Parsing section + // ------------------------------------ + + // quick explanation of components: + // ac - used to accumulate values + // isf - used to indicate a fault + // lv - used to indicate "looking for a value": implements + // the logic to allow values with no types to be strings + // params - used to store parameters in method calls + // method - used to store method name + // stack - array with parent tree of the xml element, + // used to validate the nesting of elements + + //------------------------------------- + // Start Element Handler + //------------------------------------- + + function open_tag($the_parser, $name, $attrs) + { + // If invalid nesting, then return + if ($this->xh[$the_parser]['isf'] > 1) return; + + // Evaluate and check for correct nesting of XML elements + + if (count($this->xh[$the_parser]['stack']) == 0) + { + if ($name != 'METHODRESPONSE' && $name != 'METHODCALL') + { + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = 'Top level XML-RPC element is missing'; + return; + } + } + else + { + // not top level element: see if parent is OK + if (!in_array($this->xh[$the_parser]['stack'][0], $this->valid_parents[$name])) + { + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "XML-RPC element $name cannot be child of ".$this->xh[$the_parser]['stack'][0]; + return; + } + } + + switch($name) + { + case 'STRUCT': + case 'ARRAY': + // Creates array for child elements + + $cur_val = array('value' => array(), + 'type' => $name); + + array_unshift($this->xh[$the_parser]['valuestack'], $cur_val); + break; + case 'METHODNAME': + case 'NAME': + $this->xh[$the_parser]['ac'] = ''; + break; + case 'FAULT': + $this->xh[$the_parser]['isf'] = 1; + break; + case 'PARAM': + $this->xh[$the_parser]['value'] = null; + break; + case 'VALUE': + $this->xh[$the_parser]['vt'] = 'value'; + $this->xh[$the_parser]['ac'] = ''; + $this->xh[$the_parser]['lv'] = 1; + break; + case 'I4': + case 'INT': + case 'STRING': + case 'BOOLEAN': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + if ($this->xh[$the_parser]['vt'] != 'value') + { + //two data elements inside a value: an error occurred! + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "'Twas a $name element following a ".$this->xh[$the_parser]['vt']." element inside a single value"; + return; + } + + $this->xh[$the_parser]['ac'] = ''; + break; + case 'MEMBER': + // Set name of to nothing to prevent errors later if no is found + $this->xh[$the_parser]['valuestack'][0]['name'] = ''; + + // Set NULL value to check to see if value passed for this param/member + $this->xh[$the_parser]['value'] = null; + break; + case 'DATA': + case 'METHODCALL': + case 'METHODRESPONSE': + case 'PARAMS': + // valid elements that add little to processing + break; + default: + /// An Invalid Element is Found, so we have trouble + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "Invalid XML-RPC element found: $name"; + break; + } + + // Add current element name to stack, to allow validation of nesting + array_unshift($this->xh[$the_parser]['stack'], $name); + + if ($name != 'VALUE') $this->xh[$the_parser]['lv'] = 0; + } + // END + + + //------------------------------------- + // End Element Handler + //------------------------------------- + + function closing_tag($the_parser, $name) + { + if ($this->xh[$the_parser]['isf'] > 1) return; + + // Remove current element from stack and set variable + // NOTE: If the XML validates, then we do not have to worry about + // the opening and closing of elements. Nesting is checked on the opening + // tag so we be safe there as well. + + $curr_elem = array_shift($this->xh[$the_parser]['stack']); + + switch($name) + { + case 'STRUCT': + case 'ARRAY': + $cur_val = array_shift($this->xh[$the_parser]['valuestack']); + $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values']; + $this->xh[$the_parser]['vt'] = strtolower($name); + break; + case 'NAME': + $this->xh[$the_parser]['valuestack'][0]['name'] = $this->xh[$the_parser]['ac']; + break; + case 'BOOLEAN': + case 'I4': + case 'INT': + case 'STRING': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + $this->xh[$the_parser]['vt'] = strtolower($name); + + if ($name == 'STRING') + { + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + } + elseif ($name=='DATETIME.ISO8601') + { + $this->xh[$the_parser]['vt'] = $this->xmlrpcDateTime; + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + } + elseif ($name=='BASE64') + { + $this->xh[$the_parser]['value'] = base64_decode($this->xh[$the_parser]['ac']); + } + elseif ($name=='BOOLEAN') + { + // Translated BOOLEAN values to TRUE AND FALSE + if ($this->xh[$the_parser]['ac'] == '1') + { + $this->xh[$the_parser]['value'] = TRUE; + } + else + { + $this->xh[$the_parser]['value'] = FALSE; + } + } + elseif ($name=='DOUBLE') + { + // we have a DOUBLE + // we must check that only 0123456789-. are characters here + if (!ereg("^[+-]?[eE0123456789 \\t\\.]+$", $this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; + } + else + { + $this->xh[$the_parser]['value'] = (double)$this->xh[$the_parser]['ac']; + } + } + else + { + // we have an I4/INT + // we must check that only 0123456789- are characters here + if (!ereg("^[+-]?[0123456789 \\t]+$", $this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; + } + else + { + $this->xh[$the_parser]['value'] = (int)$this->xh[$the_parser]['ac']; + } + } + $this->xh[$the_parser]['ac'] = ''; + $this->xh[$the_parser]['lv'] = 3; // indicate we've found a value + break; + case 'VALUE': + // This if() detects if no scalar was inside + if ($this->xh[$the_parser]['vt']=='value') + { + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + $this->xh[$the_parser]['vt'] = $this->xmlrpcString; + } + + // build the XML-RPC value out of the data received, and substitute it + $temp = new XML_RPC_Values($this->xh[$the_parser]['value'], $this->xh[$the_parser]['vt']); + + if (count($this->xh[$the_parser]['valuestack']) && $this->xh[$the_parser]['valuestack'][0]['type'] == 'ARRAY') + { + // Array + $this->xh[$the_parser]['valuestack'][0]['values'][] = $temp; + } + else + { + // Struct + $this->xh[$the_parser]['value'] = $temp; + } + break; + case 'MEMBER': + $this->xh[$the_parser]['ac']=''; + + // If value add to array in the stack for the last element built + if ($this->xh[$the_parser]['value']) + { + $this->xh[$the_parser]['valuestack'][0]['values'][$this->xh[$the_parser]['valuestack'][0]['name']] = $this->xh[$the_parser]['value']; + } + break; + case 'DATA': + $this->xh[$the_parser]['ac']=''; + break; + case 'PARAM': + if ($this->xh[$the_parser]['value']) + { + $this->xh[$the_parser]['params'][] = $this->xh[$the_parser]['value']; + } + break; + case 'METHODNAME': + $this->xh[$the_parser]['method'] = ereg_replace("^[\n\r\t ]+", '', $this->xh[$the_parser]['ac']); + break; + case 'PARAMS': + case 'FAULT': + case 'METHODCALL': + case 'METHORESPONSE': + // We're all good kids with nuthin' to do + break; + default: + // End of an Invalid Element. Taken care of during the opening tag though + break; + } + } + + //------------------------------------- + // Parses Character Data + //------------------------------------- + + function character_data($the_parser, $data) + { + if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already + + // If a value has not been found + if ($this->xh[$the_parser]['lv'] != 3) + { + if ($this->xh[$the_parser]['lv'] == 1) + { + $this->xh[$the_parser]['lv'] = 2; // Found a value + } + + if( ! @isset($this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['ac'] = ''; + } + + $this->xh[$the_parser]['ac'] .= $data; + } + } + + + function addParam($par) { $this->params[]=$par; } + + function output_parameters($array=FALSE) + { + $obj =& get_instance(); + + if ($array !== FALSE && is_array($array)) + { + while (list($key) = each($array)) + { + if (is_array($array[$key])) + { + $array[$key] = $this->output_parameters($array[$key]); + } + else + { + $array[$key] = $obj->input->xss_clean($array[$key]); + } + } + + $parameters = $array; + } + else + { + $parameters = array(); + + for ($i = 0; $i < sizeof($this->params); $i++) + { + $a_param = $this->decode_message($this->params[$i]); + + if (is_array($a_param)) + { + $parameters[] = $this->output_parameters($a_param); + } + else + { + $parameters[] = $obj->input->xss_clean($a_param); + } + } + } + + return $parameters; + } + + + function decode_message($param) + { + $kind = $param->kindOf(); + + if($kind == 'scalar') + { + return $param->scalarval(); + } + elseif($kind == 'array') + { + reset($param->me); + list($a,$b) = each($param->me); + + $arr = array(); + + for($i = 0; $i < sizeof($b); $i++) + { + $arr[] = $this->decode_message($param->me['array'][$i]); + } + + return $arr; + } + elseif($kind == 'struct') + { + reset($param->me['struct']); + + $arr = array(); + + while(list($key,$value) = each($param->me['struct'])) + { + $arr[$key] = $this->decode_message($value); + } + + return $arr; + } + } + +} // End XML_RPC_Messages class + + + +/** + * XML-RPC Values class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Values extends CI_XML_RPC +{ + var $me = array(); + var $mytype = 0; + + function XML_RPC_Values($val=-1, $type='') + { + parent::CI_XML_RPC(); + + if ($val != -1 || $type != '') + { + $type = $type == '' ? 'string' : $type; + + if ($this->xmlrpcTypes[$type] == 1) + { + $this->addScalar($val,$type); + } + elseif ($this->xmlrpcTypes[$type] == 2) + { + $this->addArray($val); + } + elseif ($this->xmlrpcTypes[$type] == 3) + { + $this->addStruct($val); + } + } + } + + function addScalar($val, $type='string') + { + $typeof = $this->xmlrpcTypes[$type]; + + if ($this->mytype==1) + { + echo 'XML_RPC_Values: scalar can have only one value
'; + return 0; + } + + if ($typeof != 1) + { + echo 'XML_RPC_Values: not a scalar type (${typeof})
'; + return 0; + } + + if ($type == $this->xmlrpcBoolean) + { + if (strcasecmp($val,'true')==0 || $val==1 || ($val==true && strcasecmp($val,'false'))) + { + $val = 1; + } + else + { + $val=0; + } + } + + if ($this->mytype == 2) + { + // adding to an array here + $ar = $this->me['array']; + $ar[] = new XML_RPC_Values($val, $type); + $this->me['array'] = $ar; + } + else + { + // a scalar, so set the value and remember we're scalar + $this->me[$type] = $val; + $this->mytype = $typeof; + } + return 1; + } + + function addArray($vals) + { + if ($this->mytype != 0) + { + echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
'; + return 0; + } + + $this->mytype = $this->xmlrpcTypes['array']; + $this->me['array'] = $vals; + return 1; + } + + function addStruct($vals) + { + if ($this->mytype != 0) + { + echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
'; + return 0; + } + $this->mytype = $this->xmlrpcTypes['struct']; + $this->me['struct'] = $vals; + return 1; + } + + function kindOf() + { + switch($this->mytype) + { + case 3: + return 'struct'; + break; + case 2: + return 'array'; + break; + case 1: + return 'scalar'; + break; + default: + return 'undef'; + } + } + + function serializedata($typ, $val) + { + $rs = ''; + + switch($this->xmlrpcTypes[$typ]) + { + case 3: + // struct + $rs .= "\n"; + reset($val); + while(list($key2, $val2) = each($val)) + { + $rs .= "\n{$key2}\n"; + $rs .= $this->serializeval($val2); + $rs .= "\n"; + } + $rs .= ''; + break; + case 2: + // array + $rs .= "\n\n"; + for($i=0; $i < sizeof($val); $i++) + { + $rs .= $this->serializeval($val[$i]); + } + $rs.="\n\n"; + break; + case 1: + // others + switch ($typ) + { + case $this->xmlrpcBase64: + $rs .= "<{$typ}>" . base64_encode($val) . "\n"; + break; + case $this->xmlrpcBoolean: + $rs .= "<{$typ}>" . ($val ? '1' : '0') . "\n"; + break; + case $this->xmlrpcString: + $rs .= "<{$typ}>" . htmlspecialchars($val). "\n"; + break; + default: + $rs .= "<{$typ}>{$val}\n"; + break; + } + default: + break; + } + return $rs; + } + + function serialize_class() + { + return $this->serializeval($this); + } + + function serializeval($o) + { + + $ar = $o->me; + reset($ar); + + list($typ, $val) = each($ar); + $rs = "\n".$this->serializedata($typ, $val)."\n"; + return $rs; + } + + function scalarval() + { + reset($this->me); + list($a,$b) = each($this->me); + return $b; + } + + + //------------------------------------- + // Encode time in ISO-8601 form. + //------------------------------------- + + // Useful for sending time in XML-RPC + + function iso8601_encode($time, $utc=0) + { + if ($utc == 1) + { + $t = strftime("%Y%m%dT%H:%M:%S", $time); + } + else + { + if (function_exists('gmstrftime')) + $t = gmstrftime("%Y%m%dT%H:%M:%S", $time); + else + $t = strftime("%Y%m%dT%H:%M:%S", $time - date('Z')); + } + return $t; + } + +} +// END XML_RPC_Values Class +?> \ No newline at end of file diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php new file mode 100644 index 00000000..eaec87a6 --- /dev/null +++ b/system/libraries/Xmlrpcs.php @@ -0,0 +1,492 @@ +set_system_methods(); + + if (isset($config['functions']) && is_array($config['functions'])) + { + $this->methods = $config['functions']; + } + + log_message('debug', "XML-RPC Server Class Initialized"); + } + + //------------------------------------- + // Initialize Prefs and Serve + //------------------------------------- + + function initialize($config=array()) + { + if (isset($config['functions']) && is_array($config['functions'])) + { + $this->methods = $config['functions']; + } + + if (isset($config['debug'])) + { + $this->debug = $config['debug']; + } + } + + //------------------------------------- + // Setting of System Methods + //------------------------------------- + + function set_system_methods () + { + $system_methods = array( + 'system.listMethods' => array( + 'function' => 'this.listMethods', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)), + 'docstring' => 'Returns an array of available methods on this server'), + 'system.methodHelp' => array( + 'function' => 'this.methodHelp', + 'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)), + 'docstring' => 'Returns a documentation string for the specified method'), + 'system.methodSignature' => array( + 'function' => 'this.methodSignature', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)), + 'docstring' => 'Returns an array describing the return type and required parameters of a method'), + 'system.multicall' => array( + 'function' => 'this.multicall', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)), + 'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details') + ); + } + + + //------------------------------------- + // Main Server Function + //------------------------------------- + + function serve() + { + $r = $this->parseRequest(); + $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; + $payload .= $this->debug_msg; + $payload .= $r->prepare_response(); + + header("Content-Type: text/xml"); + header("Content-Length: ".strlen($payload)); + echo $payload; + } + + //------------------------------------- + // Add Method to Class + //------------------------------------- + + function add_to_map($methodname,$function,$sig,$doc) + { + $this->methods[$methodname] = array( + 'function' => $function, + 'signature' => $sig, + 'docstring' => $doc + ); + } + + + //------------------------------------- + // Parse Server Request + //------------------------------------- + + function parseRequest($data='') + { + global $HTTP_RAW_POST_DATA; + + //------------------------------------- + // Get Data + //------------------------------------- + + if ($data == '') + { + $data = $HTTP_RAW_POST_DATA; + } + + + //------------------------------------- + // Set up XML Parser + //------------------------------------- + + $parser = xml_parser_create($this->xmlrpc_defencoding); + $parser_object = new XML_RPC_Message("filler"); + + $parser_object->xh[$parser] = array(); + $parser_object->xh[$parser]['isf'] = 0; + $parser_object->xh[$parser]['isf_reason'] = ''; + $parser_object->xh[$parser]['params'] = array(); + $parser_object->xh[$parser]['stack'] = array(); + $parser_object->xh[$parser]['valuestack'] = array(); + $parser_object->xh[$parser]['method'] = ''; + + xml_set_object($parser, $parser_object); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_set_element_handler($parser, 'open_tag', 'closing_tag'); + xml_set_character_data_handler($parser, 'character_data'); + //xml_set_default_handler($parser, 'default_handler'); + + + //------------------------------------- + // PARSE + PROCESS XML DATA + //------------------------------------- + + if ( ! xml_parse($parser, $data, 1)) + { + // return XML error as a faultCode + $r = new XML_RPC_Response(0, + $this->xmlrpcerrxml + xml_get_error_code($parser), + sprintf('XML error: %s at line %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser))); + xml_parser_free($parser); + } + elseif($parser_object->xh[$parser]['isf']) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['invalid_return'], + $this->xmlrpcstr['invalid_retrun']); + } + else + { + xml_parser_free($parser); + + $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); + $plist=''; + + for($i=0; $i < sizeof($parser_object->xh[$parser]['params']); $i++) + { + $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; + + $m->addParam($parser_object->xh[$parser]['params'][$i]); + } + + if ($this->debug === TRUE) + { + echo "
";
+				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
+				echo "
"; + } + + $r = $this->execute($m); + } + + //------------------------------------- + // SET DEBUGGING MESSAGE + //------------------------------------- + + if ($this->debug === TRUE) + { + $this->debug_msg = "\n"; + } + + return $r; + } + + //------------------------------------- + // Executes the Method + //------------------------------------- + + function execute($m) + { + $methName = $m->method_name; + + // Check to see if it is a system call + // If so, load the system_methods + $sysCall = ereg("^system\.", $methName); + $methods = $sysCall ? $this->system_methods : $this->methods; + + //------------------------------------- + // Check for Function + //------------------------------------- + + if (!isset($methods[$methName]['function'])) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + else + { + // See if we are calling function in an object + + $method_parts = explode(".",$methods[$methName]['function']); + $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? true : false; + + if ($objectCall && !is_callable(array($method_parts['0'],$method_parts['1']))) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + elseif (!$objectCall && !is_callable($methods[$methName]['function'])) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + } + + //------------------------------------- + // Checking Methods Signature + //------------------------------------- + + if (isset($methods[$methName]['signature'])) + { + $sig = $methods[$methName]['signature']; + for($i=0; $iparams)+1) + { + for($n=0; $n < sizeof($m->params); $n++) + { + $p = $m->params[$n]; + $pt = ($p->kindOf() == 'scalar') ? $p->scalartyp() : $p->kindOf(); + + if ($pt != $current_sig[$n+1]) + { + $pno = $n+1; + $wanted = $current_sig[$n+1]; + + return new XML_RPC_Response(0, + $this->xmlrpcerr['incorrect_params'], + $this->xmlrpcstr['incorrect_params'] . + ": Wanted {$wanted}, got {$pt} at param {$pno})"); + } + } + } + } + } + + //------------------------------------- + // Calls the Function + //------------------------------------- + + if ($objectCall) + { + if ($method_parts['1'] == "this") + { + return call_user_func(array($this, $method_parts['0']), $m); + } + else + { + $obj =& get_instance(); + return $obj->$method_parts['1']($m); + //$class = new $method_parts['0']; + //return $class->$method_parts['1']($m); + //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); + } + } + else + { + return call_user_func($methods[$methName]['function'], $m); + } + } + + + //------------------------------------- + // Server Function: List Methods + //------------------------------------- + + function listMethods($m) + { + $v = new XML_RPC_Values(); + $output = array(); + foreach($this->$methods as $key => $value) + { + $output[] = new XML_RPC_Values($key, 'string'); + } + + foreach($this->system_methods as $key => $value) + { + $output[]= new XML_RPC_Values($key, 'string'); + } + + $v->addArray($output); + return new XML_RPC_Response($v); + } + + //------------------------------------- + // Server Function: Return Signature for Method + //------------------------------------- + + function methodSignature($m) + { + $methName = $m->getParam(0); + $method_name = $methName->scalarval(); + + $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; + + if (isset($methods[$method_name])) + { + if ($methods[$method_name]['signature']) + { + $sigs = array(); + $signature = $methods[$method_name]['signature']; + + for($i=0; $i < sizeof($signature); $i++) + { + $cursig = array(); + $inSig = $signature[$i]; + for($j=0; $jxmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); + } + return $r; + } + + //------------------------------------- + // Server Function: Doc String for Method + //------------------------------------- + + function methodHelp($m) + { + $methName = $m->getParam(0); + $method_name = $methName->scalarval(); + + $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; + + if (isset($methods[$methName])) + { + $docstring = isset($methods[$method_name]['docstring']) ? $methods[$method_name]['docstring'] : ''; + $r = new XML_RPC_Response(new XML_RPC_Values($docstring, 'string')); + } + else + { + $r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); + } + return $r; + } + + //------------------------------------- + // Server Function: Multi-call + //------------------------------------- + + function multicall($m) + { + $calls = $m->getParam(0); + list($a,$b)=each($calls->me); + $result = array(); + + for ($i = 0; $i < sizeof($b); $i++) + { + $call = $calls->me['array'][$i]; + $result[$i] = $this->do_multicall($call); + } + + return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); + } + + + //------------------------------------- + // Multi-call Function: Error Handling + //------------------------------------- + + function multicall_error($err) + { + $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); + $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); + + $struct['faultCode'] = new XML_RPC_Values($code, 'int'); + $struct['faultString'] = new XML_RPC_Values($str, 'string'); + + return new XML_RPC_Values($struct, 'struct'); + } + + + //------------------------------------- + // Multi-call Function: Processes method + //------------------------------------- + + function do_multicall($call) + { + if ($call->kindOf() != 'struct') + return $this->multicall_error('notstruct'); + elseif (!$methName = $call->me['struct']['methodName']) + return $this->multicall_error('nomethod'); + + list($scalar_type,$scalar_value)=each($methName->me); + $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; + + if ($methName->kindOf() != 'scalar' || $scalar_type != 'string') + return $this->multicall_error('notstring'); + elseif ($scalar_value == 'system.multicall') + return $this->multicall_error('recursion'); + elseif (!$params = $call->me['struct']['params']) + return $this->multicall_error('noparams'); + elseif ($params->kindOf() != 'array') + return $this->multicall_error('notarray'); + + list($a,$b)=each($params->me); + $numParams = sizeof($b); + + $msg = new XML_RPC_Message($scalar_value); + for ($i = 0; $i < $numParams; $i++) + { + $msg->params[] = $params->me['array'][$i]; + } + + $result = $this->execute($msg); + + if ($result->faultCode() != 0) + { + return $this->multicall_error($result); + } + + return new XML_RPC_Values(array($result->value()), 'array'); + } + +} +// END XML_RPC_Server class +?> \ No newline at end of file diff --git a/system/libraries/index.html b/system/libraries/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/libraries/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/logs/index.html b/system/logs/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/logs/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php new file mode 100644 index 00000000..54944b82 --- /dev/null +++ b/system/plugins/captcha_pi.php @@ -0,0 +1,346 @@ +load->plugin('captcha'); + +Once loaded you can generate a captcha like this: + + $vals = array( + 'word' => 'Random word', + 'img_path' => './captcha/', + 'img_url' => 'http://www.your-site.com/captcha/', + 'font_path' => './system/texb.ttf', + 'img_width' => '150', + 'img_height' => 30, + 'expiration' => 7200 + ); + + $cap = create_captcha($vals); + echo $cap['image']; + + +NOTES: + + The captcha function requires the GD image library. + + Only the img_path and img_url are required. + + If a "word" is not supplied, the function will generate a random + ASCII string. You might put together your own word library that + you can draw randomly from. + + If you do not specify a path to a TRUE TYPE font, the native ugly GD + font will be used. + + The "captcha" folder must be writable (666, or 777) + + The "expiration" (in seconds) signifies how long an image will + remain in the captcha folder before it will be deleted. The default + is two hours. + +RETURNED DATA + +The create_captcha() function returns an associative array with this data: + + [array] + ( + 'image' => IMAGE TAG + 'time' => TIMESTAMP (in microtime) + 'word' => CAPTCHA WORD + ) + +The "image" is the actual image tag: + + +The "time" is the micro timestamp used as the image name without the file +extension. It will be a number like this: 1139612155.3422 + +The "word" is the word that appears in the captcha image, which if not +supplied to the function, will be a random string. + + +ADDING A DATABASE + +In order for the captcha function to prevent someone from posting, you will need +to add the information returned from create_captcha() function to your database. +Then, when the data from the form is submitted by the user you will need to verify +that the data exists in the database and has not expired. + +Here is a table prototype: + + CREATE TABLE captcha ( + captcha_id bigint(13) unsigned NOT NULL auto_increment, + captcha_time int(10) unsigned NOT NULL, + ip_address varchar(16) default '0' NOT NULL, + word varchar(20) NOT NULL, + PRIMARY KEY (captcha_id), + KEY (word) + ) + + +Here is an example of usage with a DB. + +On the page where the captcha will be shown you'll have something like this: + + $this->load->plugin('captcha'); + $vals = array( + 'img_path' => './captcha/', + 'img_url' => 'http://www.your-site.com/captcha/' + ); + + $cap = create_captcha($vals); + + $data = array( + 'captcha_id' => '', + 'captcha_time' => $cap['time'], + 'ip_address' => $this->input->ip_address(), + 'word' => $cap['word'] + ); + + $query = $this->db->insert_string('captcha', $data); + $this->db->query($query); + + echo 'Submit the word you see below:'; + echo $cap['image']; + echo ''; + + +Then, on the page that accepts the submission you'll have something like this: + + // First, delete old captchas + $expiration = time()-7200; // Two hour limit + $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); + + // Then see if a captcha exists: + $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; + $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); + $query = $this->db->query($sql, $binds); + $row = $query->row(); + + if ($row->count == 0) + { + echo "You must submit the word that appears in the image"; + } + +*/ + + + +/** +|========================================================== +| Create Captcha +|========================================================== +| +*/ +function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') +{ + $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); + + foreach ($defaults as $key => $val) + { + if ( ! is_array($data)) + { + if ( ! isset($$key) OR $$key == '') + { + $$key = $val; + } + } + else + { + $$key = ( ! isset($data[$key])) ? $val : $data[$key]; + } + } + + if ($img_path == '' OR $img_url == '') + { + return FALSE; + } + + if ( ! @is_dir($img_path)) + { + return FALSE; + } + + if ( ! is_writable($img_path)) + { + return FALSE; + } + + if ( ! extension_loaded('gd')) + { + return FALSE; + } + + // ----------------------------------- + // Remove old images + // ----------------------------------- + + list($usec, $sec) = explode(" ", microtime()); + $now = ((float)$usec + (float)$sec); + + $current_dir = @opendir($img_path); + + while($filename = @readdir($current_dir)) + { + if ($filename != "." and $filename != ".." and $filename != "index.html") + { + $name = str_replace(".jpg", "", $filename); + + if (($name + $expiration) < $now) + { + @unlink($img_path.$filename); + } + } + } + + @closedir($current_dir); + + // ----------------------------------- + // Do we have a "word" yet? + // ----------------------------------- + + if ($word == '') + { + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + $str = ''; + for ($i = 0; $i < 8; $i++) + { + $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); + } + + $word = $str; + } + + // ----------------------------------- + // Determine angle and position + // ----------------------------------- + + $length = strlen($word); + $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; + $x_axis = rand(6, (360/$length)-16); + $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); + + // ----------------------------------- + // Create image + // ----------------------------------- + + $im = ImageCreate($img_width, $img_height); + + // ----------------------------------- + // Assign colors + // ----------------------------------- + + $bg_color = ImageColorAllocate($im, 255, 255, 255); + $border_color = ImageColorAllocate($im, 153, 102, 102); + $text_color = ImageColorAllocate($im, 204, 153, 153); + $grid_color = imagecolorallocate($im, 255, 182, 182); + $shadow_color = imagecolorallocate($im, 255, 240, 240); + + // ----------------------------------- + // Create the rectangle + // ----------------------------------- + + ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); + + // ----------------------------------- + // Create the spiral pattern + // ----------------------------------- + + $theta = 1; + $thetac = 7; + $radius = 16; + $circles = 20; + $points = 32; + + for ($i = 0; $i < ($circles * $points) - 1; $i++) + { + $theta = $theta + $thetac; + $rad = $radius * ($i / $points ); + $x = ($rad * cos($theta)) + $x_axis; + $y = ($rad * sin($theta)) + $y_axis; + $theta = $theta + $thetac; + $rad1 = $radius * (($i + 1) / $points); + $x1 = ($rad1 * cos($theta)) + $x_axis; + $y1 = ($rad1 * sin($theta )) + $y_axis; + imageline($im, $x, $y, $x1, $y1, $grid_color); + $theta = $theta - $thetac; + } + + // ----------------------------------- + // Write the text + // ----------------------------------- + + $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; + + if ($use_font == FALSE) + { + $font_size = 5; + $x = rand(0, $img_width/($length/3)); + $y = 0; + } + else + { + $font_size = 16; + $x = rand(0, $img_width/($length/1.5)); + $y = $font_size+2; + } + + for ($i = 0; $i < strlen($word); $i++) + { + if ($use_font == FALSE) + { + $y = rand(0 , $img_height/2); + imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); + $x += ($font_size*2); + } + else + { + $y = rand($img_height/2, $img_height-3); + imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); + $x += $font_size; + } + } + + + // ----------------------------------- + // Create the border + // ----------------------------------- + + imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); + + // ----------------------------------- + // Generate the image + // ----------------------------------- + + $img_name = $now.'.jpg'; + + ImageJPEG($im, $img_path.$img_name); + + $img = "\""; + + ImageDestroy($im); + + return array('word' => $word, 'time' => $now, 'image' => $img); +} + +?> \ No newline at end of file diff --git a/system/plugins/index.html b/system/plugins/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/plugins/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php new file mode 100644 index 00000000..16c3f413 --- /dev/null +++ b/system/plugins/js_calendar_pi.php @@ -0,0 +1,604 @@ +load->plugin('js_calendar'); + +Once loaded you'll add the calendar script to the of your page like this: + + + +The above function will be passed the name of your form. + +Then to show the actual calendar you'll do this: + + +

+ +

Today

+
+ + +Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, +and the third tells the calendar whether to highlight the current day or not. + +Lastly, you'll need some CSS for your calendar: + +.calendar { + border: 1px #6975A3 solid; + background-color: transparent; +} +.calheading { + background-color: #7C8BC0; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; +} +.calnavleft { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + padding: 4px; + cursor: pointer; +} +.calnavright { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + text-align: right; + padding: 4px; + cursor: pointer; +} +.caldayheading { + background-color: #000; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + text-align: center; + padding: 6px 2px 6px 2px; +} +.caldaycells{ + color: #000; + background-color: #D1D7E6; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #E0E5F1 solid; + cursor: pointer; +} +.caldaycellhover{ + color: #fff; + background-color: #B3BCD4; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #B3BCD4 solid; + cursor: pointer; +} +.caldayselected{ + background-color: #737FAC; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; + border: 1px #566188 solid; + padding: 3px; + cursor: pointer; +} +.calblanktop { + background-color: #fff; + padding: 4px; +} +.calblankbot { + background-color: #fff; + padding: 4px; +} + + +*/ + +function js_calendar_script($form_name = 'entryform') +{ + +ob_start(); +?> + + + var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); + document.write('.$field_id.'.write()); + '; +} + +?> \ No newline at end of file diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php new file mode 100644 index 00000000..4b6ebeed --- /dev/null +++ b/system/scaffolding/Scaffolding.php @@ -0,0 +1,285 @@ +ci_is_loaded as $val) + { + $this->$val =& $obj->$val; + } + + /** + * Set the current table name + * This is done when initializing scaffolding: + * $this->_ci_init_scaffolding('table_name') + * + */ + $this->current_table = $db_table; + + /** + * Set the path to the "view" files + * We'll manually override the "view" path so that + * the load->view function knows where to look. + */ + $this->load->_ci_set_view_path(BASEPATH.'scaffolding/views/'); + + // Set the base URL + $this->base_url = $this->config->site_url().'/'.$this->uri->segment(1).$this->uri->slash_segment(2, 'both'); + $this->base_uri = $this->uri->segment(1).$this->uri->slash_segment(2, 'leading'); + + // Set a few globals + $data = array( + 'image_url' => $this->config->system_url().'scaffolding/images/', + 'base_uri' => $this->base_uri, + 'base_url' => $this->base_url, + 'title' => $this->current_table + ); + + $this->load->vars($data); + + // Load the language file and create variables + $this->lang = $this->load->language('scaffolding', '', TRUE); + $this->load->vars($this->lang); + + // Load the helper files we plan to use + $this->load->helper(array('url', 'form')); + + + log_message('debug', 'Scaffolding Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * "Add" Page + * + * Shows a form representing the currently selected DB + * so that data can be inserted + * + * @access public + * @return string the HTML "add" page + */ + function add() + { + $data = array( + 'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'], + 'fields' => $this->db->field_data($this->current_table), + 'action' => $this->base_uri.'/insert' + ); + + $this->load->view('add', $data); + } + + // -------------------------------------------------------------------- + + /** + * Insert the data + * + * @access public + * @return void redirects to the view page + */ + function insert() + { + if ($this->db->insert($this->current_table, $_POST) === FALSE) + { + $this->add(); + } + else + { + redirect($this->base_uri.'/view/'); + } + } + + // -------------------------------------------------------------------- + + /** + * "View" Page + * + * Shows a table containing the data in the currently + * selected DB + * + * @access public + * @return string the HTML "view" page + */ + function view() + { + // Fetch the total number of DB rows + $total_rows = $this->db->count_all($this->current_table); + + if ($total_rows < 1) + { + return $this->load->view('no_data'); + } + + // Set the query limit/offset + $per_page = 20; + $offset = $this->uri->segment(4, 0); + + // Run the query + $query = $this->db->get($this->current_table, $per_page, $offset); + + // Now let's get the field names + $fields = $this->db->field_names($this->current_table); + + // We assume that the column in the first position is the primary field. + $primary = current($fields); + + // Pagination! + $this->pagination->initialize( + array( + 'base_url' => $this->base_url.'/view', + 'total_rows' => $total_rows, + 'per_page' => $per_page, + 'uri_segment' => 4, + 'full_tag_open' => '

', + 'full_tag_close' => '

' + ) + ); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'], + 'query' => $query, + 'fields' => $fields, + 'primary' => $primary, + 'paginate' => $this->pagination->create_links() + ); + + $this->load->view('view', $data); + } + + // -------------------------------------------------------------------- + + /** + * "Edit" Page + * + * Shows a form representing the currently selected DB + * so that data can be edited + * + * @access public + * @return string the HTML "edit" page + */ + function edit() + { + if (FALSE === ($id = $this->uri->segment(4))) + { + return $this->view(); + } + + // Fetch the primary field name + $primary = $this->db->primary($this->current_table); + + // Run the query + $query = $this->db->getwhere($this->current_table, array($primary => $id)); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], + 'fields' => $query->field_data(), + 'query' => $query->row(), + 'action' => $this->base_uri.'/update/'.$this->uri->segment(4) + ); + + $this->load->view('edit', $data); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * @access public + * @return void redirects to the view page + */ + function update() + { + // Fetch the primary key + $primary = $this->db->primary($this->current_table); + + // Now do the query + $this->db->update($this->current_table, $_POST, array($primary => $this->uri->segment(4))); + + redirect($this->base_uri.'/view/'); + } + + // -------------------------------------------------------------------- + + /** + * Delete Confirmation + * + * @access public + * @return string the HTML "delete confirm" page + */ + function delete() + { + if ( ! isset($this->lang['scaff_del_confirm'])) + { + $message = 'Are you sure you want to delete the following row: '.$this->uri->segment(4); + } + else + { + $message = $this->lang['scaff_del_confirm'].' '.$this->uri->segment(4); + } + + $data = array( + 'title' => ( ! isset($this->lang['scaff_delete'])) ? 'Delete Data' : $this->lang['scaff_delete'], + 'message' => $message, + 'no' => anchor(array($this->base_uri, 'view'), ( ! isset($this->lang['scaff_no'])) ? 'No' : $this->lang['scaff_no']), + 'yes' => anchor(array($this->base_uri, 'do_delete', $this->uri->segment(4)), ( ! isset($this->lang['scaff_yes'])) ? 'Yes' : $this->lang['scaff_yes']) + ); + + $this->load->view('delete', $data); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * @access public + * @return void redirects to the view page + */ + function do_delete() + { + // Fetch the primary key + $primary = $this->db->primary($this->current_table); + + // Now do the query + $this->db->where($primary, $this->uri->segment(4)); + $this->db->delete($this->current_table); + + header("Refresh:0;url=".site_url(array($this->base_uri, 'view'))); + exit; + } + +} +?> \ No newline at end of file diff --git a/system/scaffolding/images/background.jpg b/system/scaffolding/images/background.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d5bdcea1d5b12024146ac223011123defe25635 GIT binary patch literal 410 zcmex=C5UDGKfoZ!!BEV=#mp$kz$D1XEXer(2ty*! z+02YUS0VrtD?1k>st{080OUV@genGxz>7?5j0-mkiCh&6o5sHUdIYDWAcnU8w-|VU z<}(R03o_UTDGVclFtr^J1GVtmh-M!uS+`)H81DN0} iwv|qaLOQIREgl>6ml<_DjNt59WD&;F0MaS{|0VzeUqk@_ literal 0 HcmV?d00001 diff --git a/system/scaffolding/images/index.html b/system/scaffolding/images/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/scaffolding/images/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/scaffolding/images/logo.jpg b/system/scaffolding/images/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d6cc9a76db0b1174c74379f7f20df290e4ec7f86 GIT binary patch literal 4518 zcma)9WmFX07M)>+&Osyu1!+bG1Y~Fsq@{)$x`vV%6c|cDItQdfL_oS7kdTsYK{};D z>5u^l<@vq!zVE%CZ{Ky#y=(7v?mfTG+UI)adKo~YuB@gE01^NIwtp7jdKUmu#Gssg z0YCs4@D~ZV-Um?0+q&7<0c_j;Fu?11KqvtC|AXMa0R4miq!R#vf7CzwAL0MKT(5I}$+2=KZK5cQ{QAQ%J${wef7ASEIuAtL}2{vrRu-}JvvAOVO503ad& zf`A|rQV`)^>K_hF_$LPdp(VX>SBOsjSpqx9O?onfbx$moAmlEAkUTAW(DfXE0`y0OfFJ-lz`_@m9L%!k6!HVu?}T-kg_?4(jqSP0CRK~< zTd;+%>Q{=j!gP4X%jv6Udi`lJUS>ro&s;SBt}etDR=l6!q-bJjx13$V#fGPw7n69C z!Z}>@EV4+eU2MF3&%MPAvc7b4GwV~Ii5jbROWHk~*Q;*mG~R|#+anve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x?hgnP z*Mwh<{IpUkkaJ#GM44bX^mT_Kwcou{+6J?R_Zh&|xw)?a6TLLsvZLodi+R%0)Q;cc z7x+G2n$}8vhER2&#B?%{>$aLw<{3CM0c+dfRQ_$((n1Sv*}M4~>iw`q-qLs5MRV!N zMPdvhLAMsY%OoH4hp(uQpE!7ZzvQjdx6P01op)p+lQJ!E5fDU#Ji+yvST1lv(N?Zl z>!WyO3KylR7~rrW~gJrgySkX9JoBQf5>dM)1S5UVbr6&cRgn{rZ$;4lkVeL zHN$0!`3)#o+5E!JJ2S3IbMt;1{t6xvaph-DX*%8c824Vnm)XqOruH$!BQknz$-%~49Om^tb>0(;b{MY&YYe4<}vR>s& zYP?w4;Zl7~)xo)J05Or=(~IoU3z=)cmDlr&tCmlKmgBq2R`m(-V}eJiKYsh(VG$iX zAj@8}?BbiFgq%gJI#zX9($m#Gw%WbYJZyQJJ$rV7mmR4hnDV(0jLqo{y9N-_brJPu z(`d*1p3bF}|2aImd-eF2{O(I1ujj2tm+0)W)B_wJ>=U)ujnSV0S+Z4ElE3%m_X-XJ fMjns;GH;Ptst=l@%I0apKb7 + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/scaffolding/views/add.php b/system/scaffolding/views/add.php new file mode 100644 index 00000000..a65e3d74 --- /dev/null +++ b/system/scaffolding/views/add.php @@ -0,0 +1,30 @@ +load->view('header'); ?> + +

+ + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
name; echo ' '.$field->default; ?>
+ + + + + +load->view('footer'); ?> diff --git a/system/scaffolding/views/delete.php b/system/scaffolding/views/delete.php new file mode 100644 index 00000000..75a5c21b --- /dev/null +++ b/system/scaffolding/views/delete.php @@ -0,0 +1,7 @@ +load->view('header'); ?> + +

+ +

  |   + +load->view('footer'); ?> diff --git a/system/scaffolding/views/edit.php b/system/scaffolding/views/edit.php new file mode 100644 index 00000000..a7d65c61 --- /dev/null +++ b/system/scaffolding/views/edit.php @@ -0,0 +1,31 @@ +load->view('header'); ?> + + +

+ + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
name; ?>
+ + + + + +load->view('footer'); ?> \ No newline at end of file diff --git a/system/scaffolding/views/footer.php b/system/scaffolding/views/footer.php new file mode 100644 index 00000000..36b29d1c --- /dev/null +++ b/system/scaffolding/views/footer.php @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/system/scaffolding/views/header.php b/system/scaffolding/views/header.php new file mode 100644 index 00000000..7ab60fd8 --- /dev/null +++ b/system/scaffolding/views/header.php @@ -0,0 +1,31 @@ + + + + +<?php echo $title; ?> + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/system/scaffolding/views/index.html b/system/scaffolding/views/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/scaffolding/views/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

Directory access is forbidden.

+ + + + \ No newline at end of file diff --git a/system/scaffolding/views/no_data.php b/system/scaffolding/views/no_data.php new file mode 100644 index 00000000..dca477e2 --- /dev/null +++ b/system/scaffolding/views/no_data.php @@ -0,0 +1,6 @@ +load->view('header'); ?> + +

+

+ +load->view('footer'); ?> \ No newline at end of file diff --git a/system/scaffolding/views/stylesheet.css b/system/scaffolding/views/stylesheet.css new file mode 100644 index 00000000..55c8d9e5 --- /dev/null +++ b/system/scaffolding/views/stylesheet.css @@ -0,0 +1,143 @@ +body { + margin: 0; + padding: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + color: #4F5155; + background: #fff url(background.jpg) repeat-x left top; +} + +a { + color: #8B0D00; + background-color: transparent; + text-decoration: none; + font-weight: bold; +} + +a:visited { + color: #8B0D00; + background-color: transparent; + text-decoration: none; +} + +a:hover { + color: #000; + text-decoration: none; + background-color: transparent; +} + + +#header { + margin: 0; + padding: 0; +} + +#header_left { + background-color: transparent; + float: left; + padding: 21px 0 0 32px; + margin: 0 +} + +#header_right { + background-color: transparent; + float: right; + text-align: right; + padding: 35px 50px 20px 0; + margin: 0 +} + +#footer { + margin: 20px 0 15px 0; + padding: 0; +} + +#footer p { + font-size: 10px; + color: #999; + text-align: center; +} + +#outer { + margin: 30px 40px 0 40px; +} + +img { + padding:0; + border: 0; + margin: 0; +} + +.nopad { + padding:0; + border: 0; + margin: 0; +} + +table { + background-color: #efefef; +} + +th { + background-color: #eee; + font-weight: bold; + padding: 6px; + text-align: left; +} + +td { + background-color: #fff; + padding: 6px; +} + + +form { + margin: 0; + padding: 0; +} + +.input { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + width: 600px; + color: #333; + border: 1px solid #B3B4BD; + font-size: 11px; + height: 2em; + padding: 0; + margin: 0; +} + +.textarea { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 12px; + width: 600px; + color: #333; + border: 1px solid #B3B4BD; + padding: 0; + margin: 0; +} + +.select { + background-color: #fff; + font-size: 11px; + font-weight: normal; + color: #333; + padding: 0; + margin: 0 0 3px 0; +} + +.checkbox { + background-color: transparent; + padding: 0; + border: 0; +} + +.submit { + background-color: #8B0D00; + color: transparent; + font-weight: normal; + border: 1px solid #000; + margin: 6px 0 0 0; + padding: 1px 5px 1px 5px; +} diff --git a/system/scaffolding/views/view.php b/system/scaffolding/views/view.php new file mode 100644 index 00000000..fd20a174 --- /dev/null +++ b/system/scaffolding/views/view.php @@ -0,0 +1,25 @@ +load->view('header'); ?> + + + + + + + + + + +result() as $row): ?> + + + + + + + + +
EditDelete
 $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
+ + + +load->view('footer'); ?> \ No newline at end of file diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html new file mode 100644 index 00000000..8838ac8a --- /dev/null +++ b/user_guide/general/alternative_php.html @@ -0,0 +1,142 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Alternate PHP Syntax for View Files

+ +

If you do not utilize Code Igniter's template engine, you'll be using pure PHP +in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use PHPs alternative +syntax for control structures and echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, +and eliminate "echo" statements.

+ +

Alternative Echos

+ +

Normally to echo, or print out a variable you would do this:

+ +<?php echo $variable; ?> + +

With the alternative syntax you can instead do it this way:

+ +<?=$variable?> + +

Note: If you find that the syntax described in this page does not work on your server it might +be that "short tags" are disabled in your PHP ini file.

+ + +

Alternative Control Structures

+ +

Controls structures, like if, for, foreach, and while can be +written in a simplified format as well. Here is an example using foreach:

+ + +<ul>
+
+<?php foreach($todo as $item): ?>
+
+<li><?=$item?></li>
+
+<?php endforeach ?>
+
+</ul>
+ +

Notice that there are no braces. Instead, the end brace is replaced with endforeach. +Each of the control structures listed above has a similar closing syntax: +endif, endfor, endforeach, and endwhile

+ +

Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is +important!

+ +

Here is another example, using if/elseif/else. Notice the colons:

+ + +<?php if ($username == 'sally'): ?>
+
+   <h3>Hi Sally</h3>
+
+<?php elseif ($username == 'joe'): ?>
+
+   <h3>Hi Joe</h3>
+
+<?php else: ?>
+
+   <h3>Hi unknown user</h3>
+
+<?php endif; ?>
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html new file mode 100644 index 00000000..fc67bec7 --- /dev/null +++ b/user_guide/general/ancillary_classes.html @@ -0,0 +1,122 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Creating Ancillary Classes

+ +

In some cases you may want to develop classes that exist apart from your controllers but have the ability to +utilize all of Code Igniter's resources. This is easily possible as you'll see.

+ +

get_instance()

+ + +

Any class that you instantiate within your controller functions can access Code Igniter's native resources simply by using the get_instance() function. +This function returns the main Code Igniter object.

+ +

Normally, to call any of the available Code Igniter functions requires you to use the $this construct:

+ + +$this->load->helper('url');
+$this->load->library('session');
+$this->config->item('base_url');
+etc. +
+ +

$this, however, only works within your controllers, your models, or your views. +If you would like to use Code Igniter's classes from within your own custom classes you can do so as follows:

+ + +

First, assign the Code Igniter object to a variable:

+ +$obj =& get_instance(); + +

Once you've assigned the object to a variable, you'll use that variable instead of $this:

+ + +$obj =& get_instance();

+$obj->load->helper('url');
+$obj->load->library('session');
+$obj->config->item('base_url');
+etc. +
+ +

Note: You'll notice that the above get_instance() function is being passed by reference: +

+$obj =& get_instance(); +

+This is very important. Assigning by reference allows you to use the original Code Igniter object rather than creating a copy of it.

+
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html new file mode 100644 index 00000000..5f90fdda --- /dev/null +++ b/user_guide/general/autoloader.html @@ -0,0 +1,106 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Auto-loading Resources

+ +

Code Igniter comes with an "Auto-load" feature that permits libraries, helpers, and plugins to be initialized +automatically every time the system runs. If you need certain resources globally throughout your application you should +consider auto-loading them for convenience.

+ +

The following items can be loaded automatically:

+ +
    +
  • Core classes found in the "libraries" folder
  • +
  • Helper files found in the "helpers" folder
  • +
  • Plugins found in the "plugins" folder
  • +
  • Your own Scripts found in the "applications/scripts" folder
  • +
  • Custom config files found in the "config" folder
  • +
+ +

To autoload resources, open the application/config/autoload.php file and add the item you want +loaded to the autoload array. You'll find instructions in that file corresponding to each +type of item.

+ +

Note: Do not include the file extension (.php) when adding items to the autoload array.

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/base_classes.html b/user_guide/general/base_classes.html new file mode 100644 index 00000000..215bd25b --- /dev/null +++ b/user_guide/general/base_classes.html @@ -0,0 +1,127 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Replacing System Classes

+ +

Every time Code Igniter runs there are several base classes that are initialized automatically as part of the core framework. +It is possible, however, to swap any of the core system files with your own versions.  Most users will never have any need to do this, +but the option to replace them does exist for those that would like to significantly alter the Code Igniter core. +

+ +

Note:  Replacing a core system class with your own version has a lot of implications, so make sure you +know what you are doing before attempting it.

+ + +

System Class List

+ +

The following is a list of the core system files that are invoked every time Code Igniter runs:

+ +
    +
  • Benchmark
  • +
  • Input
  • +
  • Config
  • +
  • Hooks
  • +
  • Router
  • +
  • URI
  • +
  • Language
  • +
  • Loader
  • +
  • Controller
  • +
  • Output
  • +
+ +

Replacing Core Classes

+ +

To use one of your own system classes instead of a default one simply place your version inside your local libraries directory:

+ +application/libraries/some-class.php + +

Any file named identically to one from the list above will be used instead of the one normally used.

+ +

Please note that your class must use CI as a prefix. For example, if your file is named Input.php the class will be named:

+ + +class CI_Input {

+ +} +
+ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html new file mode 100644 index 00000000..a5edbe73 --- /dev/null +++ b/user_guide/general/caching.html @@ -0,0 +1,119 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Web Page Caching

+ +

Code Igniter lets you cache your pages in order to achieve maximum performance. + +Although Code Igniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the +server resources, memory, and processing cycles utilized, which affect your page load speeds. +By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages. + + +

How Does Caching Work?

+ +

Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. +When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved +and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

+ +

Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

+ +

Enabling Caching

+ +

To enable caching, put the following tag in any of your controller functions:

+ +$this->output->cache(n); + +

Where n is the number of minutes you wish the page to remain cached between refreshes.

+ +

The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems +most logical to you. Once the tag is in place, your pages will begin being cached.

+ +

Note: Before the cache files can be written you must set the file permissions on your +system/cache folder such that it is writable (666 is usually appropriate).

+ +

Deleting Caches

+ +

If you no longer wish to cache a file you can remove the caching tag and it will not longer be refreshed when it expires. Note: +Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you +will need to manually delete it from your cache folder.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html new file mode 100644 index 00000000..0bcb165d --- /dev/null +++ b/user_guide/general/changelog.html @@ -0,0 +1,248 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Change Log

+ + + +

Version 1.4.0

+

Release Date: August 25, 2006

+ +
    +
  • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
  • +
  • Added the ability to replace core system classes with your own classes.
  • +
  • Added support for % character in URL.
  • +
  • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
  • +
  • Removed a strtolower() call that was changing URL segments to lower case.
  • +
  • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
  • +
  • Fixed a MS SQL issue.
  • +
  • Fixed an issue when removing GET variables.
  • +
  • Fixed this router bug.
  • +
  • Fixed a bug that was preventing multiple discreet database calls.
  • +
  • Fixed a bug in which loading a language file was producing a "file contains no data" message.
  • +
  • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
  • +
  • Removed backticks from Postgre class since these are not needed.
  • +
+ + + +

Version 1.3.3

+

Release Date: June 1, 2006

+ +
    + +
  • Models do not connect automatically to the database as of this version. More info here. +
  • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
  • +
  • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
  • +
  • Fixed a bug in the active record "having" function.
  • +
  • Fixed a problem in the validation class which was making checkboxes be ignored when required.
  • +
  • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
  • +
  • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
  • +
  • Fixed a validation bug that was preventing rules from being set twice in one controller.
  • +
  • Fixed a calendar bug that was not letting it use dynamically loaded languages.
  • +
  • Fixed a bug in the active record class when using WHERE clauses with LIKE
  • +
  • Fixed a bug in the hash() security helper.
  • +
  • Fixed some typos.
  • +
+ + + + +

Version 1.3.2

+

Release Date: April 17, 2006

+ +
    +
  • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
  • +
  • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
  • +
  • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
  • +
  • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
  • +
  • Fixed a couple bugs in the Model class.
  • +
  • Fixed some documentation typos and errata.
  • +
+ + + +

Version 1.3.1

+

Release Date: April 11, 2006

+ +
    +
  • Added a Unit Testing Library.
  • +
  • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
  • +
  • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
  • +
  • Added getwhere function to Active Record class.
  • +
  • Added count_all function to Active Record class.
  • +
  • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
  • +
  • Added $this->db->last_query(), which allows you to view your last query that was run.
  • +
  • Added a new mime type to the upload class for better compatibility.
  • +
  • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
  • +
  • Fixed a bug in a couple of the active record functions (where and orderby).
  • +
  • Fixed a bug in the image library when realpath() returns false.
  • +
  • Fixed a bug in the Models that was preventing libraries from being used within them.
  • +
  • Fixed a bug in the "exact_length" function of the validation class.
  • +
  • Fixed some typos in the user guide
  • +
+ + +

Version 1.3

+

Release Date: April 3, 2006

+ +
    +
  • Added support for Models.
  • +
  • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
  • +
  • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
  • +
  • Added a feature to the database class that lets you run custom function calls.
  • +
  • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
  • +
  • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
  • +
  • Added support for running standard query string URLs. These can be optionally enabled in your config file.
  • +
  • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
  • +
  • Added a new error template for use with native PHP errors.
  • +
  • Added "alternator" function in the string helpers.

    +
  • Removed slashing from the input class. After much debate we decided to kill this feature.
  • +
  • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
  • +
  • Added better class and function name-spacing to avoid collisions with user developed classes. All Code Igniter classes are now prefixed with CI_ and +all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
  • +
  • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
  • +
  • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
  • +
  • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
  • +
  • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
  • +
  • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
  • +
  • Fixed some typos in the default calendar template
  • +
  • Fixed some typos in the user guide
  • +
+ + + + + + + + +

Version 1.2

+

Release Date: March 21, 2006

+ +
    +
  • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
  • +
  • Added a global function named get_instance() allowing the main Code Igniter object to be accessible throughout your own classes.
  • +
  • Added new File Helper: delete_files()
  • +
  • Added new URL Helpers: base_url(), index_page()
  • +
  • Added the ability to create your own core libraries and store them in your local application directory.
  • +
  • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
  • +
  • Added Javascript Calendar plugin.
  • +
  • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
  • +
  • Updated the parser class so that it allows tag pars within other tag pairs.
  • +
  • Fixed a bug in the DB "where" function.
  • +
  • Fixed a bug that was preventing custom config files to be auto-loaded.
  • +
  • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
  • +
  • Fixed some bugs in the xss_clean function
  • +
+ + + + + +

Version Beta 1.1

+

Release Date: March 10, 2006

+ +
    +
  • Added a Calendaring class.
  • +
  • Added support for running multiple applications that share a common Code Igniter backend.
  • +
  • Moved the "uri protocol" variable from the index.php file into the config.php file
  • +
  • Fixed a problem that was preventing certain function calls from working within constructors.
  • +
  • Fixed a problem that was preventing the $this->load->library function from working in constructors.
  • +
  • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
  • +
  • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
  • +
  • Fixed a data type error in the form_radio function (form helper)
  • +
  • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
  • +
  • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
  • +
  • Fixed a pagination problem in the scaffolding.
  • +
  • Fixed a bug in the mysql class "where" function.
  • +
  • Fixed a regex problem in some code that trimmed duplicate slashes.
  • +
  • Fixed a bug in the br() function in the HTML helper
  • +
  • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
  • +
  • Removed the "style" attributes form the form helpers.
  • +
  • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
  • +
+ +

Version Beta 1.0

+

Release Date: February 28, 2006

+

First publicly released version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html new file mode 100644 index 00000000..648298eb --- /dev/null +++ b/user_guide/general/controllers.html @@ -0,0 +1,317 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Controllers

+ +

Controllers are the heart of your application, as they determine how HTTP requests should be handled.

+ + + + + + +

What is a Controller?

+ +

A Controller is simply a class file that is named in a way that can be associated with a URI.

+ +

Consider this URI:

+ +www.your-site.com/index.php/blog/ + +

In the above example, Code Igniter would attempt to find a controller named blog.php and load it.

+ +

When a controller's name matches the first segment of a URI, it will be loaded.

+ + +

Let's try it:  Hello World!

+ +

Let's create a simple controller so you can see it in action. Using your text editor, create a file called blog.php, and put the following code in it:

+ + + + + + +

Then save the file to your application/controllers/ folder.

+ +

Now visit the your site using a URL similar to this:

+ +www.your-site.com/index.php/blog/ + +

If you did it right, you should see Hello World!.

+ +

Note: Class names must start with an uppercase letter. In other words, this is valid: + +<?php
+class Blog extends Controller {
+
+}
+?>
+ +

This is not valid:

+ +<?php
+class blog extends Controller {
+
+}
+?>
+ +

Also, always make sure your controller extends the parent controller class so that it can inherit all its functions.

+ + + + +

Functions

+ +

In the above example the function name is index(). The "index" function is always loaded by default if the +second segment of the URI is empty. Another way to show your "Hello World" message would be this:

+ +www.your-site.com/index.php/blog/index/ + +

The second segment of the URI determines which function in the controller gets called.

+ +

Let's try it. Add a new function to your controller:

+ + + + +

Now load the following URL to see the comment function:

+ +www.your-site.com/index.php/blog/comments/ + +

You should see your new message.

+ + +

Private Functions

+ +

In some cases you may not want certain functions accessible publicly. To make a function private, simply add an +underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this:

+ + +function _utility()
+{
+  // some code
+}
+ +

Trying to access it via the URL, like this, will not work:

+ +www.your-site.com/index.php/blog/_utility/ + + + + +

Defining a Default Controller

+ +

Code Igniter can be told to load a default controller when a URI is not present, +as will be the case when only your site root URL is requested. To specify a default controller, open +your application/config/routes.php file and set this variable:

+ +$route['default_controller'] = 'Blog'; + +

Where Blog is the name of the controller class you want used. If you now load your main index.php file without +specifying any URI segments you'll see your Hello World message by default.

+ + + +

Class Constructors

+ + +

If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:

+ +parent::Controller(); + +

The reason this line is necessary is because your local constructor will be overriding the one in the parent controller class so we need to manually call it.

+ + +

If you are not familliar with constructors, in PHP 4, a constructor is simply a function that has the exact same name as the class:

+ + +<?php
+class Blog extends Controller {
+
+       function Blog()
+       {
+            parent::Controller();
+       }
+}
+?>
+ +

In PHP 5, constructors use the following syntax:

+ + +<?php
+class Blog extends Controller {
+
+       function __construct()
+       {
+            parent::Controller();
+       }
+}
+?>
+ +

Constructors are useful if you need to set some default values, or run a default process when your class is instantiated. +Constructors can't return a value, but they can do some default work.

+ + +

Reserved Function Names

+ +

Since your controller classes will extend the main application controller you +must be careful not to name your functions identically to the ones used by that class, otherwise your local functions +will override them. The following +is a list of reserved names. Do not name your controller functions any of these:

+ +
    +
  • Controller
  • +
  • CI_Base
  • +
  • _ci_autoload
  • +
  • _ci_autoloader
  • +
  • _ci_assign_core
  • +
  • _ci_initialize
  • +
  • _ci_init_database
  • +
  • _ci_init_scaffolding
  • +
  • _ci_is_loaded
  • +
  • _ci_load
  • +
  • _ci_scaffolding
  • +
  • _ci_set_view_path
  • +
+ +


If you are running PHP 4 there are some additional reserved names. These ONLY apply if you are running PHP 4.

+ +
    +
  • CI_Loader
  • +
  • config
  • +
  • database
  • +
  • file
  • +
  • helper
  • +
  • helpers
  • +
  • language
  • +
  • library
  • +
  • plugin
  • +
  • plugins
  • +
  • scaffolding
  • +
  • script
  • +
  • view
  • +
  • vars
  • +
+ + + + + + +

That's it!

+ +

That, in a nutshell, is all there is to know about controllers.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html new file mode 100644 index 00000000..fa341676 --- /dev/null +++ b/user_guide/general/creating_libraries.html @@ -0,0 +1,222 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Creating Libraries

+ +

When we use the term "Libraries" we are normally referring to the classes that are located in the libraries +directory and described in the Class Reference of this user guide. In this case, however, we will instead describe how you can create your own libraries within +your application directory in order to maintain separation between your local resources and the global framework resources.

+ +

Storage

+ +

In order for your libraries to be stored in your application folder you will need to create two directories in which to store them:

+ +
    +
  • application/init
  • +
  • application/libraries
  • +
+ + +

Anatomy of a Library

+ +

A class library consists of two components:

+ +
    +
  1. An init file.
  2. +
  3. A class file.
  4. +
+ +

The Init File

+ +

An init file a small initialization file corresponding to each of your classes. The purpose of this file is to +instantiate a particular class. Each init file must be named identically to your class file name, adding the "init_" prefix. For example, if your +class is named myclass.php your init file will be named:

+ +init_myclass.php + +

Within your init file you will place your initialization code. Here's an example of such code, using an imaginary class named Myclass:

+ + +<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+
+if ( ! class_exists('Myclass'))
+{
+     require_once(APPPATH.'libraries/Myclass'.EXT);
+}
+
+$obj =& get_instance();
+$obj->myclass = new Myclass();
+$obj->ci_is_loaded[] = 'myclass';
+
+?>
+ +

The Class File

+ +

Your class file itself will be placed inside your libraries directory:

+ +application/libraries/myclass.php + +

The class will have this basic prototype:

+ +<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+
+class Myclass {
+
+}
+?>
+ + +

Naming Conventions

+ +
    +
  • All file names must be in lowercase: myclass.php and init_myclass.php
  • +
  • Class names must be capitalize: class Myclass
  • +
+ + +

Using Your Class

+ +

From within any of your Controller classes you can initialize your class using the standard:

+ +$this->load->library('myclass'); + +

Once loaded you can access your class using:

+ +$this->myclass->function(); + +

Note: In your init file you can define the object variable name.

+ + +

Passing Parameters Your Class

+ +

In the library loading function you can pass data via the second parameter and it will be available to your initialization file:

+ + +$params = array('type' => 'large', 'color' => 'red');
+
+$this->load->library('myclass', $params);
+ +

Parameters will be accessible using a variable called $params. By default this variable is set to FALSE.

+ + +

Utilizing Code Igniter Resources within Your Library

+ + +

To access Code Igniter's native resources within your library use the get_instance() function. +This function returns the Code Igniter super object.

+ +

Normally, to call any of the available Code Igniter functions requires you to use the $this construct:

+ + +$this->load->helper('url');
+$this->load->library('session');
+$this->config->item('base_url');
+etc. +
+ +

$this, however, only works directly within your controllers, your models, or your views. +If you would like to use Code Igniter's classes from within your own custom classes you can do so as follows:

+ + +

First, assign the Code Igniter object to a variable:

+ +$obj =& get_instance(); + +

Once you've assigned the object to a variable, you'll use that variable instead of $this:

+ + +$obj =& get_instance();

+$obj->load->helper('url');
+$obj->load->library('session');
+$obj->config->item('base_url');
+etc. +
+ +

Note: You'll notice that the above get_instance() function is being passed by reference: +

+$obj =& get_instance(); +

+This is very important. Assigning by reference allows you to use the original Code Igniter object rather than creating a copy of it.

+ + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html new file mode 100644 index 00000000..dd318b7d --- /dev/null +++ b/user_guide/general/credits.html @@ -0,0 +1,96 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Credits

+ +

Code Igniter was developed by Rick Ellis, who in his other life is CEO of +pMachine, Inc. The core framework was written +specifically for this application, while many of the class libraries, helpers, and sub-systems borrow from the code-base of +ExpressionEngine, a Content Management System written by Rick Ellis and +Paul Burdick.

+ +

A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and for +bringing frameworks into the general consciousness of the web community.

+ +

The Code Igniter logo and icons were created by Rick Ellis.

+ +

The pull-down table of contents was created with the use of the moo.fx library.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html new file mode 100644 index 00000000..60acbfe1 --- /dev/null +++ b/user_guide/general/errors.html @@ -0,0 +1,142 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Error Handling

+ +

Code Igniter lets you build error reporting into your applications using the functions described below. +In addition, it has an error logging class that permits error and debugging messages to be saved as text files.

+ +

Note: By default, Code Igniter displays all PHP errors. You might +wish to change this behavior once your development is complete. You'll find the error_reporting() +function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files +from being written if there are errors.

+ +

Unlike most systems in Code Igniter, the error functions are simple procedural interfaces that are available +globally throughout the application. This approach permits error messages to get triggered without having to worry +about class/function scoping.

+ +

The following functions let you generate errors:

+ +

show_error('message')

+

This function will display the error message supplied to it using the following error template:

+

application/errors/error_general.php

+ +

show_404('page')

+

This function will display the 404 error message supplied to it using the following error template:

+

application/errors/error_404.php

+ +

The function expects the string passed to it to be the file path to the page that isn't found. +Note that Code Igniter automatically shows 404 messages if controllers are not found.

+ + +

log_message('level', 'message')

+ +

This function lets you write messages to your log files. You must supply one of three "levels" +in the first parameter, indicating what type of message it is (debug, error, info), with the message +itself in the second parameter. Example:

+ + +if ($some_var == "")
+{
+    log_message('error', 'Some variable did not contain a value.');
+}
+else
+{
+    log_message('debug', 'Some variable was correctly set');
+}
+
+log_message('info', 'The purpose of some variable is to provide some value.');
+
+ +

There are three message types:

+ +
    +
  1. Error Messages. These are actual errors, such as PHP errors or user errors.
  2. +
  3. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.
  4. +
  5. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. Code Igniter doesn't natively generate any info messsages but you may want to in your application.
  6. +
+ + +

Note: In order for the log file to actually be written, the "log_errors" +option must be enabled in your application/config/config.php file, and the "logs" folder must be writable. +In addition, you'll can set the "threshold" for logging. +You might, for example, only want error messages to be logged, and not the other two types.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html new file mode 100644 index 00000000..1bed4a8b --- /dev/null +++ b/user_guide/general/helpers.html @@ -0,0 +1,140 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Helper Functions

+ +

Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular +category. There are URL Helpers, that assist in creating links, there are Form Helpers +that help you create form elements, Text Helpers perform various text formatting routines, +Cookie Helpers set and read cookies, File Helpers help you deal with files, etc. +

+ +

Unlike most other systems in Code Igniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. +Each helper function performs one specific task, with no dependence on other functions.

+ +

Code Igniter does not load Helper Files by default, so the first step in using +a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

+ +

Loading a Helper

+ +

Loading a helper file is quite simple using the following function:

+ +$this->load->helper('name'); + +

Where name is the file name of the helper, without the .php file extension or the "helper" part.

+ +

For example, to load the URL Helper file, which is named url_helper.php, you would do this:

+ +$this->load->helper('url'); + +

A helper can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), +as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available +automatically in any function, or you can load a helper in a specific function that needs it.

+ +

Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

+ + +

Loading Multiple Helpers

+ +

If you need to load more than one helper you can specify them in an array, like this:

+ +$this->load->helper( array('helper1', 'helper2', 'helper3') ); + +

Auto-loading Helpers

+ +

If you find that you need a particular helper globally throughout your application, you can tell Code Igniter to auto-load it during system initialization. +This is done by opening the application/config/autoload.php file and adding the helper to the autoload array.

+ + +

Using a Helper

+ +

Once you've loaded the Helper File containing the function you intend to use, you'll call it the way you would a standard PHP function.

+ +

For example, to create a link using the anchor() function in one of your view files you would do this:

+ +<?=anchor('blog/comments', 'Click Here');?> + +

Where "Click Here" is the name of the link, and "blog/comments" is the URI to the controller/function you wish to link to.

+ + +

Now What?

+ +

In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html new file mode 100644 index 00000000..30165465 --- /dev/null +++ b/user_guide/general/hooks.html @@ -0,0 +1,184 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Hooks - Extending the Framework Core

+ +

Code Igniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files. +When Code Igniter runs it follows a specific execution process, diagramed in the Application Flow page. +There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process. +For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of +your own scripts in some other location. +

+ + +

Defining a Hook

+ +

Hooks are defined in application/config/hooks.php file. Each hook is specified as an array with this prototype:

+ + +$hook['pre_controller'] = array(
+                                'class'    => 'MyClass',
+                                'function' => 'Myfunction',
+                                'filename' => 'Myclass.php',
+                                'filepath' => 'hooks',
+                                'params'   => array('beer', 'wine', 'snacks')
+                                );
+ +

Notes:
The array index correlates to the name of the particular hook point you want to +use. In the above example the hook point is pre_controller. A list of hook points is found below. +The following items should be defined in your associative hook array:

+ +
    +
  • class  The name of the class you wish to invoke. If you prefer to use a procedural function instead of a class, leave this item blank.
  • +
  • function  The function name you wish to call.
  • +
  • filename  The file name containing your class/function.
  • +
  • filepath  The name of the directory containing your script. Note: Your script must be located in a directory INSIDE your application folder, so the file path is relative to that folder. For example, if your script is located in application/hooks, you will simply use hooks as your filepath. If your script is located in application/hooks/utilities you will use hooks/utilities as your filepath. No trailing slash.
  • +
  • params  Any parameters you wish to pass to your script. This item is optional.
  • +
+ + +

Multiple Calls to the Same Hook

+ +

If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this: + + +$hook['pre_controller'][] = array(
+                                'class'    => 'MyClass',
+                                'function' => 'Myfunction',
+                                'filename' => 'Myclass.php',
+                                'filepath' => 'hooks',
+                                'params'   => array('beer', 'wine', 'snacks')
+                                );
+
+$hook['pre_controller'][] = array(
+                                'class'    => 'MyOtherClass',
+                                'function' => 'MyOtherfunction',
+                                'filename' => 'Myotherclass.php',
+                                'filepath' => 'hooks',
+                                'params'   => array('red', 'yellow', 'blue')
+                                );
+ +

Notice the brackets after each array index:

+ +$hook['pre_controller'][] + +

This permits you to the same hook point with multiple scripts. The order you define your array will be the execution order.

+ + +

Hook Points

+ +The following is a list of available hook points.

+ +
    + +
  • pre_system
    +Called very early during system execution. Only the benchmark and hooks class have been loaded at this point. No routing or other processes have happened.
  • + +
  • pre_controller
    +Called immediately prior to any of your controllers being called. All base classes, routing, and security checks have been done.
  • + +
  • post_controller
    +Called immediately after the controller is called.
  • + +
  • display_override
    +Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to +use your own display methodology. Note that the finalized data will be available by calling $this->output->get_output()
  • + +
  • cache_override
    +Enables you to call your own function instead of the _display_cache() function in the output class. This permits you to use your own cache display mechanism.
  • + +
  • scaffolding_override
    +Permits a scaffolding request to trigger your own script instead.
  • + +
  • post_system
    +Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.
  • + + +
+ + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/index.html b/user_guide/general/index.html new file mode 100644 index 00000000..31e99d53 --- /dev/null +++ b/user_guide/general/index.html @@ -0,0 +1,95 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Getting Started With Code Igniter

+ +

Any software application requires some effort to learn. We've done our best to minimize the learning +curve, while making the process as enjoyable as possible. +

+ +

The first step is to install Code Igniter, then read +all the topics in the Introduction section of the User Guide.

+ +

Next, read each of the General Topics pages in order. +Each topic builds on the previous one, and includes code examples that you are encouraged to try.

+ +

Once you understand the basics you'll be ready to explore the Class Reference and +Helper Reference pages to learn to utilize the native libraries and helper files.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html new file mode 100644 index 00000000..642399ba --- /dev/null +++ b/user_guide/general/libraries.html @@ -0,0 +1,111 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Loading Libraries

+ +

The core libraries are the class files located in the "libraries" folder. +In most cases, to use one of these classes involves initializing it within your controllers using the following function:

+ +$this->load->library('class name'); + +

Where class name is the name of the class you want to invoke. For example, to load the validation class you would do this:

+ +$this->load->library('validation'); + +

Once initialized you can use it as indicated in the user guide page corresponding to each class.

+ +

Semantic Relevance

+ +

The pattern you will use when calling functions is this:

+ +

$this->class->function()

+ +

We've placed a high value on semantic relevance in the naming of our classes and functions. +Here are some examples of function calls you might use in Code Igniter:

+ +

$this->email->send()

+

$this->input->user_agent()

+

$this->benchmark->elapsed_time()

+

$this->db->query()

+

$this->load->helper()

+

$this->uri->segment()

+

$this->lang->line()

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/models.html b/user_guide/general/models.html new file mode 100644 index 00000000..dfb45d62 --- /dev/null +++ b/user_guide/general/models.html @@ -0,0 +1,256 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Models

+ +

Models are optionally available for those who want to use a more +traditional MVC approach.

+ + + + + + + +

What is a Model?

+ +

Models are PHP classes that are designed to work with information in your database. For example, let's say +you use Code Igniter to manage a blog. You might have a model class that contains functions to insert, update, and +retrieve your blog data. Here is an example of what such a model class might look like:

+ + +class Blogmodel extends Model {
+
+    var $title   = '';
+    var $content = '';
+    var $date    = '';
+
+    function Blogmodel()
+    {
+        // Call the Model constructor
+        parent::Model();
+    }
+    
+    function get_last_ten_entries()
+    {
+        $query = $this->db->get('entries', 10);
+        return $query->result();
+    }
+
+    function insert_entry()
+    {
+        $this->title   = $_POST['title'];
+        $this->content = $_POST['content'];
+        $this->date    = time();
+
+        $this->db->insert('entries', $this);
+    }
+
+    function update_entry()
+    {
+        $this->title   = $_POST['title'];
+        $this->content = $_POST['content'];
+        $this->date    = time();
+
+        $this->db->update('entries', $this, array('id', $_POST['id']));
+    }
+
+}
+ +

Note: The functions in the above example use the Active Record database functions.

+ + + +

Anatomy of a Model

+ +

Model classes are stored in your application/models/ folder. The basic prototype for a model is this:

+ + + +class Model_name extends Model {
+
+    function Model_name()
+    {
+        parent::Model();
+    }
+}
+ +

Where Model_name is the name of your class. Class names must be capitalized. +Make sure your class extends the base Model class.

+ +

The file name will be a lower case version of your class name. For example, if your class is this:

+ + +class User_model extends Model {
+
+    function User_model()
+    {
+        parent::Model();
+    }
+}
+ +

Your file will be this:

+ +application/models/user_model.php + + + +

Loading a Model

+ +

Your models will typically be loaded and called from within your controller functions. +To load a model you will use the following function:

+ +$this->load->model('Model_name'); + +

Once loaded, you will access your model functions using an object with the same name as your class:

+ + +$this->load->model('Model_name');
+
+$this->Model_name->function(); +
+ +

If you would like your model assigned to a different object name you can specify it via the second parameter of the loading +function:

+ + + +$this->load->model('Model_name', 'fubar');
+
+$this->fubar->function(); +
+ +

Here is an example of a controller, that loads a model, then serves a view:

+ + +class Blog_controller extends Controller {
+
+    function blog()
+    {
+        $this->load->model('Blog');
+
+        $data['query'] = $this->Blog->get_last_ten_entries();

+        $this->load->view('blog', $data);
+    }
+}
+ + + + +

Connecting to your Database

+ +

When a model is loaded it does NOT connect automatically to your database. The following options for connecting are available to you:

+ +
    +
  • You can connect using the standard database methods described here, either from within your Controller class or your Model class.
  • +
  • You can tell the model loading function to auto-connect by passing TRUE (boolean) via the third parameter, +and connectivity settings, as defined in your database config file will be used: + + $this->load->model('Model_name', '', TRUE); +
  • + + +
  • You can manually pass database connectivity settings via the third parameter: + + + $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['active_r'] = TRUE;
    +
    + $this->load->model('Model_name', '', $config);
  • +
+ + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html new file mode 100644 index 00000000..22934949 --- /dev/null +++ b/user_guide/general/multiple_apps.html @@ -0,0 +1,116 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Running Multiple Applications with one Code Igniter Installation

+ +

By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your +system/application/ directory. It is possible, however, to have multiple sets of applications that share a single +Code Igniter installation. To do this you will put all of the directories located inside your application folder into their +own sub-folder.

+ +

For example, let's say you want to create two applications, "foo" and "bar". You will structure your +application folder like this: + +system/application/foo/
+system/application/foo/config/
+system/application/foo/controllers/
+system/application/foo/errors/
+system/application/foo/models/
+system/application/foo/scripts/
+system/application/foo/views/
+system/application/bar/
+system/application/bar/config/
+system/application/bar/controllers/
+system/application/bar/errors/
+system/application/bar/models/
+system/application/bar/scripts/
+system/application/bar/views/
+ + +

To select a particular application for use requires that you open your main index.php file and set the $application_folder +variable. For example, to select the "foo" application for use you would do this:

+ +$application_folder = "foo"; + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html new file mode 100644 index 00000000..c28dd321 --- /dev/null +++ b/user_guide/general/plugins.html @@ -0,0 +1,125 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Plugins

+ +

Plugins work almost identically to Helpers. The main difference is that a plugin usually +provides a single function, whereas a Helper is usually a collection of functions. Helpers are also considerd a part of +the core system; plugins are intended to be created and shared by our community.

+ + +

Loading a Plugin

+ +

Loading a plugin file is quite simple using the following function:

+ +$this->load->plugin('name'); + +

Where name is the file name of the plugin, without the .php file extension or the "plugin" part.

+ +

For example, to load the Captcha plugin, which is named captcha_pi.php, you will do this:

+ +$this->load->plugin('captcha'); + +

A plugin can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), +as long as you load it before you use it. You can load your plugins in your controller constructor so that they become available +automatically in any function, or you can load a plugin in a specific function that needs it.

+ +

Note: The Plugin loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

+ + +

Loading Multiple Plugins

+ +

If you need to load more than one plugin you can specify them in an array, like this:

+ +$this->load->plugin( array('plugin1', 'plugin2', 'plugin3') ); + +

Auto-loading Plugins

+ +

If you find that you need a particular plugin globally throughout your application, you can tell Code Igniter to auto-load it +during system initialization. This is done by opening the application/config/autoload.php file and adding the plugin to the autoload array.

+ + +

Using a Plugin

+ +

Once you've loaded the Plugin, you'll call it the way you would a standard PHP function.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html new file mode 100644 index 00000000..3e95fac6 --- /dev/null +++ b/user_guide/general/quick_reference.html @@ -0,0 +1,83 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Quick Reference Chart

+ +

For a PDF version of this chart, click here. + +

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html new file mode 100644 index 00000000..8e18ab09 --- /dev/null +++ b/user_guide/general/requirements.html @@ -0,0 +1,88 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Server Requirements

+ +
    +
  • PHP version 4.3.2 or newer
  • +
  • A Database. Supported databases are MySQL, MySQLi, MS SQL, Postgre, SQLite, and ODBC
  • +
+ + + +
+ + + + + + + + \ No newline at end of file diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html new file mode 100644 index 00000000..c6e8bd9c --- /dev/null +++ b/user_guide/general/routing.html @@ -0,0 +1,163 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

URI Routing

+ +

Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. +The segments in a URI normally follow this pattern:

+ +www.your-site.com/class/function/id/ + +

In some instances, however, you may want to remap this relationship so that a different class/function can be called +instead of the one corresponding to the URL.

+ +

For example, lets say you want your URLs to have this prototype:

+ +

+www.your-site.com/product/1/
+www.your-site.com/product/2/
+www.your-site.com/product/3/
+www.your-site.com/product/4/ +

+ +

Normally the second segment of the URL is reserved for the function name, but in the example above, it instead has a product ID. +To overcome this, Code Igniter allows you to remap the URI handler.

+ + +

Setting your own routing rules

+ +

Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route, that +you can use to specify your own routing criteria. A typical route might look something like this:

+ +$route['product/:num'] = "catalog/product_lookup"; + +

In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. +In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, +the "catalog" class and the "product_lookup" method are instead used.

+ +

You can match literal values or you can use two wildcard types:

+ +

+:num
+:any +

+ +

:num will match a segment containing only numbers.
+:any will match a segment containing any character. +

+ +

Note: Routes will run in the order they are defined. +Higher routes will always take precedence over lower ones.

+ + +

Examples

+ +

Here are a few routing examples:

+ +$route['journals'] = "blogs"; +

Any URL containing the word "journals" in the first segment will be remapped to the "blogs" class.

+ +$route['blog/joe'] = "blogs/users/34"; +

Any URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

+ + +$route['product/:any'] = "catalog/product_lookup"; +

Any URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

+ +

Important: Do not use leading/trailing slashes.

+ + +

Reserved Route

+ +

There are two reserved routes:

+ +$route['default_controller'] = 'welcome'; + +

This route indicates which controller class should be loaded if the URI contains no data, which will be the case +when people load your root URL. In the above example, the "welcome" class would be loaded. You +are encouraged to always have a default route otherwise a 404 page will appear by default.

+ +$route['scaffolding_trigger'] = 'scaffolding'; + +

This route lets you set a secret word, which when present in the URL, triggers the scaffolding feature. +Please read the Scaffolding page for details.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html new file mode 100644 index 00000000..3b32c369 --- /dev/null +++ b/user_guide/general/scaffolding.html @@ -0,0 +1,153 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Scaffolding

+ +

Code Igniter's Scaffolding feature provides a fast and very convenient way to add, edit, or delete information in your database +during development.

+ +

Very Important: Scaffolding is intended for development use only. It provides very little +security other than a "secret" word, so anyone who has access to your Code Igniter site can potentially edit or delete your information. +If you use scaffolding make sure you disable it immediately after you are through using it. DO NOT leave it enabled on a live site. +And please, set a secret word before you use it.

+ + +

Why would someone use scaffolding?

+ +

Here's a typical scenario: You create a new database table during development and you'd like a quick way to insert some data +into it to work with. Without scaffolding your choices are either to write some inserts using the command line or to use a +database management tool like phpMyAdmin. With Code Igniter's scaffolding feature you can quickly add some data using its browser +interface. And when you are through using the data you can easily delete it.

+ +

Setting a Secret Word

+ +

Before enabling scaffolding please take a moment to set a secret word. This word, when encountered in your URL, +will launch the scaffolding interface, so please pick something obscure that no one is likely to guess.

+ +

To set a secret word, open your application/config/routes.php file and look for this item:

+ +$route['scaffolding_trigger'] = ''; + +

Once you've found it add your own unique word.

+ +

Note: The scaffolding word can not start with an underscore.

+ + +

Enabling Scaffolding

+ +

Note: The information on this page assumes you already know how controllers work, and that you have +a working one available. It also assumes you have configured Code Igniter to auto-connect to your database. +If not, the information here won't be very relevant, so you are encouraged to go through those sections first. +Lastly, it assumes you understand what a class constructor is. If not, read the last section of the controllers +page.

+ +

To enable scaffolding you will initialize it in your constructor like this:

+ + +<?php
+class Blog extends Controller {
+
+       function Blog()
+       {
+            parent::Controller();

+            $this->load->scaffolding('table_name');
+       }
+}
+?>
+ +

Where table_name is the name of the table (table, not database) you wish to work with.

+ +

Once you've initialized scaffolding, you will access it with this URL prototype: + +www.your-site.com/index.php/class/secret_word/ + +

For example, using a controller named Blog, and abracadabra as the secret word, +you would access scaffolding like this:

+ +www.your-site.com/index.php/blog/abracadabra/ + +

The scaffolding interface should be self-explanatory. You can add, edit or delete records.

+ + +

A Final Note:

+ +

The scaffolding feature will only work with tables that contain a primary key, as this is information is needed to perform the various +database functions.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/scripts.html b/user_guide/general/scripts.html new file mode 100644 index 00000000..d0b5d26f --- /dev/null +++ b/user_guide/general/scripts.html @@ -0,0 +1,115 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

The Scripts Folder

+ +

Inside the application directory you'll find a folder called scripts. Its purpose is +to give you a place to store your own script includes or classes.

+ +

Loading a Script

+ +

Your scripts can be loaded in your controllers or views using the following function:

+ +$this->load->script('name'); + +

Where name is the file name of the script, without the .php file extension.

+ +

For example, to load a file called utilities.php you would do this:

+ +$this->load->script('utilities'); + +

If you load a script in your controller constructor it will be available +automatically in any function, or you can load it in a specific function that needs it.

+ +

Note: The Script loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

+ +

Loading Multiple Scripts

+ +

If you need to load more than one script you can specify them in an array, like this:

+ +$this->load->script( array('script1', 'script2', 'script3') ); + +

Auto-loading Scripts

+ +

If you find that you need a particular script globally throughout your application, you can tell Code Igniter to auto-load it +during system initialization. This is done by opening the application/config/autoload.php file and adding +the script to the autoload array.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/security.html b/user_guide/general/security.html new file mode 100644 index 00000000..06287a23 --- /dev/null +++ b/user_guide/general/security.html @@ -0,0 +1,159 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Security

+ +

This page describes some "best practices" regarding web security, and details +Code Igniter's internal security features.

+ + +

URI Security

+ +

Code Igniter is fairly restrictive regarding which characters it allows in your URI strings in order to help +minimize the possibility that malicious data can be passed to your application. URIs may only contain the following: +

+ +
    +
  • Alpha-numeric text
  • +
  • Tilde: ~
  • +
  • Period: .
  • +
  • Colon: :
  • +
  • Underscore: _
  • +
  • Dash: -
  • +
+ +

GET, POST, and COOKIE Data

+ +

GET data is simply disallowed by Code Igniter since the system utilizes URI segments rather than traditional URL query strings (unless +you have the query string option enabled in your config file). The global GET +array is unset by the Input class during system initialization.

+ +

Register_globals

+ +

During system initialization all global variables are unset, except those found in the $_POST and $_COOKIE arrays. The unsetting +routine is effectively the same as register_globals = off.

+ + +

magic_quotes_runtime

+ +

The magic_quotes_runtime directive is turned off during system initialization so that you don't have to remove slashes when +retrieving data from your database.

+ +


Best Practices

+ +

Before accepting any data into your application, whether it be POST data from a form submission, COOKIE data, URI data, +XML-RPC data, or even data from the SERVER array, you are encouraged to practice this three step approach:

+ +
    + +
  1. Filter the data as if it were tainted.
  2. +
  3. Validate the data to ensure it conforms to the correct type, length, size, etc. (sometimes this step can replace step one)
  4. +
  5. Escape the data before submitting it into your database.
  6. +
+ +Code Igniter provides the following functions to assist in this process:

+ +
    + +
  • XSS Filtering

    + +

    Code Igniter comes with a Cross Site Scripting filter. This filter looks for commonly +used techniques to embed malicious Javascript into your data, or other types of code that attempt to hijack cookies +or do other malicious things. The XSS Filter is described here. +

    +
  • + +
  • Validate the data

    + +

    Code Igniter has a Validation Class that assists you in validating, filtering, and prepping +your data.

    +
  • + +
  • Escape all data before database insertion

    + +

    Never insert information into your database without escaping it. Please see the section that discusses +queries for more information.

    + +
  • + +
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html new file mode 100644 index 00000000..8daef51a --- /dev/null +++ b/user_guide/general/urls.html @@ -0,0 +1,159 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Code Igniter URLs

+ +

By default, URLs in Code Igniter are designed to be search-engine and human friendly. Rather than using the standard "query string" +approach to URLs that is synonymous with dynamic systems, Code Igniter uses a segment-based approach:

+ +www.your-site.com/news/article/my_article + +

Note: Query string URLs can be optionally enabled, as described below.

+ +

URI Segments

+ +

The segments in the URL, in following with the Model-View-Controller approach, usually represent:

+ +www.your-site.com/class/function/ID + +
    +
  1. The first segment represents the controller class that should be invoked.
  2. +
  3. The second segment represents the class function, or method, that should be called.
  4. +
  5. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.

    +
+ +

The URI Class and the URL Helper +contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the +URI Routing feature for more flexibility.

+ + + +

Removing the index.php file

+ +

By default, the index.php file will be included in your URLs: + +www.your-site.com/index.php/news/article/my_article + +

You can easily remove this file by using a .htaccess file with some simple rules. Here is an example + of such a file, using the "negative" method in which everything is redirected except the specified items:

+ +RewriteEngine on
+RewriteCond $1 !^(index\.php|images|robots\.txt)
+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.

+ + +

Adding a URL Suffix

+ +

In your config/config.php file you can specify a suffix that will be added to all URLs generated +by Code Igniter. For example, if a URL is this: + +www.your-site.com/index.php/products/view/shoes + +

You can optionaally add a suffix, like .html, making the page appear to be of a certain type:

+ +www.your-site.com/index.php/products/view/shoes.html + + +

Enabling Query Strings

+ +

In some cases you might prefer to use query strings URLs:

+ +index.php?c=products&m=view&id=345 + +

Code Igniter optionally supports this capability, which can be enabled in your application/config.php file. If you +open your config file you'll see these items:

+ +$config['enable_query_strings'] = FALSE;
+$config['controller_trigger'] = 'c';
+$config['function_trigger'] = 'm';
+ +

If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then +be accessible using the "trigger" words you've set to invoke your controllers and methods:

+ +index.php?c=controller&m=method + +

Please note: If you are using query strings you will have to build your own URLs, rather than utilizing +the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with +segment based URLs.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/general/views.html b/user_guide/general/views.html new file mode 100644 index 00000000..14b03e58 --- /dev/null +++ b/user_guide/general/views.html @@ -0,0 +1,249 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Views

+ +

A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. +In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type +of hierarchy.

+ +

Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the +traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page +you should do so before continuing.

+ +

Using the example controller you created in the controller page, let's add a view to it.

+ +

Creating a View

+ +

Using your text editor, create a file called blogview.php, and put this in it:

+ + + +

Then save the file in your application/views/ folder.

+ +

Loading a View

+ +

To load a particular view file you will use the following function:

+ +$this->load->view('name'); + +

Where name is the name of your view file, without the .php file extension.

+ +

Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

+ + + + + +

If you visit the your site using the URL you did earlier you should see your new view. The URL was similar to this:

+ +www.your-site.com/index.php/blog/ + + +

Adding Dynamic Data to the View

+ +

Data is passed from the controller to the view by way of an array or an object in the second +parameter of the view loading function. Here is an example using an array:

+ +$data = array(
+               'title' => 'My Title',
+               'heading' => 'My Heading'
+               'message' => 'My Message'
+          );
+
+$this->load->view('blogview', $data);
+ +

And here's an example using an object:

+ +$data = new Someclass();
+$this->load->view('blogview', $data);
+ +

Note: If you use an object, the class variables will be turned into array elements.

+ + +

Let's try it with your controller file. Open it add this code:

+ + + + +

Now open your view file and change the text to variables that correspond to the array keys in your data:

+ + + + +

Then load the page at the URL you've been using and you should see the variables replaced.

+ +

Note: Youl'll notice that in the example above we are using PHP's alternative syntax. If you +are not familiar with it you can read about it here.

+ +

Creating Loops

+ +

The data array you pass to your view files is not limited to simple variables. You can +pass multi dimensional arrays, which can be looped to generate multiple rows. For example, if you +pull data from your database it will typically be in the form of a multi-dimensional array.

+ +

Here's a simple example. Add this to your controller:

+ + + + +

Now open your view file and create a loop:

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html new file mode 100644 index 00000000..d719be9c --- /dev/null +++ b/user_guide/helpers/array_helper.html @@ -0,0 +1,111 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Array Helper

+ +

The Array Helper file contains functions that assist in working with arrays.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('array'); + +

The following functions are available:

+ + +

random_element()

+ +

Takes an array as input and returns a random element from it. Usage example:

+ +$quotes = array(
+            "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
+            "Don't stay in bed, unless you can make money in bed. - George Burns",
+            "We didn't lose the game; we just ran out of time. - Vince Lombardi",
+            "If everything seems under control, you're not going fast enough. - Mario Andretti",
+            "Reality is merely an illusion, albeit a very persistent one. - Albert Einstein",
+            "Chance favors the prepared mind - Louis Pasteur"
+            );
+
+echo random_element($quotes);
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html new file mode 100644 index 00000000..3152fc30 --- /dev/null +++ b/user_guide/helpers/cookie_helper.html @@ -0,0 +1,133 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Cookie Helper

+ +

The Cookie Helper file contains functions that assist in working with cookies.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('cookie'); + +

The following functions are available:

+ +

set_cookie()

+ +

Sets a cookie containing the values you specify. There are two ways to pass information this function so that a cookie can be set: +Arrray Method, and Discreet Parameters:

+ +

Array Method

+ +

Using this method, an associative array is passed to the first parameter:

+ +$cookie = array(
+                   'name'   => 'The Cookie Name',
+                   'value'  => 'The Value',
+                   'expire' => '86500',
+                   'domain' => '.some-domain.com',
+                   'path'   => '/',
+                   'prefix' => 'myprefix_',
+               );
+
+set_cookie($cookie); +
+ +

Notes:

+ +

Only the name and value are required.

+ +

The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to +zero the cookie will only last as long as the browser is open.

+

To delete a cookie set it with the expiration blank.

+

For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

+

The path is usually not needed since the function sets a root path.

+

The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

+ +

Discreet Parameters

+ +

If you prefer, you can set the cookie by passing data using individual parameters:

+ +set_cookie($name, $value, $expire, $domain, $path, $prefix); + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html new file mode 100644 index 00000000..b25f249d --- /dev/null +++ b/user_guide/helpers/date_helper.html @@ -0,0 +1,340 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Date Helper

+ +

The Date Helper file contains functions that help you work with dates.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('date'); + + +

The following functions are available:

+ +

now()

+ +

Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" +setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you +run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function. +

+ + + + +

mdate()

+ +

This function is identical to PHPs date() function, except that it lets you +use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

+ +

The benefit of doing dates this way is that you don't have to worry about escaping any characters that +are not date codes, as you would normally have to do with the date() function. Example:

+ +$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
+$time = time();
+
+echo mdate($datestring, $time);
+ +

If a timestamp is not included in the second parameter the current time will be used.

+ + +

local_to_gmt()

+ +

Takes a Unix timestamp as input and returns it as GMT. Example:

+ +$now = time();
+
+$gmt = local_to_gmt($now);
+ + +

gmt_to_local()

+ +

Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the +timezone and Daylight Saving time submitted. Example:

+ + +$timestamp = '1140153693';
+$timezone = 'UM8';
+$daylight_saving = TRUE;
+
+echo gmt_to_local($timestamp, $timezone, daylight_saving);
+ +

Note: For a list of timezones see the reference at the bottom of this page.

+ +

mysql_to_unix()

+ +

Takes a MySQL Timestamp as input and returns it as Unix. Example:

+ +$mysql = '20061124092345';
+
+$unix = mysql_to_unix($mysql);
+ + +

unix_to_human()

+ +

Takes a Unix timestamp as input and returns it in a human readable format with this prototype:

+ +YYYY-MM-DD HH:MM:SS AM/PM + +

This can be useful if you need to display a date in a form field for submission.

+ +

The time can be formatted with or without seconds, and it can be set to European or US format. If only +the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples: + +$now = time();
+
+echo unix_to_human($now); // U.S. time, no seconds
+
+echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds
+
+echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
+ + +

human_to_unix()

+ +

The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is +useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if +the date string passed to it is not formatted as indicated above. Example:

+ +$now = time();
+
+$human = unix_to_human($now);
+
+$unix = human_to_unix($human);
+ + + + + +

timespan()

+ +

Formats a unix timestamp so that is appears similar to this:

+ +1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes + +

The first parameter must contain a Unix timestamp. The second parameter must contain a +timestamp that is greater that the first timesamp. If the second parameter empty, the current time will be used. The most common purpose +for this function is to show how much time has elapsed from some point in time in the past to now. Example:

+ +$post_date = '1079621429';
+$now = time();
+
+echo timespan($post_date, $now);
+ +

Note: The text generated by this function is found in the following language file: language/<your_lang>/date_lang.php

+ + +

days_in_month()

+ +

Returns the number of days in a given month/year. Takes leap years into account. Example:

+echo days_in_month(06, 2005); + +

If the second parameter is empty, the current year will be used.

+ + + +

timezone_menu()

+ +

Generates a pull-down menu of timezones, like this one:

+ +
+ +
+ +

This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

+ +

The first paramater lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

+ +echo timezone_menu('UM8'); + +

Please see the timezone reference below to see the values of this menu.

+ +

The second parameter lets you set a CSS class name for the menu.

+ +

Note: The text contained in the menu is found in the following language file: language/<your_lang>/date_lang.php

+ + + +

Timezone Reference

+ +

The following table indicates each timezone and its location.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Time ZoneLocation
UM12(UTC - 12:00) Enitwetok, Kwajalien
UM11(UTC - 11:00) Nome, Midway Island, Samoa
UM10(UTC - 10:00) Hawaii
UM9(UTC - 9:00) Alaska
UM8(UTC - 8:00) Pacific Time
UM7(UTC - 7:00) Mountain Time
UM6(UTC - 6:00) Central Time, Mexico City
UM5(UTC - 5:00) Eastern Time, Bogota, Lima, Quito
UM4(UTC - 4:00) Atlantic Time, Caracas, La Paz
UM25(UTC - 3:30) Newfoundland
UM3(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.
UM2(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena
UM1(UTC - 1:00) Azores, Cape Verde Islands
(UTC(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia
UP1(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome
UP2(UTC + 2:00) Kaliningrad, South Africa, Warsaw
UP3(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi
UP25(UTC + 3:30) Tehran
UP4(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi
UP35(UTC + 4:30) Kabul
UP5(UTC + 5:00) Islamabad, Karachi, Tashkent
UP45(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi
UP6(UTC + 6:00) Almaty, Colomba, Dhakra
UP7(UTC + 7:00) Bangkok, Hanoi, Jakarta
UP8(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei
UP9(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk
UP85(UTC + 9:30) Adelaide, Darwin
UP10(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok
UP11(UTC + 11:00) Magadan, New Caledonia, Solomon Islands
UP12(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island
+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html new file mode 100644 index 00000000..803bb4ce --- /dev/null +++ b/user_guide/helpers/directory_helper.html @@ -0,0 +1,145 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + + +
+ + +
+ + + +
+ + +

Directory Helper

+ +

The Directory Helper file contains functions that assist in working with directories.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('directory'); + +

The following functions are available:

+ +

directory_map('source directory')

+ +

This function reads the directory path specified in the first parameter +and builds an array representation of it and all its contained files. Example:

+ +$map = directory_map('./mydirectory/'); + +

Note: Paths are almost always relative to your main index.php file.

+ + + +

Sub-folders contained within the directory will be mapped as well. If you wish to map +only the top level directory set the second parameter to true (boolean):

+ +$map = directory_map('./mydirectory/', 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:

+ +Array
+(
+   [libraries] => Array
+   (
+       [0] => benchmark.html
+       [1] => config.html
+       [database] => Array
+       (
+             [0] => active_record.html
+             [1] => binds.html
+             [2] => configuration.html
+             [3] => connecting.html
+             [4] => examples.html
+             [5] => fields.html
+             [6] => index.html
+             [7] => queries.html
+        )
+       [2] => email.html
+       [3] => file_uploading.html
+       [4] => image_lib.html
+       [5] => input.html
+       [6] => language.html
+       [7] => loader.html
+       [8] => pagination.html
+       [9] => uri.html
+)
+ + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html new file mode 100644 index 00000000..c6b049b2 --- /dev/null +++ b/user_guide/helpers/file_helper.html @@ -0,0 +1,144 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

File Helper

+ +

The File Helper file contains functions that assist in working with files.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('file'); + +

The following functions are available:

+ +

read_file('path')

+ +

Returns the data contained in the file specified in the path. Example:

+ +$string = read_file('./path/to/file.php'); + +

The path can be a relative or full server path. Returns FALSE (boolean) on failure.

+ +

Note: The path is relative to your main site index.php file, NOT your controller or view files. +Code Igniter uses a front controller so paths are always relative to the main site index.

+ +

If you server is running an open_basedir restriction this function +might not work if you are trying to access a file above the calling script.

+ +

write_file('path', $data)

+ +

Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

+ + +$data = 'Some file data';
+
+if ( ! write_file('./path/to/file.php', $data))
+{
+     echo 'Unable to write the file';
+}
+else
+{
+     echo 'File written!';
+}
+ +

Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). +If the file does not already exist, the directory containing it must be writable.

+ +

Note: The path is relative to your main site index.php file, NOT your controller or view files. +Code Igniter uses a front controller so paths are always relative to the main site index.

+ + + +

delete_files('path')

+ +

Deletes ALL files contained in the supplied path. Example:

+delete_files('/path/to/directory/'); + +

If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:

+ +delete_files('/path/to/directory/', TRUE); + +

Note: The files must be writable or owned by the system in order to be deleted.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html new file mode 100644 index 00000000..8593f81d --- /dev/null +++ b/user_guide/helpers/form_helper.html @@ -0,0 +1,343 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Form Helper

+ +

The Form Helper file contains functions that assist in working with forms.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('form'); + +

The following functions are available:

+ + + +

form_open()

+ +

Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +add form attributes and hidden input fields.

+ +

The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable +in the event your URLs ever change.

+ +

Here's a simple example:

+ +echo form_open('email/send'); + +

The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

+ +<form method="post" action="http:/www.your-site.com/index.php/email/send" /> + +

Adding Attributes

+ +

Attributes can be added by passing an associative array to the second parameter, like this:

+ + +$attributes = array('class' => 'email', 'id' => 'myform');
+
+echo form_open('email/send', $attributes);
+ +

The above example would create a form similar to this:

+ +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> + +

Adding Hidden Input Fields

+ +

Hidden fields can be added by passing an associative array to the third parameter, like this:

+ + +$hidden = array('username' => 'Joe', 'member_id' => '234');
+
+echo form_open('email/send', '', $hidden);
+ +

The above example would create a form similar to this:

+ +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
+<input type="hidden" name="username" value="Joe" />
+<input type="hidden" name="member_id" value="234" />
+ + +

form_open_multipart()

+ +

This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, +which is necessary if you would like to use the form to upload files with.

+ +

form_hidden()

+ +

Lets you generate hidden input fields. You can either submit a name/value string to create one field:

+ +form_hidden('username', 'johndoe');
+
+// Would produce:

+<input type="hidden" name="username" value="johnodoe" />
+ +

Or you can submit an associative array to create multiple fields:

+ +$data = array(
+              'name'  => 'John Doe',
+              'email' => 'john@some-site.com',
+              'url'   => 'http://www.some-site.com'
+            );
+
+echo form_hidden($data);
+
+// Would produce:

+<input type="hidden" name="name" value="John Doe" />
+<input type="hidden" name="email" value="john@some-site.com" />
+<input type="hidden" name="url" value="http://www.some-site.com" />
+ + + + +

form_input()

+ +

Lets you generate a standard text input field. You can minimally pass the field name and value in the first +and second parameter: + +echo form_input('username', 'johndoe'); + +

Or you can pass an associative array containing any data you wish your form to contain:

+ +$data = array(
+              'name'        => 'username',
+              'id'          => 'username',
+              'value'       => 'johndoe',
+              'maxlength'   => '100',
+              'size'        => '50',
+              'style'       => 'width:50%',
+            );
+
+echo form_input($data);
+
+// Would produce:

+<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
+ +

If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the +third parameter: + +$js = 'onClick="some_function()"';
+
+echo form_input('username', 'johndoe', $js);
+ +

form_password()

+ +

This function is identical in all respects to the form_input() function above +except that is sets it as a "password" type.

+ +

form_upload()

+ +

This function is identical in all respects to the form_input() function above +except that is sets it as a "file" type, allowing it to be used to upload files.

+ +

form_textarea()

+ +

This function is identical in all respects to the form_input() function above +except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above +example, you will instead specify "rows" and "cols".

+ + +

form_dropdown()

+ +

Lets you create a standard drop-down field. The first parameter will contain the name of the field, +the second parameter will contain an associative array of options, and the third parameter will contain the +value you wish to be selected. Example: + +$options = array(
+                  'small'  => 'Small Shirt',
+                  'med'    => 'Medium Shirt',
+                  large'   => 'Large Shirt',
+                  'xlarge' => 'Extra Large Shirt',
+                );
+
+echo form_dropdown('shirts', $options, 'large');
+
+// Would produce:

+ +<select name="shirts">
+<option value="small">Small Shirt
+<option value="med">Medium Shirt
+<option value="large" selected>Large Shirt
+<option value="xlarge">Extra Large Shirt
+</select>
+ + +

If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter: + +$js = 'onChange="some_function()"';
+
+echo form_dropdown('shirts', $options, 'large', $js);
+ + +

form_checkbox()

+ +

Lets you generate a checkbox field. Simple example: + + +echo form_checkbox('newsletter', 'accept', TRUE);
+
+// Would produce:
+
+<input type="checkbox" name="newsletter" value="accept" checked="checked" />
+ +

The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

+ +

Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

+ +$data = array(
+              'name'        => 'newsletter',
+              'id'          => 'newsletter',
+              'value'       => 'accept',
+              'checked'     => TRUE,
+              'style'       => 'margin:10px',
+            );
+
+echo form_checkbox($data);
+
+// Would produce:

+<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
+ +

As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter: + +$js = 'onClick="some_function()"';
+
+echo echo form_checkbox('newsletter', 'accept', TRUE, $js)
+ + +

form_radio()

+

This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

+ + +

form_submit()

+ +

Lets you generate a standard submit button. Simple example:

+ +echo form_submit('mysubmit', 'Submit Post!');
+
+// Would produce:
+
+<input type="submit" name="mysubmit" value="Submit Post!" />
+ +

Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. +The third parameter lets you add extra data to your form, like JavaScript.

+ + +

form_close()

+ +

Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

+ +$string = "</div></div>";
+
+echo form_close($string);
+
+// Would produce:
+
+</form>
+</div></div>
+ + + + + +

form_prep()

+ +

Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

+ +$string = 'Here is a string containing "quoted" text.';
+
+<input type="text" name="myform" value="$string" />
+ +

Since the above string contains a set of quotes it will cause the form to break. +The form_prep function converts HTML so that it can be used safely:

+ +<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> + +

Note: If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this function. Use it only if you are +creating your own form elements.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html new file mode 100644 index 00000000..603b83aa --- /dev/null +++ b/user_guide/helpers/html_helper.html @@ -0,0 +1,117 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

HTML Helper

+ +

The HTML Helper file contains functions that assist in working with HTML.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('html'); + +

The following functions are available:

+ + +

heading()

+ +

Lets you create HTML <h1> tags. The first parameter will contain the data, the +second the size of the heading. Example:

+ +echo heading('Welcome!', 3); + +

The above would produce: <h3>Welcome!</h3>

+ + +

nbs()

+

Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

+echo nbs(3); +

The above would produce: &nbsp;&nbsp;&nbsp;

+ + +

br()

+

Generates line break tags (<br />) based on the number you submit. Example:

+echo br(3); +

The above would produce: <br /><br /><br />

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html new file mode 100644 index 00000000..342549d3 --- /dev/null +++ b/user_guide/helpers/index.html @@ -0,0 +1,131 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Helper Functions

+ +

Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular +category. There are URL Helpers, that assist in creating links, there are Form Helpers +that help you create form elements, Text Helpers perform various text formatting routines, +Cookie Helpers set and read cookies, File Helpers help you deal with files, etc. +

+ +

Unlike most other systems in Code Igniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. +Each helper function performs one specific task, with no dependence on other functions.

+ +

Helpers are intentionally kept very simple so that they can be used within your View Files with a minimal amount of code. +This is important if you intend to have designers or non-programmer will be working with your view files, since it keeps the code to a minimum. +

+ +

Code Igniter does not load Helper Files by default, so the first step in using +a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

+ +

Loading a Helper

+ +

Loading a helper file is quite simple using the following function:

+ +$this->load->helper('name'); + +

Where name is the file name of the helper, without the .php file extension or the "helper" part.

+ +

For example, to load the URL Helper file, which is named url_helper.php, you would do this:

+ +$this->load->helper('url'); + +

A helper can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), +as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available +automatically in any function, or you can load a helper in a specific function that needs it.

+ +

Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

+ +

Auto-loading Helpers

+ +

If you find that you need a particular helper globally throughout your application, you can tell Code Igniter to auto-load it during system initialization. +This is done by opening the application/config/autoload.php file and adding the helper to the autoload array.

+ + +

Using a Helper

+ +

Once you've loaded the Helper File containing the function you intend to use, you'll call it the way you would a standard PHP function.

+ +

For example, to create a link using the anchor() function in one of your view files you would do this:

+ +<?=anchor('blog/comments', 'Click Here');?> + +

Where "Click Here" is the name of the link, and "blog/comments" is the URI to the controller/function you wish to link to.

+ + +

Now What?

+ +

In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html new file mode 100644 index 00000000..7649fe77 --- /dev/null +++ b/user_guide/helpers/security_helper.html @@ -0,0 +1,131 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Security Helper

+ +

The Security Helper file contains security related functions.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('security'); + +

The following functions are available:

+ + +

xss_clean()

+ +

Provides Cross Site Script Hack filtering. This function is an alias to the the one in the +Input class. More info can be found there.

+ + +

hash()

+ +

Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

+ + +$str = hash($str); // SHA1
+
+$str = hash($str, 'md5'); // MD5 +
+ + + + +

strip_image_tags()

+ +

This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

+ +$string = strip_image_tags($string); + + +

encode_php_tags()

+ +

This is a security function that converts PHP tags to entities. Note: If you use the XSS filtering function it does this automatically.

+ +$string = encode_php_tags($string); + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html new file mode 100644 index 00000000..dfe8ae7d --- /dev/null +++ b/user_guide/helpers/string_helper.html @@ -0,0 +1,144 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

String Helper

+ +

The String Helper file contains functions that assist in working with strings.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('string'); + +

The following functions are available:

+ +

random_string()

+ +

Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

+ +

The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

+ + +
    +
  • alnum:  Alpha-numeric string with lower and uppercase characters.
  • +
  • numeric:  Numeric string.
  • +
  • nozero:  Numeric string with no zeros.
  • +
  • unique:  Encrypted with MD5 and uniquid(). Note: The length parameter is not available for this type. +Returns a fixed length 33 character string.
  • +
+ +

Usage example:

+ +echo random_string('alnum', 16); + + +

alternator()

+ +

Allows two or more items to be alternated between, when cycling through a loop. Example: + +for ($i = 0; $i < 10; $i++)
+{
+    echo alternator('string one', 'string two');
+}
+
+ +

You can add as many parameters as you want, and with each each iteration of your loop the next item will be returned.

+ +for ($i = 0; $i < 10; $i++)
+{
+    echo alternator('one', 'two', 'three', 'four', 'five');
+}
+
+ +

Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

+ + + +

repeater()

+

Generates repeating copies of the data you submit. Example:

+$string = "\n";
+echo repeater($string, 30);
+ +

The above would generate 30 newlines.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html new file mode 100644 index 00000000..61de8ea4 --- /dev/null +++ b/user_guide/helpers/text_helper.html @@ -0,0 +1,197 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Text Helper

+ +

The Text Helper file contains functions that assist in working with text.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('text'); + +

The following functions are available:

+ + +

word_limiter()

+ +

Truncates a string to the number of words specified. Example:

+ + +$str = "Here is a nice text string consisting of eleven words.";
+
+$string = word_limiter($string, 4);

+ +// Returns: Here is a nice… +
+ +

The third parameter is an optional suffix added to the string. By default it add an ellipsis.

+ + +

character_limiter()

+ +

Truncates a string to the number of characters specified. It maintains the integrity +of words so the character count may be slightly more or less then what you specify. Example:

+ + +$str = "Here is a nice text string consisting of eleven words.";
+
+$string = char_limiter($string, 20);

+ +// Returns: Here is a nice text string… +
+ +

The third parameter is an optional suffix added to the string. By default it add an ellipsis.

+ + + +

ascii_to_entities()

+ +

Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, +so that they can be shown consistently regardless of browser settings or stored reliably in a database. +There is some dependance on your server's supported character sets, so it may not be 100% reliable in all cases, but for the most +part it should correctly identify characters outside the normal range (like accented characters). Example:

+ +$string = ascii_to_entities($string); + + +

entities_to_ascii()

+ +

This function does the opposite of the previous one; it turns character entities back into ASCII.

+ + +

word_censor()

+ +

Enables you to censor words within a text string. The first parameter will contain the original string. The +second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value +for the words. If not specified they are replaced with pound signs: ####. Example:

+ + +$disallowed = array('darn', 'shucks', 'golly', 'phooey');
+
+$string = word_censor($string, $disallowed, 'Beep!');
+ + +

highlight_code()

+ +

Colorizes a string of code (PHP, HTML, etc.). Example:

+ +$string = highlight_code($string); + +

The function uses PHP's highlight_string() function, so the colors used are the ones specified in your php.ini file.

+ + +

highlight_phrase()

+ +

Will highlight a phrase within a text string. The first parameter will contain the original string, the second will +contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags +you would like the phrase wrapped in. Example:

+ + +$str = "Here is a nice text string about nothing in particular.";
+
+$string = highlight_phrase($string, "nice text", '<span style="color:#990000">', '</span>'); +
+ +

The above text returns:

+ +

Here is a nice text string about nothing in particular.

+ + + +

word_wrap()

+ +

Wraps text at the specified character count while maintaining complete words. Example:

+ +$string = "Here is a simple string of text that will help us demonstrate this function.";
+
+echo word_wrap($string, 25);
+
+// Would produce:
+
+Here is a simple string
+of text that will help
+us demonstrate this
+function
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html new file mode 100644 index 00000000..5e8da4ba --- /dev/null +++ b/user_guide/helpers/typography_helper.html @@ -0,0 +1,129 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Typography Helper

+ +

The Typography Helper file contains functions that help your format text in semantically relevant ways.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('typography'); + +

The following functions are available:

+ + +

auto_typography()

+ +

Formats text so that it is semantically and typographically correct HTML. Takes a string as input and returns it with +the following formatting:

+ +
    +
  • Surrounds paragraphs within <p></p> (looks for double line breaks to identify paragraphs).
  • +
  • Single line breaks are converted to <br />, except those that appear within <pre> tags.
  • +
  • Block level elements, like <div> tags, are are not wrapped within paragraphs, but their contained text is if it contains paragraphs.
  • +
  • Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
  • +
  • Apostrophes are converted to curly apostrophy entities.
  • +
  • Double dashes (either like -- this or like--this) are converted to em—dashes.
  • +
  • Three consecutive periods either preceding or following a word are converted to ellipsis…
  • +
  • Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
  • +
+ +

Usage example:

+ +$string = auto_typography($string); + +

Note: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. +If you choose to use this function you may want to consider +caching your pages.

+ + +

nl2br_except_pre()

+ +

Converts newlines to <br /> tags unless they appear within <pre> tags. +This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

+ +

Usage example:

+ +$string = nl2br_except_pre($string); + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html new file mode 100644 index 00000000..a8f5c14d --- /dev/null +++ b/user_guide/helpers/url_helper.html @@ -0,0 +1,269 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

URL Helper

+ +

The URL Helper file contains functions that assist in working with URLs.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('url'); + +

The following functions are available:

+ +

site_url()

+ +

Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your +site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

+ +

You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable +in the event your URL changes.

+ +

Segments can be optionally passed to the function as a string or an array. Here is a string example:

+ +echo site_url("news/local/123"); + +

The above example would return something like: http://www.your-site.com/index.php/news/local/123

+ +

Here is an example of segments passed as an array:

+ + +$segments = array('news', 'local', '123');
+
+echo site_url($segments);
+ + +

base_url()

+

Returns your site base URL, as specified in your config file. Example:

+echo base_url(); + + +

index_page()

+

Returns your site "index" page, as specified in your config file. Example:

+echo index_page(); + + + +

anchor()

+ +

Creates a standard HTML anchor link based on your local site URL:

+ +<a href="http://www.your-site.com">Click Here</a> + +

The tag has three optional parameters:

+ +anchor(uri segments, text, attributes) + +

The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, +segments can be a string or an array. Note: Do not include the base URL. It will be built as specified in your config file. Include +only the URI segments you wish appended to the URL.

+ +

The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

+ +

The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

+ +

Here are some examples:

+ +echo anchor(news/local/123, My News); + +

Would produce: <a href="http://www.your-site.com/index.php/news/local/123" title="My News">My News</a>

+ +echo anchor(news/local/123, My News, array('title' => 'The best news!')); + +

Would produce: <a href="http://www.your-site.com/index.php/news/local/123" title="The best news!">My News</a>

+ + +

anchor_popup()

+ +

Nearly identical to the anchor() function except that it opens the URL in a new window. + +You can specify JavaScript window attributes in the third parameter to control how the window is opened. If +the third parameter is not set it will simply open a new window with your own browser settings. Here is an example +with attributes:

+ + + +$atts = array(
+              'width'      => '800',
+              'height'     => '600',
+              'scrollbars' => 'yes',
+              'status'     => 'yes',
+              'resizable'  => 'yes',
+              'screenx'    => '0',
+              'screeny'    => '0'
+            );
+
+echo anchor_popup(news/local/123, 'Click Me!', $atts);
+ +

Note: The above attributes are the function defaults so you only need to set the ones that are different from what you need. +If you want the function to use all of its defaults simply pass an empty array in the third parameter:

+ +echo anchor_popup(news/local/123, 'Click Me!', array()); + + +

mailto()

+ +

Creates a standard HTML email link. Usage example:

+ +echo mailto('me@my-site.com', 'Click Here to Contact Me'); + +

As with the anchor() tab above, you can set attributes using the third parameter.

+ + +

safe_mailto()

+ +

Identical to the above function except it writes an obfuscated version of the mailto tag using ordinal numbers +written with JavaScript to help prevent the email address from being harvested by spam bots.

+ + +

auto_link()

+ +

Automatically turns URLs and email addresses contained in a string into links. Example:

+ +$string = auto_link($string); + +

The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both +if the parameter is not specified

+ +

Converts only URLs:

+$string = auto_link($string, 'url'); + +

Converts only Email addresses:

+$string = auto_link($string, 'email'); + +

The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

+$string = auto_link($string, 'both', TRUE); + + +

url_title()

+

Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog +in which you'd like to use the title of your entries in the URL. Example:

+ +$title = "What's wrong with CSS?";
+
+$url_title = url_title($title);
+
+// Produces: whats-wrong-with-css +
+ + +

The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

+ +$title = "What's wrong with CSS?";
+
+$url_title = url_title($title, 'underscore');
+
+// Produces: whats_wrong_with_css +
+ + +

prep_url()

+

This function will add http:// in the event it is missing from a URL. Pass the URL string to the function like this:

+ +$url = "www.some-site.com";

+$url = prep_url($url);
+ + + + +

redirect()

+ +

Does a "header redirect" to the local URI specified. Just like other functions in this helper, this one is designed +to redirect to a local URL within your site. You will not specify the full site URL, but rather simply the URI segments +to the controller you want to direct to. The function will build the URL based on your config file values.

+ +

The second parameter allows you to choose between the "location" +method or the "refresh" method. Location is faster, but on Windows servers it can sometimes be a problem. Example:

+ +if ($logged_in == FALSE)
+{
+     redirect('/login/form/', 'refresh');
+}
+ +

Note: In order for this function to work it must be used before anything is outputted +to the browser since it utilizes server headers.

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html new file mode 100644 index 00000000..63e2b73c --- /dev/null +++ b/user_guide/helpers/xml_helper.html @@ -0,0 +1,110 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

XML Helper

+ +

The XML Helper file contains functions that assist in working with XML data.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('xml'); + +

The following functions are available:

+ +

xml_convert('string')

+ +

Takes a string as input and converts the following reserved XML characters to entities:

+ +

+Ampersands: &
+Less then and greater than characters: < >
+Single and double quotes: '  "
+Dashes: -

+ +

This function ignores ampersands if they are part of existing character entities. Example:

+ +$string = xml_convert($string); + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/images/appflowchart.gif b/user_guide/images/appflowchart.gif new file mode 100644 index 0000000000000000000000000000000000000000..422332c9e21ceb09a535d098407f52effc392baa GIT binary patch literal 25276 zcmV)2K+L~KNk%w1VYvd$0QUd@|Ns9kW}lEq1OER0kQf;K{r#7BIsgCwMTkWF{QUa* z`uF$u`}_Ow@bL8X^!fSu?d|Q^+1dE`_~_{9+}zyu_V(=T?BCzt_4W1h^Yi57GARL;Nalp<>l4Y)#vBu($doI?(XmJ@7mhh>gwv$)YOtq3eC;U=H}+x z+uPUI*VEI}k4OX7*4E?W<27rc;o;%Oqk-$|>vyPjkxUAOgM-M9j=Ig~TUc1Dj8WRh zu&$C^wY9XHFE2tuLh9Yns!mR~XlRV8=F!p7V~o~qliE2sIdPWU-rnATq2bTZ&yPm~ z@aWzjA0A*}V61jRkhqV~(9m_5-IlV?dY#|S&d&1a9e^mvgqN0vR1FDHjhF1cmyy&Kd zMj#&_2s)l(jJJ+U3XMktpP!$Yax9#joM>falT8brUn3wOAo%p}qQjxUz`)D9oR?D* z%h~6zudmJ8^mk1FT3A=rx}f;;^0R?bfPa6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nRB+Hgi8oRkQj+~vx5vZzkr648 T6G@R3X^|I+kr`=$0RaFz4Q(3T literal 0 HcmV?d00001 diff --git a/user_guide/images/arrow.gif b/user_guide/images/arrow.gif new file mode 100644 index 0000000000000000000000000000000000000000..9e9c79a79f1e962848ce10853005a144faea2aee GIT binary patch literal 123 zcmZ?wbhEHbI#bim(+ zf&LE|m>3ute(y|7%*-sz%uJ{L0^1*O{0$l)5Xiv5z{M-`!^`!TpX*-( z$G?Za&-tIp$y)#y6TlhJ52WD&&~niLxoA$h0dc=&0~l#&e%t@xk1j?gW?CAS-}Ha+ zfBZDGoPa+{Xn_nsAQKbgUlfoIK+nL%$Rx@w$HR;;zI$Gt*CSLb+2nLywP#q(1%>gs zd)lV=Z$|LddZ&pi^Pl1Re{s2JXitcMQ$U*E!hl?WD}dDm+E7j0J{|xO%kg7jb(461 z@lciUa>$K9x*&ggx+~+XtB!u$(FA{LlF?h#O%ckR^}RaytY``9rJfb{S+q6ANrMHM zq9=0DLw6t>j!=$VLva6&h=TC4(Ekbj?+Iebc`WSKkAti9$~t+QxG#*QZL%S4xA#^T zoFfifw~0Xw}`6hj+jj}75g0eaU9J8Yaa+axBt4B$`u(@R37tWk^^Vy-W@29IWQ z!_nez3RotLd7QTXqv~&YnmAz=<_8~fxO(}(#19E*@!8Gsv-LBW^-7(Y8a~c(sIppW zUGX;n3%lcHbon_!n?1vf``b~kmA|e*PXNNr4GV@Ey10^b!4EcV^LW~z$vf3sPc2TB z_&N?#3t2HacKRjgSLi9iVpX7ex9CnSiVc8Ji!|z1ydSIJhx5>8eZ})d>>@-v_4aST-V+E+?6knHl9`cXY}x?*Z{2aWlj zs_T?aKHhxi4zAEQYc1K@TIEkvV|{X5pca&huC|sd=keM8dW>n(Hmr#RmrDSI z%pRLVlOUx)n4r}nYr9fCS3~M+?)!q&YC2Y;U+;W`GT`{1)%LIF$`QAPOHTXjs9Lec zQOlp5Mc3=={H}BHO}zRywLuh1ys>?1s=DTpXh)vL@Kx(GWe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_J7{Z1fhO-4r*3`FsQ;KkEteXG9I-k#X)5d+$#$Inm zJ7$|H5sJc#zBm|vXgX3A)7LiXpX`7s8uYiSo)6se+P0JS-3)T;=y`KSUPqK+9_NdC z7mGIrnoj_vs%y$Dq)Gqx%9J|RtZ~KqROby1E5q9O=v!S$DhKLqf9n+KG^yjr#CNo6 z+{?xCjJ8h*@jI&H2t_klnVXl-Cj{a0BCG>`(S0qrTQ*ckX zIY&a&gHyXZU4!Qx_KFJm7`HEh*wg&^%2)Sh@onCNZxqvtnkt74SO9 zfWAZ9Ex)-Osv5IPkdR;`#Q%s?E`n2z&HTR^GJ0 literal 0 HcmV?d00001 diff --git a/user_guide/images/ci_quick_ref.png b/user_guide/images/ci_quick_ref.png new file mode 100644 index 0000000000000000000000000000000000000000..c07d6b46970bfde2affac0e50644db91414e41c0 GIT binary patch literal 94476 zcmXt2Pe_cIrb)_ zI1MAKa-!5}oaFoR{``LaaXXyX^}6PB+@Fu@hO4tJFSiso2n6CiZfE5V0zudy5OkRn z3jF2O*X2^+7e^Sz2?KnZn{n~h0X|D!wD!K}aX$3om4Mg~5GMG1V2Hx;$bhgA_mF_# zt1&|%ra%iISH~09dwY9p8+)HxTM1cvz=JPdyx3&!ecRdl^?MJEMw^?PCnhE~J$zwo zVoo3sE?i99>g%J?Xy51Nwzjt1`co+sii?ZO>-jA#?ga=0j);iJ%*_t40K zyuAFx!~}nRP`)fA-}Z`0?Y1 zmX_8fAD`fm^D?sXC=}|;)Le5)%9%5Ma&mH>Uj8ro_ZU~Mm}qEVvDi1YwF}F8+uPga z_xBz=crZCRd9S?L*3N~Pl=HH4OF_w81LaL7lef0_hL0Zo_wOH@%@z<47%eUJvam>) zt>Hr=KYsj}cmDk9>Z+`mSXXZD{QSJSqGDS9UQ^QY&!2larF)@HP7^bGJ8PetAMcT` zU5mUjM+y#hI$4}-H4FTF`}S@9R4Wn}__@}i<*TwL5WHMMWwzU}Ml`|{-rCntYHL&N^ce*IQl zTw-Ko?CtHX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OD8p-_JhfT>t-f2uGVo90{WPaW4mWojPHEyz!V%-2VZRU;f?z literal 0 HcmV?d00001 diff --git a/user_guide/images/file.gif b/user_guide/images/file.gif new file mode 100644 index 0000000000000000000000000000000000000000..8141e035765ada7662821335f68ff7d29de5788b GIT binary patch literal 370 zcmZ?wbhEHb{^WFOoFJHa>_Wk?kFJGQKd;ak8lf8TQ z)iyRCJa}m5u3a_tjn7}aOh`(xvvUZGh;sMz{`l!rbZq>ax9@!X0-Rmk0)s;>Ev=uu zcsXg>j0KCA?%ub*v863DCvU^1E$!XCpFe-;>YGqeQ`b9TQeI(kN_yt@ox8U0+`WF| z<}KT{=NFX}msJ2A!$2ZX{K>+|z@X2d1JVcb69ZfSf$0SvI#T^7mK1r$Sj_hmI&Q4P zyY9wnMY*cvxjC`hf1ST9^5^DoD2u0Y1wvKwzT8WPXHXO0qJU~g_|We^Z$5aH?R z?Ga%R6=GnSI&C_GkR*c`*Sz`j#26&S8CaLESjiwR%)rmPVI%)$24M*Xj-9)9Ge`(B fa2`B#m_bmA;l#;PC#0CpoxgCw=kgV2M+R#E(SVbV literal 0 HcmV?d00001 diff --git a/user_guide/images/folder.gif b/user_guide/images/folder.gif new file mode 100644 index 0000000000000000000000000000000000000000..fef31a60b2ff00dec181fc27cb2267878e36afaa GIT binary patch literal 570 zcmZ?wbhEHb?p5w`Tqng2jwY@F89^E4)=f8xaV)zya^8_!Rg_eFZbEnIkI(!>uNH$6Rm{MXEx zXS=)iIXjj5`!^pr@VTx1)|@%#O-(a)Y=1p__W3ny?r+=na>dHqB_&(yYB#Q0eRtxd z_sf>uJaOXpp+jGD^Hyxx@_g~)Ye$d%$j@K2VdIm{o1R%&=Pg-sea4K_d-lAaH}~S? zNypmScJABvp{aRWL&N5djy+SSo>;T`ep}nEo}OnDCmxJ+|t_C-qG3B-P7B|FkwO`1LM@G4DC}S zI62w087EF)^O?f3Y?;fn=?m9PbXH(xVA{N8D=PF+VzCqGfJn;p$*7`mUcr-AmEU eyJE=#gU2VVgM@NA3XTWNU)(OBY{tdHU=0AxnagGX literal 0 HcmV?d00001 diff --git a/user_guide/images/nav_bg.jpg b/user_guide/images/nav_bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..440e04ddb406a6f6553ff755135a99777e31d148 GIT binary patch literal 441 zcmex=C5UDGKfoZ!!JxyS&deytz$D1XEXer(2tzE; z+02YUS0VrtJ0}+-st{080O$i&PJ}831}4UZLCnIzEMnK#!>4md3Swyae~W#!?^^YX6AMO8Puw(Hyc;7hZ!H>CxI!wx+U+LW&w|K*+%b%MCq+vG0Yry*91L~ jaC@6HoiRDsMTgN>U<0d((*co-+zdc26UaU=_^fFN%4A1V|p(1D);H+XF(6x5S@*!k5_aSq~!K^=ukl3oFr# mj1WZ$DpAEMmj3oHefc-!Emdo4$gT{c_~odK8J#CbySxCR0v&n) literal 0 HcmV?d00001 diff --git a/user_guide/images/nav_toggle.jpg b/user_guide/images/nav_toggle.jpg new file mode 100644 index 0000000000000000000000000000000000000000..531bc2635a35d9a91711a542a62063a7a98b9b29 GIT binary patch literal 3076 zcma)5c{J2tAO4OpW(+1{i?Si z8QHgxwL+E%(Y!jR-|v0TdCz&@-*eCX+77@ot+mp;f!xlu7Cjyh*~lmK7p zIi1>jL{iOdK+4Frl^+QL_M`rDgjfX#sf5147y;P9`yvvI1ayEwvDP9BA&9Dks1@81 zxqQ8eOe%bnLl;^CUs*t`cpQf6-i*{8(gfEXVxiE5Ch2O3ux~8kNw2SC$g>FVxlQtS9cFwMa#`$Nw zb~WdePWZKgdcCK2QzRArK;!cF@mVb7W!hmUSL9;5Bk1QwDn<~v`;454otAp_QDN35g^RxtIkTHA!ZR!Bmsp@8dx?_eU7f<)$vDVj|6_2pw zuhUhV&Xsv^sJ~KJ6YFH3=N|XqUX`pd5uY5M<}AeRkA`9i1=M=KPRR~=ShZ7SbfQ&r zpjD5?Jw+yd-D4Njq-a%z>DIIaNotxbPbRCz`JuzAT)kjbv4e1`r_2LMCBI}dk&}+x zg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-y&u+H69`>n~Rc zs-LW`N7)Tpznf>SJ%U!TWUs1n53Z*1`>ndT6AM?m6m3*JO{=evhpt9+HMu=Ht9;3) z66+;Pv2>GO$CM?dvvg%^+)?Gq#o8A|kdh?d+OqdZoq9be;&#RmQ|f*`K6_D&rXaj5 zs6%<{UQyX`vP`Pbq{I zUc4)2*hn-vmdwfY)OB8c_xlt(CAgJv2uCHEwX9RpOVsB%rW{n_h%NL$`y(t8)E;Uv z=Y!ZTe=eK65wiZo0LxvTDV&998MfSxJ*XpE?a`bRac$-zAzo)YQQGyh=O|wLjjTA= zpzqV?$?}%IHe+(X9$@e(v27a}!{B0Jd|tZTB^hyj2hvo*8)oo@E>zV0rwR*xY+&s0 zWkaZRg>u;SL3JktL~<5GiwMC*ksx2MmtV^n?R&CtDz*4MypC3TLR0znypAB8mHT+J z;r)k~Kx&w$2&NUIJFlim8}8@=QTAl8s36Qi;uUgq)8qJ)alQ#U;S1eXVKmuhUdkNm zD^iS(C7R;7O2-HlUvaTMLYEkTyAU+u=kp(d+hZ@zVpYQ0wd%TUMrbAymkIbRDsG!> ztl}VNOcaP+$2dDXLgY5J3X7&vP=3rL1jVpm9t-012Ma~biGOCZuJ_i`q1OlCwP0{Xd2e-J4aMx}Eb&E% z{B~E&ew||g-fQlI48XYRK-i$x$Dy^2ty;-Y3lEbOf%(i)VTZmkmx z!R5W>-+|D#``_VeP{{7(RGpAtzKxodMY{U^Klj*H@@B5))W;a~MB*CT+8($eGH$F%!BQbc z7#qIqNGK#UACS`hp-AhaeS)TvLNZ*xxUPb!bnOn*25KvOWeq;(1_A literal 0 HcmV?d00001 diff --git a/user_guide/images/transparent.gif b/user_guide/images/transparent.gif new file mode 100644 index 0000000000000000000000000000000000000000..b7406476aa46e4d98eefacf95f6d3e8c5439e330 GIT binary patch literal 43 qcmZ?wbh9u|WMp7uXkY+=|Ns9h{$ycf01D`U_#hbuCMF+725SJnmj?g< literal 0 HcmV?d00001 diff --git a/user_guide/index.html b/user_guide/index.html new file mode 100644 index 00000000..b0f4bfa3 --- /dev/null +++ b/user_guide/index.html @@ -0,0 +1,106 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + +
+ + + +
+ +
+ + + +
+ + + +

Welcome to Code Igniter

+ +

Code Igniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. +Its goal is to enable you to develop projects must 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. Code Igniter lets you creatively focus on your project by +minimizing the amount of code needed for a given task.

+ +

Please read the Introduction section of the User Guide to learn the broad concepts behind Code Igniter, +then read the Getting Started page.

+ + +

Who is Code Igniter For?

+ +

Code Igniter is right for you if:

+ +
    +
  • You want a framework with a small footprint.
  • +
  • You are not interested in large-scale, monolithic libraries, like PEAR.
  • +
  • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
  • +
  • You want a framework that requires nearly zero configuration.
  • +
  • You want a framework that does not require you to use the command line.
  • +
  • You do not want to be forced to learn a templating language.
  • +
  • You need exceptional performance.
  • +
  • You eschew complexity, favoring simple solutions.
  • +
  • You need clear, thorough documentation.
  • +
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html new file mode 100644 index 00000000..df887845 --- /dev/null +++ b/user_guide/installation/downloads.html @@ -0,0 +1,97 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html new file mode 100644 index 00000000..15e7925b --- /dev/null +++ b/user_guide/installation/index.html @@ -0,0 +1,116 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Installation Instructions

+ +

Code Igniter is installed in four steps:

+ +
    +
  1. Unzip the package.
  2. +
  3. Upload the Code Igniter folders and files to your server. Normally the index.php file will be at your root.
  4. +
  5. Open the application/config/config.php file with a text editor and set your base URL.
  6. +
  7. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
  8. +
+ +

If you wish to increase security by hiding the location of your Code Igniter files you can rename the system folder +to something more private. If you do rename it, you must open your main index.php file and set the $system_folder +variable at the top of the page with the new name you've chosen.

+ +

That's it!

+ +

If you're new to Code Igniter, please read the Getting Started section of the User Guide to begin learning how +to build dynamic PHP applications. Enjoy!

+ +

Troubleshooting

+ +

If you find that no matter what you put in your URL only your default page is loading, it might be that your server +does not support the PATH_INFO variable needed to serve search-engine friendly URLs. + +As a first step, open your application/config/config.php file and look for the URI Protocol +information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need +to force Code Igniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:

+ +$config['index_page'] = "index.php"; + +

To this:

+ +$config['index_page'] = "index.php?"; + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html new file mode 100644 index 00000000..28ee83cb --- /dev/null +++ b/user_guide/installation/upgrade_120.html @@ -0,0 +1,98 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading From Beta 1.0 to Final 1.2

+ +

To upgrade to Version 1.2 please replace the following directories with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • drivers
  • +
  • helpers
  • +
  • init
  • +
  • language
  • +
  • libraries
  • +
  • plugins
  • +
  • scaffolding
  • +
+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html new file mode 100644 index 00000000..41de13e7 --- /dev/null +++ b/user_guide/installation/upgrade_130.html @@ -0,0 +1,209 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading from 1.2 to 1.3

+ +

Note: The instructions on this page assume you are running version 1.2. If you +have not upgraded to that version please do so first.

+ + +

Before performing an update you should take your site offline by replacing the index.php file +with a static one.

+ + +

Step 1: Update your Code Igniter files

+ +

Replace the following directories in your "system" folder with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • application/models/   (new for 1.3)
  • +
  • codeigniter   (new for 1.3)
  • +
  • drivers
  • +
  • helpers
  • +
  • init
  • +
  • language
  • +
  • libraries
  • +
  • plugins
  • +
  • scaffolding
  • +
+ + +

Step 2: Update your error files

+ +

Version 1.3 contains two new error templates located in application/errors, and for naming consistency the other error templates have +been renamed.

+ +

If you have not customized any of the error templates simply +replace this folder:

+ +
    +
  • application/errors/
  • +
+ +

If you have customized your error templates, rename them as follows:

+ + +
    +
  • 404.php   =  error_404.php
  • +
  • error.php   =  error_general.php
  • +
  • error_db.php   (new)
  • +
  • error_php.php   (new)
  • +
+ + +

Step 3: Update your index.php file

+ +

Please open your main index.php file (located at your root). At the very bottom of the file, change this:

+ +require_once BASEPATH.'libraries/Front_controller'.EXT; + +

To this:

+ +require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; + + +

Step 4: Update your config.php file

+ +

Open your application/config/config.php file and add these new items:

+ +
+/*
+|------------------------------------------------
+| URL suffix
+|------------------------------------------------
+|
+| This option allows you to add a suffix to all URLs.
+| For example, if a URL is this:
+|
+| www.your-site.com/index.php/products/view/shoes
+| 
+| You can optionally add a suffix, like ".html",
+| making the page appear to be of a certain type:
+|
+| www.your-site.com/index.php/products/view/shoes.html
+|
+*/
+$config['url_suffix'] = "";
+
+
+/*
+|------------------------------------------------
+| Enable Query Strings
+|------------------------------------------------
+|
+| By default Code Igniter uses search-engine and 
+| human-friendly segment based URLs:
+|
+| www.your-site.com/who/what/where/
+|
+| You can optionally enable standard query string
+| based URLs:
+|
+| www.your-site.com?who=me&what=something&where=here
+|
+| Options are: TRUE or FALSE (boolean)
+|
+| The two other items let you set the query string "words"
+| that will invoke your controllers and functions:
+| www.your-site.com/index.php?c=controller&m=function
+|
+*/
+$config['enable_query_strings'] = FALSE;
+$config['controller_trigger'] = 'c';
+$config['function_trigger'] = 'm';
+
+ + +

Step 5: Update your database.php file

+ +

Open your application/config/database.php file and add these new items:

+ +
+$db['default']['dbprefix'] = "";
+$db['default']['active_r'] = TRUE;
+
+ + +

Step 6: Update your user guide

+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html new file mode 100644 index 00000000..8f7a7408 --- /dev/null +++ b/user_guide/installation/upgrade_131.html @@ -0,0 +1,108 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading from 1.3 to 1.3.1

+ +

Note: The instructions on this page assume you are running version 1.3. If you +have not upgraded to that version please do so first.

+ +

Before performing an update you should take your site offline by replacing the index.php file with a static one.

+ + + +

Step 1: Update your Code Igniter files

+ +

Replace the following directories in your "system" folder with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • drivers
  • +
  • init/init_unit_test.php (new for 1.3.1)
  • +
  • language/
  • +
  • libraries
  • +
  • scaffolding
  • +
+ + +

Step 2: Update your user guide

+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html new file mode 100644 index 00000000..69f22212 --- /dev/null +++ b/user_guide/installation/upgrade_132.html @@ -0,0 +1,106 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading from 1.3.1 to 1.3.2

+ +

Note: The instructions on this page assume you are running version 1.3.1. If you +have not upgraded to that version please do so first.

+ +

Before performing an update you should take your site offline by replacing the index.php file with a static one.

+ + + +

Step 1: Update your Code Igniter files

+ +

Replace the following directories in your "system" folder with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • drivers
  • +
  • init
  • +
  • libraries
  • +
+ + +

Step 2: Update your user guide

+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html new file mode 100644 index 00000000..563cbf7b --- /dev/null +++ b/user_guide/installation/upgrade_133.html @@ -0,0 +1,118 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading from 1.3.2 to 1.3.3

+ +

Note: The instructions on this page assume you are running version 1.3.2. If you +have not upgraded to that version please do so first.

+ +

Before performing an update you should take your site offline by replacing the index.php file with a static one.

+ + + +

Step 1: Update your Code Igniter files

+ +

Replace the following directories in your "system" folder with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • codeigniter
  • +
  • drivers
  • +
  • helpers
  • +
  • init
  • +
  • libraries
  • +
+ + +

Step 2: Update your Models

+ +

If you are NOT using Code Igniter's Models feature disregard this step.

+ +

As of version 1.3.3, Code Igniter does not connect automatically to your database when a model is loaded. This +allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting +to your database prior to a model being loaded you will have to update your code. There are several options for connecting, +as described here. + + +

Step 3: Update your user guide

+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html new file mode 100644 index 00000000..7f25c44e --- /dev/null +++ b/user_guide/installation/upgrade_140.html @@ -0,0 +1,111 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading from 1.3.3 to 1.4.0

+ +

Note: The instructions on this page assume you are running version 1.3.2. If you +have not upgraded to that version please do so first.

+ +

Before performing an update you should take your site offline by replacing the index.php file with a static one.

+ + + +

Step 1: Update your Code Igniter files

+ +

Replace the following directories in your "system" folder with the new versions:

+ +

Note: If you have any custom developed files in these folders please make copies of them first.

+ +
    +
  • application/config/mimes.php
  • +
  • codeigniter
  • +
  • drivers
  • +
  • helpers
  • +
  • init
  • +
  • language
  • +
  • libraries
  • +
  • scaffolding
  • +
+ + +

Step 4: Update your user guide

+ +

Please also replace your local copy of the user guide with the new version.

+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html new file mode 100644 index 00000000..562507a5 --- /dev/null +++ b/user_guide/installation/upgrade_b11.html @@ -0,0 +1,150 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading From Beta 1.0 to Beta 1.1

+ +

To upgrade to Beta 1.1 please perform the following steps:

+ +

Step 1: Replace your index file

+ +

Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.

+ +

Step 2: Relocate your config folder

+ +

This version of Code Igniter now permits multiple sets of "applications" to all share a common set of backend files. In order to enable +each application to have its own configuration values, the config directory must now reside +inside of your application folder, so please move it there.

+ + +

Step 3: Replace directories

+ +

Replace the following directories with the new versions:

+ +
    +
  • drivers
  • +
  • helpers
  • +
  • init
  • +
  • libraries
  • +
  • scaffolding
  • +
+ + +

Step 4: Add the calendar language file

+ +

There is a new language file corresponding to the new calendaring class which must be added to your language folder. Add +the following item to your version: language/english/calendar_lang.php

+ + +

Step 5: Edit your config file

+ +

The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:

+ +$conf['cookie_prefix'] = "";
+$conf['cookie_domain'] = "";
+$conf['cookie_path'] = "/";
+ +

Change the array name from $conf to $config, like this:

+ +$config['cookie_prefix'] = "";
+$config['cookie_domain'] = "";
+$config['cookie_path'] = "/";
+ +

Lastly, add the following new item to the config file (and edit the option if needed):

+ +
+/*
+|------------------------------------------------
+| URI PROTOCOL
+|------------------------------------------------
+|
+| This item determines which server global
+| should be used to retrieve the URI string. The
+| default setting of "auto" works for most servers.
+| If your links do not seem to work, try one of
+| the other delicious flavors:
+|
+| 'auto' Default - auto detects
+| 'path_info' Uses the PATH_INFO
+| 'query_string' Uses the QUERY_STRING
+*/
+
+$config['uri_protocol'] = "auto";
+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html new file mode 100644 index 00000000..3ab9fd84 --- /dev/null +++ b/user_guide/installation/upgrading.html @@ -0,0 +1,95 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Upgrading From a Previous Version

+ +

Please read the upgrade notes corresponding to the version you are upgrading from.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html new file mode 100644 index 00000000..1f72f353 --- /dev/null +++ b/user_guide/libraries/benchmark.html @@ -0,0 +1,160 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Benchmarking Class

+ +

Code Igniter has a Benchmarking class that is always active, enabling the time difference between any +two marked points to be calculated.

+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ + +

In addition, the benchmark is always started the moment the framework is +invoked, and ended by the output class right before sending the final view to the browser, enabling a very accurate +timing of the entire system execution to be shown.

+ +

Using the Benchmark

+ +

The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this: + +

    +
  1. Mark a start point
  2. +
  3. Mark an end point
  4. +
  5. Run the "elapsed time" function to view the results
  6. +
+ +

Here's an example using real code:

+ +$this->benchmark->mark('start');
+
+// Some code happens here
+
+$this->benchmark->mark('end');
+
+echo $this->benchmark->elapsed_time('start', 'end');
+ +

Note: The words "start" and "end" are arbitrary. They are simply words used to set two markers. You can +use any words you want, and you can set multiple sets of markers. Consider this example:

+ +$this->benchmark->mark('dog');
+
+// Some code happens here
+
+$this->benchmark->mark('cat');
+
+// More code happens here
+
+$this->benchmark->mark('bird');
+
+echo $this->benchmark->elapsed_time('dog', 'cat');
+echo $this->benchmark->elapsed_time('cat', 'bird');
+echo $this->benchmark->elapsed_time('dog', 'bird');
+ + +

Displaying Total Execution Time

+ +

If you would like to display the total elapsed time from the moment Code Igniter starts to the moment the final output +is sent to the browser, simply place this in one of your view templates:

+ +<?=$this->benchmark->elapsed_time();?> + +

You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are +not using any parameters. When the parameters are absent, Code Igniter does not stop the benchmark until right before the final +output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

+ +

An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

+{elapsed_time} + +

Note: If you want to benchmark anything within your controller +functions you must set your own start/end points.

+ +

Displaying Memory Consumption

+ +

If your PHP installation is configured with --enable-memory-limit, you can display the amount of memory consumed by the entire +system using the following code in one of your view file:

+ +<?=$this->benchmark->memory_usage();?> +

Note: This function can only be used in your view files. The consumpiton will reflect the total memory used by the entire app.

+ +

An alternate way to show your memory usage in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

+{memory_usage} + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html new file mode 100644 index 00000000..a3bd87b5 --- /dev/null +++ b/user_guide/libraries/calendar.html @@ -0,0 +1,258 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + + + +

Calendaring Class

+ +

The Calendar class enables you to dynamically create calendars. Your calendars can be formatted through the use of a calendar +template, allowing 100% control over every aspect of its design. In addition, you can pass data to your calendar cells.

+ +

Initializing the Class

+ +

Like most other classes in Code Igniter, the Calendar class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('calendar'); +

Once loaded, the Calendar object will be available using: $this->calendar

+ + +

Displaying a Calendar

+ +

Here is a very simple example showing how you can display a calendar:

+ +$this->load->library('calendar');
+
+echo $this->calendar->generate();
+ +

The above code will generate a calendar for the current month/year based on your server time. +To show a calendar for a specific month and year you will pass this information to the calendar generating function:

+ +$this->load->library('calendar');
+
+echo $this->calendar->generate(2006, 6);
+ +

The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

+ +

Passing Data to your Calendar Cells

+ +

To add data to your calendar cells involves creating an associative array in which the keys correspond to the days +you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar +generating function. Consider this example:

+ +$this->load->library('calendar');
+
+$data = array(
+               3  => 'http://your-site.com/news/article/2006/03/',
+               7  => 'http://your-site.com/news/article/2006/07/',
+               13 => 'http://your-site.com/news/article/2006/13/',
+               26 => 'http://your-site.com/news/article/2006/26/'
+             );
+
+echo $this->calendar->generate(2006, 6, $data);
+ +

Using the above example, day numbers 3, 7, 13, and 26 will become links pointing to the URLs you've provided.

+ +

Note: By default it is assumed that your array will contain links. +In the section that explains the calendar template below you'll see how you can customize +how data passed to your cells is handled so you can pass different types of information.

+ + +

Setting Display Preferences

+ +

There are seven preferences you can set to control various aspects of the calendar. Preferences are set using an initialization +function similar to other classes. Here is an example: + + +$this->load->library('calendar');
+
+$prefs = array (
+               'start_day'    => 'saturday',
+               'month_type'   => 'long',
+               'day_type'     => 'short'
+             );
+
+$this->calendar->initialize($prefs);
+
+echo $this->calendar->generate();
+ +

The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information +regarding preferences below.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
templateNoneNoneA string containing your calendar template. See the template section below.
local_timetime()NoneA Unix timestamp corresponding to the current time.
start_daysundayAny week day (sunday, monday, tuesday, etc.)Sets the day of the week the calendar should start on.
month_typelonglong, shortDetermines what version of the month name to use in the header. long = January, short = Jan.
day_typeabrlong, short, abrDetermines what version of the weekday names to use in the column headers. long = Sunday, short = Sun, abr = Su.
show_next_prevFALSETRUE/FALSE (boolean)Determines whether to display links allowing you to toggle to next/previous months. See information on this feature below.
next_prev_urlNoneA URLSets the basepath used in the next/previous calendar links.
+ + + + +

Creating a Calendar Template

+ +

By creating a calendar template you have 100% control over the design of your calendar. Each component of your +calendar will be placed within a pair of pseudo-variables as shown here:

+ + +$this->load->library('calendar');

+$prefs['template'] = '

+   {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}
+
+   {heading_row_start}<tr>{/heading_row_start}
+
+   {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
+   {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
+   {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}
+
+   {heading_row_end}</tr>{/heading_row_end}
+
+   {week_row_start}<tr>{/week_row_start}
+   {week_day_cell}<td>{week_day}</td>{/week_day_cell}
+   {week_row_end}</tr>{/week_row_end}
+
+   {cal_row_start}<tr>{/cal_row_start}
+   {cal_cell_start}<td>{/cal_cell_start}
+
+   {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
+   {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}
+
+   {cal_cell_no_content}{day}{/cal_cell_no_content}
+   {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
+
+   {cal_cell_blank}&nbsp;{/cal_cell_blank}
+
+   {cal_cell_end}</td>{/cal_cell_end}
+   {cal_row_end}<tr>{/cal_row_end}
+
+   {table_close}</table>{/table_close}
+';
+
+$this->calendar->initialize($prefs);
+
+echo $this->calendar->generate();
+ + + +

Showing Next/Previous Month Links

+ +

To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar +code similar to this example:

+ + +$this->load->library('calendar');
+
+$prefs = array (
+               'show_next_prev'  => TRUE,
+               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
+             );
+
+$this->calendar->initialize($prefs);
+
+echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
+ +

You'll notice a few things about the above example:

+ +
    +
  • You must set the "show_next_prev" to TRUE.
  • +
  • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
  • +
  • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
  • +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html new file mode 100644 index 00000000..c173f569 --- /dev/null +++ b/user_guide/libraries/config.html @@ -0,0 +1,158 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Config Class

+ +

The Config class provides a means to retrieve configuration preferences. These preferences can +come from the default config file (application/config/config.php) or from your own custom config files.

+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ + +

Anatomy of a Config File

+ +

By default, Code Igniter has a one primary config file, located at application/config/config.php. If you open the file using +your text editor you'll see that config items are stored in an array called $config.

+ +

You can add your own config items to +this file, or if you prefer to keep your configuration items separate (assuming you even need config items), +simply create your own file and save it in config folder.

+ +

Note: If you do create your own config files use the same format as the primary one, storing your items in +an array called $config. Code Igniter will intelligently manage these files so there will be no conflict even though +the array has the same name (assuming an array index is not named the same as another).

+ +

Loading a Config File

+ +

Note: Code Igniter automatically loads the primary config file (application/config/config.php), +so you will only need to load a config file if you have created your own.

+ +

There are two ways to load a config file:

+ +
  1. Manual Loading + +

    To load one of your custom config files you will use the following function within the controller that needs it:

    + +$this->config->load('filename'); + +

    Where filename is the name of your config file, without the .php file extension.

    + +
  2. +
  3. Auto-loading
  4. + +

    If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, +open the autoload.php file, located at application/config/autoload.php, and add your config file as +indicated in the file.

    + +
+ + +

Fetching Config Items

+ +

To retrive an item from your config file, use the following function:

+ +$this->config->item('item name'); + +

Where item name is the $config array index you want to retrieve. For example, to fetch your language choice you'll do this:

+ +$lang = $this->config->item('language'); + +

The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

+ +

Setting a Config Item

+ +

If you would like to dynamically set a config item or change an existing one, you can so so using:

+ +$this->config->set_item('item_name', 'item_value'); + +

Where item_name is the $config array index you want to change, and item_value is its value.

+ + +

Helper Functions

+ +

The config class has the following helper functions:

+ +

$this->config->site_url();

+

This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

+ +

$this->config->system_url();

+

This function retrieves the URL to your system folder.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/active_record.html b/user_guide/libraries/database/active_record.html new file mode 100644 index 00000000..8fc3b813 --- /dev/null +++ b/user_guide/libraries/database/active_record.html @@ -0,0 +1,610 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ + +

Active Record Class

+ + +

Code Igniter uses a modified version of the Active Record Database Pattern. +This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. +In some cases only one or two lines of code are necessary to perform a database action. +Code Igniter does not require that each database table be its own class file. It instead provides a more simplified interface.

+ +

Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax +is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

+ +

Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

+ +
+ + + + + + +  +

Selecting Data

+ +

The following functions allow you to build SQL SELECT statements.

+ +

Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

+ + +

$this->db->get();

+ +

Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

+ +$query = $this->db->get('mytable');
+
+// Produces: SELECT * FROM mytable
+ +

The second and third parameters enable you do set a limit and offset clause:

+ +$query = $this->db->get('mytable', 10, 20);
+
+// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
+ + + +

You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

+ +$query = $this->db->get('mytable');
+
+foreach ($query->result() as $row)
+{
+    echo $row->title;
+}
+ +

Please visit the result functions page for a full discussion regarding result generation.

+ + +

$this->db->getwhere();

+ +

Identical to the above function except that it permits you to add a "where" clause in the second parameter, +instead of using the db->where() function:

+ +$query = $this->db->getwhere('mytable', array(id => $id), $limit, $offset); + +

Please read the about the where function below for more information.

+ + +

$this->db->select();

+ +

Permits you to write the SELECT portion of your query:

+ + +$this->db->select('title, content, date');
+
+$query = $this->db->get('mytable');
+
+// Produces: SELECT title, content, date FROM mytable
+ +

Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, Code Igniter assumes you wish to SELECT *

+ + +

$this->db->from();

+ +

Permits you to write the FROM portion of your query:

+ + +$this->db->select('title, content, date');
+$this->db->from('mytable');
+
+$query = $this->db->get();
+
+// Produces: SELECT title, content, date FROM mytable
+ +

Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method +you prefer.

+ +

$this->db->join();

+ +

Permits you to write the JOIN portion of your query:

+ + +$this->db->select('*');
+$this->db->from('blogs');
+$this->db->join('comments', 'comments.id = blogs.id');
+
+$query = $this->db->get();
+
+// Produces:
+// SELECT * FROM blogs
+// JOIN comments ON comments.id = blogs.id
+
+ +

Multiple function calls can be made if you need several joins in one query.

+ +

If you need something other than a natural JOIN you can specify it via the third parameter of the function. +Options are: left, right, outer, inner, left outer, and right outer.

+ + +$this->db->join('comments', 'comments.id = blogs.id', 'left');
+
+// Produces: LEFT JOIN comments ON comments.id = blogs.id
+ + + + + +

$this->db->where();

+

This function enables you to set WHERE clauses using one of four methods:

+ +

Note: All values passed to this function are escaped automatically, producing safer queries.

+ +
    +
  1. Simple key/value method: + + $this->db->where('name', $name); +

    // Produces: WHERE name = 'Joe' +
    + +

    Notice that the equal sign is added for you.

    + +

    If you use multiple function calls they will be chained together with AND between them:

    + + $this->db->where('name', $name);
    + $this->db->where('title', $title);
    + $this->db->where('status', $status); +

    // WHERE = 'Joe' AND title = 'boss' AND status = 'active' +
    + + +
  2. + +
  3. Custom key/value method: + +

    You can include an operator in the first parameter in order to to control the comparison:

    + + $this->db->where('name !=', $name);
    + $this->db->where('id <', $id); +

    // Produces: WHERE name != 'Joe' AND id < 45 +
    + + + +
  4. +
  5. Associative array method: + + + + $array = array('name' => $name, 'title' => $title, 'status' => $status);

    + + $this->db->where($array); +

    // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' +
    + +

    You can include your own operators using this method as well:

    + + + $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

    + + $this->db->where($array);
    + +
  6. +
  7. Custom string: + +

    You can write your own clauses manually:

    + + + $where = "name='Joe' AND status='boss' OR status='active'";

    + $this->db->where($where);
    + +
  8. +
+ + +

$this->db->orwhere();

+

This function is identical to the one above, except that multiple instances are joined by OR:

+ + +$this->db->where('name !=', $name);
+$this->db->orwhere('id >', $id); +

// Produces: WHERE name != 'Joe' OR id > 50 +
+ + + + +

$this->db->like();

+

This function enables you to generate LIKE clauses, useful for doing searches.

+ +

Note: All values passed to this function are escaped automatically.

+ + +
    +
  1. Simple key/value method: + + $this->db->like('title', $match); +

    // Produces: WHERE title LIKE '%match%' +
    + +

    If you use multiple function calls they will be chained together with AND between them:

    + + $this->db->like('title', $match);
    + $this->db->like('body', $match); +

    // WHERE title LIKE '%match%' AND body LIKE '%match%' +
    + +
  2. + +
  3. Associative array method: + + + $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

    + + $this->db->like($array); +

    // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%' +
    + +
  4. +
+ + +

$this->db->orlike();

+

This function is identical to the one above, except that multiple instances are joined by OR:

+ + +$this->db->like('title', $match);
+$this->db->orlike('body', $match); +

// WHERE title LIKE '%match%' OR body LIKE '%match%' +
+ + + + +

$this->db->groupby();

+ +

Permits you to write the GROUP BY portion of your query:

+ +$this->db->groupby("title"); +

// Produces: GROUP BY title +
+ +

You can also pass an array of multiple values as well:

+ +$this->db->groupby(array("title", "date"); +

// Produces: GROUP BY title, date +
+ + +

$this->db->having();

+ +

Permits you to write the HAVING portion of your query:

+ +$this->db->having('user_id = 45'); +

// Produces: HAVING 'user_id = 45' +
+ +

You can also pass an array of multiple values as well:

+ + +$this->db->having(array('title =' => 'My Title', 'id <' => $id)); +

// Produces: HAVING title = 'My Title', 'id < 45' +
+ + + +

$this->db->orderby();

+

Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. +The second parameter lets you set the direction of the result. Options are asc or desc

+ +$this->db->orderby("title", "desc"); +

// Produces: ORDER BY title DESC +
+ +

You can also pass your own string in the first parameter:

+ +$this->db->orderby('title desc, name asc'); +

// Produces: ORDER BY title DESC, name ASC +
+ + + +

$this->db->limit();

+

Lets you limit the number of rows you would like returned by the query: + + +$this->db->limit(10);
+
+// Produces: LIMIT 10
+ + +

The second parameter lets you set a result offset.

+ + +$this->db->limit(10, 20);
+
+// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
+ + +

$this->db->count_all();

+ +

Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

+ +echo $this->db->count_all('my_table');
+
+// Produces an integer, like 25
+ + + + +  +

Inserting Data

+ +

$this->db->insert();

+

Generates an insert string based on the data you supply, and runs the query. You can either pass an +array or an object to the function. Here is an example using an array:

+ + +$data = array(
+               'title' => $title,
+               'name' => $name,
+               'date' => $date
+            );
+
+$this->db->insert('mytable', $data); +

+// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
+ +

The first parameter will contain the table name, the second is an associative array of values.

+ +

Here is an example using an object:

+ + +/*
+    class Myclass {
+        var = $title = 'My Title';
+        var = $content = 'My Content';
+        var = $date = 'My Date';
+    }
+*/
+
+$object = new Myclass;
+
+$this->db->insert('mytable', $object); +

+// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
+ +

The first parameter will contain the table name, the second is an associative array of values.

+ +

Note: All values are escaped automatically producing safer queries.

+ + + + +

$this->db->set();

+

This function enables you to set values for inserts or updates.

+ +

It can be used instead of passing a data array directly to the insert or update functions:

+ +$this->db->set('name', $name); +
+$this->db->insert('mytable'); +

+// Produces: INSERT INTO mytable (name) VALUES ('{$name}')
+ +

If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

+ +$this->db->set('name', $name);
+$this->db->set('title', $title);
+$this->db->set('status', $status);
+$this->db->insert('mytable'); +
+ +

You can also pass an associative array to this function:

+ + +$array = array('name' => $name, 'title' => $title, 'status' => $status);

+ +$this->db->set($array);
+$this->db->insert('mytable'); +
+ +

Or an object:

+ + + +/*
+    class Myclass {
+        var = $title = 'My Title';
+        var = $content = 'My Content';
+        var = $date = 'My Date';
+    }
+*/
+
+$object = new Myclass;
+
+$this->db->set($object);
+$this->db->insert('mytable'); +
+ + + +  +

Updating Data

+ +

$this->db->update();

+

Generates an update string and runs the query based on the data you supply. You can pass an +array or an object to the function. Here is an example using +an array:

+ + +$data = array(
+               'title' => $title,
+               'name' => $name,
+               'date' => $date
+            );
+
+$this->db->where('id', $id);
+$this->db->update('mytable', $data); +

+// Produces:
+// UPDATE mytable
+// SET title = '{$title}', name = '{$name}', date = '{$date}'
+// WHERE id = $id
+ +

Or you can supply an object:

+ + +/*
+    class Myclass {
+        var = $title = 'My Title';
+        var = $content = 'My Content';
+        var = $date = 'My Date';
+    }
+*/
+
+$object = new Myclass;
+
+$this->db->where('id', $id);
+$this->db->update('mytable', $object, $where); +

+// Produces:
+// UPDATE mytable
+// SET title = '{$title}', name = '{$name}', date = '{$date}'
+// WHERE id = $id
+ + + +

Note: All values are escaped automatically producing safer queries.

+ +

You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. +You can optionally pass this information directly into the update function as a string:

+ +$this->db->update('mytable', $data, "id = 4"); + +

Or as an array:

+ +$this->db->update('mytable', $data, array('id' => $id)); + +

You may also use the $this->db->set() function described above when performing updates.

+ + +  +

Deleting Data

+ + + +

$this->db->delete();

+

Generates a delete SQL string and runs the query.

+ + +$this->db->delete('mytable', array('id', $id)); +

+// Produces:
+// DELETE FROM mytable
+// WHERE id = $id
+ +

The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing +the data to the second parameter of the function: + + +$this->db->where('id', $id);
+$this->db->delete('mytable'); +

+// Produces:
+// DELETE FROM mytable
+// WHERE id = $id
+ +

Note: All values are escaped automatically producing safer queries.

+ + +  +

Method Chaining

+ +

Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

+ + +$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
+
+$query = $this->db->get();
+ +

Note: Method chaining only works with PHP 5.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/call_function.html b/user_guide/libraries/database/call_function.html new file mode 100644 index 00000000..9c860a42 --- /dev/null +++ b/user_guide/libraries/database/call_function.html @@ -0,0 +1,123 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ +

Custom Function Calls

+ +

$this->db->call_function();

+ +

This function enables you to call PHP database functions that are not natively included in Code Igniter, in a platform independent manner. +For example, lets say you want to call the mysql_get_client_info() function, which is not natively supported +by Code Igniter. You could do so like this: +

+ +$this->db->call_function('get_client_info'); + +

You must supply the name of the function, without the mysql_ prefix, in the first parameter. The prefix is added +automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. +Obviously not all function calls are identical between platforms, so there are limits to how useful this function can be in terms of portability.

+ +

Any parameters needed by the function you are calling will be added to the second parameter.

+ +$this->db->call_function('some_function', $param1, $param2, etc..); + + +

Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

+ +$this->db->conn_id; + +

The result ID can be accessed from within your result object, like this:

+ +$query = $this->db->query("SOME QUERY");
+
+$query->result_id;
+ + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/configuration.html b/user_guide/libraries/database/configuration.html new file mode 100644 index 00000000..4b7d2a8a --- /dev/null +++ b/user_guide/libraries/database/configuration.html @@ -0,0 +1,144 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ + +

Database Configuration

+ +

Code Igniter has a config file that lets you store your database connection values (username, password, database name, etc.). +The config file is located at: + +

application/config/database.php

+ +

The config settings are stored in a multi-dimensional array with this prototype:

+ +$db['default']['hostname'] = "localhost";
+$db['default']['username'] = "root";
+$db['default']['password'] = "";
+$db['default']['database'] = "database_name";
+$db['default']['dbdriver'] = "mysql";
+$db['default']['dbprefix'] = "";
+$db['default']['pconnect'] = TRUE;
+$db['default']['db_debug'] = FALSE;
+$db['default']['active_r'] = TRUE;
+ +

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, production, test, etc.) +under a single installation, you can set up a connection group for each, then switch between groups as needed. +For example, to set up a "test" environment you would do this:

+ +$db['test']['hostname'] = "localhost";
+$db['test']['username'] = "root";
+$db['test']['password'] = "";
+$db['test']['database'] = "database_name";
+$db['test']['dbdriver'] = "mysql";
+$db['test']['dbprefix'] = "";
+$db['test']['pconnect'] = TRUE;
+$db['test']['db_debug'] = FALSE;
+$db['test']['active_r'] = TRUE;
+ + +

Then, to globally tell the system to use that group you would set this variable located in the config file:

+ +$active_group = "test"; + +

Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" +for the primary connection, but it too can be renamed to something more relevant to your project.

+ +

Explanation of Values:

+ +
    +
  • hostname - The hostname of your database server. Often this is "localhost".
  • +
  • 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, postgre, obdc, etc. Must be specified in lower case.
  • +
  • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple Code Igniter installations to share one database.
  • +
  • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
  • +
  • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
  • +
  • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources.
  • +
+ +

Note: Depending on what database platform you are using (MySQL, Postgre, etc.) +not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and +the database name will be the path to your database file. The information above assumes you are using MySQL.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/connecting.html b/user_guide/libraries/database/connecting.html new file mode 100644 index 00000000..7bf93c30 --- /dev/null +++ b/user_guide/libraries/database/connecting.html @@ -0,0 +1,172 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ + +

Connecting to your Database

+ +

There are two ways to connect to a database:

+ +

Automatically Connecting

+ +

The "auto connect" feature will load and instantiate the database class with every page load. +To enable "auto connecting", add the word database to the core array, as indicated in the following file:

+ +

application/config/autoload.php

+ +

Manually Connecting

+ +

If only some of your pages require database connectivity you can manually connect to your database by adding this +line of code in any function where it is needed, or in your class constructor to make the database +available globally in that class.

+ +$this->load->database(); + +

If the above function does not contain any information in the first parameter it will connect +to the group specified in your database config file. For most people, this is the preferred method of use.

+ + +

The first parameter of this function can optionally be used to specify a particular database group +from your config file, or you can even submit connection values for a database that is not specified in your config file. +Examples:

+ +

To choose a specific group from your config file you can do this:

+ +$this->load->database('group_name'); + +

Where group_name is the name of the connection group from your config 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['active_r'] = TRUE;
+
+$this->load->database($config);
+ +

For information on each of these values please see the configuration page. + +

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');
+ +

Note that if you use a DSN you will not be able to specify some of the default values like you can if you use a connection array.

+ + + + +

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); +
+ +

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 as indicated above).

+ +

By setting the second parameter to TRUE (boolean) the function will return the database object.

+ +
+

When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with:

+ +

$this->db->query();
$this->db->result();
etc...

+ +

You will instead use:

+ +

$DB1->query();
$DB1->result();
etc...

+ +
+ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/examples.html b/user_guide/libraries/database/examples.html new file mode 100644 index 00000000..e738ba82 --- /dev/null +++ b/user_guide/libraries/database/examples.html @@ -0,0 +1,183 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + + +
+ + + +
+ + + +
+ + +

Database Quick Start: Example Code

+ +

The following page contains example code showing how the database class is used. For complete details please +read the individual pages describing each function.

+ + +

Initializing the Database Class

+ +

The following code loads and initializes the database class based on your configuration settings:

+ +$this->load->database(); + +

Once loaded the class is ready to be used as described below.

+ +

Note: If all your pages require database access you can connect automatically. See the connecting page for details.

+ + +

Standard Query With Multiple Results (Object Version)

+ +$query = $this->db->query('SELECT name, title, email FROM my_table');
+
+foreach ($query->result() as $row)
+{
+    echo $row->title;
+    echo $row->name;
+    echo $row->email;
+}
+
+echo 'Total Results: ' . $query->num_rows(); +
+ +

The above result() function returns an array of objects. Example: $row->title

+ + +

Standard Query With Multiple Results (Array Version)

+ +$query = $this->db->query('SELECT name, title, email FROM my_table');
+
+foreach ($query->result_array() as $row)
+{
+    echo $row['title'];
+    echo $row['name'];
+    echo $row['email'];
+}
+ +

The above result_array() function returns an array of standard array indexes. Example: $row['title']

+ + +

Standard Query With Single Result

+ +$query = $this->db->query('SELECT name FROM my_table LIMIT 1');
+
+$row = $query->row();
+echo $row->name;
+
+ + +

Standard Insert

+ + +$sql = "INSERT INTO mytable (title, name)
+        VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";
+
+$this->db->query($sql);
+
+echo $this->db->affected_rows(); +
+ + + + +

Active Record Query

+ +

The Active Record Pattern gives you a simplified means of retrieving data:

+ + +$query = $this->db->get('table_name');
+
+foreach ($query->result() as $row)
+{
+    echo $row->title;
+}
+ + +

Active Record Insert

+ + +$data = array(
+               'title' => $title,
+               'name' => $name,
+               'date' => $date
+            );
+
+$this->db->insert('mytable', $data); +

+// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/fields.html b/user_guide/libraries/database/fields.html new file mode 100644 index 00000000..dd2def9a --- /dev/null +++ b/user_guide/libraries/database/fields.html @@ -0,0 +1,144 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + +
+ + + +
+ + + +
+ + +

Field Data

+ + +

Retrieving Field Names

+

Sometimes it's helpful to gather the field names.

+ +

$this->db->field_names();

+

Returns an array containing the field names. You must supply the table name to the function:

+ + +$fields = $this->db->field_names('table_name');

+ +foreach ($fields as $field)
+{
+   echo $field;
+} +
+ + + +

Retrieving Field MetaData

+

Sometimes it's helpful to gather the field names or other metadata, like the column type, max length, etc.

+ +

$this->db->field_data();

+

Returns an array of objects containing field information.

+ +

Note: Not all databases provide meta-data.

+ +

Usage example:

+ + +$fields = $this->db->field_data('table_name');

+ +foreach ($fields as $field)
+{
+   echo $field->name;
+   echo $field->type;
+   echo $field->max_length;
+   echo $field->primary_key;
+} +
+ +

If you have run a query already you can use the result oject instead of supplying the table name:

+ + +$query = $this->db->query("YOUR QUERY");
+$fields = $query->field_data(); +
+ + +

The following data is available from this function if supported by your database:

+ +
    +
  • name - column name
  • +
  • max_length - maximum length of the column
  • +
  • primary_key - 1 if the column is a primary key
  • +
  • type - the type of the column
  • +
+ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/index.html b/user_guide/libraries/database/index.html new file mode 100644 index 00000000..a8e7c8e7 --- /dev/null +++ b/user_guide/libraries/database/index.html @@ -0,0 +1,99 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ + +

The Database Class

+ +

Code Igniter comes with a full-featured and very fast abstracted database class that supports both traditional +structures and Active Record patterns. The database functions offer clear, simple syntax.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/queries.html b/user_guide/libraries/database/queries.html new file mode 100644 index 00000000..57fd916e --- /dev/null +++ b/user_guide/libraries/database/queries.html @@ -0,0 +1,180 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + + +
+ + + +
+ + +

Queries

+ +

To submit a query, use the following function:

+ +$this->db->query('YOUR QUERY HERE'); + +

The query() function returns a database result object +which you can use to show your results. You will typically assign the query to your own variable, like this:

+ +$query = $this->db->query('YOUR QUERY HERE'); + + +

Escaping Queries

+ +

It's a very good security practice to escape your data before sumbiting it into your database. +Code Igniter has two functions that help you do this:

+ +
    + +
  1. $this->db->escape() This function determines the data type so that it +can escape only string data. It also automatically adds single quotes around the data so you don't have to: + +$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")"; + + +
  2. $this->db->escape_str() This function escapes the data passed to it, regardless of type. +Most of the time you'll use the above function rather then this one. Use the function like this: + +$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')"; + + +
  3. +
+ + + +


Query Bindings

+ + +

Bindings enable you to simplify your query syntax by letting the system put the queries together for you. Consider the following example:

+ + +$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"; +

+$this->db->query($sql, array(3, 'live', 'Rick')); +
+ +

The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.

+

The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

+ + + +


Query Helper Functions

+ + +

$this->db->last_query();

+ +

Returns the last query that was run (the query string, not the result). Example:

+ +$str = $this->db->last_query();
+
+// Produces: SELECT * FROM sometable.... +
+ + +

The following two functions help simplify the process of writing database INSERTs and UPDATEs.

+ + +

$this->db->insert_string();

+

This function simplifies the process of writing database inserts. It returns a correctly formatted SQL insert string. Example:

+ +$data = array('name' => $name, 'email' => $email, 'url' => $url);
+
+$str = $this->db->insert_string('table_name', $data); +
+ +

The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

+INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@your-site.com', 'www.your-site.com') + + + +

$this->db->update_string();

+

This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. Example:

+ +$data = array('name' => $name, 'email' => $email, 'url' => $url);
+
+$where = "author_id = 1 AND status = 'active'"; +

+$str = $this->db->update_string('table_name', $data, $where); +
+ +

The first parameter is the table name, the second is an associative array with the data to be inserted, and the third parameter is the "where" clause. The above example produces:

+ UPDATE exp_weblog SET name = 'Rick', email = 'rick@your-site.com', url = 'www.your-site.com' WHERE author_id = 1 AND status = 'active' + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/results.html b/user_guide/libraries/database/results.html new file mode 100644 index 00000000..7e6b95d2 --- /dev/null +++ b/user_guide/libraries/database/results.html @@ -0,0 +1,235 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ + + +

Query Results

+ + +

There are several ways to generate query results:

+ +

result()

+ +

This function returns the query result as an array of objects, or FALSE on failure. + + Typically you'll use this in a foreach loop, like this:

+ + + $query = $this->db->query("YOUR QUERY");
+
+ foreach ($query->result() as $row)
+ {
+    echo $row->title;
+    echo $row->name;
+    echo $row->body;
+ }
+ +

If you run queries that might not produce a result, you are encouraged to test the result first:

+ + + $query = $this->db->query("YOUR QUERY");
+
+ if ($query->num_rows() > 0)
+ {
+    foreach ($query->result() as $row)
+    {
+       echo $row->title;
+       echo $row->name;
+       echo $row->body;
+    }
+ } +
+ +

result_array()

+ +

This function returns the query result as a pure array, or FALSE on failure. Typically you'll use this in a foreach loop, like this:

+ + $query = $this->db->query("YOUR QUERY");
+
+ foreach ($query->result_array() as $row)
+ {
+    echo $row['title'];
+    echo $row['name'];
+    echo $row['body'];
+ }
+ + +

row()

+ +

This function returns a single result row. If your query has more than one row, it returns only the first row. + The result is returned as an object. Here's a usage example:

+ + $query = $this->db->query("YOUR QUERY");
+
+ if ($query->num_rows() > 0)
+ {
+    $row = $query->row(); +

+    echo $row->title;
+    echo $row->name;
+    echo $row->body;
+ } +
+ +

If you want a specific row returned you can submit the row number as a digit in the first parameter: + + $row = $query->row(5); + + +

row_array()

+ +

Identical to the above row() function, except it returns an array. Example:

+ + + $query = $this->db->query("YOUR QUERY");
+
+ if ($query->num_rows() > 0)
+ {
+    $row = $query->row_array(); +

+    echo $row['title'];
+    echo $row['name'];
+    echo $row['body'];
+ } +
+ + +

If you want a specific row returned you can submit the row number as a digit in the first parameter: + + $row = $query->row_array(5); + + +

In addition, you can walk forward/backwards/first/last through your results using these variations:

+ +

+ $row = $query->first_row()
+ $row = $query->last_row()
+ $row = $query->next_row()
+ $row = $query->previous_row() +

+ +

By default they return an object unless you put the word "array" in the parameter:

+ +

+ $row = $query->first_row('array')
+ $row = $query->last_row('array')
+ $row = $query->next_row('array')
+ $row = $query->previous_row('array') +

+ + +


Query Result Helpers

+ +

The following functions provide useful information when dealing with query results.

+ +

$query->num_rows()

+

The number of rows returned by the query. Note: $query is the variable that the query was assigned to:

+ +$query = $this->db->query('SELECT * FROM my_table');

+echo $query->num_rows(); +
+ +

$query->num_fields()

+

The number of FIELDS returned by the query. Make sure to call the function using your query result object:

+ +$query = $this->db->query('SELECT * FROM my_table');

+echo $query->num_fields(); +
+ + +

$this->db->insert_id()

+

The insert ID number when performing database inserts.

+ +

$this->db->affected_rows()

+

Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).

+

Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the +correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

+ + +

$this->db->version()

+

Outputs the database version you are running:

+ +echo $this->db->version(); + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/database/table_data.html b/user_guide/libraries/database/table_data.html new file mode 100644 index 00000000..7d340d4e --- /dev/null +++ b/user_guide/libraries/database/table_data.html @@ -0,0 +1,116 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + + +
+ + + +
+ +

Table Data

+ +

These functions let you fetch table information.

+ +

$this->db->tables();

+ +

Returns an array containing the names of all the tables in the database you are currently connected to. Example:

+ +$tables = $this->db->tables()
+
+foreach ($tables as $table)
+{
+   echo $table;
+} +
+ + +

$this->db->table_exists();

+ +

Sometimes it's helpful to know whether a particular table exists before running an operation on it. +Returns a boolean TRUE/FALSE. Usage example:

+ + +if ($this->db->table_exists('table_name'))
+{
+   // some code...
+} +
+ +

Note: Replace table_name with the name of the table you are looking for.

+ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html new file mode 100644 index 00000000..25f5f4ad --- /dev/null +++ b/user_guide/libraries/email.html @@ -0,0 +1,294 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Email Class

+ +

Code Igniter's robust Email Class supports the following features:

+ + +
    +
  • Multiple Protocols: Mail, Sendmail, and SMTP
  • +
  • Multiple recipients
  • +
  • CC and BCCs
  • +
  • HTML or Plaintext email
  • +
  • Attachments
  • +
  • Word wrapping
  • +
  • Priorities
  • +
  • BCC Batch Mode, enabling large email lists to be broken into small BCC batches.
  • +
  • Email Debugging tools
  • +
+ + +

Sending Email

+ +

Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

+ +

Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your +controllers.

+ +$this->load->library('email');
+
+$this->email->from('your@your-site.com', 'Your Name');
+$this->email->to('someone@some-site.com');
+$this->email->cc('another@another-site.com');
+$this->email->bcc('them@their-site.com');
+
+$this->email->subject('Email Test');
+$this->email->message('Testing the email class.');
+
+$this->email->send();
+
+echo $this->email->print_debugger();
+ + + + +

Setting Email Preferences

+ +

There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually +as described here, or automatically via preferences stored in your config file, described below:

+ +

Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

+ +$config['protocol'] = 'sendmail';
+$config['mailpath'] = '/usr/sbin/sendmail';
+$config['charset'] = 'iso-8859-1';
+$config['wordwrap'] = TRUE;
+
+$this->email->initialize($config);
+ +

Note: Most of the preferences have default values that will be used if you do not set them.

Setting Email Preferences in your Config File + +

If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the email.php, add the $config +array in that file. Then save the file at config/email.php and it will be used automatically. You +will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

+ + + + +

Email Preferences

+ +

The following is a list of all the preferences that can be set when sending email.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
useragentCode IgniterNoneThe "user agent".
protocolmailmail, sendmail, or smtpThe mail sending protocol.
mailpath/usr/sbin/sendmailNoneThe server path to Sendmail.
smtp_hostNo DefaultNoneSMTP Server Address.
smtp_userNo DefaultNoneSMTP Username.
smtp_passNo DefaultNoneSMTP Password.
smtp_port25NoneSMTP Port.
smtp_timeout5NoneSMTP Timeout (in seconds).
wordwrapTRUETRUE or FALSE (boolean)Enable word-wrap.
wrapchars76 Character count to wrap at.
mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
charsetutf-8Character set (utf-8, iso-8859-1, etc.).
validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
newline\n"\r\n" or "\n"Newline character. (Use "\r\n" to comply with RFC 822).
bcc_batch_modeFALSETRUE or FALSE (boolean)Enable BCC Batch Mode.
bcc_batch_size200NoneNumber of emails in each BCC batch.
+ + +

Email Function Reference

+ +

$this->email->from()

+

Sets the email address and name of the person sending the email:

+$this->email->from('you@your-site.com', 'Your Name'); + +

$this->email->reply_to()

+

Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

+$this->email->reply_to('you@your-site.com', 'Your Name'); + + +

$this->email->to()

+

Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

+ +$this->email->to('someone@some-site.com'); +$this->email->to('one@some-site.com, two@some-site.com, three@some-site.com'); + +$list = array('one@some-site.com, two@some-site.com, three@some-site.com');

+$this->email->to('$list');
+ +

$this->email->cc()

+

Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

+ +

$this->email->bcc()

+

Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

+ + +

$this->email->subject()

+

Sets the email subject:

+$this->email->subject('This is my subject'); + +

$this->email->message()

+

Sets the email message body:

+$this->email->message('This is my message'); + +

$this->email->alt_message()

+

Sets the alternative email message body:

+$this->email->alt_message('This is the alternative message'); + +

This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative +message with no HTML formatting which is added to the header string for people who do not accept HTML email. +If you do not set your own message Code Igniter will extract the message from your HTML email and strip the tags.

+ + + +

$this->email->clear()

+

Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function +in a loop, permitting the data to be reset between cycles.

+foreach ($list as $name => $address)
+{
+    $this->email->clear();

+ +    $this->email->to($address);
+    $this->email->from('your@your-site.com');
+    $this->email->subject('Here is your info '.$name);
+    $this->email->message('Hi '.$name.' Here is the info you requested.');
+    $this->email->send();
+}
+ + +

$this->email->send()

+

The Email sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used +conditionally.

+ + +

$this->email->attach()

+

Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. +For multiple attachments use the function multiple times. For example:

+ +$this->email->attach('/path/to/photo1.jpg');
+$this->email->attach('/path/to/photo2.jpg');
+$this->email->attach('/path/to/photo3.jpg');
+
+$this->email->send();
+ + +

$this->email->print_debugger()

+

Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

+ + +

Overriding Word Wrapping

+ +

If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can +get wrapped too, causing it to become un-clickable by the person receiving it. Code Igniter lets you manually override +word wrapping within part of your message like this: + +The text of your email that
+gets wrapped normally.
+
+{unwrap}http://www.some-site.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
+
+More text that will be
+wrapped normally.
+ +

Place the item you do not want word-wrappd between: {unwrap} {/unwrap} + + +

+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html new file mode 100644 index 00000000..e24e11df --- /dev/null +++ b/user_guide/libraries/encryption.html @@ -0,0 +1,187 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Encrypt Class

+ +

The Encrypt Class provides two-way data encryption. It uses a scheme that pre-compiles +the message using a randomly hashed bitwise XOR encoding scheme, which is then encrypted using +the Mcrypt library. If Mcrypt is not available on your server the encoded message will +still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. +If Mcrypt is available, you'll effectively end up with a double-encrypted message string, which should +provide a very high degree of security.

+ + +

Setting your Key

+ +

A key is a piece of information that controls the cryptographic process and permits an encrypted string to be decoded. +In fact, the key you chose will provide the only means to decode data that was encrypted with that key, +so not only must you chose the key carefully, you must must never change it if you intend use it for persistent data.

+ +

It goes without saying that you should guard your key carefully. +Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control +it's impossible to ensure key security so you may want to think carefully before using it for anything +that requires high security, like storing credit card numbers.

+ +

To take maximum advantage of the encryption algorithm, your key should be 32 characters in length (128 bits). +The key should be as random a string as you can concoct, with numbers and uppercase and lowercase letters. +Your key should not be a simple text string. In order to be cryptographically secure it +needs to be as random as possible.

+ +

Your key can be either stored in your application/config/config.php, or you can design your own +storage mechanism and pass the key dynamically when encoding/decoding.

+ +

To save your key to your application/config/config.php, open the file and set:

+$config['encryption_key'] = "YOUR KEY"; + + +

Message Length

+ +

It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original +message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up +with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in +64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, +for example, can only hold 4K of information.

+ + +

Initializing the Class

+ +

Like most other classes in Code Igniter, the Encrypt class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('encrypt'); +

Once loaded, the Encrypt library object will be available using: $this->encrypt

+ + +

$this->encrypt->encode()

+ +

Performs the data encryption and returns it as a string. Example:

+ +$msg = 'My secret message';
+
+$encrypted_string = $this->encrypt->encode($msg);
+ +

You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file:

+ + +$msg = 'My secret message';
+$key = 'super-secret-key';
+
+$encrypted_string = $this->encrypt->encode($msg, $key);
+ + +

$this->encrypt->decode()

+ +

Decrypts an encoded string. Example:

+ + +$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
+
+$plaintext_string = $this->encrypt->decode($encrypted_string);
+ + +

$this->encrypt->set_cypher();

+ +

Permits you to set an Mcrypt cypher. By default it uses MCRYPT_RIJNDAEL_256. Example: +$this->encrypt->set_cypher('MCRYPT_BLOWFISH'); +

Please visit php.net for a list of available cyphers.

+ +

If you'd like to manually test whether your server supports Mcrypt you can use:

+echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; + + +

$this->encrypt->set_mode();

+ +

Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example: +$this->encrypt->set_mode('MCRYPT_MODE_CFB'); +

Please visit php.net for a list of available modes.

+ + +

$this->encrypt->sha1();

+

SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

+$hash = $this->encrypt->sha1('Some string'); + +

Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native +function:

+ +$hash = sha1('Some string'); + +

If your server does not support SHA1 you can use the provided function.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html new file mode 100644 index 00000000..7fabb095 --- /dev/null +++ b/user_guide/libraries/file_uploading.html @@ -0,0 +1,429 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

File Uploading Class

+ +

Code Igniter's File Uploading Class permits files to be uploaded. You can set various +preferences, restricting the type and size of the files.

+ + +

The Process

+ +

Uploading a file involves the following general process:

+ + +
    +
  • An upload form is displayed, allowing a user to select a file and upload it.
  • +
  • When the form is submitted, the file is uploaded to the destination you specify.
  • +
  • Along the way, the file is validated to make sure it is allowed to be uploaded based on the preferences you set.
  • +
  • Once uploaded, the user will be shown a success message.
  • +
+ +

To demonstrate this process here is brief tutorial. Afterward you'll find reference information.

+ +

Creating the Upload Form

+ + + +

Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ +folder:

+ + + + +

You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper +creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event +the user does something wrong.

+ + +

The Success Page

+ +

Using a text editor, create a form called upload_success.php. +In it, place this code and save it to your applications/views/ folder:

+ + + + +

The Controller

+ +

Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ +folder:

+ + + + + +

The Upload Folder

+ +

You'll need a destination folder for your uploaded images. Create a folder at the root of your Code Igniter installation called +uploads and set its file permissions to 777.

+ + +

Try it!

+ +

To try your form, visit your site using a URL similar to this one:

+ +www.your-site.com/index.php/upload/ + +

You should see an upload form. Try uploading an image file (either a jpg, gif, or png). If the path in your +controller is correct it should work.

+ + +

 

+ +

Reference Guide

+ + +

Initializing the Upload Class

+ +

Like most other classes in Code Igniter, the Upload class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('upload'); +

Once the Upload class is loaded, the object will be available using: $this->upload

+ + +

Setting Preferences

+ +

Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you +built above you set the following preferences:

+ +$config['upload_path'] = './uploads/';
+$config['allowed_types'] = 'gif|jpg|png';
+$config['max_size'] = '100';
+$config['max_width'] = '1024';
+$config['max_height'] = '768';
+
+$this->upload->initialize($config);
+ +

The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

+ + +

Preferences

+ +

The following preferences are available. The default value indicates what will be used if you do not specify that preference.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
upload_pathNoneNoneThe path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.
allowed_typesNoneNoneThe mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.
overwriteFALSETRUE/FALSE (boolean)If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten. If set to false, a number will be appended to the filename if another with the same name exists.
max_size0NoneThe maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.
max_width0NoneThe maximum width (in pixels) that the file can be. Set to zero for no limit.
max_height0NoneThe maximum height (in pixels) that the file can be. Set to zero for no limit.
encrypt_nameFALSETRUE/FALSE (boolean)If set to TRUE the file name will be converted to a random encrypted string. This can be useful if you would like the file saved with a name that can not be discerned by the person uploading it.
remove_spacesTRUETRUE/FALSE (boolean)If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended.
+ + +

Setting preferences in a config file

+ +

If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the upload.php, add the $config +array in that file. Then save the file in: config/upload.php and it will be used automatically. You +will NOT need to use the $this->upload->initialize function if you save your preferences in a config file.

+ + +

Function Reference

+ +

The following functions are available

+ + +

$this->upload->do_upload()

+ +

Performs the upload based on the preferences you've set. Note: The upload routine expects the file to come from a form field +called userfile, and the form must be a "multipart type:

+ +<form method="post" action="some_action" enctype="multipart/form-data" /> + + +

$this->upload->display_errors()

+ +

Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it +returns the data so you can assign it however you need.

+ +

Formatting Errors

+

By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

+ +$this->upload->display_errors('<p>', '</p>'); + +

$this->upload->data()

+ +

This is a helper function that returns an array containing all of the data related to the file you uploaded. +Here is the array prototype:

+ +Array
+(
+    [file_name]    => mypic.jpg
+    [file_type]    => image/jpeg
+    [file_path]    => /path/to/your/upload/
+    [full_path]    => /path/to/your/upload/jpg.jpg
+    [raw_name]     => mypic
+    [orig_name]    => mypic.jpg
+    [file_ext]     => .jpg
+    [file_size]    => 22.2
+    [is_image]     => 1
+    [image_width]  => 800
+    [image_height] => 600
+    [image_type]   => jpeg
+    [image_size_str] => width="800" height="200"
+)
+ +

Explanation

+ +

Here is an explanation of the above array items.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemDescription
file_nameThe name of the file that was uploaded including the file extension.
file_typeThe file's Mime type
file_pathThe absolute server path to the file
full_pathThe absolute server path including the file name
raw_nameThe file name without the extension
orig_nameThe original file name. This is only useful if you use the encrypted name option.
file_extThe file extension with period
file_sizeThe file size in kilobytes
is_imageWhether the file is an image or not. 1 = image. 0 = not.
image_widthImage width.
image_heigthImage height
image_typeImage type. Typically the file extension without the period.
image_size_strA string containing the width and height. Useful to put into an image tag.
+ +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html new file mode 100644 index 00000000..ae043b53 --- /dev/null +++ b/user_guide/libraries/image_lib.html @@ -0,0 +1,669 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Image Manipulation Class

+ +

Code Igniter's Image Manipulation class lets you perform the following actions:

+ +
    +
  • Image Resizing
  • +
  • Thumbnail Creation
  • +
  • Image Cropping
  • +
  • Image Rotating
  • +
  • Image Watermarking
  • +
+ +

All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

+ +

Note: Watermarking is only available using the GD/GD2 library. +In addition, even though other libraries are supported, GD is required in +order for the script to calculate the image properties. The image processing, however, will be performed with the +library you specify.

+ + +

Initializing the Class

+ +

Like most other classes in Code Igniter, the image class is initialized in your controller +using the $this->load_library function:

+$this->load->library('image_lib'); + +

Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

+ + +

Processing an Image

+ +

Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is +identical. You will set some preferences corresponding to the action you intend to perform, then +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

+ +$config['image_library'] = 'GD';
+$config['source_image'] = '/path/to/image/mypic.jpg';
+$config['create_thumb'] = TRUE;
+$config['maintain_ratio'] = TRUE;
+$config['width'] = 75;
+$config['height'] = 50;
+
+$this->image_lib->initialize($config); +
+
+$this->image_lib->resize();
+ +

The above code tells the image_resize function to look for an image called mypic.jpg +located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. +Since the maintain_ratio option is enabled, the thumb will be as close to the target width and +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +

+ +

Note: In order for the image class to be allowed to do any processing, the +folder containing the image files must have file permissions of 777.

+ + +

Processing Functions

+ +

There are four available processing functions:

+ +
    +
  • $this->image_lib->resize()
  • +
  • $this->image_lib->crop()
  • +
  • $this->image_lib->rotate()
  • +
  • $this->image_lib->watermark()
  • +
+ +

These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +error message using this function:

+ +echo $this->image_lib->display_errors(); + +

A good practice is use the processing function conditionally, showing an error upon failure, like this:

+ +if ( ! $this->image_lib->resize())
+{
+    echo $this->image_lib->display_errors();
+}
+ +

Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +tags in the function, like this:

+ +$this->image_lib->display_errors('<p>', '</p>'); + + +

Preferences

+ +

The 14 available preferences described below allow you to tailor the image processing to suit your needs.

+ +

Note that not all preferences are available for every +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

+ +

Availability Legend:

+ +
    +
  • R - Image Resizing
  • +
  • C - Image Cropping
  • +
  • X - Image Rotation
  • +
  • W - Image Watermarking
  • + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescriptionAvailability
image_libraryGD2GD, GD2, ImageMagick, NetPBMSets the image library to be used.R, C, X, W
library_pathNoneNoneSets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path.R, C, X
source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.R, C, S, W
dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.R, C, X, W
quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.R, C, X, W
new_imageNoneNoneSets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL.R
widthNoneNoneSets the width you would like the image set to.R
heightNoneNoneSets the height you would like the image set to.R
create_thumbFALSETRUE/FALSE (boolean)Tells the image processing function to create a thumb.R
thumb_marker_thumbNoneSpecifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpgR
maintain_ratioTRUETRUE/FALSE (boolean)Specifies whether to maintain the original aspect ratio when resizing or use hard values.R
master_dimautoauto, width, heightSpecifies what to use as the master axis when resizing or creating thumbs. For example, let's say you want to resize an image to 100 X 75 pixels. If the source image size does not allow perfect resizing to those dimensions, this setting determines which axis should be used as the hard value. "auto" sets the axis automatically based on whether the image is taller then wider, or vice versa.R
rotation_angleNone90, 180, 270, vrt, horSpecifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270.X
x_axisNoneNoneSets the X coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the left.C
y_axisNoneNoneSets the Y coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the top.C
+ + +

Setting preferences in a config file

+ +

If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the image_lib.php, add the $config +array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You +will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

+ + +

$this->image_lib->resize()

+ +

The image resizing function lets you resize the original image, create a copy (with or without resizing), +or create a thumbnail image.

+ +

For practical purposes there is no difference between creating a copy and creating +a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

+ +

All preferences listed in the table above are available for this function except these three: rotation, x_axis, and y_axis.

+ +

Creating a Thumbnail

+ +

The resizing function will create a thumbnail file (and preserve the original) if you set this preference so TRUE:

+ +$config['create_thumb'] = TRUE; + +

This single preference determines whether a thumbnail is created or not.

+ +

Creating a Copy

+ +

The resizing function will create a copy of the image file (and preserve the original) if you set +a path and/or a new filename using this preference:

+ +$config['new_image'] = '/path/to/new_image.jpg'; + +

Notes regarding this preference:

+
    +
  • If only the new image name is specified it will be placed in the same folder as the original
  • +
  • If only the path is specified, the new image will be placed in the destination with the same name as the original.
  • +
  • If both the path and image name are specified it will placed in its own destination and given the new name.
  • +
+ + +

Resizing the Original Image

+ +

If neither of the two preferences listed above (create_thumb, and new_image) are used, the resizing function will instead +target the original image for processing.

+ + +

$this->image_lib->crop()

+ +

The cropping function works nearly identically to the resizing function except it requires that you set +preferences for the X and Y axis (in pixels) specifying where to crop, like this:

+ +$config['x_axis'] = '100';
+$config['x_axis'] = '40';
+ +

All preferences listed in the table above are available for this function except these: rotation, width, height, create_thumb, new_image.

+ +

Here's an example showing how you might crop an image:

+ +$config['image_library'] = 'imagemagick';
+$config['library_path'] = '/usr/X11R6/bin/';
+$config['source_image'] = '/path/to/image/mypic.jpg';
+$config['x_axis'] = '100';
+$config['y_axis'] = '60';
+
+$this->image_lib->initialize($config); +
+
+if ( ! $this->image_lib->crop())
+{
+    echo $this->image_lib->display_errors();
+}
+ + +

Note: Without a visual interface it is difficult to crop images, so this function is not very useful +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +area be selected.

+ +

$this->image_lib->rotate()

+ +

The image rotation function requires that the angle of rotation be set via its preference:

+ +$config['rotation_angle'] = '90'; + +

There are 5 rotation options:

+ +
    +
  1. 90 - rotates counter-clockwise by 90 degrees.
  2. +
  3. 180 - rotates counter-clockwise by 180 degrees.
  4. +
  5. 270 - rotates counter-clockwise by 270 degrees.
  6. +
  7. hor - flips the image horizontally.
  8. +
  9. vrt - flips the image vertically.
  10. +
+ +

Here's an example showing how you might rotate an image:

+ +$config['image_library'] = 'netpbm';
+$config['library_path'] = '/usr/bin/';
+$config['source_image'] = '/path/to/image/mypic.jpg';
+$config['rotation_angle'] = 'hor';
+
+$this->image_lib->initialize($config); +
+
+if ( ! $this->image_lib->rotate())
+{
+    echo $this->image_lib->display_errors();
+}
+ + + +

 

+

Image Watermarking

+ +

The Watermarking feature requires the GD/GD2 library.

+ + +

Two Types of Watermarking

+ +

There are two types of watermarking that you can use:

+ +
    +
  • Text: The watermark message will be generating using text, either with a True Type font that you specify, or +using the native text output that the GD library supports. If you use the True Type version your GD installation +must be compiled with True Type support (most are, but not all).
  • + +
  • Overlay: The watermark message will be generated by overlaying an image (usually a transparent PNG or GIF) +containing your watermark over the source image.
  • + +
+ + +

Watermarking an Image

+ +

Just as with the other function (resizing, cropping, and rotating) the general process for watermarking +involves setting the preferences corresponding to the action you intend to perform, then +calling the watermark function. Here is an example:

+ + +$config['source_image'] = '/path/to/image/mypic.jpg';
+$config['wm_text'] = 'Copyright 2006 - John Doe';
+$config['wm_type'] = 'text';
+$config['wm_font_path'] = './system/fonts/texb.ttf';
+$config['wm_font_size'] = '16';
+$config['wm_text_color'] = 'ffffff';
+$config['wm_vrt_alignment'] = 'bottom';
+$config['wm_hor_alignment'] = 'center';
+$config['wm_padding'] = '20';
+
+$this->image_lib->initialize($config); +
+
+$this->image_lib->watermark();
+ + +

The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

+ +

Note: In order for the image class to be allowed to do any processing, the image file must have file permissions of 777.

+ + +

Watermarking Preferences

+ +

This table shown the preferences that are available for both types of watermarking (text or overlay)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
wm_typetexttype, overlaySets the type of watermarking that should be used.
source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.
dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.
quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.
paddingNoneA numberThe 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_alignmentbottomtop, middle, bottomSets the vertical alignment for the watermark image.
wm_hor_alignmentcenterleft, center, rightSets the horizontal alignment for the watermark image.
wm_vrt_offsetNoneNoneYou may specify a horizontal offset (in pixels) to apply to the watermark position. The offset normally moves the watermark to the right, except if you have your alignment set to "right" then your offset value will move the watermark toward the left of the image.
wm_hor_offsetNoneNoneYou may specify a horizontal offset (in pixels) to apply to the watermark position. The offset normally moves the watermark down, except if you have your alignment set to "bottom" then your offset value will move the watermark toward the top of the image.
+ + + +

Text Preferences

+

This table shown the preferences that are available for the text type of watermarking.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
wm_textNoneNoneThe text you would like shown as the watermark. Typically this will be a copyright notice.
wm_font_pathNoneNoneThe server path to the True Type Font you would like to use Code Igniter includes a font in the system/fonts folder. If you do not use this option, the native GD font will be used.
wm_font_size16NoneThe size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using.
wm_font_colorffffffNoneThe font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
wm_shadow_colorNoneNoneThe color of the drop shadow, specified in hex. If you leave this blank a drop shadow will not be used. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
wm_shadow_distance3NoneThe distance (in pixels) from the font that the drop shadow should appear.
+ + + + +

Overlay Preferences

+

This table shown the preferences that are available for the overlay type of watermarking.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefault ValueOptionsDescription
wm_overlay_pathNoneNoneThe server path to the image you wish to use as your watermark. Required only if you are using the overlay method.
wm_opacity501 - 100Image opacity. You may specify the opacity (i.e. transparency) of your watermark image. This allows the watermark to be faint and not completely obscure the details from the original image behind it. A 50% opacity is typical.
wm_x_transp4A numberIf your watermark image is a PNG or GIF image, you may specify a color on the image to be "transparent". This setting (along with the next) will allow you to specify that color. This works by specifying the "X" and "Y" coordinate pixel (measured from the upper left) within the image that corresponds to a pixel representative of the color you want to be transparent.
wm_y_transp4A numberAlong with the previous setting, this allows you to specify the coordinate to a pixel representative of the color you want to be transparent.
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html new file mode 100644 index 00000000..0878f9d1 --- /dev/null +++ b/user_guide/libraries/input.html @@ -0,0 +1,207 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Input Class

+ +

The Input Class serves two purposes:

+ +
    +
  1. It pre-processes global input data for security.
  2. +
  3. It provides some helper functions for fetching input data and pre-processing it.
  4. +
+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ + +

Security Filtering

+ +

The security filtering function is called automatically when a new controller is invoked. It does the following:

+ +
    +
  • Destroys the global GET array. Since Code Igniter does not utilize GET strings, there is no reason to allow it.
  • +
  • Destroys all global variables in the event register_globals is turned on.
  • +
  • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
  • +
  • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
  • +
  • Standardizes newline characters to \n
  • +
+ + +

XSS Filtering

+ +

Code Igniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

+ +

The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

+ +

+Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

+ + +

To filter data through the XSS filter use this function:

+ +

$this->input->xss_clean()

+ +

Here is an usage example:

+ +$data = $this->input->xss_clean($data); + +

If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +application/config/config.php file and setting this: + +$config['global_xss_filtering'] = TRUE; + +

Note: If you use the form validation class, it gives you the option of XSS filtering as well.

+ + + + +

Using POST or COOKIE Data

+ +

Code Igniter comes with two helper functions that let you fetch POST or COOKIE items. The main advantage of using the provided +functions rather then fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +In other words, normally you might do something like this: + + +if ( ! isset($_POST['something']))
+{
+    $something = FALSE;
+}
+else
+{
+    $something = $_POST['something'];
+}
+ +

With Code Igniter's built in functions you can simply do this:

+ +$something = $this->input->post('something'); + +

The two functions are:

+ +

$this->input->post()

+ +

The first parameter will contain the name of the POST item you are looking for:

+ +$this->input->post('some_data'); + +

The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

+ +

The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

+ +$this->input->post('some_data', TRUE); + +

$this->input->cookie()

+ +

This function is identical to the post function, only it fetches cookie data:

+ +$this->input->cookie('some_data', TRUE); + + + + +

$this->input->ip_address()

+

Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

+echo $this->input->ip_address(); + + +

$this->input->valid_ip($ip)

+ +

Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +validates the IP automatically.

+ +if ( ! valid_id($ip))
+{
+     echo 'Not Valid';
+}
+else
+{
+     echo 'Valid';
+}
+ + +

$this->input->user_agent()

+

Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.

+echo $this->input->user_agent(); + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html new file mode 100644 index 00000000..98ef4b09 --- /dev/null +++ b/user_guide/libraries/language.html @@ -0,0 +1,130 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Language Class

+ +

The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

+ +

In your Code Igniter system folder you'll find one called language containing sets of language files. You can create +your own language files as needed in order to display error and other messages in other languages.

+ +

Creating Language Files

+ +

Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

+ +

Within the file you will assign each line of text to an array called $lang with this prototype:

+ +$lang['language_key'] = "The actual message to be shown"; + +

Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with +similarly named items in other files:

+ +$lang['error_email_missing'] = "You must submit an email address";
+$lang['error_url_missing'] = "You must submit a URL";
+$lang['error_username_missing'] = "You must submit a username";
+ + +

Loading A Language File

+ +

In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

+ +$this->lang->load('filename', 'language'); + +

Where filename is the name of the file you wish to load (without the file extension), and language +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +application/config/config.php file will be used.

+ + +

Fetching a Line of Text

+ +

Once your desired language file is loaded you can access any line of text using this function:

+ +$this->lang->line('language_key'); + +

Where language_key is the array key corresponding to the line you wish to show.

+ +

Note: This function simply returns the line. It does not echo it for you.

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html new file mode 100644 index 00000000..630a2ea6 --- /dev/null +++ b/user_guide/libraries/loader.html @@ -0,0 +1,171 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Loader Class

+ +

Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +Helpers, Plugins, or your own files.

+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ +

The following functions are available in this class:

+ + + +

$this->load->view('file_name', $data, true/false)

+ +

This function is used to load your View files. If you haven't read the Views section of the +user guide it is recommended that you do since it shows you how this function is typically used.

+ +

The first parameter is required. It is the name of the view file you would like to load.

+ +

The second optional parameter can take +an associative array or an object as input, which it runs through the PHP extract function to +convert to variables that can be used in your view files. Again, read the Views page to learn +how this might be useful.

+ +

The third optional parameter lets you change the behavior of the function so that it returns data as a string +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you wan the data returned:

+ +$string = $this->load->view('myfile', '', true); + + + +

$this->load->library('class_name')

+ +

This function is used to load core classes. Where class_name is the name of the class you want to load. +Note: We use the terms "class" and "library" interchangeably.

+ +

For example, if you would like to send email with Code Igniter, the first step is to load the email class within your controller:

+ +$this->load->library('email'); + +

Once loaded, the library will be ready for use. Each library is described in detail in its own page, so please read the +information regarding each one you would like to use.

+ + + +

$this->load->database('options', true/false)

+ +

This function lets you load the database class. The two parameters are optional. Please see the +database section for more info.

+ + +

$this->load->scaffolding('table_name')

+ +

This function lets you enable scaffolding. Please see the +scaffolding section for more info.

+ + + +

$this->load->vars($array)

+ +

This function takes an associative array as input and generates variables using the PHP extract function. +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +want to use this function independently is if you would like to set some global variables in the constructor of your controller +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and merged into one array for conversion to variables. +

+ + +

$this->load->helper('file_name')

+

This function loads helper files, where file_name is the name of the file, without the _helper.php extension.

+ + +

$this->load->plugin('file_name')

+

This function loads plugins files, where file_name is the name of the file, without the _plugin.php extension.

+ +

$this->load->file('filepath/filename', true/false)

+

This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) +it will instead return the data as a string.

+ + +

$this->load->lang('file_name')

+

This function is an alias of the language loading function: $this->lang->load()

+ +

$this->load->config('file_name')

+

This function is an alias of the config file loading function: $this->config->load()

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html new file mode 100644 index 00000000..1a4537af --- /dev/null +++ b/user_guide/libraries/output.html @@ -0,0 +1,112 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Output Class

+ +

The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +also responsible for caching your web pages, if you use that feature.

+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ +

Under normal circumstances you won't even notice the Output class since it works transparently without your intervention. +For example, when you use the Loader class to load a view file, it's automatically +passed to the Output class, which will be called automatically by Code Igniter at the end of system execution. +It is possible, however, for you to manually intervene with the output if you need to, using either of the two following functions:

+ +

$this->output->set_output();

+ +

Permits you to manually set the final output string. Usage example:

+ +$this->output->set_output($data); + +

Important: If you do set your output manually, it must be the last thing done in the function you call it from. +For example, if you build a page in one of your controller functions, don't set the output until the end.

+ + +

$this->output->get_output();

+ +

Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

+$string = $this->output->get_output(); + +

Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the +Code Igniter functions like $this->load->view().

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html new file mode 100644 index 00000000..3f4e5693 --- /dev/null +++ b/user_guide/libraries/pagination.html @@ -0,0 +1,218 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Pagination Class

+ +

Code Igniter's Pagination class is very easy to use, and it is 100% customizable, ether dynamically or via stored preferences.

+ +

If you are not familiar with the term "pagination", it refers to links that allows you to navigate from page to page, like this:

+ +« First  < 1 2 3 4 5 >  Last » + +

Example

+ +

Here is a simple example showing how to create pagination in one of your controller functions:

+ + +$this->load->library('pagination');

+$config['base_url'] = 'http://www.your-site.com/index.php/test/page/';
+$config['total_rows'] = '200';
+$config['per_page'] = '20'; +

+$this->pagination->initialize($config); + +

+echo $this->pagination->create_links();
+ +

Notes:

+ +

The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

+ +
    +
  • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Page" and a function called "test". Keep in mind that you can + re-route your URI if you need a different structure.
  • +
  • total_rows This number represents the total rows in the result set you are creating pagination for. + Typically this number will be the total rows that your database query returned. +
  • +
  • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
  • +
+ +

The create_links() function returns an empty string when there is no pagination to show. + + +

Setting preferences in a config file

+ +

If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the pagination.php, add the $config +array in that file. Then save the file in: config/pagination.php and it will be used automatically. You +will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

+ + +

Customizing the Pagination

+ +

The following is a list of all the preferences you can pass to the initialization function to tailor the display.

+ + +

$config['uri_segment'] = 3;

+ +

The pagination function automatically determines which segment of your URI contains the page number. If you need +something different you can specify it.

+ +

$config['num_links'] = 2;

+ +

The number of "digit" links you would like before and after the the selected page number. For example, the number 2 +will place two digits on either side, as in the example links at the very top of this page.

+ +

Adding Enclosing Markup

+ +

If you would like to surround the entire pagination with some markup you can do it with these two prefs:

+ +

$config['full_tag_open'] = '<p>';

+

The opening tag placed on the left side of the entire result.

+ +

$config['full_tag_close'] = '</p>';

+

The closing tag placed on the right side of the entire result.

+ + +

Customizing the First Link

+ +

$config['first_link'] = 'First';

+

The text you would like shown in the "first" link on the left.

+ +

$config['first_tag_open'] = '<div>';

+

The opening tag for the "first" link.

+ +

$config['first_tag_close'] = '</div>';

+

The closing tag for the "first" link.

+ +

Customizing the Last Link

+ +

$config['last_link'] = 'Last';

+

The text you would like shown in the "last" link on the right.

+ +

$config['last_tag_open'] = '<div>';

+

The opening tag for the "last" link.

+ +

$config['last_tag_close'] = '</div>';

+

The closing tag for the "last" link.

+ +

Customizing the "Next" Link

+ +

$config['next_link'] = '&gt';

+

The text you would like shown in the "next" page link.

+ +

$config['next_tag_open'] = '<div>';

+

The opening tag for the "next" link.

+ +

$config['next_tag_close'] = '</div>';

+

The closing tag for the "next" link.

+ +

Customizing the "Previous" Link

+ +

$config['prev_link'] = '&lt';

+

The text you would like shown in the "previous" page link.

+ +

$config['prev_tag_open'] = '<div>';

+

The opening tag for the "previous" link.

+ +

$config['prev_tag_close'] = '</div>';

+

The closing tag for the "previous" link.

+ +

Customizing the "Current Page" Link

+ +

$config['cur_tag_open'] = '<b>';

+

The opening tag for the "current" link.

+ +

$config['cur_tag_close'] = '</b>';

+

The closing tag for the "current" link.

+ + +

Customizing the "Digit" Link

+ +

$config['num_tag_open'] = '<div>';

+

The opening tag for the "digit" link.

+ +

$config['num_tag_close'] = '</div>';

+

The closing tag for the "digit" link.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html new file mode 100644 index 00000000..f8ddd41c --- /dev/null +++ b/user_guide/libraries/parser.html @@ -0,0 +1,214 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + + + +

Template Parser Class

+ +

The Template Parser Class enables you to parse pseudo-variables contained within your view files. It can parse simple +variables or variable tag pairs. If you've never used a template engine, pseudo-variables look like this:

+ +<html>
+<head>
+<title>{blog_title}</title>
+</head>
+<body>
+
+<h3>{blog_heading}</h3>
+
+{blog_entries}
+<h5>{title}</h5>
+<p>{body}</p>
+{/blog_entries}
+ +</body>
+</html>
+ +

These variables are not actual PHP variables, but rather plain text representations that allow you to eliminate +PHP from your templates (view files).

+ +

Note: Code Igniter does not require you to use this class +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +they work with designers who they feel would find some confusion working with PHP.

+ +

Also Note: The Template Parser Class is not not a +full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance. + +

+ + +

Initializing the Class

+ +

Like most other classes in Code Igniter, the Parser class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('parser'); +

Once loaded, the Parser library object will be available using: $this->parser

+ +

The following functions are available in this library:

+ +

$this->parser->parse()

+ +

This variable accepts a template name and data array as input, and it generates a parsed version. Example:

+ +$this->load->library('parser');
+
+$data = array(
+            'blog_title' => 'My Blog Title',
+            'blog_heading' => 'My Blog Heading'
+            );
+
+$this->parser->parse('blog_template', $data);
+ +

The first parameter contains the name of the view file (in this example the file would be called blog_template.php), +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +template would contain two variables: {blog_title} and {blog_heading}

+ +

There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +pass TRUE (boolean) to the third parameter:

+ +$string = $this->parser->parse('blog_template', $data, TRUE); + + +

Variable Pairs

+ +

The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

+ +<html>
+<head>
+<title>{blog_title}</title>
+</head>
+<body>
+
+<h3>{blog_heading}</h3>
+
+{blog_entries}
+<h5>{title}</h5>
+<p>{body}</p>
+{/blog_entries}
+ +</body>
+</html>
+ +

In the above code you'll notice a pair of variables: {blog_entries} data... {/blog_entries}. +In a case like this, the entire chunk of data between these pairs would be repeated multiple times, corresponding +to the number of rows in a result.

+ +

Parsing variable pairs is done using the identical code shown above to parse single variables, +except, you will add a multi-dimensional array corresponding to your variable pair data. +Consider this example:

+ + +$this->load->library('parser');
+
+$data = array(
+              'blog_title'   => 'My Blog Title',
+              'blog_heading' => 'My Blog Heading',
+              'blog_entries' => array(
+                                      array('title' => 'Title 1', 'body' => 'Body 1'),
+                                      array('title' => 'Title 2', 'body' => 'Body 2'),
+                                      array('title' => 'Title 3', 'body' => 'Body 3'),
+                                      array('title' => 'Title 4', 'body' => 'Body 4'),
+                                      array('title' => 'Title 5', 'body' => 'Body 5')
+                                      )
+            );
+
+$this->parser->parse('blog_template', $data);
+ +

If your "pair" data is coming from a database result, which is already a multi-dimensional array, you can simply +use the database result function:

+ + +$query = $this->db->query("SELECT * FROM blog");
+
+$this->load->library('parser');
+
+$data = array(
+              'blog_title'   => 'My Blog Title',
+              'blog_heading' => 'My Blog Heading',
+              'blog_entries' => $query->result_array()
+            );
+
+$this->parser->parse('blog_template', $data);
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html new file mode 100644 index 00000000..1050e110 --- /dev/null +++ b/user_guide/libraries/sessions.html @@ -0,0 +1,283 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Session Class

+ +

The Session class permits you maintain a user's "state" and track their activity while they browse your site. +The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. +It can also store the session data in a database table for added security, as this permits the session ID in the +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +use the database option you'll need to create the session table as indicated below. +

+ +

Note: The Session class does not utilize native PHP sessions. It +generates its own session data, offering more flexibility for developers.

+ +

Initializing a Session

+ +

Sessions will typically run globally with each page load, so the session class must either be +initialized in your +controller constructors, or it can be +auto-loaded by the system. +For the most part the session class will run unattended in the background, so simply initializing the class +will cause it to read, create, and update sessions.

+ + +

To initialize the Session class manually in your controller constructor, use the $this->load->library function:

+ +$this->load->library('session'); +

Once loaded, the Sessions library object will be available using: $this->session

+ + +

How do Sessions work?

+ +

When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. +If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. +If a session does exist, its information will be updated and the cookie will be updated.

+ +

It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

+ + +

What is Session Data?

+ +

A session, as far as Code Igniter is concerned, is simply an array containing the following information:

+ +
    +
  • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability)
  • +
  • The user's IP Address
  • +
  • The user's User Agent data (the first 50 characters of the browser data string)
  • +
  • The "last activity" and "last visit" time stamps.
  • +
+ +

The above data is stored in a cookie as a serialized array with this prototype:

+ +[array]
+(
+     'session_id'    => random hash,
+     'ip_address'    => 'string - user IP address',
+     'user_agent'    => 'string - user agent data',
+     'last_activity' => timestamp,
+     'last_visit'    => timestamp
+)
+ +

If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, +making the data highly secure and impervious to being read or altered by someone. More info regarding encryption +can be found here, although the Session class will take care of initializing +and encrypting the data automatically.

+ +

Note: Session cookies are only updated every five minutes to reduce processor load. If you repeatedly reload a page +you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time +the cookie was written.

+ +

Retrieving Session Data

+ +

Any piece of information from the session array is available using the following function:

+ +$this->session->userdata('item'); + +

Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +will do this:

+ +$session_id = $this->session->userdata('session_id'); + +

Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

+ + +

Adding Custom Session Data

+ +

A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. +Why would you want to do this? Here's one example:

+ +

Let's say a particular user logs into your site. Once authenticated, +you could add their username and email address to the session cookie, making that data globally available to you without +having to run a database query when you need it.

+ +

To add your data to the session array involves passing an array containing your new data to this function:

+ +$this->session->set_userdata($array); + +

Where $array is an associative array containing your new data. Here's an example:

+ + +$newdata = array(
+                   'username'  => 'johndoe',
+                   'email'     => 'johndoe@some-site.com',
+                   'logged_in' => TRUE
+               );
+
+$this->session->set_userdata($newdata);
+ +

Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

+ +

Saving Session Data to a Database

+ +

While the session data array stored in the user's cookie contains a Session ID, +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

+ +

When session data is available in a database, every time a valid session is found in the user's cookie, a database +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +be updated, they can only be generated when a new session is created.

+ +

In order to store sessions, you must first create a database table for this purpose. Here is the basic +prototype required by the session class:

+ + + +

Note: By default the table is called ci_sessions, but you can name it anything you want +as long as you update the application/config/config.php file so that it contains the name you have chosen. +Once you have created your database table you can enable the database option in your config.php file as follows:

+ +$config['sess_use_database'] = TRUE; + +

Once enabled, the Session class will store session data in the DB.

+ +

Session Preferences

+ +

You'll find the following Session related preferences in your application/config/config.php file:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreferenceDefaultOptionsDescription
sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). +If you would like a non-expiring session set the value to zero: 0
sess_encrypt_cookieTRUETRUE/FALSE (boolean)Whether to encrypt the session data.
sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically +changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html new file mode 100644 index 00000000..71b9be04 --- /dev/null +++ b/user_guide/libraries/trackback.html @@ -0,0 +1,251 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Trackback Class

+ +

The Trackback Class provides functions that enable you to send and receive Trackback data.

+ + +

If you are not familiar with Trackbacks you'll find more information here.

+ +

Initializing the Class

+ +

Like most other classes in Code Igniter, the Trackback class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('trackback'); +

Once loaded, the Trackback library object will be available using: $this->trackback

+ + +

Sending Trackbacks

+ +

A Trackback can be sent from any of your controller functions using code similar to this example: + +$this->load->library('trackback');
+
+$tb_data = array(
+                'ping_url'  => 'http://some-site.com/trackback/456',
+                'url'       => 'http://www.my-site.com/blog/entry/123',
+                'title'     => 'The Title of My Entry',
+                'excerpt'   => 'The entry content.',
+                'blog_name' => 'My Blog Name',
+                'charset'   => 'utf-8'
+                );
+
+if ( ! $this->trackback->send($tb_data))
+{
+     echo $this->trackback->display_errors();
+}
+else
+{
+     echo 'Trackback was sent!';
+}
+ +

Description of array data:

+ +
    +
  • ping_url - The URL of the site you are sending the Trackback to. You can send Trackbacks to multiple URLs by separating each URL with a comma.
  • +
  • url - The URL to YOUR site where the weblog entry can be seen.
  • +
  • title - The title of your weblog entry.
  • +
  • excerpt - The content of your weblog entry. Note: the Trackback class will automatically send only the first 500 characters of your entry. It will also strip all HTML.
  • +
  • blog_name - The name of your weblog.
  • +
  • charset - The character encoding your weblog is written in. If omitted, UTF-8 will be used.
  • +
+ +

The Trackback sending function returns TRUE/FALSE (boolean) on success or failure. If it fails, you can retrieve the error message using:

+ +$this->trackback->display_errors(); + + +

Receiving Trackbacks

+ +

Before you can receive Trackbacks you must create a weblog. If you don't have a blog yet there's no point in continuing.

+ +

Receiving Trackbacks is a little more complex than sending them, only because you will need a database table in which to store them, +and you will need to validate the incoming trackback data. You are encouraged to implement a thorough validation process to +guard against spam and duplicate data. You may also want to limit the number of Trackbacks you allow from a particular IP within +a given span of time to further curtail spam. The process of receiving a Trackback is quite simple; +the validation is what takes most of the effort.

+ +

Your Ping URL

+ +

In order to accept Trackbacks you must display a Trackback URL next to each one of your weblog entries. This will be the URL +that people will use to send you Trackbacks (we will refer to this as your "Ping URL").

+ +

Your Ping URL must point to a controller function where your Trackback receiving code is located, and the URL +must contain the ID number for each particular entry, so that when the Trackback is received you'll be +able to associate it with a particular entry.

+ +

For example, if your controller class is called Trackback, and the receiving function is called receive, your +Ping URLs will look something like this:

+ +http://www.your-site.com/index.php/trackback/receive/entry_id + +

Where entry_id represents the individual ID number for each of your entries.

+ + +

Creating a Trackback Table

+ +

Before you can receive Trackbacks you must create a table in which to store them. Here is a basic prototype for such a table:

+ + + + +

The Trackback specification only requires four pieces of information to be sent in a Trackback (url, title, excerpt, blog_name), +but to make the data more useful we've added a few more fields in the above table schema (date, IP address, etc.).

+ +

Processing a Trackback

+ +

Here is an example showing how you will receive and process a Trackback. The following +code is intended for use within the controller function where you expect to receive Trackbacks.

+ +$this->load->library('trackback');
+$this->load->database();
+
+if ($this->uri->segment(3) == FALSE)
+{
+    $this->trackback->send_error("Unable to determine the entry ID");
+}
+
+if ( ! $this->trackback->receive())
+{
+    $this->trackback->send_error("The Trackback did not contain valid data");
+}
+
+$data = array(
+                'tb_id'      => '',
+                'entry_id'   => $this->uri->segment(3),
+                'url'        => $this->trackback->data('url'),
+                'title'      => $this->trackback->data('title'),
+                'excerpt'    => $this->trackback->data('excerpt'),
+                'blog_name'  => $this->trackback->data('blog_name'),
+                'tb_date'    => time(),
+                'ip_address' => $this->input->ip_address()
+                );
+
+$sql = $this->db->insert_string('trackbacks', $data);
+$this->db->query($sql);
+
+$this->trackback->send_success();
+ +

Notes:

+ +

The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:

+ +http://www.your-site.com/index.php/trackback/receive/entry_id + +

Notice the entry_id is in the third URI, which you can retrieve using:

+ +$this->uri->segment(3); + +

In our Trackback receiving code above, if the third segment is missing, we will issue an error. Without a valid entry ID, there's no +reason to continue.

+ +

The $this->trackback->receive() function is simply a validation function that looks at the incoming data +and makes sure it contains the four pieces of data that are required (url, title, excerpt, blog_name). +It returns TRUE on success and FALSE on failure. If it fails you will issue an error message.

+ +

The incoming Trackback data can be retrieved using this function:

+ +$this->trackback->data('item') + +

Where item represents one of these four pieces of info: url, title, excerpt, or blog_name

+ +

If the Trackback data is successfully received, you will issue a success message using:

+ +$this->trackback->send_success(); + +

Note: The above code contains no data validation, which you are encouraged to add.

+ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html new file mode 100644 index 00000000..182e29e3 --- /dev/null +++ b/user_guide/libraries/unit_testing.html @@ -0,0 +1,210 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Unit Testing Class

+ +

Unit testing is an approach to software development in which tests are written for each function in your application. +If you are not familiar with the concept you might do a little googling on the subject.

+ +

Code Igniter's Unit Test class is quite simple, consisting of an evaluation function and two result functions. +It's not intended to be a full-blown test suite but rather a simple mechanism to evaluate your code +to determine if it is producing the correct data type and result. +

+ + +

Initializing the Class

+ +

Like most other classes in Code Igniter, the Unit Test class is initialized in your controller using the $this->load->library function:

+ +$this->load->library('unit_test'); +

Once loaded, the Unit Test object will be available using: $this->unit

+ + +

Running Tests

+ +

Running a test involves supplying a test and an expected result to the following function:

+ +

$this->unit->run( test, expected result, 'test name' );

+ +

Where test is the result of the code you wish to test, +expected result is the data type you expect, and test name is an optional name you can give your test. Example:

+ +$test = 1 + 1;
+
+$expected_result = 2;
+
+$test_name = 'Adds one plus one';
+
+$this->unit->run($test, $expected_result, $test_name);
+ +

The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:

+ +$this->unit->run('Foo', 'Foo'); + +

Here is an example of a data type match:

+ +$this->unit->run('Foo', 'is_string'); + +

Notice the use of "is_string" in the second parameter? This tells the function to evaluate whether your test is producing a string +as the result. Here is a list of allowed comparison types:

+ +
    +
  • is_string
  • +
  • is_bool
  • +
  • is_true
  • +
  • is_false
  • +
  • is_int
  • +
  • is_numeric
  • +
  • is_float
  • +
  • is_double
  • +
  • is_array
  • +
  • is_null
  • +
+ + +

Generating Reports

+ +

You can either display results after each test, or your can run several tests and generate a report at the end. +To show a report directly simply echo or return the run function:

+ +echo $this->unit->run($test, $expected_result); + +

To run a full report of all tests, use this:

+ +echo $this->unit->report(); + +

The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:

+ +echo $this->unit->result(); + + +

Strict Mode

+ +

By default the unit test class evaluates literal matches loosely. Consider this example:

+ +$this->unit->run(1, TRUE); + +

The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing +will evaluate the above code as TRUE using a normal equality test:

+ +if (1 == TRUE) echo 'This evaluates as true'; + +

If you prefer, you can put the unit test class in to strict mode, which will compare the data type as well as the value:

+ +if (1 === TRUE) echo 'This evaluates as FALSE'; + +

To enable strict mode use this:

+ +$this->unit->strict(TRUE); + +

Enabling/Disabling Unit Testing

+ +

If you would like to leave some testing in place in your scripts, but not have it run unless you need it, you can disable +unit testing using:

+ +$this->unit->active(FALSE) + + + +

Creating a Template

+ +

If you would like your test results formatted differently then the default you can set your own template. Here is an +example of a simple template. Note the required pseudo-variables:

+ + +$str = '
+<table border="0" cellpadding="4" cellspacing="1">
+    {rows}
+        <tr>
+        <td>{item}</td>
+        <td>{result}</td>
+        </tr>
+    {/rows}
+</table>';
+
+$this->unit->set_template($str); +
+ + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html new file mode 100644 index 00000000..5218cea8 --- /dev/null +++ b/user_guide/libraries/uri.html @@ -0,0 +1,220 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

URI Class

+ +

The URI Class provides functions that help you retrieve information from your URI strings.

+ +

Note: This class is initialized automatically by the system so there is no need to do it manually.

+ +

$this->uri->segment(n)

+ +

Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. +Segments are numbered from left to right. For example, if your full URL is this:

+ +http://www.your-site.com/index.php/news/local/metro/crime_is_up + +

The segment numbers would be this:

+ +
    +
  1. news
  2. +
  3. local
  4. +
  5. metro
  6. +
  7. crime_is_up
  8. +
+ +

By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that +permits you to set your own default value if the segment is missing. +For example, this would tell the function to return the number zero in the event of failure:

+ +$product_id = $this->uri->segment(3, 0); + +

It helps avoid having to write code like this:

+ +if ($this->uri->segment(3) === FALSE)
+{
+    $product_id = 0;
+}
+else
+{
+    $product_id = $this->uri->segment(3);
+}
+
+ + +

$this->uri->slash_segment(n)

+ +

This function is almost identical to the one above, except it adds a trailing and/or leading slash based on the second +parameter. If the parameter is not used, a trailing slash added. Examples:

+ +$this->uri->slash_segment(3);
+$this->uri->slash_segment(3, 'leading');
+$this->uri->slash_segment(3, 'both');
+ +

Returns:

+ +
    +
  1. segment/
  2. +
  3. /segment
  4. +
  5. /segment/
  6. +
+ + +

$this->uri->uri_to_assoc(n)

+ +

This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

+ +index.php/user/search/name/joe/location/UK/gender/male + +

Using this function you can turn the URI into an associative array with this prototype:

+ +[array]
+(
+    'name' => 'joe'
+    'location' => 'UK'
+    'gender' => 'male'
+)
+ +

The first parameter of the function lets you set an offset. By default it is set to 3 since your +URI will normally contain a controller/function in the first and second segments. Example:

+ + +$array = $this->uri->uri_to_assoc(3);
+
+echo $array['name']; +
+ + +

The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

+ + +$default = array('name', 'gender', 'location', 'type', 'sort');
+
+$array = $this->uri->uri_to_assoc(3, $default);
+ +

If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

+ +

Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

+ + +

$this->uri->assoc_to_uri()

+ +

Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

+ +$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
+
+$str = $this->uri->assoc_to_str($array);
+
+// Produces: product/shoes/size/large/color/red +
+ + +

$this->uri->uri_string()

+ +

Returns a string with the complete URI. For example, if this is your full URL:

+ +http://www.your-site.com/index.php/news/local/345 + +

The function would return this:

+ +news/local/345 + + +

$this->uri->total_segments()

+ +

Returns the total number of segments.

+ + + +

$this->uri->segment_array()

+ +

Returns an array containing the URI segments. For example:

+ + +$segs = $this->uri->segment_array();
+
+foreach ($segs as $segment)
+{
+    echo $segment;
+    echo '<br />';
+}
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html new file mode 100644 index 00000000..2489aa6e --- /dev/null +++ b/user_guide/libraries/validation.html @@ -0,0 +1,674 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Form Validation

+ +

Before explaining Code Igniter's approach to data validation, let's describe the ideal scenario:

+ +
    +
  1. A form is displayed.
  2. +
  3. You fill it in and submit it.
  4. +
  5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data along with an error message describing the problem.
  6. +
  7. This process continues until you have submitted a valid form.
  8. +
+ +

On the receiving end, the script must:

+ +
    +
  1. Check for required data.
  2. +
  3. Verify that the data is of the correct type, and meets the correct criteria. (For example, if a username is submitted +it must be validated to contain only permitted characters. It must be of a minimum length, +and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.) +
  4. Sanitize the data for security.
  5. +
  6. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
  7. +
  8. Prep the data for insertion in the database.
  9. +
+ + +

Although there is nothing complex about the above process, it usually requires a significant +amount of code, and to display error messages, various control structures are usually placed within the form HTML. +Form validation, while simple to create, is generally very messy and tedious to implement.

+ +Code Igniter provides a comprehensive validation framework that truly minimizes the amount of code you'll write. +It also removes all control structures from your form HTML, permitting it to be clean and free of code. + +

Overview

+ +

In order to implement Code Igniter's form validation you'll need three things:

+ +
    +
  1. A View file containing the form.
  2. +
  3. A View file containing a "success" message to be displayed upon successful submission.
  4. +
  5. A controller function to receive and process the submitted data.
  6. +
+ +

Let's create those three things, using a member sign-up form as the example.

+ +

The Form

+ +

Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +folder:

+ + + + + +

The Success Page

+ + +

Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +folder:

+ + + + + +

The Controller

+ +

Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +folder:

+ + + + + +

Try it!

+ +

To try your form, visit your site using a URL similar to this one:

+ +www.your-site.com/index.php/form/ + +

If you submit the form you should simply see the form reload. That's because you haven't set up any validation +rules yet, which we'll get to in a moment.

+ + +

Explanation

+ +

You'll notice several things about the above pages:

+ +

The form (myform.php) is a standard web form with a couple exceptions:

+ +
    +
  1. It uses a form helper to create the form opening. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable +and flexible in the event your URLs change.
  2. + +
  3. At the top of the form you'll notice the following variable: +<?=$this->validation->error_string; ?> + +

    This variable will display any error messages sent back by the validator. If there are no messages it returns nothing.

    +
  4. +
+ +

The controller (form.php) has one function: index(). This function initializes the validation class and +loads the form helper and URL helper used by your view files. It also runs +the validation routine. Based on +whether the validation was successful it either presents the form or the success page.

+ +

Since you haven't told the validation class to validate anything yet, it returns "false" (boolean false) by default. The run() +function only returns "true" if it has successfully applied your rules without any of them failing.

+ + +

Setting Validation Rules

+ +

Code Igniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data +at the same time. Let's see it in action, we'll explain it afterwards.

+ +

In your controller (form.php), add this code just below the validation initialization function:

+ +$rules['username'] = "required";
+$rules['password'] = "required";
+$rules['passconf'] = "required";
+$rules['email'] = "required";
+
+$this->validation->set_rules($rules);
+ +

Your controller should now look like this:

+ + + +

Now submit the form with the fields blank and you should see the error message. +If you submit the form with all the fields populated you'll see your success page.

+ +

Note: The form fields are not yet being re-populated with the data when +there is an error. We'll get to that shortly, once we're through explaining the validation rules.

+ + +

Changing the Error Delimiters

+ +

By default, the system adds a paragraph tag (<p>) around each error message shown. You can easily change these delimiters with +this code, placed in your controller:

+ +$this->validation->set_error_delimiters('<div class="error">', '</div>'); + +

In this example, we've switched to using div tags.

+ +

Cascading Rules

+ +

Code Igniter lets you pipe multiple rules together. Let's try it. Change your rules array like this:

+ + +$rules['username'] = "required|min_length[5]|max_length[12]";
+$rules['password'] = "required|matches[passconf]";
+$rules['passconf'] = "required";
+$rules['email'] = "required|valid_email";
+ +

The above code requires that:

+ +
    +
  1. The username field be no shorter than 5 characters and no longer than 12.
  2. +
  3. The password field must match the password confirmation field.
  4. +
  5. The email field must contain a valid email address.
  6. +
+ +

Give it a try!

+ +

Note: There are numerous rules available which you can read about in the validation reference.

+ + +

Prepping Data

+ +

In addition to the validation functions like the ones we used above, you can also prep your data in various ways. +For example, you can set up rules like this: + +$rules['username'] = "trim|required|min_length[5]|max_length[12]|xss_clean";
+$rules['password'] = "trim|required|matches[passconf]|md5";
+$rules['passconf'] = "trim|required";
+$rules['email'] = "trim|required|valid_email";
+ +

In the above, we are "trimming" the fields, converting the password to MD5, and running the username through +the "xss_clean" function, which removes malicious data.

+ +

Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, +trim, MD5, etc.

+ +

Note: You will generally want to use the prepping functions after +the validation rules so if there is an error, the original data will be shown in the form.

+ +

Callbacks: Your own Validation Functions

+ +

The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a simple example.

+ +

In your controller, change the "username" rule to this:

+ +$rules['username'] = "callback_username_check"; + +

Then add a new function called username_check to your controller. Here's how your controller should look:

+ + + + +

Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +callback function for you to process.

+ +

To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

+ +

The error message was set using the $this->validation->set_message function. +Just remember that the message key (the first parameter) must match your function name.

+ +

Note: You can apply your own custom error messages to any rule, just by setting the +message similarly. For example, to change the message for the "required" rule you will do this:

+ +$this->validation->set_message('required', 'Your custom message here'); + +

Re-populating the form

+ +

Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. +This is done similarly to your rules. Add the following code to your controller, just below your rules:

+ +$fields['username'] = 'Username';
+$fields['password'] = 'Password';
+$fields['passconf'] = 'Password Confirmation';
+$fields['email'] = 'Email Address';
+
+$this->validation->set_fields($fields);
+ +

The array keys are the actual names of the form fields, the value represents the full name that you want shown in the +error message.

+ +

The index function of your controller should now look like this:

+ + + + + +

Now open your myform.php view file and update the value in each field so that it has an object corresponding to its name:

+ + + + + +

Now reload your page and submit the form so that it triggers an error. Your form fields should be populated +and the error messages will contain a more relevant field name.

+ + + +

Showing Errors Individually

+ +

If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

+ + + + +

If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you +have set (<p> tags by default).

+ +

Note: To display errors this way you must remember to set your fields using the $this->validation->set_fields +function described earlier. The errors will be turned into variables that have "_error" after your field name. +For example, your "username" error will be available at:
$this->validation->username_error.

+ + +

Rule Reference

+ +

The following is a list of all the native rules that are available to use:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RuleParameterDescriptionExample
requiredNoReturns FALSE if the form element is empty. 
matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
numericNoReturns FALSE if the form element contains anything other than numeric characters. 
valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
+ +

Note: These rules can also be called as discreet functions. For example:

+ +$this->validation->required($string); + +

Note: You can also use any native PHP functions that permit one parameter.

+ + + +

Prepping Reference

+ +

The following is a list of all the prepping functions that are available to use:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameParameterDescription
xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
prep_urlNoAdds "http://" to URLs if missing.
strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
encode_php_tagsNoConverts PHP tags to entities.
+ +

Note: You can also use any native PHP functions that permit one parameter, +like trim, htmlspecialchars, urldecode, etc.

+ + +

Setting Custom Error Messages

+ +

All of the native error messages are located in the following language file: language/english/validation_lang.php

+ +

To set your own custom message you can either edit that file, or use the following function:

+ +$this->validation->set_message('rule', 'Error Message'); + +

Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html new file mode 100644 index 00000000..f8ef5995 --- /dev/null +++ b/user_guide/libraries/xmlrpc.html @@ -0,0 +1,485 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

XML-RPC and XML-RPC Server Classes

+ + +

Code Igniter's XML-RPC classes permit you to send requests to another server, or set up +your own XML-RPC server to receive requests.

+ + +

What is XML-RPC?

+ +

Quite simply it is a way for two computers to communicate over the internet using XML. +One computer, which we will call the client, sends an XML-RPC request to +another computer, which we will call the server. Once the server receives and processes the request it +will send back a response to the client.

+ +

For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will +send a request to an XML-RPC Server running on your site. This request might be a new weblog entry +being sent for publication, or it could be a request for an existing entry for editing. + +When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. +Once processed, the server will then send back a response message.

+ +

For detailed spcifications, you can visit the XML-RPC site.

+ +

Initializing the Class

+ +

Like most other classes in Code Igniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

+ +

To load the XML-RPC class you will use: +$this->load->library('xmlrpc'); +

Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

+ +

To load the XML-RPC Server class you will use: +$this->load->library('xmlrpcs'); +

Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

+ + + +

Sending XML-RPC Requests

+ +

To send a request to an XML-RPC server you must specify the following information:

+ +
    +
  • The URL of the server
  • +
  • The method on the server you wish to call
  • +
  • The request data (explained below).
  • +
+ +

Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

+ + +$this->load->library('xmlrpc');
+
+$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
+$this->xmlrpc->method('weblogUpdates.ping');
+ +
+$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
+$this->xmlrpc->request($request);
+
+if ( ! $this->xmlrpc->send_request())
+{
+    echo $xmlrpc->display_error();
+} +
+ +

Explanation

+ +

The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The +request (in this case, the title and URL of your site) is placed into an array for transportation, and +compiled using the request() function. +Lastly, the full request is sent. If the send_request() method returns false we will display the error message +sent back from the XML-RPC Server.

+ +

Anatomy of a Request

+ +

An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request +is referred to as a request parameter. The above example has two parameters: +The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

+ +

Request parameters must be placed into an array for transportation, and each parameter can can be one +of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings +you will have to include the data type in the request array.

+ +

Here is an example of a simple array with three parameters:

+ +$request = array('John', 'Doe', 'www.some-site.com');
+$this->xmlrpc->request($request);
+ +

If you use data types other than strings, or if you have several different data types, you will place +each parameter into its own array, with the data type in the second position:

+ + +$request = array (
+                   array('John', 'string'),
+                   array('Doe', 'string'),
+                   array(FALSE, 'boolean'),
+                   array(12345, 'int')
+                 ); +
+$this->xmlrpc->request($request);
+ +The Data Types section below has a full list of data types.

+ + + +

Creating an XML-RPC Server

+ +

An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the +appropriate functions for processing.

+ +

To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming +request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate +class and method for processing.

+ +

Here is an example to illustrate:

+ +$this->load->library('xmlrpcs');
+
+$config['functions']['new_post'];  = array('function' => 'My_blog.new_entry');
+$config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
+
+$this->xmlrpcs->initialize($config);
+$this->xmlrpcs->serve();
+ +

The above example contains an array specifying two method requests that the Server allows. +The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right. + +

In other words, if an XML-RPC Client sends a request for the new_post method, your +server will load the My_blog class and call the new_entry function. +If the request is for the update_post method, your +server will load the My_blog class and call the update_entry function.

+ +

The function names in the above example are arbitrary. You'll decide what they should be called on your server, +or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

+ + +

Processing Server Requests

+ +

When the XML-RPC Server receives a request and loads the class/method for processing, it will pass +an object to that method containing the data sent by the client.

+ +

Using the above example, if the new_post method is requested, the server will expect a class +to exist with this prototype:

+ +class My_blog extends Controller {
+
+    function new_post($request)
+    {
+
+    }
+} +
+ +

The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. +Using this object you will have access to the request parameters enabling you to process the request. When +you are done you will send a Response back to the Client.

+ +

Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). +Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends +back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing +function might look:

+ + +class My_blog extends Controller {
+
+    function getUserInfo($request)
+    {
+ +        $username = 'smitty';
+        $password = 'secretsmittypass';

+ +        $this->load->library('xmlrpc');
+    
+        $parameters = $request->output_parameters();
+    
+        if ($parameters['1'] != $username AND $parameters['2'] != $password)
+        {
+            return $this->xmlrpc->send_error_message('100', 'Invalid Access');
+        }
+    
+        $response = array(array('nickname'  => array('Smitty','string'),
+                                'userid'    => array('99','string'),
+                                'url'       => array('http://yoursite.com','string'),
+                                'email'     => array('jsmith@yoursite.com','string'),
+                                'lastname'  => array('Smith','string'),
+                                'firstname' => array('John','string')
+                                ),
+                         'struct');
+
+        $this->xmlrpc->send_response($response);
+    }
+} +
+ +

Notes:

+

The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. +In the above example, the output parameters will be the username and password.

+ +

If the username and password sent by the client were not valid, and error message is returned using send_error_message().

+ +

If the operation was successful, the client will be sent back a response array containing the user's info.

+ + +

Formatting a Response

+ +

Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array +that contains a single item. This item can be an array with several additional arrays, but there +can be only one primary array index. In other words, the basic prototype is this:

+ +$request = array('Response data', 'array'); + +

Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own +array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

+ + +$request = array (
+                   array(
+                         'first_name' => array('John', 'string'),
+                         'last_name' => array('Doe', 'string'),
+                         'member_id' => array(123435, 'int'),
+                         'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
+                        ),
+                 'struct'
+                 ); +
+ +

Notice that the above array is formatted as a struct. This is the most common data type for responses.

+ +

As with Requests, a response can be on of the seven data types listed in the Data Types section.

+ + +

Sending an Error Response

+ +

If you need to send the client an error response you will use the following:

+ +return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

The first parameter is the error number while the second parameter is the error message.

+ + + + + + +

Creating Your Own Client and Server

+ +

To help you understand everything we've covered thus far, let's create a couple controllers that act as +XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

+ +

The Client

+ +

Using a text editor, create a controller called xmlrpc_client.php. +In it, place this code and save it to your applications/controllers/ folder:

+ + + +

Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

+ +

The Server

+ +

Using a text editor, create a controller called xmlrpc_server.php. +In it, place this code and save it to your applications/controllers/ folder:

+ + + +

Try it!

+ +

Now visit the your site using a URL similar to this:

+www.your-site.com/index.php/xmlrpc_client/ + +

You should now see the message you sent to the server, and its response back to you.

+ +

The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. +The Server receives the request and maps it to the "process" function, where a response is sent back.

+ + + +

 

+

XML-RPC Function Reference

+ +

$this->xmlrpc->server()

+

Sets the URL and port number of the server to which a request is to be sent:

+$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80); + +

$this->xmlrpc->timeout()

+

Set a time out period (in seconds) after which the request will be canceled:

+$this->xmlrpc->timeout(6); + +

$this->xmlrpc->method()

+

Sets the method that will be requested from the XML-RPC server:

+$this->xmlrpc->method('method'); + +

Where method is the name of the method.

+ +

$this->xmlrpc->request()

+

Takes an array of data and builds request to be sent to XML-RPC server:

+$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
+$this->xmlrpc->request($request);
+ +

$this->xmlrpc->send_request()

+

The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

+ +

$this->xmlrpc->set_debug(TRUE);

+

Enables debugging, which will display a variety of information and error data helpful during development.

+ + +

$this->xmlrpc->display_error()

+

Returns an error message as a string if your request failed for some reason.

+echo $this->xmlrpc->display_error(); + +

$this->xmlrpc->display_response()

+

Returns the response from the remote server once request is received. The response will typically be an associative array.

+$this->xmlrpc->display_response(); + +

$this->xmlrpc->send_error_message()

+

This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter +is the error message.

+return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

$this->xmlrpc->send_response()

+

Lets you send the response from your server to the client. An array of of valid data values must be sent with this method.

+$response = array(
+                 array(
+                        'flerror' => array(FALSE, 'boolean'),
+                        'message' => "Thanks for the ping!")
+                     )
+                 'struct');
+return $this->xmlrpc->send_response($response);
+ + + +

Data Types

+ +

According to the XML-RPC spec there are seven types +of values that you can send via XML-RPC:

+ +
    +
  • int or i4
  • +
  • boolean
  • +
  • string
  • +
  • double
  • +
  • dateTime.iso8601
  • +
  • base64
  • +
  • struct (contains array of values)
  • +
  • array (contains array of values)
  • +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/license.html b/user_guide/license.html new file mode 100644 index 00000000..4bc94154 --- /dev/null +++ b/user_guide/license.html @@ -0,0 +1,113 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + + +
+ + + + +
+ + + +
+ +

Code Igniter License Agreement

+ +

Copyright (c) 2006, pMachine, Inc.
+All rights reserved.

+ +

This license is a legal agreement between you and pMachine Inc. for the use of Code Igniter 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. +
  3. Redistributions of source code must retain the above copyright notice in all source code files.
  4. +
  5. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution.
  6. +
  7. Any files that have been modified must carry notices stating the nature of the change and the names of those who changed them.
  8. +
  9. Products derived from the Software must include an acknowledgment that they are derived from Code Igniter in their documentation and/or other materials provided with the distribution.
  10. +
  11. Products derived from the Software may not be called "Code Igniter", nor may "Code Igniter" appear in their name, without prior written permission from pMachine, Inc.
  12. +
+ +

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.

+ + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html new file mode 100644 index 00000000..0322a043 --- /dev/null +++ b/user_guide/overview/appflow.html @@ -0,0 +1,101 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Application Flow Chart

+ +

The following graphic illustrates how data flows throughout the system:

+ +
+ + +
    +
  1. The index.php serves as the front controller, initializing the base resources needed to run Code Igniter.
  2. +
  3. The Router examines the HTTP request to determine what should be done with it.
  4. +
  5. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
  6. +
  7. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
  8. +
  9. The Controller loads the model, core libraries, plugins, helpers, and any other resources needed to process the specific request.
  10. +
  11. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so +that on subsequent requests it can be served.
  12. +
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html new file mode 100644 index 00000000..188ced25 --- /dev/null +++ b/user_guide/overview/at_a_glance.html @@ -0,0 +1,168 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Code Igniter at a Glance

+ + +

Code Igniter is an Application Framework

+ +

Code Igniter is a toolkit for people who build web application using PHP. Its goal is to enable you to develop projects must 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. Code Igniter lets you creatively focus on your project by +minimizing the amount of code needed for a given task.

+ +

Code Igniter is Free

+

Code Igniter is licensed under an Apache/BSD-style open source license so you can use it however you please. +For more information please read the license agreement.

+ + +

Code Igniter Runs on PHP 4

+

Code Igniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling +in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), +at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our +potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so +we felt that it did not serve the best interests of the PHP community to write Code Igniter in PHP 5.

+ +

Note: Code Igniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

+ +

Code Igniter is Light Weight

+

Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system +is very lean and quite fast. +

+ +

Code Igniter Uses M-V-C

+

Code Igniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. +This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

+ +

Code Igniter Generates Clean URLs

+

The URLs generated by Code Igniter are clean and search-engine friendly. Rather than using the standard "query string" +approach to URLs that is synonymous with dynamic systems, Code Igniter uses a segment-based approach:

+ +www.your-site.com/news/article/345 + +

Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

+ +

Code Igniter Packs a Punch

+

Code Igniter comes with a very nice set of libraries that enable the most commonly needed web development tasks, +like connecting to a database, sending email, validating form data, maintaining sessions, manipulating images, and more.

+ +

Code Igniter is Extensible

+

The system can be easily extended through the use of plugins and helper files, or even through class extensions or standard includes.

+ +

Code Igniter Does Not Require a Template Engine

+

Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

+ +<ul>
+
+<?php foreach ($addressbook as $name):?>
+
+<li><?=$name?></li>
+
+<?php endforeach; ?>
+
+</ul>
+ +

Contrast this with the pseudo-code used by a template engine:

+ +<ul>
+
+{foreach from=$addressbook item="name"}
+
+<li>{$name}</li>
+
+{/foreach}
+
+</ul>
+ +

Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted +back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

+ +

That said, Code Igniter does come with a simple template engine class which you can optionally use. Or, if you +prefer using a full-blown template engine such as Smarty, there's no reason why you can't use it with Code Igniter. +Just include your template engine script when you write your controllers, and continue working as you normally do.

+ +

Code Igniter is Thoroughly Documented

+

Programmers love to code and hate to write documentation. We're no different, of course, but +since documentation is as important as the code itself, +we are committed to doing it. Our source code is extremely clean and well commented as well.

+ + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html new file mode 100644 index 00000000..3cb1ba1f --- /dev/null +++ b/user_guide/overview/features.html @@ -0,0 +1,122 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Code Igniter Features

+ +

Features in and of themselves are a very poor way to judge an application since they tell you nothing +about the user experience, or how intuitively or intelligently it is designed. Features +don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. +The only way to really judge an app is to try it and get to know the code. Installing +Code Igniter is child's play so we encourage you to do just that. In the mean time here's a list of Code Igniter's main features.

+ +
    +
  • Model-View-Controller Based System
  • +
  • PHP 4 Compatible
  • +
  • Extremely Light Weight
  • +
  • Full Featured database classes with support for several platforms.
  • +
  • Active Record Database Support
  • +
  • Form and Data Validation
  • +
  • Security and XSS Filtering
  • +
  • Session Management
  • +
  • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
  • +
  • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
  • +
  • File Uploading Class
  • +
  • Localization
  • +
  • Pagination
  • +
  • Data Encryption
  • +
  • Benchmarking
  • +
  • Full Page Caching
  • +
  • Error Logging
  • +
  • Scaffolding
  • +
  • Calendaring Class
  • +
  • Template Engine Class
  • +
  • Trackback Class
  • +
  • XML-RPC Library
  • +
  • Unit Testing Class
  • +
  • Search-engine Friendly URLs
  • +
  • Flexible URI Routing
  • +
  • Library of "helper" functions
  • +
  • Plugin Support
  • +
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html new file mode 100644 index 00000000..0fdd4d1a --- /dev/null +++ b/user_guide/overview/goals.html @@ -0,0 +1,103 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + + +

Design and Architectural Goals

+ +

Our goal for Code Igniter is maximum performance, capability, and flexibility in the smallest, lightest possible package.

+ +

To meet this goal we are committed to benchmarking, re-factoring, and simplifying at every step of the development process, +rejecting anything that doesn't further the stated objective.

+ +

From an technical and architectural standpoint, Code Igniter was created with the following objectives:

+ +
    +
  • Dynamic Instantiation. In Code Igniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
  • +
  • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
  • +
  • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In Code Igniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
  • +
+ +

Code Igniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html new file mode 100644 index 00000000..8ddbdad3 --- /dev/null +++ b/user_guide/overview/index.html @@ -0,0 +1,89 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ +

Code Igniter Overview

+ +

The following pages describe the broad concepts behind Code Igniter:

+ + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html new file mode 100644 index 00000000..4f251e4d --- /dev/null +++ b/user_guide/overview/mvc.html @@ -0,0 +1,105 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Model-View-Controller

+ +

Code Igniter is based on the Model-View-Controller development pattern. + +MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

+ +
    +
  • The Model represents your data structures. Typically your model classes will contains functions that help you +retrieve, insert, and update information in your your database.
  • +
  • The View is the information that is being presented to a user. A View will normally be a web page, but +in Code Igniter, a view can also be a page fragment like a header or footer.
  • +
  • The Controller serves as an intermediary between the Model, the View, +and any other resources needed to process the HTTP request and generate a web page.
  • + +
+ +

Code Igniter has a fairly loose approach to MVC since Models are not required. +If you don't need the added separation, or find that maintaining models requires more complexity than you +want, you can ignore them and build your application minimally using Controllers and Views. Code Igniter also +enables you to incorporate your own existing scripts, or even develop core libraries for the system, + enabling you to work in a way that makes the most sense to you.

+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/user_guide/scripts/hacks.txt b/user_guide/scripts/hacks.txt new file mode 100644 index 00000000..f29e5a77 --- /dev/null +++ b/user_guide/scripts/hacks.txt @@ -0,0 +1,9 @@ +I did the following hack in moo.fx.js: + +At line 79 in the toggle: function() function, I added: + +document.getElementById('nav').style.display = 'block'; + + + +-- Rick Ellis \ No newline at end of file diff --git a/user_guide/scripts/moo.fx.js b/user_guide/scripts/moo.fx.js new file mode 100755 index 00000000..953e87c6 --- /dev/null +++ b/user_guide/scripts/moo.fx.js @@ -0,0 +1,119 @@ +/* +moo.fx, simple effects library built with prototype.js (http://prototype.conio.net). +by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE. +for more info (http://moofx.mad4milk.net). +10/24/2005 +v(1.0.2) +*/ + +//base +var fx = new Object(); +fx.Base = function(){}; +fx.Base.prototype = { + setOptions: function(options) { + this.options = { + duration: 500, + onComplete: '' + } + Object.extend(this.options, options || {}); + }, + + go: function() { + this.duration = this.options.duration; + this.startTime = (new Date).getTime(); + this.timer = setInterval (this.step.bind(this), 13); + }, + + step: function() { + var time = (new Date).getTime(); + var Tpos = (time - this.startTime) / (this.duration); + if (time >= this.duration+this.startTime) { + this.now = this.to; + clearInterval (this.timer); + this.timer = null; + if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); + } + else { + this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from; + //this time-position, sinoidal transition thing is from script.aculo.us + } + this.increase(); + }, + + custom: function(from, to) { + if (this.timer != null) return; + this.from = from; + this.to = to; + this.go(); + }, + + hide: function() { + this.now = 0; + this.increase(); + }, + + clearTimer: function() { + clearInterval(this.timer); + this.timer = null; + } +} + +//stretchers +fx.Layout = Class.create(); +fx.Layout.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.el.style.overflow = "hidden"; + this.el.iniWidth = this.el.offsetWidth; + this.el.iniHeight = this.el.offsetHeight; + this.setOptions(options); + } +}); + +fx.Height = Class.create(); +Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { + increase: function() { + this.el.style.height = this.now + "px"; + }, + + toggle: function() { + if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); + else this.custom(0, this.el.scrollHeight); + } +}); + +fx.Width = Class.create(); +Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), { + increase: function() { + this.el.style.width = this.now + "px"; + }, + + toggle: function(){ + if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0); + else this.custom(0, this.el.iniWidth); + } +}); + +//fader +fx.Opacity = Class.create(); +fx.Opacity.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.now = 1; + this.increase(); + this.setOptions(options); + }, + + increase: function() { + if (this.now == 1) this.now = 0.9999; + if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible"; + if (this.now == 0) this.el.style.visibility = "hidden"; + if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")"; + this.el.style.opacity = this.now; + }, + + toggle: function() { + if (this.now > 0) this.custom(1, 0); + else this.custom(0, 1); + } +}); \ No newline at end of file diff --git a/user_guide/scripts/moo.fx.pack.js b/user_guide/scripts/moo.fx.pack.js new file mode 100755 index 00000000..8b422832 --- /dev/null +++ b/user_guide/scripts/moo.fx.pack.js @@ -0,0 +1,241 @@ +/* +moo.fx pack, effects extensions for moo.fx. +by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE +for more info visit (http://moofx.mad4milk.net). +Wednesday, November 16, 2005 +v1.0.4 +*/ + +//text size modify, now works with pixels too. +fx.Text = Class.create(); +fx.Text.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.setOptions(options); + if (!this.options.unit) this.options.unit = "em"; + }, + + increase: function() { + this.el.style.fontSize = this.now + this.options.unit; + } +}); + +//composition effect, calls Width and Height alltogheter +fx.Resize = Class.create(); +fx.Resize.prototype = { + initialize: function(el, options) { + this.h = new fx.Height(el, options); + if (options) options.onComplete = null; + this.w = new fx.Width(el, options); + this.el = $(el); + }, + + toggle: function(){ + this.h.toggle(); + this.w.toggle(); + }, + + modify: function(hto, wto) { + this.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto); + this.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto); + }, + + custom: function(hto, wto) { + this.h.custom(this.el.offsetHeight, hto); + this.w.custom(this.el.offsetWidth, wto); + }, + + hide: function(){ + this.h.hide(); + this.w.hide(); + } +} + +//composition effect, calls Opacity and (Width and/or Height) alltogheter +fx.FadeSize = Class.create(); +fx.FadeSize.prototype = { + initialize: function(el, options) { + this.el = $(el); + this.el.o = new fx.Opacity(el, options); + if (options) options.onComplete = null; + this.el.h = new fx.Height(el, options); + this.el.w = new fx.Width(el, options); + }, + + toggle: function() { + this.el.o.toggle(); + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] == 'height') this.el.h.toggle(); + if (arguments[i] == 'width') this.el.w.toggle(); + } + }, + + hide: function(){ + this.el.o.hide(); + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] == 'height') this.el.h.hide(); + if (arguments[i] == 'width') this.el.w.hide(); + } + } +} + +//intended to work with arrays. +var Multi = new Object(); +Multi = function(){}; +Multi.prototype = { + initialize: function(elements, options){ + this.options = options; + this.el = this.getElementsFromArray(elements); + for (i=0;i 0 && this.el[i] != el && this.el[i].h.timer == null && el.h.timer == null){ + this.el[i].fs.toggle(mode); + setTimeout(function(){el.fs.toggle(mode);}.bind(el), delay); + } + + } + }, + + hide: function(el, mode){ + el.fs.hide(mode); + } +}); + +var Remember = new Object(); +Remember = function(){}; +Remember.prototype = { + initialize: function(el, options){ + this.el = $(el); + this.days = 365; + this.options = options; + this.effect(); + var cookie = this.readCookie(); + if (cookie) { + this.fx.now = cookie; + this.fx.increase(); + } + }, + + //cookie functions based on code by Peter-Paul Koch + setCookie: function(value) { + var date = new Date(); + date.setTime(date.getTime()+(this.days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/"; + }, + + readCookie: function() { + var nameEQ = this.el+this.el.id+this.prefix + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return false; + }, + + custom: function(from, to){ + if (this.fx.now != to) { + this.setCookie(to); + this.fx.custom(from, to); + } + } +} + +fx.RememberHeight = Class.create(); +fx.RememberHeight.prototype = Object.extend(new Remember(), { + effect: function(){ + this.fx = new fx.Height(this.el, this.options); + this.prefix = 'height'; + }, + + toggle: function(){ + if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight); + else this.setCookie(0); + this.fx.toggle(); + }, + + resize: function(to){ + this.setCookie(this.el.offsetHeight+to); + this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to); + }, + + hide: function(){ + if (!this.readCookie()) { + this.fx.hide(); + } + } +}); + +fx.RememberText = Class.create(); +fx.RememberText.prototype = Object.extend(new Remember(), { + effect: function(){ + this.fx = new fx.Text(this.el, this.options); + this.prefix = 'text'; + } +}); + + +//use to attach effects without using js code, just classnames and rel attributes. +ParseClassNames = Class.create(); +ParseClassNames.prototype = { + initialize: function(options){ + var babies = document.getElementsByTagName('*') || document.all; + for (var i = 0; i < babies.length; i++) { + var el = babies[i]; + //attach the effect, from the classNames; + var effects = this.getEffects(el); + for (var j = 0; j < effects.length; j++) { + if (j == 1 && options) options.onComplete = null; + el[effects[j]+"fx"] = new fx[effects[j]](el, options); + } + //execute methods, from rel + if (el.rel) { + el.crel = el.rel.split(' '); + if (el.crel[0].indexOf("fx_") > -1) { + var event = el.crel[0].replace('fx_', ''); + var tocompute = this.getEffects($(el.crel[1])); + el["on"+event] = function(){ + for (var f = 0; f < tocompute.length; f++) { + $(this.crel[1])[tocompute[f]+"fx"][this.crel[2] || "toggle"](this.crel[3] || null, this.crel[4] || null); + } + } + } + } + } + }, + + getEffects: function(el){ + var effects = new Array(); + var css = el.className.split(' '); + for (var i = 0; i < css.length; i++) { + if (css[i].indexOf('fx_') > -1) { + var effect = css[i].replace('fx_', ''); + effects.push(effect); + } + } + return effects; + } +} \ No newline at end of file diff --git a/user_guide/scripts/nav.js b/user_guide/scripts/nav.js new file mode 100644 index 00000000..be0f7b1a --- /dev/null +++ b/user_guide/scripts/nav.js @@ -0,0 +1,116 @@ +function create_menu(basepath) +{ + var base = (basepath == 'null') ? '' : basepath; + + document.write( + '' + + '
' + + + '

User Guide Home

' + + + '

Basic Info

' + + '' + + + '

Installation

' + + '' + + + '

Introduction

' + + '' + + + '
' + + + '

General Topics

' + + '' + + + '
' + + + + '

Class Reference

' + + '' + + + '
' + + + '

Helper Reference

' + + '' + + + + '

Additional Resources

' + + '' + + + '
'); +} \ No newline at end of file diff --git a/user_guide/scripts/prototype.lite.js b/user_guide/scripts/prototype.lite.js new file mode 100755 index 00000000..f1520e2c --- /dev/null +++ b/user_guide/scripts/prototype.lite.js @@ -0,0 +1,127 @@ +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + + +//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +} + +Function.prototype.bind = function(object) { + var __method = this; + return function() { + return __method.apply(object, arguments); + } +} + +function $() { + var elements = new Array(); + + for (var i = 0; i < arguments.length; i++) { + var element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + + if (arguments.length == 1) + return element; + + elements.push(element); + } + + return elements; +} + +//------------------------- + +document.getElementsByClassName = function(className) { + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + var classNames = child.className.split(' '); + for (var j = 0; j < classNames.length; j++) { + if (classNames[j] == className) { + elements.push(child); + break; + } + } + } + + return elements; +} + +//------------------------- + +if (!window.Element) { + var Element = new Object(); +} + +Object.extend(Element, { + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + hasClassName: function(element, className) { + element = $(element); + if (!element) + return; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] == className) + return true; + } + return false; + }, + + addClassName: function(element, className) { + element = $(element); + Element.removeClassName(element, className); + element.className += ' ' + className; + }, + + removeClassName: function(element, className) { + element = $(element); + if (!element) + return; + var newClassName = ''; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] != className) { + if (i > 0) + newClassName += ' '; + newClassName += a[i]; + } + } + element.className = newClassName; + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + } +}); \ No newline at end of file diff --git a/user_guide/toc.html b/user_guide/toc.html new file mode 100644 index 00000000..9935c730 --- /dev/null +++ b/user_guide/toc.html @@ -0,0 +1,182 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +

Code Igniter User Guide Version 1.4.0

+
+ + + + + + + + + + +
+ + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/user_guide/userguide.css b/user_guide/userguide.css new file mode 100644 index 00000000..4da90dc6 --- /dev/null +++ b/user_guide/userguide.css @@ -0,0 +1,406 @@ +body { + margin: 0; + padding: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 14px; + color: #4F5155; + background: #fff url(images/background.jpg) repeat-x left top; +} + +a { + color: #003399; + background-color: transparent; + text-decoration: none; + font-weight: normal; +} +a:visited { + color: #003399; + background-color: transparent; + text-decoration: none; +} +a:hover { + color: #000; + text-decoration: none; + background-color: transparent; +} + +#breadcrumb { + float: left; + background-color: transparent; + margin: 10px 0 0 42px; + padding: 0; + font-size: 10px; + color: #666; +} +#breadcrumb_right { + float: right; + width: 175px; + background-color: transparent; + padding: 8px 8px 3px 0; + text-align: right; + font-size: 10px; + color: #666; +} +#nav { + background-color: #5d5d5d; + margin: 0; + padding: 0; +} +#nav2 { + background: #fff url(images/nav_bg.jpg) repeat-x left top; + padding: 0 180px 0 0; + margin: 0; + text-align: right; +} +#nav_inner { + background-color: transparent; + padding: 8px 12px 0 20px; + margin: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; +} + +#nav_inner h3 { + font-size: 12px; + color: #fff; + margin: 0; + padding: 0; +} + +#nav_inner .td_sep { + background: transparent url(images/nav_separator.jpg) repeat-y left top; + width: 25%; + padding: 0 0 0 20px; +} +#nav_inner .td { + width: 25%; +} +#nav_inner p { + color: #eee; + background-color: transparent; + padding:0; + margin: 0 0 10px 0; +} +#nav_inner ul { + list-style-image: url(images/arrow.gif); + padding: 0 0 0 18px; + margin: 8px 0 12px 0; +} +#nav_inner li { + padding: 0; + margin: 0 0 4px 0; +} + +#nav_inner a { + color: #eee; + background-color: transparent; + text-decoration: none; + font-weight: normal; +} + +#nav_inner a:visited { + color: #eee; + background-color: transparent; + text-decoration: none; +} + +#nav_inner a:hover { + color: #ccc; + text-decoration: none; + background-color: transparent; +} + +#masthead { + margin: 0 40px 0 35px; + padding: 0 0 0 6px; + border-bottom: 1px solid #999; +} + +#masthead h1 { +background-color: transparent; +color: #003399; +font-size: 18px; +font-weight: normal; +margin: 0; +padding: 0 0 6px 0; +} + +#searchbox { + background-color: transparent; + padding: 6px 40px 0 0; + text-align: right; + font-size: 10px; + color: #666; +} + +#img_welcome { + border-bottom: 1px solid #D0D0D0; + margin: 0 40px 0 40px; + padding: 0; + text-align: center; +} + +#content { + margin: 20px 40px 0 40px; + padding: 0; +} + +#content p { + margin: 10px 20px 12px 0; +} + +#content h1 { +color: #333; +font-weight: normal; +font-size: 22px; +margin: 0 0 15px 0; +padding: 0; +} + +#content h2 { + background-color: transparent; + border-bottom: 1px solid #D0D0D0; + color: #444; + font-size: 16px; + font-weight: bold; + margin: 24px 0 2px 0; + padding: 5px 0 6px 0; +} + +#content h3 { + background-color: transparent; + color: #333; + font-size: 14px; + font-weight: bold; + margin: 22px 0 12px 0; + padding: 0 0 0 0; +} + +#content h4 { + background-color: transparent; + color: #444; + font-size: 14px; + font-weight: bold; + margin: 22px 0 0 0; + padding: 0 0 0 0; +} + +#content img { + margin: auto; + padding: 0; +} + +#content code { + font-family: Monaco, Verdana, Sans-serif; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#content pre { + font-family: Monaco, Verdana, Sans-serif; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#content .path { + background-color: #EBF3EC; + border: 1px solid #99BC99; + color: #005702; + text-align: center; + margin: 0 0 14px 0; + padding: 5px 10px 5px 8px; +} + +#content dfn { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #00620C; + font-weight: bold; + font-style: normal; +} +#content var { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #8F5B00; + font-weight: bold; + font-style: normal; +} +#content samp { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #480091; + font-weight: bold; + font-style: normal; +} +#content kbd { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #A70000; + font-weight: bold; + font-style: normal; +} + +#content ul { + list-style-image: url(images/arrow.gif); + padding: 0 0 0 18px; + margin: 8px 0 12px 0; +} + +#content li { + padding: 0; + margin: 0 0 6px 0; +} + +#content li p { + margin-left: 0; + margin-right: 0; +} + +#content .tableborder { + border: 1px solid #999; +} +#content th { + font-weight: bold; + text-align: left; + font-size: 12px; + background-color: #666; + color: #fff; + padding: 4px; +} + +#content .td { + font-weight: normal; + font-size: 12px; + padding: 6px; + background-color: #f3f3f3; +} + +#content .tdpackage { + font-weight: normal; + font-size: 12px; +} + +#content .important { + background: #FBE6F2; + border: 1px solid #D893A1; + color: #333; + margin: 10px 0 5px 0; + padding: 10px; +} + +#content .important p { + margin: 6px 0 8px 0; + padding: 0; +} + +#content .important .leftpad { + margin: 6px 0 8px 0; + padding-left: 20px; +} + +#content .critical { + background: #FBE6F2; + border: 1px solid #E68F8F; + color: #333; + margin: 10px 0 5px 0; + padding: 10px; +} + +#content .critical p { + margin: 5px 0 6px 0; + padding: 0; +} + + +#footer { +background-color: transparent; +font-size: 10px; +padding: 16px 0 15px 0; +margin: 20px 0 0 0; +text-align: center; +} + +#footer p { + font-size: 10px; + color: #999; + text-align: center; +} +#footer address { + font-style: normal; +} + +.center { + text-align: center; +} + +img { + padding:0; + border: 0; + margin: 0; +} + +.nopad { + padding:0; + border: 0; + margin: 0; +} + + +form { + margin: 0; + padding: 0; +} + +.input { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + color: #333; + border: 1px solid #B3B4BD; + width: 100%; + font-size: 11px; + height: 1.5em; + padding: 0; + margin: 0; +} + +.textarea { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 14px; + color: #143270; + background-color: #f9f9f9; + border: 1px solid #B3B4BD; + width: 100%; + padding: 0; + margin: 0; +} + +.select { + background-color: #fff; + font-size: 11px; + font-weight: normal; + color: #333; + padding: 0; + margin: 0 0 3px 0; +} + +.checkbox { + background-color: transparent; + padding: 0; + border: 0; +} + +.submit { + background-color: #000; + color: #fff; + font-weight: normal; + font-size: 10px; + border: 1px solid #fff; + margin: 0; + padding: 1px 5px 2px 5px; +} \ No newline at end of file From d34f4248ec3fe428838aadccaf8ca57047a4f60e Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Aug 2006 22:03:55 +0000 Subject: [PATCH 0002/2544] --- user_guide/general/libraries.html | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 642399ba..edef2d72 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -47,7 +47,7 @@ Code Igniter Home  ›  User Guide Home  ›  -Loading Libraries +Using Code Igniter Libraries
Search User Guide   
@@ -60,10 +60,10 @@
-

Loading Libraries

+

Using Code Igniter Libraries

-

The core libraries are the class files located in the "libraries" folder. -In most cases, to use one of these classes involves initializing it within your controllers using the following function:

+

All of the available libraries are located in your system/libraries folder. +In most cases, to use one of these classes involves initializing it within a controller using the following initialization function:

$this->load->library('class name'); @@ -71,24 +71,11 @@

Loading Libraries

$this->load->library('validation'); -

Once initialized you can use it as indicated in the user guide page corresponding to each class.

+

Once initialized you can use it as indicated in the user guide page corresponding to that class.

-

Semantic Relevance

+

Creating Your Own Libraries

-

The pattern you will use when calling functions is this:

- -

$this->class->function()

- -

We've placed a high value on semantic relevance in the naming of our classes and functions. -Here are some examples of function calls you might use in Code Igniter:

- -

$this->email->send()

-

$this->input->user_agent()

-

$this->benchmark->elapsed_time()

-

$this->db->query()

-

$this->load->helper()

-

$this->uri->segment()

-

$this->lang->line()

+

Please read the section of the user guide that discusses how to create your own libraries

From 04d4dbede875d9562da88f6eb4dfa2af8cc91511 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Aug 2006 22:09:35 +0000 Subject: [PATCH 0003/2544] --- .../{base_classes.html => core_classes.html} | 14 +++++++------- user_guide/scripts/nav.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) rename user_guide/general/{base_classes.html => core_classes.html} (88%) diff --git a/user_guide/general/base_classes.html b/user_guide/general/core_classes.html similarity index 88% rename from user_guide/general/base_classes.html rename to user_guide/general/core_classes.html index 215bd25b..c03e70d6 100644 --- a/user_guide/general/base_classes.html +++ b/user_guide/general/core_classes.html @@ -47,7 +47,7 @@ Code Igniter Home  ›  User Guide Home  ›  -Replacing System Classes +Creating Core System Classes
Search User Guide   
@@ -60,11 +60,11 @@
-

Replacing System Classes

+

Creating Core System Classes

Every time Code Igniter runs there are several base classes that are initialized automatically as part of the core framework. -It is possible, however, to swap any of the core system files with your own versions.  Most users will never have any need to do this, -but the option to replace them does exist for those that would like to significantly alter the Code Igniter core. +It is possible, however, to swap any of the core system classes with your own versions.  Most users will never have any need to do this, +but the option to replace them does exist for those that would like to significantly alter the Code Igniter core.

Note:  Replacing a core system class with your own version has a lot of implications, so make sure you @@ -90,10 +90,12 @@

System Class List

Replacing Core Classes

-

To use one of your own system classes instead of a default one simply place your version inside your local libraries directory:

+

To use one of your own system classes instead of a default one simply place your version inside your local application/libraries directory:

application/libraries/some-class.php +

If this directory does not exist you can create it.

+

Any file named identically to one from the list above will be used instead of the one normally used.

Please note that your class must use CI as a prefix. For example, if your file is named Input.php the class will be named:

@@ -106,8 +108,6 @@

Replacing Core Classes

- -
diff --git a/user_guide/scripts/nav.js b/user_guide/scripts/nav.js index be0f7b1a..27e65530 100644 --- a/user_guide/scripts/nav.js +++ b/user_guide/scripts/nav.js @@ -46,7 +46,7 @@ function create_menu(basepath) '
  • Scripts
  • ' + '
  • Using Code Igniter Libraries
  • ' + '
  • Creating Your Own Libraries
  • ' + - '
  • Creating Core Classes
  • ' + + '
  • Creating Core Classes
  • ' + '
  • Hooks - Extending the Core
  • ' + '
  • Auto-loading Resources
  • ' + '
  • Scaffolding
  • ' + From a634e56d86b965df334e4a431fb0586565ade7a6 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Aug 2006 22:19:55 +0000 Subject: [PATCH 0004/2544] --- user_guide/general/autoloader.html | 2 +- user_guide/general/core_classes.html | 4 ++-- user_guide/general/creating_libraries.html | 4 ++-- user_guide/general/hooks.html | 4 ++-- user_guide/general/scripts.html | 2 +- user_guide/toc.html | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 5f90fdda..48cdf4d0 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -93,7 +93,7 @@

    Auto-loading Resources

    diff --git a/user_guide/toc.html b/user_guide/toc.html index 9935c730..adfa3d0b 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -99,11 +99,11 @@

    General Topics

  • Helpers
  • Plugins
  • Scripts
  • -
  • Loading Libraries
  • -
  • Creating Libraries
  • -
  • Creating Ancillary Classes
  • +
  • Using Code Igniter Libraries
  • +
  • Creating Your Own Libraries
  • +
  • Creating Core Classes
  • +
  • Hooks - Extending the Core
  • Auto-loading Resources
  • -
  • Hooks
  • Scaffolding
  • URI Routing
  • Error Handling
  • From d4e95072203a5cf4f1d50d16fe3e490f275a4307 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 26 Aug 2006 01:15:06 +0000 Subject: [PATCH 0005/2544] --- system/application/config/routes.php | 2 ++ system/libraries/Router.php | 19 ++++++++++++++---- user_guide/general/changelog.html | 3 ++- user_guide/general/routing.html | 29 +++++++++++++++++++++++++--- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/system/application/config/routes.php b/system/application/config/routes.php index 622bf88e..5167f756 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -46,4 +46,6 @@ // Define your own routes below ------------------------------------------- +$route['products\/([a-z]+)\/(\d+)'] = "$1/a$2"; + ?> \ No newline at end of file diff --git a/system/libraries/Router.php b/system/libraries/Router.php index abc253ef..b61dfb79 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -300,16 +300,27 @@ function _parse_routes() } // Loop through the route array looking for wildcards - foreach ($this->routes as $key => $val) + foreach (array_slice($this->routes, 1) as $key => $val) { if (count(explode('/', $key)) != $num) continue; - - if (preg_match("|".str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key))."$|", $uri)) - { + + // Convert wildcards to RegEx + $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); + + // Does the regex match this URI ? + if (preg_match('|^'.$key.'$|', $uri)) + { + // Do we have a replacemnt? + if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) + { + $val = preg_replace('|^'.$key.'$|', $val, $uri); + } + $this->_compile_segments(explode('/', $val), TRUE); break; } + } } // END set_method() diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 0bcb165d..a03d6b19 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -69,8 +69,9 @@

    Version 1.4.0

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • -
    • Added the ability to replace core system classes with your own classes.
    • +
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • +
    • Updated the Routing feature to accept regular expressions within routing rules.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index c6e8bd9c..977698b9 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -85,8 +85,13 @@

      URI Routing

      Setting your own routing rules

      -

      Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route, that -you can use to specify your own routing criteria. A typical route might look something like this:

      +

      Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that +permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions + + +

      Wildcards

      + +

      A typical wildcard route might look something like this:

      $route['product/:num'] = "catalog/product_lookup"; @@ -125,8 +130,21 @@

      Examples

      Important: Do not use leading/trailing slashes.

      +

      Regular Expressions

      + +

      If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.

      + +

      Note:  If you use back-references you must use the dollar syntax rather then the double backslash syntax.

      + +

      A typical RegEx route might look something like this:

      + +$route['products\/([a-z]+)\/(\d+)'] = "$1/id_$2"; -

      Reserved Route

      +

      In the above example, a URI similar to products/shirts/123 would instead call the shirts controller class and the id_123 function.

      + +

      You can also mix and match wildcards with regular expressions.

      + +

      Reserved Routes

      There are two reserved routes:

      @@ -144,6 +162,11 @@

      Reserved Route

      + + + + +
    From 45c872b0ac215d590e785fe393241a06facd7e05 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 26 Aug 2006 04:51:38 +0000 Subject: [PATCH 0006/2544] --- system/codeigniter/CodeIgniter.php | 13 +- system/libraries/Router.php | 211 +++++++++++++++++++---------- user_guide/general/changelog.html | 1 + 3 files changed, 144 insertions(+), 81 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index aef7618e..de7f89af 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -99,16 +99,6 @@ } } -/* - * ------------------------------------------------------ - * Does the requested controller exist? - * ------------------------------------------------------ - */ -if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_class().EXT)) -{ - show_404(); -} - /* * ------------------------------------------------------ * Load the remaining base classes @@ -132,7 +122,6 @@ * */ - _load_class('CI_Loader'); if (floor(phpversion()) < 5) @@ -146,7 +135,7 @@ _load_class('CI_Controller'); -require(APPPATH.'controllers/'.$RTR->fetch_class().EXT); +require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); /* * ------------------------------------------------------ diff --git a/system/libraries/Router.php b/system/libraries/Router.php index b61dfb79..7839de2d 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -34,6 +34,7 @@ class CI_Router { var $routes = array(); var $class = ''; var $method = 'index'; + var $directory = ''; var $uri_protocol = 'auto'; var $default_controller; var $scaffolding_request = FALSE; // Must be set to FALSE @@ -121,6 +122,7 @@ function _set_route_mapping() log_message('debug', "No URI present. Default controller set."); return; } + unset($this->routes['default_controller']); // Do we need to remove the suffix specified in the config file? if ($this->config->item('url_suffix') != "") @@ -129,13 +131,20 @@ function _set_route_mapping() } // Explode the URI Segments. The individual segments will - // be stored in the $this->segments array. - $this->_compile_segments(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string))); - - - // Remap the class/method if a route exists - unset($this->routes['default_controller']); + // be stored in the $this->segments array. + $i = 1; + foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + $this->segments[$i++] = $val; + } + $this->_compile_segments($this->segments); + + // Do we have any custom routing to deal with? if (count($this->routes) > 0) { $this->_parse_routes(); @@ -157,19 +166,15 @@ function _set_route_mapping() * @param bool * @return void */ - function _compile_segments($segs, $route = FALSE) - { - $segments = array(); - - $i = 1; - foreach($segs as $val) + function _compile_segments($segments = array()) + { + $segments = $this->_validate_segments($segments); + + if (count($segments) == 0) { - $val = trim($this->_filter_uri($val)); - - if ($val != '') - $segments[$i++] = $val; + return; } - + $this->set_class($segments['1']); if (isset($segments['2'])) @@ -186,15 +191,54 @@ function _compile_segments($segs, $route = FALSE) $this->set_method($segments['2']); } } - - if ($route == FALSE) + } + // END _compile_segments() + + // -------------------------------------------------------------------- + + /** + * Validates the supplied segments. Attempts to determine the path to + * the controller. + * + * @access private + * @param array + * @return array + */ + function _validate_segments($segments) + { + // Does the requested controller exist? + if ( ! file_exists(APPPATH.'controllers/'.$segments['1'].EXT)) { - $this->segments = $segments; + // Is it a directory? No? Smite them! + if ( ! is_dir(APPPATH.'controllers/'.$segments['1'])) + { + show_404(); + } + else + { + $this->set_directory($segments['1']); + $segs = array_slice($segments, 1); + + if (count($segs) == 0) + { + $this->set_class($this->default_controller); + $this->set_method('index'); + $this->directory = ''; + return array(); + } + + $i = 1; + $segments = array(); + foreach ($segs as $val) + { + $segments[$i++] = $val; + } + } } - unset($segments); + return $segments; } - // END _compile_segments() + // END _validate_segments() // -------------------------------------------------------------------- @@ -218,6 +262,56 @@ function _filter_uri($str) // -------------------------------------------------------------------- + /** + * Parse Routes + * + * This function matches any routes that may exist in + * the config/routes.php file against the URI to + * determine if the class/method need to be remapped. + * + * @access private + * @return void + */ + function _parse_routes() + { + // Turn the segment array into a URI string + $uri = implode('/', $this->segments); + $num = count($this->segments); + + // Is there a literal match? If so we're done + if (isset($this->routes[$uri])) + { + $this->_compile_segments(explode('/', $this->routes[$uri])); + return; + } + + // Loop through the route array looking for wildcards + foreach (array_slice($this->routes, 1) as $key => $val) + { + if (count(explode('/', $key)) != $num) + continue; + + // Convert wildcards to RegEx + $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); + + // Does the RegEx match? + if (preg_match('|^'.$key.'$|', $uri)) + { + // Do we have a back-reference? + if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) + { + $val = preg_replace('|^'.$key.'$|', $val, $uri); + } + + $this->_compile_segments(explode('/', $val)); + return; + } + } + } + // END set_method() + + // -------------------------------------------------------------------- + /** * Set the class name * @@ -229,7 +323,7 @@ function set_class($class) { $this->class = $class; } - // END _filter_uri() + // END set_class() // -------------------------------------------------------------------- @@ -243,7 +337,7 @@ function fetch_class() { return $this->class; } - // END _filter_uri() + // END fetch_class() // -------------------------------------------------------------------- @@ -259,7 +353,7 @@ function set_method($method) $this->method = $method; } // END set_method() - + // -------------------------------------------------------------------- /** @@ -272,58 +366,37 @@ function fetch_method() { return $this->method; } - // END set_method() - + // END fetch_method() + // -------------------------------------------------------------------- /** - * Parse Routes + * Set the directory name * - * This function matches any routes that may exist in - * the config/routes.php file against the URI to - * determine if the class/method need to be remapped. - * - * @access private + * @access public + * @param string * @return void - */ - function _parse_routes() + */ + function set_directory($dir) { - // Turn the segment array into a URI string - $uri = implode('/', $this->segments); - $num = count($this->segments); + $this->directory = $dir.'/'; + } + // END set_directory() - // Is there a literal match? If so we're done - if (isset($this->routes[$uri])) - { - $this->_compile_segments(explode('/', $this->routes[$uri]), TRUE); - return; - } - - // Loop through the route array looking for wildcards - foreach (array_slice($this->routes, 1) as $key => $val) - { - if (count(explode('/', $key)) != $num) - continue; - - // Convert wildcards to RegEx - $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); - - // Does the regex match this URI ? - if (preg_match('|^'.$key.'$|', $uri)) - { - // Do we have a replacemnt? - if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) - { - $val = preg_replace('|^'.$key.'$|', $val, $uri); - } - - $this->_compile_segments(explode('/', $val), TRUE); - break; - } - - } + // -------------------------------------------------------------------- + + /** + * Fetch the sub-directory (if any) that contains the requested controller class + * + * @access public + * @return string + */ + function fetch_directory() + { + return $this->directory; } - // END set_method() + // END fetch_directory() + } // END Router Class ?> \ No newline at end of file diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index a03d6b19..5f3b8690 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -71,6 +71,7 @@

    Version 1.4.0

  • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
  • Added the ability to replace core system classes with your own classes.
  • Added support for % character in URL.
  • +
  • Added the ability to organize controller files into sub-folders.
  • Updated the Routing feature to accept regular expressions within routing rules.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
  • Removed a strtolower() call that was changing URL segments to lower case.
  • From e07fbb376a741e21e69a182eada322c4d3b7e62e Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 26 Aug 2006 17:11:01 +0000 Subject: [PATCH 0007/2544] --- system/libraries/Router.php | 84 ++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 7839de2d..67814545 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -132,23 +132,25 @@ function _set_route_mapping() // Explode the URI Segments. The individual segments will // be stored in the $this->segments array. - $i = 1; foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) { // Filter segments for security $val = trim($this->_filter_uri($val)); if ($val != '') - $this->segments[$i++] = $val; + $this->segments[] = $val; } - $this->_compile_segments($this->segments); + // Parse any custom routing that may exist + $this->_parse_routes(); - // Do we have any custom routing to deal with? - if (count($this->routes) > 0) + // Re-index the segment array so that it starts with 1 rather than 0 + $i = 1; + foreach ($this->segments as $val) { - $this->_parse_routes(); + $this->segments[$i++] = $val; } + unset($this->segments['0']); } // END _set_route_mapping() @@ -175,12 +177,12 @@ function _compile_segments($segments = array()) return; } - $this->set_class($segments['1']); + $this->set_class($segments['0']); - if (isset($segments['2'])) + if (isset($segments['1'])) { // A scaffolding request. No funny business with the URL - if ($this->routes['scaffolding_trigger'] == $segments['2'] AND $segments['2'] != '_ci_scaffolding') + if ($this->routes['scaffolding_trigger'] == $segments['1'] AND $segments['1'] != '_ci_scaffolding') { $this->scaffolding_request = TRUE; unset($this->routes['scaffolding_trigger']); @@ -188,7 +190,7 @@ function _compile_segments($segments = array()) else { // A standard method request - $this->set_method($segments['2']); + $this->set_method($segments['1']); } } } @@ -206,37 +208,32 @@ function _compile_segments($segments = array()) */ function _validate_segments($segments) { - // Does the requested controller exist? - if ( ! file_exists(APPPATH.'controllers/'.$segments['1'].EXT)) + // Does the requested controller exist in the root folder? + if (file_exists(APPPATH.'controllers/'.$segments['0'].EXT)) { - // Is it a directory? No? Smite them! - if ( ! is_dir(APPPATH.'controllers/'.$segments['1'])) + return $segments; + } + + // Is the controller in a sub-folder? + if (is_dir(APPPATH.'controllers/'.$segments['0'])) + { + // Set the directory and remove it from the segment array + $this->set_directory($segments['0']); + $segments = array_slice($segments, 1); + + if (count($segments) == 0) { - show_404(); + $this->set_class($this->default_controller); + $this->set_method('index'); + $this->directory = ''; + return array(); } - else - { - $this->set_directory($segments['1']); - $segs = array_slice($segments, 1); - if (count($segs) == 0) - { - $this->set_class($this->default_controller); - $this->set_method('index'); - $this->directory = ''; - return array(); - } - - $i = 1; - $segments = array(); - foreach ($segs as $val) - { - $segments[$i++] = $val; - } - } + return $segments; } - - return $segments; + + // Can't find the requested controller... + show_404(); } // END _validate_segments() @@ -274,6 +271,13 @@ function _filter_uri($str) */ function _parse_routes() { + // Do we even have any custom routing to deal with? + if (count($this->routes) == 0) + { + $this->_compile_segments($this->segments); + return; + } + // Turn the segment array into a URI string $uri = implode('/', $this->segments); $num = count($this->segments); @@ -284,7 +288,7 @@ function _parse_routes() $this->_compile_segments(explode('/', $this->routes[$uri])); return; } - + // Loop through the route array looking for wildcards foreach (array_slice($this->routes, 1) as $key => $val) { @@ -306,7 +310,11 @@ function _parse_routes() $this->_compile_segments(explode('/', $val)); return; } - } + } + + // If we got this far it means we didn't encounter a + // matching route so we'll set the site default route + $this->_compile_segments($this->segments); } // END set_method() From b071bb5a92aade551345a495fb13f5678f3978d0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 26 Aug 2006 19:28:37 +0000 Subject: [PATCH 0008/2544] --- system/application/config/config.php | 2 + system/application/config/routes.php | 3 +- system/codeigniter/CodeIgniter.php | 6 +-- system/codeigniter/Common.php | 3 +- system/drivers/DB_mssql.php | 2 +- system/drivers/DB_mysql.php | 2 +- system/drivers/DB_mysqli.php | 2 +- system/drivers/DB_odbc.php | 2 +- system/drivers/DB_postgre.php | 8 ++-- system/drivers/DB_sqlite.php | 2 +- system/helpers/form_helper.php | 2 +- system/helpers/url_helper.php | 4 +- system/libraries/Calendar.php | 2 +- system/libraries/Loader.php | 2 +- system/libraries/Router.php | 45 ++++++++++--------- system/libraries/URI.php | 14 +++--- user_guide/general/changelog.html | 16 +++++-- user_guide/general/controllers.html | 20 +++++++++ user_guide/general/routing.html | 2 +- user_guide/helpers/form_helper.html | 10 ++--- user_guide/helpers/url_helper.html | 6 ++- .../libraries/database/active_record.html | 2 +- 22 files changed, 96 insertions(+), 61 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 0b4f33f4..c33bda37 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -37,6 +37,8 @@ | 'auto' Default - auto detects | 'path_info' Uses the PATH_INFO | 'query_string' Uses the QUERY_STRING +| 'orig_path_info' Uses the ORIG_PATH_INFO +| 'request_uri' Uses the REQUEST_URI | */ $config['uri_protocol'] = "auto"; diff --git a/system/application/config/routes.php b/system/application/config/routes.php index 5167f756..dc8a32d0 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -45,7 +45,8 @@ // Define your own routes below ------------------------------------------- +$route['products/([a-z]+)/(\d+)'] = "bamo/$1/a$2"; + -$route['products\/([a-z]+)\/(\d+)'] = "$1/a$2"; ?> \ No newline at end of file diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index de7f89af..872f4c04 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -27,7 +27,7 @@ * @link http://www.codeigniter.com/user_guide/ */ -define('APPVER', '1.4'); +define('APPVER', '1.4.0'); /* * ------------------------------------------------------ @@ -122,7 +122,7 @@ * */ -_load_class('CI_Loader'); +_load_class('CI_Loader', FALSE); if (floor(phpversion()) < 5) { @@ -133,7 +133,7 @@ require(BASEPATH.'codeigniter/Base5'.EXT); } -_load_class('CI_Controller'); +_load_class('CI_Controller', FALSE); require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 2ec1c3d3..4879e709 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -63,11 +63,10 @@ function &_load_class($class, $instantiate = TRUE) } else { - $objects[$class] = TRUE; + $objects[$class] = FALSE; } } - return $objects[$class]; } diff --git a/system/drivers/DB_mssql.php b/system/drivers/DB_mssql.php index 6156ec3c..48d1929e 100644 --- a/system/drivers/DB_mssql.php +++ b/system/drivers/DB_mssql.php @@ -93,7 +93,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { return $sql; } diff --git a/system/drivers/DB_mysql.php b/system/drivers/DB_mysql.php index 18c080b2..82e677a1 100644 --- a/system/drivers/DB_mysql.php +++ b/system/drivers/DB_mysql.php @@ -100,7 +100,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { // "DELETE FROM TABLE" returns 0 affected rows This hack modifies // the query so that it returns the number of affected rows diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php index f8cb19db..32c4c0f8 100644 --- a/system/drivers/DB_mysqli.php +++ b/system/drivers/DB_mysqli.php @@ -102,7 +102,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { // "DELETE FROM TABLE" returns 0 affected rows This hack modifies // the query so that it returns the number of affected rows diff --git a/system/drivers/DB_odbc.php b/system/drivers/DB_odbc.php index fac44904..50f39acc 100644 --- a/system/drivers/DB_odbc.php +++ b/system/drivers/DB_odbc.php @@ -94,7 +94,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { return $sql; } diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index 01d4b3df..3829b04a 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -94,7 +94,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { return $sql; } @@ -174,7 +174,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + $query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table.""); if ($query->num_rows() == 0) return '0'; @@ -225,7 +225,7 @@ function escape_table($table) { if (stristr($table, '.')) { - $table = preg_replace("/\./", "`.`", $table); + $table = preg_replace("/\./", ".", $table); } return $table; @@ -432,7 +432,7 @@ function field_data() $F->name = pg_field_name($this->result_id, $i); $F->type = pg_field_type($this->result_id, $i); $F->max_length = pg_field_size($this->result_id, $i); - $F->primary_key = 0; + $F->primary_key = $i == 0; $F->default = ''; $retval[] = $F; diff --git a/system/drivers/DB_sqlite.php b/system/drivers/DB_sqlite.php index 6428dd5b..1192e6dc 100644 --- a/system/drivers/DB_sqlite.php +++ b/system/drivers/DB_sqlite.php @@ -115,7 +115,7 @@ function execute($sql) * @param string an SQL query * @return string */ - function &_prep_query($sql) + function _prep_query($sql) { return $sql; } diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index f82ad01a..d4e45a0a 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -326,7 +326,7 @@ function form_close($extra = '') */ function form_prep($str = '') { - if ($str == '') + if ($str === '') { return ''; } diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index d2d2a598..03d6c3b2 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -90,7 +90,7 @@ function index_page() */ function anchor($uri = '', $title = '', $attributes = '') { - $site_url = site_url($uri); + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; if ($title == '') { @@ -128,7 +128,7 @@ function anchor($uri = '', $title = '', $attributes = '') */ function anchor_popup($uri = '', $title = '', $attributes = FALSE) { - $site_url = site_url($uri); + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; if ($title == '') { diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 013f0679..b77dd1b6 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -263,7 +263,7 @@ function get_month_name($month) } else { - $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_novermber', '12' => 'cal_december'); + $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_november', '12' => 'cal_december'); } $month = $month_names[$month]; diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index e2467fa6..3d2501fc 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -478,7 +478,7 @@ function _ci_load($data) if ($path == '') { $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.EXT : $view; + $file = ($ext != EXT) ? $view.EXT : $view; $path = $this->view_path.$file; } else diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 67814545..b28ead95 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -87,25 +87,31 @@ function _set_route_mapping() // Fetch the URI string Depending on the server, // the URI will be available in one of two globals - switch ($this->config->item('uri_protocol')) + if ($this->config->item('uri_protocol') == 'auto') { - case 'path_info' : $this->uri_string = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - break; - case 'query_string' : $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - break; - default : - $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - - if ($path_info != '' AND $path_info != "/".SELF) - { - $this->uri_string = $path_info; - } - else - { - $this->uri_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - } - break; + $path_info = getenv('PATH_INFO'); + if ($path_info != '' AND $path_info != "/".SELF) + { + $this->uri_string = $path_info; + } + else + { + $path_info = getenv('ORIG_PATH_INFO'); + if ($path_info != '' AND $path_info != "/".SELF) + { + $this->uri_string = $path_info; + } + else + { + $this->uri_string = getenv('QUERY_STRING'); + } + } + } + else + { + $this->uri_string = getenv(strtoupper($this->config->item('uri_protocol'))); } + // Is there a URI string? If not, the default controller specified // by the admin in the "routes" file will be shown. @@ -291,10 +297,7 @@ function _parse_routes() // Loop through the route array looking for wildcards foreach (array_slice($this->routes, 1) as $key => $val) - { - if (count(explode('/', $key)) != $num) - continue; - + { // Convert wildcards to RegEx $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 4c2fa9c7..c5fd4625 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -28,7 +28,7 @@ */ class CI_URI { - var $uri; + var $router; var $keyval = array(); /** @@ -42,7 +42,7 @@ class CI_URI { */ function CI_URI() { - $this->uri =& _load_class('CI_Router'); + $this->router =& _load_class('CI_Router'); log_message('debug', "URI Class Initialized"); } @@ -60,7 +60,7 @@ function CI_URI() */ function segment($n, $no_result = FALSE) { - return ( ! isset($this->uri->segments[$n])) ? $no_result : $this->uri->segments[$n]; + return ( ! isset($this->router->segments[$n])) ? $no_result : $this->router->segments[$n]; } // -------------------------------------------------------------------- @@ -196,7 +196,7 @@ function slash_segment($n, $where = 'trailing') $leading = '/'; $trailing = '/'; } - return ( ! isset($this->uri->segments[$n])) ? '' : $leading.$this->uri->segments[$n].$trailing; + return ( ! isset($this->router->segments[$n])) ? '' : $leading.$this->router->segments[$n].$trailing; } // -------------------------------------------------------------------- @@ -209,7 +209,7 @@ function slash_segment($n, $where = 'trailing') */ function segment_array() { - return $this->uri->segments; + return $this->router->segments; } // -------------------------------------------------------------------- @@ -222,7 +222,7 @@ function segment_array() */ function total_segments() { - return count($this->uri->segments); + return count($this->router->segments); } // -------------------------------------------------------------------- @@ -235,7 +235,7 @@ function total_segments() */ function uri_string() { - return $this->uri->uri_string; + return $this->router->uri_string; } } diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 5f3b8690..5721bc86 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -69,20 +69,28 @@

    Version 1.4.0

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added regular expressions support for routing rules.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • -
    • Added the ability to organize controller files into sub-folders. -
    • Updated the Routing feature to accept regular expressions within routing rules.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
    • +
    • Tweaked the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • +
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • +
    • Removed backticks from Postgre class since these are not needed.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • -
    • Fixed a MS SQL issue.
    • Fixed an issue when removing GET variables.
    • Fixed this router bug.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • -
    • Removed backticks from Postgre class since these are not needed.
    • +
    • Fixed some missing prefixes when using the database prefix feature.
    • +
    • Fixed a bug that was causing the Loader class to incorrectly identify the file extension.
    • +
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed an evaluation bug in the database initialization function.
    • +
    • Fixed some MS SQL bugs.
    • +
    • Fixed some doc typos.
    diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 648298eb..b45b5aef 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -71,6 +71,7 @@

    Controllers

  • Functions
  • Private Functions
  • Defining a Default Controller
  • +
  • Organizing Controllers into Sub-folders
  • Class Constructors
  • Reserved Function Names
  • @@ -204,6 +205,25 @@

    Defining a Default Controller

    specifying any URI segments you'll see your Hello World message by default.

    + +

    Organizing Your Controllers into Sub-folders

    + +

    If you are building a large application you might find it convenient to organize your controllers into sub-folders. Code Igniter permits you to do this.

    + +

    Simply create folders within your application/controllers directory and place your controller classes within them.

    + +

    Note:  When using this feature the first segment or your URI must specify the folder. For example, lets say you have a controller +located here:

    + +application/controllers/products/shoes.php + +

    To call the above controller your URI will look something like this:

    + +www.your-site.com/index.php/products/shoes/123 + +

    Code Igniter also permits you to remap your URIs using its URI Routing feature. + +

    Class Constructors

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 977698b9..e5dac680 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -138,7 +138,7 @@

    Regular Expressions

    A typical RegEx route might look something like this:

    -$route['products\/([a-z]+)\/(\d+)'] = "$1/id_$2"; +$route['products/([a-z]+)/(\d+)'] = "$1/id_$2";

    In the above example, a URI similar to products/shirts/123 would instead call the shirts controller class and the id_123 function.

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 8593f81d..f38d4ada 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -208,7 +208,7 @@

    form_dropdown()

    $options = array(
                      'small'  => 'Small Shirt',
                      'med'    => 'Medium Shirt',
    -                  large'   => 'Large Shirt',
    +                  'large'   => 'Large Shirt',
                      'xlarge' => 'Extra Large Shirt',
                    );

    @@ -217,10 +217,10 @@

    form_dropdown()

    // Would produce:

    <select name="shirts">
    -<option value="small">Small Shirt
    -<option value="med">Medium Shirt
    -<option value="large" selected>Large Shirt
    -<option value="xlarge">Extra Large Shirt
    +<option value="small">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected>Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    </select>
    diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index a8f5c14d..2b5b354c 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -117,8 +117,10 @@

    anchor()

    anchor(uri segments, text, attributes)

    The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, -segments can be a string or an array. Note: Do not include the base URL. It will be built as specified in your config file. Include -only the URI segments you wish appended to the URL.

    +segments can be a string or an array.

    + +

    Note:  If you are building links that are internal to your application do not include the base URL (http://...). This +will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.

    The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

    diff --git a/user_guide/libraries/database/active_record.html b/user_guide/libraries/database/active_record.html index 8fc3b813..6e5d6126 100644 --- a/user_guide/libraries/database/active_record.html +++ b/user_guide/libraries/database/active_record.html @@ -557,7 +557,7 @@

    $this->db->delete();

    Generates a delete SQL string and runs the query.

    -$this->db->delete('mytable', array('id', $id)); +$this->db->delete('mytable', array('id' => $id));

    // Produces:
    // DELETE FROM mytable
    From 141808ad31d4eefad4c6c3dbaf8306fac2342668 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 01:52:51 +0000 Subject: [PATCH 0009/2544] --- system/drivers/DB_mysql.php | 4 ---- system/drivers/DB_mysqli.php | 4 ---- system/drivers/DB_postgre.php | 4 ---- system/drivers/DB_sqlite.php | 4 ---- system/helpers/form_helper.php | 9 +++++++-- system/libraries/Encrypt.php | 2 +- system/libraries/Language.php | 2 +- system/libraries/Log.php | 2 +- system/libraries/Validation.php | 8 ++++---- user_guide/general/changelog.html | 6 +++++- user_guide/libraries/pagination.html | 2 +- 11 files changed, 20 insertions(+), 27 deletions(-) diff --git a/system/drivers/DB_mysql.php b/system/drivers/DB_mysql.php index 82e677a1..a90d8426 100644 --- a/system/drivers/DB_mysql.php +++ b/system/drivers/DB_mysql.php @@ -126,10 +126,6 @@ function _prep_query($sql) */ function escape_str($str) { - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } return mysql_real_escape_string($str); } diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php index 32c4c0f8..75c01e7f 100644 --- a/system/drivers/DB_mysqli.php +++ b/system/drivers/DB_mysqli.php @@ -128,10 +128,6 @@ function _prep_query($sql) */ function escape_str($str) { - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } return mysqli_real_escape_string($this->conn_id, $str); } diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index 3829b04a..cf59f0fd 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -110,10 +110,6 @@ function _prep_query($sql) */ function escape_str($str) { - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } return pg_escape_string($str); } diff --git a/system/drivers/DB_sqlite.php b/system/drivers/DB_sqlite.php index 1192e6dc..b2c31a8b 100644 --- a/system/drivers/DB_sqlite.php +++ b/system/drivers/DB_sqlite.php @@ -131,10 +131,6 @@ function _prep_query($sql) */ function escape_str($str) { - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } return sqlite_escape_string($str); } diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index d4e45a0a..06910106 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -38,11 +38,16 @@ * @param array a key/value pair hidden data * @return string */ -function form_open($action, $attributes = array(), $hidden = array()) +function form_open($action = '', $attributes = array(), $hidden = array()) { $obj =& get_instance(); - $form = '
    config->site_url($action).'"'; + + if ( ! isset($attributes['method'])) + { + $form .= ' method="post"'; + } if (is_array($attributes) AND count($attributes) > 0) { diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 532bfe1f..bcffdf1a 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -322,7 +322,7 @@ function _get_mcrypt() */ function set_hash($type = 'sha1') { - $this->_hash_type = ($type != 'sha1' OR $type != 'md5') ? 'sha1' : $type; + $this->_hash_type = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type; } // END set_hash() diff --git a/system/libraries/Language.php b/system/libraries/Language.php index b668aa06..328d53e4 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -68,7 +68,7 @@ function load($langfile = '', $idiom = '', $return = FALSE) if ( ! file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) { - show_error('Unable to load the requested language file: language/'.$langfile.EXT); + show_error('Unable to load the requested language file: language/'.$langfile); } include_once(BASEPATH.'language/'.$idiom.'/'.$langfile); diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 35e30b64..17b96b2c 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -88,7 +88,7 @@ function write_log($level = 'error', $msg, $php_error = FALSE) return FALSE; } - $filepath = $this->log_path.'log-'.date('Y-m-d').'.php'; + $filepath = $this->log_path.'log-'.date('Y-m-d').EXT; $message = ''; if ( ! file_exists($filepath)) diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index df8c70ee..e037e69c 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -252,12 +252,12 @@ function run() // Strip the parameter (if exists) from the rule // Rules can contain a parameter: max_length[5] $param = FALSE; - if (preg_match("/.*?(\[.*?\]).*/", $rule, $match)) + if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) { - $param = substr(substr($match['1'], 1), 0, -1); - $rule = str_replace($match['1'], '', $rule); + $rule = $match[1]; + $param = $match[2]; } - + // Call the function that corresponds to the rule if ($callback === TRUE) { diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 5721bc86..bf79a14d 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -75,7 +75,8 @@

    Version 1.4.0

  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
  • -
  • Tweaked the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
  • +
  • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
  • +
  • Updated the form_open() helper to allow the GET method to be used.
  • Removed a strtolower() call that was changing URL segments to lower case.
  • Removed some references that were interfering with PHP 4.4.1 compatibility.
  • Removed backticks from Postgre class since these are not needed.
  • @@ -89,6 +90,9 @@

    Version 1.4.0

  • Fixed a bug that was causing the Loader class to incorrectly identify the file extension.
  • Fixed a typo in the Calendar class (cal_november).
  • Fixed an evaluation bug in the database initialization function.
  • +
  • Fixed a minor bug in one of the error messages in the language class.
  • +
  • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
  • +
  • Fixed a couple bugs in the Unit Testing class.
  • Fixed some MS SQL bugs.
  • Fixed some doc typos.
  • diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3f4e5693..ac71d78b 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -91,7 +91,7 @@

    Notes:

    • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Page" and a function called "test". Keep in mind that you can + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
    • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned. From 57b3d39cb79bb3b8d193e0e345a62e3396e519f2 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 15:28:31 +0000 Subject: [PATCH 0010/2544] --- system/codeigniter/Common.php | 6 ++++-- system/drivers/DB_active_record.php | 2 +- system/drivers/DB_driver.php | 10 +++++----- system/helpers/form_helper.php | 4 ++-- system/libraries/Log.php | 2 +- user_guide/general/changelog.html | 3 +++ 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 4879e709..d5bec77f 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -153,8 +153,10 @@ function show_404($page = '') * @access public * @return void */ -function log_message($level = 2, $message, $php_error = FALSE) +function log_message($level = 'error', $message, $php_error = FALSE) { + static $LOG; + $config =& _get_config(); if ($config['log_errors'] === FALSE) { @@ -166,7 +168,7 @@ function log_message($level = 2, $message, $php_error = FALSE) include_once(BASEPATH.'libraries/Log.php'); } - if ( ! isset($LOG)) + if ( ! is_object($LOG)) { $LOG = new CI_Log( $config['log_path'], diff --git a/system/drivers/DB_active_record.php b/system/drivers/DB_active_record.php index 373c0f62..f1995c80 100644 --- a/system/drivers/DB_active_record.php +++ b/system/drivers/DB_active_record.php @@ -663,7 +663,7 @@ function delete($table = '', $where = '') if (count($this->ar_where) == 0) { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_del_must_use_where'); } diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php index ed18d54e..3a2a5e9b 100644 --- a/system/drivers/DB_driver.php +++ b/system/drivers/DB_driver.php @@ -86,7 +86,7 @@ function initialize($params = '') { log_message('error', 'Invalid DB Connection String'); - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_invalid_connection_str'); } @@ -265,7 +265,7 @@ function call_function($function) if ( ! function_exists($function)) { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_unsupported_function'); } @@ -425,7 +425,7 @@ function field_names($table = '') { if ($table == '') { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_field_param_missing'); } @@ -472,7 +472,7 @@ function field_data($table = '') { if ($table == '') { - if ($this->debug) + if ($this->db_debug) { return $this->display_error('db_field_param_missing'); } @@ -535,7 +535,7 @@ function compile_binds($sql, $binds) // Just in case the replacement string contains the bind // character we'll temporarily replace it with a marker $val = str_replace($this->bind_marker, '{%bind_marker%}', $val); - $sql = preg_replace("#".preg_quote($this->bind_marker)."#", $val, $sql, 1); + $sql = preg_replace("#".preg_quote($this->bind_marker, '#')."#", str_replace('$', '\$', $val), $sql, 1); } return str_replace('{%bind_marker%}', $this->bind_marker, $sql); diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 06910106..eb97913f 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -247,7 +247,7 @@ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - if (isset($data['checked'])) + if (is_array($data) AND array_key_exists('checked', $data)) { $checked = $data['checked']; @@ -256,7 +256,7 @@ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') } if ($checked == TRUE) - $defaults['checked'] = ' checked="checked"'; + $defaults['checked'] = 'checked'; else unset($defaults['checked']); diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 17b96b2c..de5a9b83 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -40,7 +40,7 @@ class CI_Log { * @param string the error threshold * @param string the date formatting codes */ - function CI_Log($path = '', $threshold = '', $date_fmt = '') + function CI_Log($path = '', $threshold = 4, $date_fmt = '') { $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index bf79a14d..5d499679 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -89,8 +89,11 @@

      Version 1.4.0

    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a bug that was causing the Loader class to incorrectly identify the file extension.
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed a bug in the form_checkbox() helper.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed an undefined variable in the DB Driver class.
    • +
    • Fixed a bug in which dollar signs used as binding replacemnt values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed some MS SQL bugs.
    • From b4473d4407311cc5e4b2306cf5fa51221d5826f8 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 15:46:31 +0000 Subject: [PATCH 0011/2544] --- system/libraries/Controller.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index ec21f8d6..06e54b2d 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -127,7 +127,12 @@ function _ci_load_model($model, $name = '', $db_conn = FALSE) { $name = $model; } - + + if (in_array($name, $this->_ci_models)) + { + return; + } + if (isset($this->$name)) { show_error('The model name you are loading is the name of a resource that is already being used: '.$name); From 0d29605b1e774efd57ffd8f5ccc8eaec1e9ca576 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 15:48:38 +0000 Subject: [PATCH 0012/2544] --- system/libraries/Controller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 06e54b2d..768b154e 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -128,7 +128,8 @@ function _ci_load_model($model, $name = '', $db_conn = FALSE) $name = $model; } - if (in_array($name, $this->_ci_models)) + $obj =& get_instance(); + if (in_array($name, $obj->_ci_models)) { return; } From 1082bddc0c065895a3b39607cb930f5a101f54fb Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 19:32:02 +0000 Subject: [PATCH 0013/2544] --- system/application/config/config.php | 20 +++++++++++++++++ system/drivers/DB_mssql.php | 4 ++-- system/drivers/DB_mysqli.php | 4 +++- system/libraries/Config.php | 5 +++-- system/libraries/Router.php | 14 +++++++----- user_guide/general/changelog.html | 12 ++++++---- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/installation/upgrade_140.html | 28 +++++++++++++++++++++++- 9 files changed, 73 insertions(+), 18 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index c33bda37..c19fabf4 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -81,6 +81,26 @@ $config['enable_hooks'] = TRUE; +/* +|-------------------------------------------------------------------------- +| Allowed URL Characters +|-------------------------------------------------------------------------- +| +| This lets you specify which characters are permitted within your URLs. +| When someone tries to submit a URL with disallowed characters they will +| get a warning message. +| +| As a security measure you are STRONGLY encouraged to restrict URLs to +| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- +| +| Leave blank to allow all characters -- but only if you are insane. +| +| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! +| +*/ +$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; + + /* |-------------------------------------------------------------------------- | Enable Query Strings diff --git a/system/drivers/DB_mssql.php b/system/drivers/DB_mssql.php index 48d1929e..f6e672b9 100644 --- a/system/drivers/DB_mssql.php +++ b/system/drivers/DB_mssql.php @@ -109,8 +109,8 @@ function _prep_query($sql) */ function escape_str($str) { - // MS SQL doesn't require escaping - return $str; + // Escape single quotes + return str_replace("'", "''", $str); } // -------------------------------------------------------------------- diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php index 75c01e7f..fadcdd3c 100644 --- a/system/drivers/DB_mysqli.php +++ b/system/drivers/DB_mysqli.php @@ -88,7 +88,9 @@ function db_select() function execute($sql) { $sql = $this->_prep_query($sql); - return @mysqli_query($this->conn_id, $sql); + $result = @mysqli_query($this->conn_id, $sql); + mysqli_next_result($this->conn_id); + return $result; } // -------------------------------------------------------------------- diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 85b29579..bd138331 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -53,7 +53,7 @@ function CI_Config() * * @access public * @param string the config file name - * @return void + * @return boolean if the file was loaded correctly */ function load($file = '') { @@ -61,7 +61,7 @@ function load($file = '') if (in_array($file, $this->is_loaded)) { - return; + return TRUE; } include_once(APPPATH.'config/'.$file.EXT); @@ -77,6 +77,7 @@ function load($file = '') unset($config); log_message('debug', 'Config file loaded: config/'.$file.EXT); + return TRUE; } // END load() diff --git a/system/libraries/Router.php b/system/libraries/Router.php index b28ead95..2219f573 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -254,12 +254,14 @@ function _validate_segments($segments) */ function _filter_uri($str) { - if ( ! preg_match("/^[a-z0-9~\s\%\.:_-]+$/i", $str)) - { - exit('The URI you submitted has disallowed characters: '.$str); - } - - return $str; + if ($this->config->item('permitted_uri_chars') != '') + { + if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + { + exit('The URI you submitted has disallowed characters: '.$str); + } + } + return $str; } // END _filter_uri() diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 5d499679..59a02f86 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -74,15 +74,19 @@

      Version 1.4.0

    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • -
    • Moved the MIME type array out of the Upload class and into its own file in the applications/comfig/ folder.
    • +
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • +
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • +
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • +
    • Updated the Models loader function to allow multiple loads of the same model.
    • +
    • Updated the MS SQL driver so that single quotes are escaped.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • -
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • -
    • Fixed an issue when removing GET variables.
    • -
    • Fixed this router bug.
    • +
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • +
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • +
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index b45b5aef..4dc94cba 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -212,7 +212,7 @@

      Organizing Your Controllers into Sub-folders

      Simply create folders within your application/controllers directory and place your controller classes within them.

      -

      Note:  When using this feature the first segment or your URI must specify the folder. For example, lets say you have a controller +

      Note:  When using this feature the first segment of your URI must specify the folder. For example, lets say you have a controller located here:

      application/controllers/products/shoes.php diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 1e596847..4abe0677 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -64,7 +64,7 @@

      Creating Core System Classes

      Every time Code Igniter runs there are several base classes that are initialized automatically as part of the core framework. It is possible, however, to swap any of the core system classes with your own versions.  Most users will never have any need to do this, -but the option to replace them does exist for those that would like to significantly alter the Code Igniter core. +but the option to replace them does exist for those who would like to significantly alter the Code Igniter core.

      Note:  Replacing a core system class with your own version has a lot of implications, so make sure you diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 7f25c44e..bd84c242 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -87,7 +87,33 @@

      Step 1: Update your Code Igniter files

    -

    Step 4: Update your user guide

    +

    Step 2: Update your config.php file

    + +

    Open your application/config/config.php file and add these new items:

    + +
    +/*
    +|--------------------------------------------------------------------------
    +| Allowed URL Characters
    +|--------------------------------------------------------------------------
    +|
    +| This lets you specify which characters are permitted within your URLs.
    +| When someone tries to submit a URL with disallowed characters they will
    +| get a warning message.
    +|
    +| As a security measure you are STRONGLY encouraged to restrict URLs to
    +| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
    +|
    +| Leave blank to allow all characters -- but only if you are insane.
    +| 
    +| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
    +|
    +*/
    +$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
    +
    + + +

    Step 3: Update your user guide

    Please also replace your local copy of the user guide with the new version.

    From 97cdfb15951439bd4b04fabaf0dd590d9480c39e Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 19:48:30 +0000 Subject: [PATCH 0014/2544] --- user_guide/general/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 59a02f86..d2a33dda 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -84,6 +84,7 @@

    Version 1.4.0

  • Removed a strtolower() call that was changing URL segments to lower case.
  • Removed some references that were interfering with PHP 4.4.1 compatibility.
  • Removed backticks from Postgre class since these are not needed.
  • +
  • Renamed display() to _display() in the Output class to make it clear that it's a private function.
  • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
  • Fixed an bug that was preventing the input class from unsetting GET variables.
  • Fixed a router bug that was making it too greedy when matching end segments.
  • From 6a285fb39f5fce271dc23e13bafdb414502c9ecb Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 27 Aug 2006 19:54:10 +0000 Subject: [PATCH 0015/2544] --- system/drivers/DB_sqlite.php | 9 ++++++++- user_guide/general/changelog.html | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/system/drivers/DB_sqlite.php b/system/drivers/DB_sqlite.php index b2c31a8b..71d2561d 100644 --- a/system/drivers/DB_sqlite.php +++ b/system/drivers/DB_sqlite.php @@ -489,7 +489,14 @@ function _fetch_assoc() */ function _fetch_object() { - return sqlite_fetch_object($this->result_id); + if (function_exists('sqlite_fetch_object')) + { + return sqlite_fetch_object($this->result_id); + } + else + { + return $this->_fetch_assoc(); + } } } diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index d2a33dda..ef344ffc 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -79,6 +79,7 @@

    Version 1.4.0

  • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
  • Updated the form_open() helper to allow the GET method to be used.
  • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
  • +
  • Updated the SQLite Driver to check for object support before attmpting to return results as objects. If unsupported it returns an array.
  • Updated the Models loader function to allow multiple loads of the same model.
  • Updated the MS SQL driver so that single quotes are escaped.
  • Removed a strtolower() call that was changing URL segments to lower case.
  • From 671dc754ef954eecf4c2e8301dde5b3aba6bfedc Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 02:36:03 +0000 Subject: [PATCH 0016/2544] --- system/libraries/Config.php | 99 ++++++++++++++++++++++++++++++++----- 1 file changed, 86 insertions(+), 13 deletions(-) diff --git a/system/libraries/Config.php b/system/libraries/Config.php index bd138331..f7f813f8 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -36,8 +36,12 @@ class CI_Config { * * Sets the $config data from the primary config.php file as a class variable * - * @access public - */ + * @access public + * @param string the config file name + * @param boolean if configuration values should be loaded into their own section + * @param boolean true if errors should just return false, false if an error message should be displayed + * @return boolean if the file was successfully loaded or not + */ function CI_Config() { $this->config =& _get_config(); @@ -55,7 +59,7 @@ function CI_Config() * @param string the config file name * @return boolean if the file was loaded correctly */ - function load($file = '') + function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); @@ -63,15 +67,42 @@ function load($file = '') { return TRUE; } + + if ( ! file_exists(APPPATH.'config/'.$file.EXT)) + { + if ($fail_gracefully === TRUE) + { + return FALSE; + } + show_error('The configuration file '.$file.EXT.' does not exist.'); + } include_once(APPPATH.'config/'.$file.EXT); if ( ! isset($config) OR ! is_array($config)) { + if ($fail_gracefully === TRUE) + { + return FALSE; + } show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.'); } - $this->config = array_merge($this->config, $config); + if ($use_sections === TRUE) + { + if (isset($this->config[$file])) + { + $this->config[$file] = array_merge($this->config[$file], $config); + } + else + { + $this->config[$file] = $config; + } + } + else + { + $this->config = array_merge($this->config, $config); + } $this->is_loaded[] = $file; unset($config); @@ -86,6 +117,48 @@ function load($file = '') /** * Fetch a config file item * + * + * @access public + * @param string the config item name + * @param string the index name + * @param bool + * @return string + */ + function item($item, $index = '') + { + if ($index == '') + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + + $pref = $this->config[$item]; + } + else + { + if ( ! isset($this->config[$index])) + { + return FALSE; + } + + if ( ! isset($this->config[$index][$item])) + { + return FALSE; + } + + $pref = $this->config[$index][$item]; + } + + return $pref; + } + // END item() + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item - adds slash after item + * * The second parameter allows a slash to be added to the end of * the item, in the case of a path. * @@ -94,7 +167,7 @@ function load($file = '') * @param bool * @return string */ - function item($item, $slash = FALSE) + function slash_item($item) { if ( ! isset($this->config[$item])) { @@ -103,20 +176,20 @@ function item($item, $slash = FALSE) $pref = $this->config[$item]; - if ($pref == '') - { - return $pref; + if ($pref != '') + { + if (ereg("/$", $pref) === FALSE) + { + $pref .= '/'; + } } - - if ($slash !== FALSE AND ereg("/$", $pref) === FALSE) - { - $pref .= '/'; - } return $pref; } // END item() + + // -------------------------------------------------------------------- /** From eb6db84333c40ed8d15dec5014564120ee0c60e6 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 02:39:45 +0000 Subject: [PATCH 0017/2544] --- system/codeigniter/CodeIgniter.php | 5 +++++ system/drivers/DB_postgre.php | 7 +++++-- system/helpers/date_helper.php | 2 +- system/libraries/Validation.php | 2 +- user_guide/general/changelog.html | 6 +++++- user_guide/libraries/config.html | 32 +++++++++++++++++++++++++++++- 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 872f4c04..1f7850ec 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -188,6 +188,11 @@ } else { + if ($method == $class) + { + $method = 'index'; + } + if ( ! method_exists($CI, $method)) { show_404(); diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index cf59f0fd..fd98ec78 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -211,7 +211,8 @@ function error_number() * Escape Table Name * * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped + * in it. Some DBs will get cranky unless periods are escaped. + * NOT NEEDED FOR POSTGRE * * @access public * @param string the table name @@ -219,10 +220,12 @@ function error_number() */ function escape_table($table) { + /* if (stristr($table, '.')) { - $table = preg_replace("/\./", ".", $table); + $table = preg_replace("/\./", "`.`", $table); } + */ return $table; } diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 2a3d5085..c8205bb7 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -189,7 +189,7 @@ function timespan($seconds = 1, $time = '') { if ($minutes > 0) { - $str .= $minutes.' '.$obj->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minutes')).', '; + $str .= $minutes.' '.$obj->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; } $seconds -= $minutes * 60; diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index e037e69c..30faa85e 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -208,7 +208,7 @@ function run() { if (in_array('isset', $ex) OR in_array('required', $ex)) { - if ( ! isset($this->messages['isset'])) + if ( ! isset($this->_error_messages['isset'])) { if (FALSE === ($line = $this->obj->lang->line('isset'))) { diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index ef344ffc..a7707723 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -65,7 +65,7 @@

    Change Log

    Version 1.4.0

    -

    Release Date: August 25, 2006

    +

    Release Date: Septemer 01, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • @@ -76,6 +76,7 @@

      Version 1.4.0

    • Added the ability to supply full URLs using the anchor() helper function.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • +
    • Updated the Config Library to be able to load config files silently.
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • @@ -96,12 +97,15 @@

      Version 1.4.0

    • Fixed a bug that was causing the Loader class to incorrectly identify the file extension.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • +
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacemnt values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • +
    • Fixed an incorrectlyl named variable in the Validation class.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.
    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index c173f569..ca4773d2 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -97,6 +97,22 @@

    Loading a Config File

    Where filename is the name of your config file, without the .php file extension.

    +

    If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if +you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE +and each config file will be stored in an array index corresponding to the name of the config file. Example: + + +// Stored in an array with this prototype: $this->config['blog_settings'] = $config
    +$this->config->load('blog_settings', TRUE);
    + +

    Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

    + +

    The third parameter allows you to suppress errors in the event that a config file does not exist:

    + +$this->config->load('blog_settings', FALSE, TRUE); + + +
  • Auto-loading
  • @@ -109,7 +125,7 @@

    Loading a Config File

    Fetching Config Items

    -

    To retrive an item from your config file, use the following function:

    +

    To retrieve an item from your config file, use the following function:

    $this->config->item('item name'); @@ -119,6 +135,20 @@

    Fetching Config Items

    The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

    +

    If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example: + + +// Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
    +$this->config->load('blog_settings', 'TRUE');

    + +// Retrieve a config item named site_name contained within the blog_settings array
    +$site_name = $this->config->item('site_name', 'blog_settings');

    + +// An alternate way to specify the same item:
    +$blog_config = $this->config->item('blog_settings');
    +$site_name = $blog_config['site_name'];
    +

    Setting a Config Item

    If you would like to dynamically set a config item or change an existing one, you can so so using:

    From 6bda4e97821ee26efa29a2604b2e03eb2aa7273f Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 02:45:31 +0000 Subject: [PATCH 0018/2544] --- user_guide/general/changelog.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index a7707723..0a91b0c5 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -65,7 +65,7 @@

    Change Log

    Version 1.4.0

    -

    Release Date: Septemer 01, 2006

    +

    Release Date: September 01, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • @@ -80,7 +80,7 @@

      Version 1.4.0

    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • -
    • Updated the SQLite Driver to check for object support before attmpting to return results as objects. If unsupported it returns an array.
    • +
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • @@ -102,10 +102,10 @@

      Version 1.4.0

    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • -
    • Fixed a bug in which dollar signs used as binding replacemnt values in the DB class would be treated as RegEx back-references.
    • +
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • -
    • Fixed an incorrectlyl named variable in the Validation class.
    • +
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.
    From 7530d50cd01c6cde8eabe6c62c180fe13a917f76 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 02:50:23 +0000 Subject: [PATCH 0019/2544] --- system/application/config/autoload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index a3ce4108..1ed6f175 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -39,7 +39,7 @@ | $autoload['core'] = array('database', 'session', 'xmlrpc'); */ -$autoload['core'] = array('session'); +$autoload['core'] = array(); /* From c2efd6e9d84a3cb688d30239c4a0b2571b48b714 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 02:52:02 +0000 Subject: [PATCH 0020/2544] --- user_guide/installation/upgrade_140.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index bd84c242..810d1078 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -89,7 +89,7 @@

    Step 1: Update your Code Igniter files

    Step 2: Update your config.php file

    -

    Open your application/config/config.php file and add these new items:

    +

    Open your application/config/config.php file and add this new item:

     /*
    
    From e0d85bf837a59e74054260346867aec8329565c0 Mon Sep 17 00:00:00 2001
    From: admin 
    Date: Sat, 2 Sep 2006 03:59:48 +0000
    Subject: [PATCH 0021/2544]
    
    ---
     system/application/config/hooks.php | 12 ++++++++++++
     1 file changed, 12 insertions(+)
     create mode 100644 system/application/config/hooks.php
    
    diff --git a/system/application/config/hooks.php b/system/application/config/hooks.php
    new file mode 100644
    index 00000000..8ebb236d
    --- /dev/null
    +++ b/system/application/config/hooks.php
    @@ -0,0 +1,12 @@
    +
    \ No newline at end of file
    
    From b64b0be2dba3b342b70002b02305342e7f4e7ea4 Mon Sep 17 00:00:00 2001
    From: admin 
    Date: Sat, 2 Sep 2006 17:19:54 +0000
    Subject: [PATCH 0022/2544]
    
    ---
     user_guide/helpers/file_helper.html | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
    index c6b049b2..6970dd58 100644
    --- a/user_guide/helpers/file_helper.html
    +++ b/user_guide/helpers/file_helper.html
    @@ -103,6 +103,12 @@ 

    write_file('path', $data)

         echo 'File written!';
    }
    +

    You can optionally set the write mode via the third parameter: + +write_file('./path/to/file.php', $data, 'r+'); + +

    The default mode is wb. Please see the PHP user guide for mode options.

    +

    Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). If the file does not already exist, the directory containing it must be writable.

    From b4fd1d8b53451832fcdc54a01b76522f9bc8e125 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:22:01 +0000 Subject: [PATCH 0023/2544] --- user_guide/general/changelog.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 0a91b0c5..54f4746e 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -73,10 +73,11 @@

    Version 1.4.0

  • Added regular expressions support for routing rules.
  • Added the ability to replace core system classes with your own classes.
  • Added support for % character in URL.
  • -
  • Added the ability to supply full URLs using the anchor() helper function.
  • +
  • Added the ability to supply full URLs using the anchor() helper function.
  • +
  • Added mode parameter to file_write() helper.
  • Moved the list of "allowed URI characters" out of the Router class and into the config file.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
  • -
  • Updated the Config Library to be able to load config files silently.
  • +
  • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
  • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
  • Updated the form_open() helper to allow the GET method to be used.
  • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
  • From 6d5a1c26d9cc3e754687580c6837f4fdbe8af49f Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:33:03 +0000 Subject: [PATCH 0024/2544] --- user_guide/libraries/database/configuration.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/libraries/database/configuration.html b/user_guide/libraries/database/configuration.html index 4b7d2a8a..1e14438a 100644 --- a/user_guide/libraries/database/configuration.html +++ b/user_guide/libraries/database/configuration.html @@ -117,6 +117,7 @@

    Explanation of Values:

  • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
  • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
  • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources.
  • +
  • port - The database port number. Currently only used with the Postgre driver.
  • Note: Depending on what database platform you are using (MySQL, Postgre, etc.) From 51cf423e1e41f573f87176d28affa50efda46c45 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:34:05 +0000 Subject: [PATCH 0025/2544] --- user_guide/general/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 54f4746e..188d8566 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -75,6 +75,7 @@

    Version 1.4.0

  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • Added mode parameter to file_write() helper.
  • +
  • Added support for changing the port number in the Postgre driver.
  • Moved the list of "allowed URI characters" out of the Router class and into the config file.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
  • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
  • From 2ed76d5ac89ec7869dcb64c050360fb2f99e9326 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:34:52 +0000 Subject: [PATCH 0026/2544] --- system/application/config/config.php | 2 +- system/drivers/DB_driver.php | 3 ++- system/drivers/DB_postgre.php | 10 +++++++--- system/helpers/file_helper.php | 4 ++-- system/helpers/url_helper.php | 2 +- system/libraries/Output.php | 2 +- user_guide/general/changelog.html | 2 +- user_guide/general/hooks.html | 6 ++++++ user_guide/installation/upgrade_140.html | 15 ++++++++++++++- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index c19fabf4..7b19b83b 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -78,7 +78,7 @@ | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = TRUE; +$config['enable_hooks'] = FALSE; /* diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php index 3a2a5e9b..0c2084ad 100644 --- a/system/drivers/DB_driver.php +++ b/system/drivers/DB_driver.php @@ -36,6 +36,7 @@ class CI_DB_driver { var $database; var $dbdriver = 'mysql'; var $dbprefix = ''; + var $port = ''; var $pconnect = FALSE; var $conn_id = FALSE; var $result_id = FALSE; @@ -75,7 +76,7 @@ function initialize($params = '') { if (is_array($params)) { - foreach (array('hostname' => '', 'username' => '', 'password' => '', 'database' => '', 'dbdriver' => 'mysql', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => FALSE) as $key => $val) + foreach (array('hostname' => '', 'username' => '', 'password' => '', 'database' => '', 'dbdriver' => 'mysql', 'dbprefix' => '', 'port' => '', 'pconnect' => FALSE, 'db_debug' => FALSE) as $key => $val) { $this->$key = ( ! isset($params[$key])) ? $val : $params[$key]; } diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index fd98ec78..673dea33 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -38,9 +38,11 @@ class CI_DB_postgre extends CI_DB { */ function db_connect() { - return pg_connect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password); + $port = ($this->port == '') ? '' : " port=".$this->port; + + return pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); } - + // -------------------------------------------------------------------- /** @@ -51,7 +53,9 @@ function db_connect() */ function db_pconnect() { - return pg_pconnect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password); + $port = ($this->port == '') ? '' : " port=".$this->port; + + return pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); } // -------------------------------------------------------------------- diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 93bddb02..32c0b2cd 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -75,9 +75,9 @@ function read_file($file) * @param string file data * @return bool */ -function write_file($path, $data) +function write_file($path, $data, $mode = 'wb') { - if ( ! $fp = @fopen($path, 'wb')) + if ( ! $fp = @fopen($path, $mode)) { return FALSE; } diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 03d6c3b2..09169e32 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -56,7 +56,7 @@ function site_url($uri = '') function base_url() { $obj =& get_instance(); - return $obj->config->item('base_url', 1); + return $obj->config->slash_item('base_url'); } // ------------------------------------------------------------------------ diff --git a/system/libraries/Output.php b/system/libraries/Output.php index f5db3e0d..73f03863 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -147,7 +147,7 @@ function _write_cache($output) return; } - $uri = $obj->config->item('base_url', 1). + $uri = $obj->config->slash_item('base_url'). $obj->config->item('index_page'). $obj->uri->uri_string(); diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 188d8566..e556684e 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -75,7 +75,7 @@

    Version 1.4.0

  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • Added mode parameter to file_write() helper.
  • -
  • Added support for changing the port number in the Postgre driver.
  • +
  • Added support for changing the port number in the Postgre driver.
  • Moved the list of "allowed URI characters" out of the Router class and into the config file.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
  • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
  • diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 33d343d8..a780a5cd 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -69,6 +69,12 @@

    Hooks - Extending the Framework Core

    your own scripts in some other location.

    +

    Enabling Hooks

    + +

    The hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file:

    + +$config['enable_hooks'] = TRUE; +

    Defining a Hook

    diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 810d1078..1c72b5d7 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -89,9 +89,22 @@

    Step 1: Update your Code Igniter files

    Step 2: Update your config.php file

    -

    Open your application/config/config.php file and add this new item:

    +

    Open your application/config/config.php file and add these new items:

    +
    +/*
    +|--------------------------------------------------------------------------
    +| Enable/Disable System Hooks
    +|--------------------------------------------------------------------------
    +|
    +| If you would like to use the "hooks" feature you must enable it by
    +| setting this variable to TRUE (boolean).  See the user guide for details.
    +|
    +*/
    +$config['enable_hooks'] = FALSE;
    +
    +
     /*
     |--------------------------------------------------------------------------
     | Allowed URL Characters
    
    From 337b270b6e566e81d3ee3b5575a3f274c000b459 Mon Sep 17 00:00:00 2001
    From: admin 
    Date: Sat, 2 Sep 2006 17:43:16 +0000
    Subject: [PATCH 0027/2544]
    
    ---
     system/libraries/Loader.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
    index 3d2501fc..f005adcf 100644
    --- a/system/libraries/Loader.php
    +++ b/system/libraries/Loader.php
    @@ -478,7 +478,7 @@ function _ci_load($data)
     		if ($path == '')
     		{
     			$ext = pathinfo($view, PATHINFO_EXTENSION);
    -			$file = ($ext != EXT) ? $view.EXT : $view;
    +			$file = ($ext != '') ? $view.EXT : $view;
     			$path = $this->view_path.$file;
     		}
     		else
    
    From 4064c1d7dab84fcafb42267a35a3b3aba8f9952d Mon Sep 17 00:00:00 2001
    From: admin 
    Date: Sat, 2 Sep 2006 17:43:31 +0000
    Subject: [PATCH 0028/2544]
    
    ---
     user_guide/general/changelog.html | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html
    index e556684e..168e72fe 100644
    --- a/user_guide/general/changelog.html
    +++ b/user_guide/general/changelog.html
    @@ -96,7 +96,6 @@ 

    Version 1.4.0

  • Fixed a bug in which loading a language file was producing a "file contains no data" message.
  • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
  • Fixed some missing prefixes when using the database prefix feature.
  • -
  • Fixed a bug that was causing the Loader class to incorrectly identify the file extension.
  • Fixed a typo in the Calendar class (cal_november).
  • Fixed a bug in the form_checkbox() helper.
  • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
  • From 108d18acae3cf6e6e05afe2526eca97bfabcb4ad Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:45:38 +0000 Subject: [PATCH 0029/2544] --- user_guide/general/views.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 14b03e58..b05e44c3 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -95,7 +95,7 @@

    Loading a View

    $this->load->view('name'); -

    Where name is the name of your view file, without the .php file extension.

    +

    Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other then .php.

    Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

    From 6ac4bea2da9e64fb0b434f52177353f6bd65b8e6 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Sep 2006 17:46:15 +0000 Subject: [PATCH 0030/2544] --- system/libraries/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f005adcf..e2467fa6 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -478,7 +478,7 @@ function _ci_load($data) if ($path == '') { $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext != '') ? $view.EXT : $view; + $file = ($ext == '') ? $view.EXT : $view; $path = $this->view_path.$file; } else From 1cf89aab5fff8c8068cbf0ed18038b6e4fd4f605 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Sep 2006 18:24:39 +0000 Subject: [PATCH 0031/2544] --- system/codeigniter/CodeIgniter.php | 15 ++++++++---- system/codeigniter/Common.php | 2 +- system/drivers/DB_active_record.php | 2 +- system/drivers/DB_driver.php | 2 +- system/helpers/date_helper.php | 2 +- system/helpers/text_helper.php | 2 +- system/libraries/Email.php | 4 ++-- system/libraries/Image_lib.php | 2 +- system/libraries/Log.php | 6 ++--- system/libraries/Output.php | 2 +- system/libraries/Pagination.php | 2 +- system/libraries/Router.php | 14 ++++++++--- system/libraries/Session.php | 2 +- system/libraries/Trackback.php | 4 ++-- system/libraries/URI.php | 4 ++-- system/libraries/Validation.php | 8 +++---- user_guide/general/changelog.html | 2 ++ user_guide/general/controllers.html | 36 ++++++++++++++++++++++++++++- 18 files changed, 81 insertions(+), 30 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 1f7850ec..5c3d19b7 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -192,13 +192,20 @@ { $method = 'index'; } - - if ( ! method_exists($CI, $method)) + + if (method_exists($CI, '_remap')) { - show_404(); + $CI->_remap($method); } + else + { + if ( ! method_exists($CI, $method)) + { + show_404(); + } - $CI->$method(); + $CI->$method(); + } } /* diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index d5bec77f..1b190e20 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -175,7 +175,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) $config['log_threshold'], $config['log_date_format'] ); - } + } $LOG->write_log($level, $message, $php_error); } diff --git a/system/drivers/DB_active_record.php b/system/drivers/DB_active_record.php index f1995c80..1320af9e 100644 --- a/system/drivers/DB_active_record.php +++ b/system/drivers/DB_active_record.php @@ -790,7 +790,7 @@ function _compile_select() } } - if (ctype_digit($this->ar_limit)) + if (is_numeric($this->ar_limit)) { $sql .= "\n"; $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php index 0c2084ad..5fcb04a0 100644 --- a/system/drivers/DB_driver.php +++ b/system/drivers/DB_driver.php @@ -352,7 +352,7 @@ function last_query() */ function escape($str) { - if ( ! ctype_digit($str)) // bug fix to ensure that numbers are not treated as strings. + if ( ! is_numeric($str)) // bug fix to ensure that numbers are not treated as strings. { switch (gettype($str)) { diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index c8205bb7..ab3a3186 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -223,7 +223,7 @@ function days_in_month($month = 0, $year = '') return 0; } - if ( ! ctype_digit($year) OR strlen($year) != 4) + if ( ! is_numeric($year) OR strlen($year) != 4) { $year = date('Y'); } diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 15b5573b..e4f816eb 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -333,7 +333,7 @@ function highlight_phrase($str, $phrase, $tag_open = '', $tag_close = '< */ function word_wrap($str, $chars = '76') { - if ( ! ctype_digit($chars)) + if ( ! is_numeric($chars)) $chars = 76; $str = preg_replace("/(\r\n|\r|\n)/", "\n", $str); diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 96dc0014..abc77a54 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -275,7 +275,7 @@ function cc($cc) */ function bcc($bcc, $limit = '') { - if ($limit != '' && ctype_digit($limit)) + if ($limit != '' && is_numeric($limit)) { $this->bcc_batch_mode = true; $this->bcc_batch_size = $limit; @@ -475,7 +475,7 @@ function set_protocol($protocol = 'mail') */ function set_priority($n = 3) { - if ( ! ctype_digit($n)) + if ( ! is_numeric($n)) { $this->priority = 3; return; diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 854f0484..18e3253f 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -291,7 +291,7 @@ function initialize($props = array()) // Set the quality $this->quality = trim(str_replace("%", "", $this->quality)); - if ($this->quality == '' OR $this->quality == 0 OR ! ctype_digit($this->quality)) + if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) $this->quality = 90; // Set the x/y coordinates diff --git a/system/libraries/Log.php b/system/libraries/Log.php index de5a9b83..6c78316f 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -43,13 +43,13 @@ class CI_Log { function CI_Log($path = '', $threshold = 4, $date_fmt = '') { $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; - + if ( ! is_dir($this->log_path) OR ! is_writable($this->log_path)) { $this->_enabled = FALSE; } - if (ctype_digit($threshold)) + if (is_numeric($threshold)) { $this->_threshold = $threshold; } @@ -77,7 +77,7 @@ function CI_Log($path = '', $threshold = 4, $date_fmt = '') function write_log($level = 'error', $msg, $php_error = FALSE) { if ($this->_enabled === FALSE) - { + { return FALSE; } diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 73f03863..7a03cf9c 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -78,7 +78,7 @@ function set_output($output) */ function cache($time) { - $this->cache_expiration = ( ! ctype_digit($time)) ? 0 : $time; + $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; } // -------------------------------------------------------------------- diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 0bbb577a..9d558f00 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -128,7 +128,7 @@ function create_links() $this->cur_page = $obj->uri->segment($this->uri_segment); } - if ( ! ctype_digit($this->cur_page)) + if ( ! is_numeric($this->cur_page)) { $this->cur_page = 0; } diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 2219f573..1c67113f 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -219,15 +219,23 @@ function _validate_segments($segments) { return $segments; } - + // Is the controller in a sub-folder? if (is_dir(APPPATH.'controllers/'.$segments['0'])) - { + { // Set the directory and remove it from the segment array $this->set_directory($segments['0']); $segments = array_slice($segments, 1); - if (count($segments) == 0) + if (count($segments) > 0) + { + // Does the requested controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments['0'].EXT)) + { + show_404(); + } + } + else { $this->set_class($this->default_controller); $this->set_method('index'); diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 4f08cf69..94efee55 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -99,7 +99,7 @@ function sess_run() */ $expiration = $this->object->config->item('sess_expiration'); - if (ctype_digit($expiration)) + if (is_numeric($expiration)) { if ($expiration > 0) { diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 583c6d28..8f9680d4 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -368,7 +368,7 @@ function get_id($url) $tb_array = explode('/', $url); $tb_end = $tb_array[count($tb_array)-1]; - if ( ! ctype_digit($tb_end)) + if ( ! is_numeric($tb_end)) { $tb_end = $tb_array[count($tb_array)-2]; } @@ -386,7 +386,7 @@ function get_id($url) $tb_array = explode('/', $url); $tb_id = $tb_array[count($tb_array)-1]; - if ( ! ctype_digit($tb_id)) + if ( ! is_numeric($tb_id)) { $tb_id = $tb_array[count($tb_array)-2]; } diff --git a/system/libraries/URI.php b/system/libraries/URI.php index c5fd4625..ba6279e8 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -88,7 +88,7 @@ function segment($n, $no_result = FALSE) */ function uri_to_assoc($n = 3, $default = array()) { - if ( ! ctype_digit($n)) + if ( ! is_numeric($n)) { return $default; } @@ -110,7 +110,7 @@ function uri_to_assoc($n = 3, $default = array()) { $retval[$val] = FALSE; } - return $default; + return $retval; } $segments = array_slice($this->segment_array(), ($n - 1)); diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 30faa85e..44f49ff6 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -404,7 +404,7 @@ function matches($str, $field) */ function min_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -423,7 +423,7 @@ function min_length($str, $val) */ function max_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -442,7 +442,7 @@ function max_length($str, $val) */ function exact_length($str, $val) { - if ( ! ctype_digit($val)) + if ( ! is_numeric($val)) { return FALSE; } @@ -517,7 +517,7 @@ function alpha_dash($str) */ function numeric($str) { - return ( ! ctype_digit($str)) ? FALSE : TRUE; + return ( ! is_numeric($str)) ? FALSE : TRUE; } // -------------------------------------------------------------------- diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 168e72fe..370cd044 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -71,6 +71,7 @@

    Version 1.4.0

  • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
  • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
  • Added regular expressions support for routing rules.
  • +
  • Added the ability to remap function calls withing your controllers.
  • Added the ability to replace core system classes with your own classes.
  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • @@ -107,6 +108,7 @@

    Version 1.4.0

  • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
  • Fixed a couple bugs in the Unit Testing class.
  • Fixed an incorrectly named variable in the Validation class.
  • +
  • Fixed an incorrectly named variable in the URI class.
  • Fixed some MS SQL bugs.
  • Fixed some doc typos.
  • diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 4dc94cba..3ea0b61c 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -69,6 +69,7 @@

    Controllers

  • What is a Controller?
  • Hello World
  • Functions
  • +
  • Remapping Function Calls
  • Private Functions
  • Defining a Default Controller
  • Organizing Controllers into Sub-folders
  • @@ -174,10 +175,43 @@

    Functions

    You should see your new message.

    + + +

    Remapping Function Calls

    + +

    As noted above, the second segment of the URI typically determines which function in the controller gets called. +Code Igniter permits you to override this behavior through the use of the _remap() function:

    + +function _remap()
    +{
    +    // Some code here...
    +}
    + +

    Important:  If your controller contains a function named _remap(), it will always +get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called, +allowing you to define your own function routing rules.

    + +

    The overriden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:

    + +function _remap($method)
    +{
    +    if ($method == 'some_method')
    +    {
    +        $this->$method();
    +    }
    +    else
    +    {
    +        $this->default_method();
    +    }
    +}
    + + + +

    Private Functions

    -

    In some cases you may not want certain functions accessible publicly. To make a function private, simply add an +

    In some cases you may want certain functions hidden from public access. To make a function private, simply add an underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this:

    From 5e7ac0e9a4319d29fd23b5525aef05ad28ff0706 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Sep 2006 18:29:51 +0000 Subject: [PATCH 0032/2544] --- system/drivers/DB_postgre.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index 673dea33..f0be3c0b 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -174,7 +174,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table.""); + $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); if ($query->num_rows() == 0) return '0'; @@ -216,7 +216,6 @@ function error_number() * * This function adds backticks if the table name has a period * in it. Some DBs will get cranky unless periods are escaped. - * NOT NEEDED FOR POSTGRE * * @access public * @param string the table name @@ -224,12 +223,10 @@ function error_number() */ function escape_table($table) { - /* if (stristr($table, '.')) { - $table = preg_replace("/\./", "`.`", $table); + $table = '"'.preg_replace("/\./", '"."', $table).'"'; } - */ return $table; } From 2e825884e53da33db143d71ff64deb204e041962 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Sep 2006 18:34:32 +0000 Subject: [PATCH 0033/2544] --- user_guide/general/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 370cd044..5c721d1f 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -65,7 +65,7 @@

    Change Log

    Version 1.4.0

    -

    Release Date: September 01, 2006

    +

    Release Date: September 03, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • From e6ed3d965a3148327302e6f6a22ea38a141d4be9 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Sep 2006 18:38:18 +0000 Subject: [PATCH 0034/2544] --- system/application/config/database.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index 610f6081..cf91844d 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -29,29 +29,16 @@ | */ -$active_group = "test"; +$active_group = "default"; $db['default']['hostname'] = "localhost"; -$db['default']['username'] = "root"; +$db['default']['username'] = ""; $db['default']['password'] = ""; -$db['default']['database'] = "ellislab"; +$db['default']['database'] = ""; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = FALSE; $db['default']['db_debug'] = TRUE; - - -$db['test']['hostname'] = "localhost"; -$db['test']['username'] = "root"; -$db['test']['password'] = ""; -$db['test']['database'] = "tester"; -$db['test']['dbdriver'] = "mysql"; -$db['test']['dbprefix'] = ""; -$db['test']['active_r'] = TRUE; -$db['test']['pconnect'] = FALSE; -$db['test']['db_debug'] = TRUE; - - ?> \ No newline at end of file From 6cd2ee9a7aa926b607922d933abc3f21b9e3868e Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 4 Sep 2006 07:11:16 +0000 Subject: [PATCH 0035/2544] --- system/libraries/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Config.php b/system/libraries/Config.php index f7f813f8..532f70d4 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -208,12 +208,12 @@ function site_url($uri = '') if ($uri == '') { - return $this->item('base_url', 1).$this->item('index_page'); + return $this->slash_item('base_url').$this->item('index_page'); } else { $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); - return $this->item('base_url', 1).$this->item('index_page', 1).preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; + return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; } } // END site_url() From d7bb13b67294da6f0e0accccf6f992465665c149 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 4 Sep 2006 07:13:05 +0000 Subject: [PATCH 0036/2544] --- system/language/english/validation_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/language/english/validation_lang.php b/system/language/english/validation_lang.php index 326fe557..580ce297 100644 --- a/system/language/english/validation_lang.php +++ b/system/language/english/validation_lang.php @@ -7,7 +7,8 @@ $lang['min_length'] = "The %s field must be at least %s characters in length."; $lang['max_length'] = "The %s field can not exceed %s characters in length."; $lang['exact_length'] = "The %s field must be exactly %s characters in length."; -$lang['alpha'] = "The %s field may only contain alpha-numeric characters."; +$lang['alpha'] = "The %s field may only contain alphabetical characters."; +$lang['alpha_numeric'] = "The %s field may only contain alpha-numeric characters."; $lang['alpha_dash'] = "The %s field may only contain alpha-numeric characters, underscores, and dashes."; $lang['numeric'] = "The %s field must contain a number."; $lang['matches'] = "The %s field does not match the %s field."; From 813711e6ddfa347fd0d74c109c14fe10a919f668 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 4 Sep 2006 07:13:57 +0000 Subject: [PATCH 0037/2544] --- system/libraries/Config.php | 2 +- system/libraries/Router.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 532f70d4..108c94ab 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -229,7 +229,7 @@ function site_url($uri = '') function system_url() { $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); - return $this->item('base_url', 1).end($x).'/'; + return $this->slash_item('base_url').end($x).'/'; } // END system_url() diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 1c67113f..c7e855a7 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -312,12 +312,12 @@ function _parse_routes() $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); // Does the RegEx match? - if (preg_match('|^'.$key.'$|', $uri)) + if (preg_match('#^'.preg_quote($key).'$#', $uri)) { // Do we have a back-reference? if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) { - $val = preg_replace('|^'.$key.'$|', $val, $uri); + $val = preg_replace('#^'.preg_quote($key).'$#', $val, $uri); } $this->_compile_segments(explode('/', $val)); From eb2b8199fe2d2f7728e0c88fd68f6e712aba8951 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 4 Sep 2006 07:19:25 +0000 Subject: [PATCH 0038/2544] --- user_guide/general/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 5c721d1f..899896a1 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -109,6 +109,7 @@

      Version 1.4.0

    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • +
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.
    From e3817a3d5edcca29e21b3c2f4292abae80070b2b Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 Sep 2006 03:30:46 +0000 Subject: [PATCH 0039/2544] --- user_guide/general/controllers.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 3ea0b61c..13a007aa 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -255,9 +255,15 @@

    Organizing Your Controllers into Sub-folders

    www.your-site.com/index.php/products/shoes/123 +

    Each of your sub-folders may contain a default controller which will be +called if the URL contains only the sub-folder. Simply name your default controller as specified in your +application/config/routes.php file

    + +

    Code Igniter also permits you to remap your URIs using its URI Routing feature. +

    Class Constructors

    From 27818494dca469e96709fd9c54ba8f8461d88714 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 Sep 2006 03:31:28 +0000 Subject: [PATCH 0040/2544] --- system/libraries/Router.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index c7e855a7..de1a6e9a 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -239,8 +239,14 @@ function _validate_segments($segments) { $this->set_class($this->default_controller); $this->set_method('index'); - $this->directory = ''; - return array(); + + // Does the default controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT)) + { + $this->directory = ''; + return array(); + } + } return $segments; From ddd0c7dff8e8d422f72c91c43e8a3a0a24c4c408 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 Sep 2006 04:05:33 +0000 Subject: [PATCH 0041/2544] --- user_guide/libraries/file_uploading.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 7fabb095..071ad1f1 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -323,11 +323,17 @@

    Function Reference

    $this->upload->do_upload()

    -

    Performs the upload based on the preferences you've set. Note: The upload routine expects the file to come from a form field +

    Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field called userfile, and the form must be a "multipart type:

    <form method="post" action="some_action" enctype="multipart/form-data" /> +

    If you would like to set your own field name simply pass its value to the do_upload function:

    + + +$field_name = "some_field_name";
    +$this->upload->do_upload($field_name)
    +

    $this->upload->display_errors()

    From 4cdd137a1d6d54e24058b35533f6d6df37856aa2 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 Sep 2006 04:07:02 +0000 Subject: [PATCH 0042/2544] --- user_guide/general/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 899896a1..eebd9127 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -79,6 +79,7 @@

    Version 1.4.0

  • Added support for changing the port number in the Postgre driver.
  • Moved the list of "allowed URI characters" out of the Router class and into the config file.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
  • +
  • Updated the Upload class to allow the upload field name to be set when calling do_upload().
  • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
  • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
  • Updated the form_open() helper to allow the GET method to be used.
  • From 73e582fbd7d7f6cdcf7f18b31b4b96ecb7c4141f Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 01:36:34 +0000 Subject: [PATCH 0043/2544] --- system/helpers/security_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 918e4ae9..f14ba72a 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -50,7 +50,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * @param string * @return string */ -function hash($str, $type = 'sha1') +function dohash($str, $type = 'sha1') { if ($type == 'sha1') { From 5ffcde80fe0c37015c5383da6e53389ad6f4d6f0 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 01:41:48 +0000 Subject: [PATCH 0044/2544] --- user_guide/helpers/security_helper.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 7649fe77..2fc8f6dc 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -80,14 +80,14 @@

    xss_clean()

    Input class. More info can be found there.

    -

    hash()

    +

    dohash()

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    -$str = hash($str); // SHA1
    +$str = dohash($str); // SHA1

    -$str = hash($str, 'md5'); // MD5 +$str = dohash($str, 'md5'); // MD5
    From 1066dcb279e26de29fd663d61957dfcd1f939f9a Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 01:55:56 +0000 Subject: [PATCH 0045/2544] --- system/drivers/DB_postgre.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index f0be3c0b..aa7ec702 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -154,7 +154,35 @@ function affected_rows() */ function insert_id() { - return pg_last_oid($this->result_id); + $v = pg_version($this->conn_id); + $v = $v['server']; + + $table = func_num_args() > 0 ? func_get_arg(0) : null; + $column = func_num_args() > 1 ? func_get_arg(1) : null; + + if ($table == null && $v >= '8.1') + { + $sql='SELECT LASTVAL() as ins_id'; + } + elseif ($table != null && $column != null && $v >= '8.0') + { + $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); + $query = $this->query($sql); + $row = $query->row(); + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); + } + elseif ($table != null) + { + // seq_name passed in table parameter + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); + } + else + { + return pg_last_oid($this->result_id); + } + $query = $this->query($sql); + $row = $query->row(); + return $row->ins_id; } // -------------------------------------------------------------------- From fdd928182d6691ed2073f6f3a90427157007f54b Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 01:57:41 +0000 Subject: [PATCH 0046/2544] --- system/drivers/DB_odbc.php | 69 +++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/system/drivers/DB_odbc.php b/system/drivers/DB_odbc.php index 50f39acc..a5a8db64 100644 --- a/system/drivers/DB_odbc.php +++ b/system/drivers/DB_odbc.php @@ -445,9 +445,16 @@ function field_data() */ function _fetch_assoc() { - return odbc_fetch_array($this->result_id); + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_array($this->result_id); + } + else + { + return $this->_odbc_fetch_array($this->result_id); + } } - + // -------------------------------------------------------------------- /** @@ -460,9 +467,63 @@ function _fetch_assoc() */ function _fetch_object() { - return odbc_fetch_object($this->result_id); + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_object($this->result_id); + } + else + { + return $this->_odbc_fetch_object($this->result_id); + } } - + + + /** + * Result - object + * + * subsititutes the odbc_fetch_object function when + * not available (odbc_fetch_object requires unixODBC) + * + * @access private + * @return object + */ + + function _odbc_fetch_object(& $odbc_result) { + $rs = array(); + $rs_obj = false; + if (odbc_fetch_into($odbc_result, $rs)) { + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_obj->$field_name = $v; + } + } + return $rs_obj; + } + + + /** + * Result - array + * + * subsititutes the odbc_fetch_array function when + * not available (odbc_fetch_array requires unixODBC) + * + * @access private + * @return array + */ + + function _odbc_fetch_array(& $odbc_result) { + $rs = array(); + $rs_assoc = false; + if (odbc_fetch_into($odbc_result, $rs)) { + $rs_assoc=array(); + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_assoc[$field_name] = $v; + } + } + return $rs_assoc; + } + } ?> \ No newline at end of file From 4d07c1528873d70efcb6fbf305a8ab930a9bc758 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 02:14:53 +0000 Subject: [PATCH 0047/2544] --- system/helpers/url_helper.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 09169e32..6e2f7f45 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -90,7 +90,14 @@ function index_page() */ function anchor($uri = '', $title = '', $attributes = '') { - $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; + if ( ! is_array($uri)) + { + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; + } + else + { + $site_url = site_url($uri); + } if ($title == '') { From 2e5872ac0527c342e066bdc2e8facf452858dd39 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 02:32:55 +0000 Subject: [PATCH 0048/2544] --- system/libraries/Loader.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index e2467fa6..a140fb5a 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -565,15 +565,7 @@ function _ci_autoloader($autoload) { if (isset($autoload[$type])) { - if ( ! is_array($autoload[$type])) - { - $autoload[$type] = array($autoload[$type]); - } - - foreach ($autoload[$type] as $item) - { - $this->$type($item); - } + $this->$type($autoload[$type]); } } } @@ -592,20 +584,9 @@ function _ci_autoloader($autoload) */ function _ci_object_to_array($object) { - if ( ! is_object($object)) - { - return $object; - } - - $array = array(); - foreach (get_object_vars($object) as $key => $val) - { - $array[$key] = $val; - } - - return $array; + return (is_object($object)) ? get_object_vars($object) : $object; } + // END _ci_object_to_array() } -// END Loader Class ?> \ No newline at end of file From a16e88387eb0b0d56d7fab44874e63fdead19da4 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 02:48:30 +0000 Subject: [PATCH 0049/2544] --- user_guide/general/hooks.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index a780a5cd..d71ec598 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -142,6 +142,9 @@

    Hook Points

  • pre_controller
    Called immediately prior to any of your controllers being called. All base classes, routing, and security checks have been done.
  • +
  • post_controller_constructor
    +Called immediately after the controller is instantiated, but prior to any method calls happen.
  • +
  • post_controller
    Called immediately after the controller is called.
  • From eb567c702cda744b53be22206c55a960a36cb678 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Sep 2006 02:48:47 +0000 Subject: [PATCH 0050/2544] --- system/codeigniter/CodeIgniter.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 5c3d19b7..e09bf3de 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -188,6 +188,16 @@ } else { + /* + * ------------------------------------------------------ + * Is there a "post_controller_constructor" hook? + * ------------------------------------------------------ + */ + if ($EXT->_hook_exists('post_controller_constructor')) + { + $EXT->_call_hook('post_controller_constructor'); + } + if ($method == $class) { $method = 'index'; From 764672b45108814fc643be65b53b18f0b6507112 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:02:05 +0000 Subject: [PATCH 0051/2544] --- system/libraries/Hooks.php | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 389e7ac1..7ff0592f 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -66,34 +66,6 @@ function CI_Hooks() } // END CI_Hooks() - // -------------------------------------------------------------------- - - /** - * Does a given hook exist? - * - * Returns TRUE/FALSE based on whether a given hook exists - * - * @access private - * @param string - * @return bool - */ - function _hook_exists($which = '') - { - if ( ! $this->enabled) - { - return FALSE; - } - - if ( ! isset($this->hooks[$which])) - { - return FALSE; - } - - return TRUE; - } - // END hook_exists() - - // -------------------------------------------------------------------- /** @@ -107,6 +79,11 @@ function _hook_exists($which = '') */ function _call_hook($which = '') { + if ( ! $this->enabled OR ! isset($this->hooks[$which])) + { + return FALSE; + } + if (isset($this->hooks[$which][0]) AND is_array($this->hooks[$which][0])) { foreach ($this->hooks[$which] as $val) @@ -118,6 +95,8 @@ function _call_hook($which = '') { $this->_run_hook($this->hooks[$which]); } + + return TRUE; } // END hook_exists() @@ -144,7 +123,7 @@ function _run_hook($data) // ----------------------------------- // If the script being called happens to have the same - // extension call within it a loop can happen + // hook call within it a loop can happen if ($this->in_progress == TRUE) { From af436d7ceb4ea5afb96e3cbe1545ba9ace3d062a Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:02:14 +0000 Subject: [PATCH 0052/2544] --- system/codeigniter/CodeIgniter.php | 43 ++++++------------------------ 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index e09bf3de..09cdcbfb 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -66,10 +66,7 @@ * Is there a "pre_system" hook? * ------------------------------------------------------ */ -if ($EXT->_hook_exists('pre_system')) -{ - $EXT->_call_hook('pre_system'); -} +$EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ @@ -87,11 +84,7 @@ * ------------------------------------------------------ */ -if ($EXT->_hook_exists('cache_override')) -{ - $EXT->_call_hook('cache_override'); -} -else +if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache() == TRUE) { @@ -163,10 +156,7 @@ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ -if ($EXT->_hook_exists('pre_controller')) -{ - $EXT->_call_hook('pre_controller'); -} +$EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ @@ -177,11 +167,7 @@ if ($RTR->scaffolding_request === TRUE) { - if ($EXT->_hook_exists('scaffolding_override')) - { - $EXT->_call_hook('scaffolding_override'); - } - else + if ($EXT->_call_hook('scaffolding_override') === FALSE) { $CI->_ci_scaffolding(); } @@ -193,10 +179,7 @@ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ - if ($EXT->_hook_exists('post_controller_constructor')) - { - $EXT->_call_hook('post_controller_constructor'); - } + $EXT->_call_hook('post_controller_constructor'); if ($method == $class) { @@ -223,10 +206,7 @@ * Is there a "post_controller" hook? * ------------------------------------------------------ */ -if ($EXT->_hook_exists('post_controller')) -{ - $EXT->_call_hook('post_controller'); -} +$EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ @@ -234,11 +214,7 @@ * ------------------------------------------------------ */ -if ($EXT->_hook_exists('display_override')) -{ - $EXT->_call_hook('display_override'); -} -else +if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } @@ -248,10 +224,7 @@ * Is there a "post_system" hook? * ------------------------------------------------------ */ -if ($EXT->_hook_exists('post_system')) -{ - $EXT->_call_hook('post_system'); -} +$EXT->_call_hook('post_system'); /* * ------------------------------------------------------ From 349b09c2af14c79c332a6b7d5e3b653a8ad527b7 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:07:00 +0000 Subject: [PATCH 0053/2544] --- system/codeigniter/Common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 1b190e20..6d76fb09 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -38,7 +38,7 @@ */ function &_load_class($class, $instantiate = TRUE) { - static $objects; + static $objects = array(); if ( ! isset($objects[$class])) { @@ -63,7 +63,7 @@ function &_load_class($class, $instantiate = TRUE) } else { - $objects[$class] = FALSE; + $objects[$class] = TRUE; } } From 71430b4c30f01c861abe379becc670748e3b4a19 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:29:25 +0000 Subject: [PATCH 0054/2544] --- system/libraries/Router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index de1a6e9a..1dd1e542 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -318,12 +318,12 @@ function _parse_routes() $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); // Does the RegEx match? - if (preg_match('#^'.preg_quote($key).'$#', $uri)) + if (preg_match('#^'.$key.'$#', $uri)) { // Do we have a back-reference? if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) { - $val = preg_replace('#^'.preg_quote($key).'$#', $val, $uri); + $val = preg_replace('#^'.$key.'$#', $val, $uri); } $this->_compile_segments(explode('/', $val)); From 633ec3758910482863299c7122dda3c15d9758a8 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:43:32 +0000 Subject: [PATCH 0055/2544] --- system/libraries/Log.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 6c78316f..39274258 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -40,23 +40,25 @@ class CI_Log { * @param string the error threshold * @param string the date formatting codes */ - function CI_Log($path = '', $threshold = 4, $date_fmt = '') - { - $this->log_path = ($path != '') ? $path : BASEPATH.'logs/'; + function CI_Log() + { + $config =& _get_config(); + + $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; if ( ! is_dir($this->log_path) OR ! is_writable($this->log_path)) { $this->_enabled = FALSE; } - if (is_numeric($threshold)) + if (is_numeric($config['log_threshold'])) { - $this->_threshold = $threshold; + $this->_threshold = $config['log_threshold']; } - if ($date_fmt != '') + if ($config['log_date_format'] != '') { - $this->_date_fmt = $date_fmt; + $this->_date_fmt = $config['log_date_format']; } } // END CI_Log() From 43a46cc3d3d485a50c287d33ad94f044f8a6c46c Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:44:52 +0000 Subject: [PATCH 0056/2544] --- system/codeigniter/Common.php | 36 ++++------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 6d76fb09..a4531a7d 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -110,12 +110,7 @@ function &_get_config() */ function show_error($message) { - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); echo $error->show_error('An Error Was Encountered', $message); exit; } @@ -133,12 +128,7 @@ function show_error($message) */ function show_404($page = '') { - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); $error->show_404($page); exit; } @@ -163,20 +153,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) return; } - if ( ! class_exists('CI_Log')) - { - include_once(BASEPATH.'libraries/Log.php'); - } - - if ( ! is_object($LOG)) - { - $LOG = new CI_Log( - $config['log_path'], - $config['log_threshold'], - $config['log_date_format'] - ); - } - + $LOG =& _load_class('CI_Log'); $LOG->write_log($level, $message, $php_error); } @@ -209,12 +186,7 @@ function _exception_handler($severity, $message, $filepath, $line) return; } - // Send the PHP error to the log file... - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); // Should we display the error? // We'll get the current error_reporting level and add its bits From 1856f58a16da54f12414350f2e2a833d0cdd7d45 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:48:15 +0000 Subject: [PATCH 0057/2544] --- system/libraries/Output.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 7a03cf9c..9523599e 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -147,7 +147,7 @@ function _write_cache($output) return; } - $uri = $obj->config->slash_item('base_url'). + $uri = $obj->config->item('base_url'). $obj->config->item('index_page'). $obj->uri->uri_string(); @@ -191,8 +191,10 @@ function _display_cache() } // Build the file path. The file name is an MD5 hash of the full URI - $uri = $CFG->item('base_url', 1).$CFG->item('index_page').$RTR->uri_string; - + $uri = $obj->config->item('base_url'). + $obj->config->item('index_page'). + $obj->uri->uri_string(); + $filepath = $cache_path.md5($uri); if ( ! @file_exists($filepath)) From 55c11e03927b371f895d98a0b533f69cac246b07 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:50:51 +0000 Subject: [PATCH 0058/2544] --- system/application/config/mimes.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/application/config/mimes.php b/system/application/config/mimes.php index 06bfcc67..b09cc196 100644 --- a/system/application/config/mimes.php +++ b/system/application/config/mimes.php @@ -52,7 +52,6 @@ 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', 'zip' => array('application/zip', 'application/x-zip-compressed'), - 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mpga' => 'audio/mpeg', From dac65764e5ead0bcc9e7fcb2477926d7a2c1dc95 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 17 Sep 2006 18:05:43 +0000 Subject: [PATCH 0059/2544] --- system/libraries/Validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 44f49ff6..e4fd3669 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -187,7 +187,7 @@ function run() $ex = explode('|', $rules); // Is the field required? If not, if the field is blank we'll move on to the next text - if ( ! in_array('required', $ex)) + if ( ! in_array('required', $ex) AND strpos($rules, 'callback_') === FALSE) { if ( ! isset($_POST[$field]) OR $_POST[$field] == '') { From c47289a3196587361ac5fbbd8acd216b1ba0b8dc Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 17 Sep 2006 18:09:42 +0000 Subject: [PATCH 0060/2544] --- user_guide/libraries/unit_testing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 182e29e3..c1109613 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -185,7 +185,7 @@

    Creating a Template

    $this->unit->set_template($str);
    - +

    Note: Your template must be declared before running the unit test process.

    From f6d823ee041caab303a7aba6ecd8c358c6970113 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 17 Sep 2006 18:10:57 +0000 Subject: [PATCH 0061/2544] --- system/libraries/Unit_test.php | 4 ++-- user_guide/general/changelog.html | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index bf50350a..b2f4bf8c 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -223,9 +223,9 @@ function result($results = array()) * @params string * @return void */ - function set_template($tempalte) + function set_template($template) { - $this->_template = $tempalte; + $this->_template = $template; } // -------------------------------------------------------------------- diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index eebd9127..b8a399c3 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -71,7 +71,7 @@

    Version 1.4.0

  • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
  • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
  • Added regular expressions support for routing rules.
  • -
  • Added the ability to remap function calls withing your controllers.
  • +
  • Added the ability to remap function calls within your controllers.
  • Added the ability to replace core system classes with your own classes.
  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • @@ -111,6 +111,7 @@

    Version 1.4.0

  • Fixed an incorrectly named variable in the Validation class.
  • Fixed an incorrectly named variable in the URI class.
  • Fixed a bug in the config class that was preventing the base URL from being called properly.
  • +
  • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
  • Fixed some MS SQL bugs.
  • Fixed some doc typos.
  • From b68745e494773bce023c9a7eaca672e32beb1a47 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 17 Sep 2006 18:13:34 +0000 Subject: [PATCH 0062/2544] --- system/drivers/DB_mysqli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php index fadcdd3c..8bea6044 100644 --- a/system/drivers/DB_mysqli.php +++ b/system/drivers/DB_mysqli.php @@ -451,7 +451,7 @@ function field_data() $F->type = $field->type; $F->default = $field->def; $F->max_length = $field->max_length; - $F->primary_key = 0; + $F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0; $retval[] = $F; } From 990e3c6c79f68a396cd39fc99e798bc4333a3afc Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 17 Sep 2006 18:47:00 +0000 Subject: [PATCH 0063/2544] --- user_guide/general/changelog.html | 1 + user_guide/libraries/sessions.html | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index b8a399c3..92caa699 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -112,6 +112,7 @@

    Version 1.4.0

  • Fixed an incorrectly named variable in the URI class.
  • Fixed a bug in the config class that was preventing the base URL from being called properly.
  • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
  • +
  • Fixed a problem that was prevenging scaffolding from working properly with MySQLi.
  • Fixed some MS SQL bugs.
  • Fixed some doc typos.
  • diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 1050e110..f8549a5c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -183,7 +183,7 @@

    Saving Session Data to a Database

    be updated, they can only be generated when a new session is created.

    In order to store sessions, you must first create a database table for this purpose. Here is the basic -prototype required by the session class:

    +prototype (for MySQL) required by the session class:

    + + +

    The Trackback specification only requires four pieces of information to be sent in a Trackback (url, title, excerpt, blog_name), +but to make the data more useful we've added a few more fields in the above table schema (date, IP address, etc.).

    + +

    Processing a Trackback

    + +

    Here is an example showing how you will receive and process a Trackback. The following +code is intended for use within the controller function where you expect to receive Trackbacks.

    + +$this->load->library('trackback');
    +$this->load->database();
    +
    +if ($this->uri->segment(3) == FALSE)
    +{
    +    $this->trackback->send_error("Unable to determine the entry ID");
    +}
    +
    +if ( ! $this->trackback->receive())
    +{
    +    $this->trackback->send_error("The Trackback did not contain valid data");
    +}
    +
    +$data = array(
    +                'tb_id'      => '',
    +                'entry_id'   => $this->uri->segment(3),
    +                'url'        => $this->trackback->data('url'),
    +                'title'      => $this->trackback->data('title'),
    +                'excerpt'    => $this->trackback->data('excerpt'),
    +                'blog_name'  => $this->trackback->data('blog_name'),
    +                'tb_date'    => time(),
    +                'ip_address' => $this->input->ip_address()
    +                );
    +
    +$sql = $this->db->insert_string('trackbacks', $data);
    +$this->db->query($sql);
    +
    +$this->trackback->send_success();
    + +

    Notes:

    + +

    The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:

    + +http://www.your-site.com/index.php/trackback/receive/entry_id + +

    Notice the entry_id is in the third URI, which you can retrieve using:

    + +$this->uri->segment(3); + +

    In our Trackback receiving code above, if the third segment is missing, we will issue an error. Without a valid entry ID, there's no +reason to continue.

    + +

    The $this->trackback->receive() function is simply a validation function that looks at the incoming data +and makes sure it contains the four pieces of data that are required (url, title, excerpt, blog_name). +It returns TRUE on success and FALSE on failure. If it fails you will issue an error message.

    + +

    The incoming Trackback data can be retrieved using this function:

    + +$this->trackback->data('item') + +

    Where item represents one of these four pieces of info: url, title, excerpt, or blog_name

    + +

    If the Trackback data is successfully received, you will issue a success message using:

    + +$this->trackback->send_success(); + +

    Note: The above code contains no data validation, which you are encouraged to add.

    + + + + + +
    + + + + + + + \ No newline at end of file From a39627655aefb65df1e2cc845bd6ebf3d0a40a72 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 03:31:32 +0000 Subject: [PATCH 0300/2544] --- user_guide/libraries/table.html | 169 ++------------------------------ 1 file changed, 6 insertions(+), 163 deletions(-) diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 68b31165..f861a2c9 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -47,7 +47,7 @@ Code Igniter Home  ›  User Guide Home  ›  -Trackback Class +HTML Table Class Search User Guide    @@ -61,173 +61,16 @@
    -

    Trackback Class

    +

    HTML Table Class

    -

    The Trackback Class provides functions that enable you to send and receive Trackback data.

    - - -

    If you are not familiar with Trackbacks you'll find more information here.

    +

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    Initializing the Class

    -

    Like most other classes in Code Igniter, the Trackback class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('trackback'); -

    Once loaded, the Trackback library object will be available using: $this->trackback

    - - -

    Sending Trackbacks

    - -

    A Trackback can be sent from any of your controller functions using code similar to this example: - -$this->load->library('trackback');
    -
    -$tb_data = array(
    -                'ping_url'  => 'http://some-site.com/trackback/456',
    -                'url'       => 'http://www.my-site.com/blog/entry/123',
    -                'title'     => 'The Title of My Entry',
    -                'excerpt'   => 'The entry content.',
    -                'blog_name' => 'My Blog Name',
    -                'charset'   => 'utf-8'
    -                );
    -
    -if ( ! $this->trackback->send($tb_data))
    -{
    -     echo $this->trackback->display_errors();
    -}
    -else
    -{
    -     echo 'Trackback was sent!';
    -}
    - -

    Description of array data:

    - -
      -
    • ping_url - The URL of the site you are sending the Trackback to. You can send Trackbacks to multiple URLs by separating each URL with a comma.
    • -
    • url - The URL to YOUR site where the weblog entry can be seen.
    • -
    • title - The title of your weblog entry.
    • -
    • excerpt - The content of your weblog entry. Note: the Trackback class will automatically send only the first 500 characters of your entry. It will also strip all HTML.
    • -
    • blog_name - The name of your weblog.
    • -
    • charset - The character encoding your weblog is written in. If omitted, UTF-8 will be used.
    • -
    - -

    The Trackback sending function returns TRUE/FALSE (boolean) on success or failure. If it fails, you can retrieve the error message using:

    - -$this->trackback->display_errors(); - - -

    Receiving Trackbacks

    - -

    Before you can receive Trackbacks you must create a weblog. If you don't have a blog yet there's no point in continuing.

    - -

    Receiving Trackbacks is a little more complex than sending them, only because you will need a database table in which to store them, -and you will need to validate the incoming trackback data. You are encouraged to implement a thorough validation process to -guard against spam and duplicate data. You may also want to limit the number of Trackbacks you allow from a particular IP within -a given span of time to further curtail spam. The process of receiving a Trackback is quite simple; -the validation is what takes most of the effort.

    - -

    Your Ping URL

    - -

    In order to accept Trackbacks you must display a Trackback URL next to each one of your weblog entries. This will be the URL -that people will use to send you Trackbacks (we will refer to this as your "Ping URL").

    - -

    Your Ping URL must point to a controller function where your Trackback receiving code is located, and the URL -must contain the ID number for each particular entry, so that when the Trackback is received you'll be -able to associate it with a particular entry.

    - -

    For example, if your controller class is called Trackback, and the receiving function is called receive, your -Ping URLs will look something like this:

    - -http://www.your-site.com/index.php/trackback/receive/entry_id - -

    Where entry_id represents the individual ID number for each of your entries.

    - - -

    Creating a Trackback Table

    - -

    Before you can receive Trackbacks you must create a table in which to store them. Here is a basic prototype for such a table:

    - - - - -

    The Trackback specification only requires four pieces of information to be sent in a Trackback (url, title, excerpt, blog_name), -but to make the data more useful we've added a few more fields in the above table schema (date, IP address, etc.).

    - -

    Processing a Trackback

    - -

    Here is an example showing how you will receive and process a Trackback. The following -code is intended for use within the controller function where you expect to receive Trackbacks.

    - -$this->load->library('trackback');
    -$this->load->database();
    -
    -if ($this->uri->segment(3) == FALSE)
    -{
    -    $this->trackback->send_error("Unable to determine the entry ID");
    -}
    -
    -if ( ! $this->trackback->receive())
    -{
    -    $this->trackback->send_error("The Trackback did not contain valid data");
    -}
    -
    -$data = array(
    -                'tb_id'      => '',
    -                'entry_id'   => $this->uri->segment(3),
    -                'url'        => $this->trackback->data('url'),
    -                'title'      => $this->trackback->data('title'),
    -                'excerpt'    => $this->trackback->data('excerpt'),
    -                'blog_name'  => $this->trackback->data('blog_name'),
    -                'tb_date'    => time(),
    -                'ip_address' => $this->input->ip_address()
    -                );
    -
    -$sql = $this->db->insert_string('trackbacks', $data);
    -$this->db->query($sql);
    -
    -$this->trackback->send_success();
    - -

    Notes:

    - -

    The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:

    - -http://www.your-site.com/index.php/trackback/receive/entry_id - -

    Notice the entry_id is in the third URI, which you can retrieve using:

    - -$this->uri->segment(3); - -

    In our Trackback receiving code above, if the third segment is missing, we will issue an error. Without a valid entry ID, there's no -reason to continue.

    - -

    The $this->trackback->receive() function is simply a validation function that looks at the incoming data -and makes sure it contains the four pieces of data that are required (url, title, excerpt, blog_name). -It returns TRUE on success and FALSE on failure. If it fails you will issue an error message.

    - -

    The incoming Trackback data can be retrieved using this function:

    - -$this->trackback->data('item') - -

    Where item represents one of these four pieces of info: url, title, excerpt, or blog_name

    - -

    If the Trackback data is successfully received, you will issue a success message using:

    - -$this->trackback->send_success(); - -

    Note: The above code contains no data validation, which you are encouraged to add.

    +

    Like most other classes in Code Igniter, the Table class is initialized in your controller using the $this->load->library function:

    +$this->load->library('table'); +

    Once loaded, the Trackback library object will be available using: $this->table

    From 345b890d459880d0cd75315c95a47b27c35b9a2b Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 03:32:49 +0000 Subject: [PATCH 0301/2544] --- user_guide/toc.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/toc.html b/user_guide/toc.html index 88b3bd25..65bf2e16 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -132,6 +132,7 @@

    Class Reference

  • Output Class
  • Pagination Class
  • Session Class
  • +
  • Table Class
  • Trackback Class
  • Template Parser Class
  • Unit Testing Class
  • From 6c9f736650bd9eafb2c44bb844f13de259d5efb6 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 03:33:48 +0000 Subject: [PATCH 0302/2544] --- system/libraries/Calendar.php | 42 +++---- system/libraries/User_agent.php | 178 ++++++++++++++++++++++++++-- user_guide/libraries/trackback.html | 4 +- user_guide/libraries/uri.html | 2 +- user_guide/nav/nav.js | 1 + 5 files changed, 193 insertions(+), 34 deletions(-) diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 23a6bf79..048934b8 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -398,27 +398,27 @@ function get_total_days($month, $year) function default_template() { return array ( - 'table_open' => '', - 'heading_row_start' => '', - 'heading_previous_cell' => '', - 'heading_title_cell' => '', - 'heading_next_cell' => '', - 'heading_row_end' => '', - 'week_row_start' => '', - 'week_day_cell' => '', - 'week_row_end' => '', - 'cal_row_start' => '', - 'cal_cell_start' => '', - 'cal_cell_end_today' => '', - 'cal_row_end' => '', - 'table_close' => '
    <<{heading}>>
    {week_day}
    ', - 'cal_cell_start_today' => '', - 'cal_cell_content' => '{day}', - 'cal_cell_content_today' => '{day}', - 'cal_cell_no_content' => '{day}', - 'cal_cell_no_content_today' => '{day}', - 'cal_cell_blank' => ' ', - 'cal_cell_end' => '
    ' + 'table_open' => '', + 'heading_row_start' => '', + 'heading_previous_cell' => '', + 'heading_title_cell' => '', + 'heading_next_cell' => '', + 'heading_row_end' => '', + 'week_row_start' => '', + 'week_day_cell' => '', + 'week_row_end' => '', + 'cal_row_start' => '', + 'cal_cell_start' => '', + 'cal_cell_end_today' => '', + 'cal_row_end' => '', + 'table_close' => '
    <<{heading}>>
    {week_day}
    ', + 'cal_cell_start_today' => '', + 'cal_cell_content' => '{day}', + 'cal_cell_content_today' => '{day}', + 'cal_cell_no_content' => '{day}', + 'cal_cell_no_content_today' => '{day}', + 'cal_cell_blank' => ' ', + 'cal_cell_end' => '
    ' ); } diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 33e8451c..8c63924b 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -33,6 +33,9 @@ class CI_User_agent { var $is_browser = FALSE; var $is_robot = FALSE; var $is_mobile = FALSE; + + var $languages = array(); + var $charsets = array(); var $platform = ''; var $browser = ''; @@ -40,7 +43,6 @@ class CI_User_agent { var $moble = ''; var $robot = ''; - var $platforms = array ( 'windows nt 6.0' => 'Windows Longhorn', 'windows nt 5.2' => 'Windows 2003', @@ -55,12 +57,13 @@ class CI_User_agent { 'windows 95' => 'Windows 95', 'win95' => 'Windows 95', 'windows' => 'Unknown Windows OS', - 'mac os x' => 'Mac OS X', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', 'freebsd' => 'FreeBSD', 'ppc' => 'Macintosh', - 'sunos' => 'Sun Solaris', 'linux' => 'Linux', 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', 'beos' => 'BeOS', 'apachebench' => 'ApacheBench', 'aix' => 'AIX', @@ -80,12 +83,21 @@ class CI_User_agent { 'Internet Explorer' => 'Internet Explorer', 'Shiira' => 'Shiira', 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', 'Mozilla' => 'Mozilla', 'Safari' => 'Safari', 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', 'Lynx' => 'Lynx', - 'ANTFresco' => 'Fresco' + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' ); var $mobiles = array( @@ -488,7 +500,7 @@ function _set_browser() return FALSE; } - + // -------------------------------------------------------------------- /** @@ -535,6 +547,51 @@ function _set_mobile() return FALSE; } + // -------------------------------------------------------------------- + + /** + * Set the accepted languages + * + * @access private + * @return void + */ + function _set_languages() + { + if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') + { + $languages = preg_replace('/(;q=.+)/i', '', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + + $this->languages = explode(',', $languages); + } + + if (count($this->languages) == 0) + { + $this->languages = array('Undefined'); + } + } + + // -------------------------------------------------------------------- + + /** + * Set the accepted character sets + * + * @access private + * @return void + */ + function _set_charsets() + { + if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') + { + $charsets = preg_replace('/(;q=.+)/i', '', $_SERVER['HTTP_ACCEPT_CHARSET']); + + $this->charsets = explode(',', $charsets); + } + + if (count($this->charsets) == 0) + { + $this->charsets = array('Undefined'); + } + } // -------------------------------------------------------------------- @@ -577,13 +634,39 @@ function is_mobile() // -------------------------------------------------------------------- + /** + * Is this a referral from another site? + * + * @access public + * @return bool + */ + function is_referral() + { + return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Agent String + * + * @access public + * @return string + */ + function agent() + { + return $this->agent; + } + + // -------------------------------------------------------------------- + /** * Get Platform * * @access public * @return string */ - function get_platform() + function platform() { return $this->platform; } @@ -596,7 +679,7 @@ function get_platform() * @access public * @return string */ - function get_browser() + function browser() { return $this->browser; } @@ -609,7 +692,7 @@ function get_browser() * @access public * @return string */ - function get_version() + function version() { return $this->version; } @@ -622,7 +705,7 @@ function get_version() * @access public * @return string */ - function get_robot() + function robot() { return $this->robot; } @@ -634,11 +717,86 @@ function get_robot() * @access public * @return string */ - function get_mobile() + function mobile() { return $this->mobile; } + // -------------------------------------------------------------------- + + /** + * Get the referrer + * + * @access public + * @return bool + */ + function referrer() + { + return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : $_SERVER['HTTP_REFERER']; + } + + // -------------------------------------------------------------------- + + /** + * Get the accepted languages + * + * @access public + * @return array + */ + function languages() + { + if (count($this->languages) == 0) + { + $this->_set_languages(); + } + + return $this->languages; + } + + // -------------------------------------------------------------------- + + /** + * Get the accepted Character Sets + * + * @access public + * @return array + */ + function charsets() + { + if (count($this->charsets) == 0) + { + $this->_set_charsets(); + } + + return $this->charsets; + } + + // -------------------------------------------------------------------- + + /** + * Test for a particular language + * + * @access public + * @return bool + */ + function accept_lang($lang = 'en') + { + return (in_array(strtolower($lang), $this->languages(), TRUE)) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Test for a particular character set + * + * @access public + * @return bool + */ + function accept_charset($charset = 'utf-8') + { + return (in_array(strtolower($charset), $this->charsets(), TRUE)) ? TRUE : FALSE; + } + } diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index c2c9e815..0621d4e7 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -238,11 +238,11 @@

    Notes:

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 8d2f2ee3..e221f4c6 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -249,7 +249,7 @@

    $this->uri->rsegment_array(n)

       ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Validation Class +Next Topic:  User Agent Class

    Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

    diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index 8d195572..b280e8fc 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -78,6 +78,7 @@ function create_menu(basepath) '
  • Output Class
  • ' + '
  • Pagination Class
  • ' + '
  • Session Class
  • ' + + '
  • Table Class
  • ' + '
  • Trackback Class
  • ' + '
  • Template Parser Class
  • ' + '
  • Unit Testing Class
  • ' + From a1931ad87e8145f08dbf381ceab5bf88457b1a83 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 04:17:38 +0000 Subject: [PATCH 0303/2544] --- system/libraries/Table.php | 11 +-- user_guide/libraries/table.html | 138 +++++++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 10 deletions(-) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 935a7d8a..4771295a 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -61,7 +61,7 @@ function set_template($template) // -------------------------------------------------------------------- /** - * Add a table heading + * Set the table heading * * Can be passed as an array or discreet params * @@ -69,7 +69,7 @@ function set_template($template) * @param mixed * @return void */ - function add_heading() + function set_heading() { $args = func_get_args(); $this->heading = (is_array($args[0])) ? $args[0] : $args; @@ -313,12 +313,7 @@ function _default_template() 'table_close' => '' ); } - - - - - - + } diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index f861a2c9..e80e53fd 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -70,9 +70,143 @@

    Initializing the Class

    Like most other classes in Code Igniter, the Table class is initialized in your controller using the $this->load->library function:

    $this->load->library('table'); -

    Once loaded, the Trackback library object will be available using: $this->table

    - +

    Once loaded, the Table library object will be available using: $this->table

    + + +

    Examples

    + +

    Here is an example showing how you can create a table from a multi-dimensional array. +Note that the first array index will become the table heading.

    + + +$this->load->library('table');
    +
    +$data = array(
    +             array('Name', 'Color', 'Size'),
    +             array('Fred', 'Blue', 'Small'),
    +             array('Mary', 'Red', 'Large'),
    +             array('John', 'Green', 'Medium')
    +             );
    +
    +echo $this->table->generate($data); +
    + +

    Here is an example of a table created from a database query result. The table class will automatically generate the +headings based on the table names. Or you can set your own headings using the set_heading() function described +in the function reference below.

    + + +$this->load->library('table');
    +
    +$query = $this->db->query("SELECT * FROM my_table");
    +
    +echo $this->table->generate($query); +
    + + +

    Here is an example showing how you might create a table using discreet parameters:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading('Name', 'Color', 'Size');
    +
    +$this->table->add_row('Fred', 'Blue', 'Small');
    +$this->table->add_row('Mary', 'Red', 'Large');
    +$this->table->add_row('John', 'Green', 'Medium');
    +
    +echo $this->table->generate(); +
    + +

    Here is the same example, except instead of individual parameters, arrays are used: + + +$this->load->library('table');
    +
    +$this->table->set_heading(array('Name', 'Color', 'Size'));
    +
    +$this->table->add_row(array('Fred', 'Blue', 'Small'));
    +$this->table->add_row(array('Mary', 'Red', 'Large'));
    +$this->table->add_row(array('John', 'Green', 'Medium'));
    +
    +echo $this->table->generate(); +
    + + +

    Changing the Look of Your Table

    + +

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template +prototype:

    + + +$tmpl = array (
    +                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',
    +
    +                    'heading_row_start'   => '<tr>',
    +                    'heading_row_end'     => '</tr>',
    +                    'heading_cell_start'  => '<th>',
    +                    'heading_cell_end'    => '</th>',
    +
    +                    'row_start'           => '<tr>',
    +                    'row_end'             => '</tr>',
    +                    'cell_start'          => '<td>',
    +                    'cell_end'            => '</td>',
    +
    +                    'row_alt_start'       => '<tr>',
    +                    'row_alt_end'         => '</tr>',
    +                    'cell_alt_start'      => '<td>',
    +                    'cell_alt_end'        => '</td>',
    +
    +                    'table_close'         => '</table>'
    +              );
    + +
    +$this->table->set_template($tmpl); +
    + +

    You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each +iteration of the row data.

    + +

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. +In this example, only the table opening tag is being changed:

    + + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    + +
    +

    Function Reference

    + +

    $this->table->generate()

    +

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    + +

    $this->table->set_heading()

    + +

    Permits you to set the table heading. You can submit an array or discreet params:

    + +$this->table->set_heading('Name', 'Color', 'Size'); +$this->table->set_heading(array('Name', 'Color', 'Size')); + +

    $this->table->add_row()

    + +

    Permits you to add a row to your table. You can submit an array or discreet params:

    + +$this->table->add_row('Blue', 'Red', 'Green'); +$this->table->add_row(array('Blue', 'Red', 'Green')); + +

    $this->table->set_template()

    + +

    Permits you to set your template. You can submit a full or partial template.

    + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    From b3ad05ccbc2c0ad24c9af16f7f4d48bf59c71a11 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 17:25:46 +0000 Subject: [PATCH 0304/2544] --- system/application/config/user_agents.php | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 system/application/config/user_agents.php diff --git a/system/application/config/user_agents.php b/system/application/config/user_agents.php new file mode 100644 index 00000000..a799f06b --- /dev/null +++ b/system/application/config/user_agents.php @@ -0,0 +1,103 @@ + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + '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( + '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', + 'Mozilla' => 'Mozilla', + 'Safari' => 'Safari', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' + ); + +$mobiles = array( + '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' + ); + +// 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' + ); + + +?> \ No newline at end of file From 3822194cde4614137a54eecb1e1fcc86672e84a1 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 17:34:19 +0000 Subject: [PATCH 0305/2544] --- system/libraries/User_agent.php | 500 ++++++-------------------------- 1 file changed, 96 insertions(+), 404 deletions(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 8c63924b..21162388 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -43,375 +43,6 @@ class CI_User_agent { var $moble = ''; var $robot = ''; - var $platforms = array ( - 'windows nt 6.0' => 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - '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' - ); - - var $browsers = array( - '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', - 'Mozilla' => 'Mozilla', - 'Safari' => 'Safari', - 'Konqueror' => 'Konqueror', - 'icab' => 'iCab', - 'Lynx' => 'Lynx', - 'Links' => 'Links', - 'hotjava' => 'HotJava', - 'amaya' => 'Amaya', - 'IBrowse' => 'IBrowse' - ); - - var $mobiles = array( - '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' - ); - - var $robots = array( - - 'googlebot' => 'Googlebot', - 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', - 'askjeeves' => 'AskJeeves', - 'fastcrawler' => 'FastCrawler', - 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos', - 'abcdatos' => 'ABCdatos BotLink', - 'Acme.Spider' => 'Acme.Spider', - 'ahoythehomepagefinder' => 'Ahoy! The Homepage Finder', - 'Alkaline' => 'Alkaline', - 'anthill' => 'Anthill', - 'appie' => 'Walhello appie', - 'arachnophilia' => 'Arachnophilia', - 'arale' => 'Arale', - 'araneo' => 'Araneo', - 'araybot' => 'AraybOt', - 'architext' => 'ArchitextSpider', - 'aretha' => 'Aretha', - 'ariadne' => 'ARIADNE', - 'arks' => 'arks', - 'aspider' => 'ASpider (Associative Spider)', - 'atn.txt' => 'ATN Worldwide', - 'atomz' => 'Atomz.com Search Robot', - 'auresys' => 'AURESYS', - 'backrub' => 'BackRub', - 'bbot' => 'BBot', - 'bigbrother' => 'Big Brother', - 'bjaaland' => 'Bjaaland', - 'blackwidow' => 'BlackWidow', - 'blindekuh' => 'Die Blinde Kuh', - 'Bloodhound' => 'Bloodhound', - 'borg-bot' => 'Borg-Bot', - 'boxseabot' => 'BoxSeaBot', - 'brightnet' => 'bright.net caching robot', - 'bspider' => 'BSpider', - 'cactvschemistryspider' => 'CACTVS Chemistry Spider', - 'calif' => 'Calif', - 'cassandra' => 'Cassandra', - 'cgireader' => 'Digimarc Marcspider/CGI', - 'checkbot' => 'Checkbot', - 'christcrawler' => 'ChristCrawler.com', - 'churl' => 'churl', - 'cienciaficcion' => 'cIeNcIaFiCcIoN.nEt', - 'cmc' => 'CMC/0.01', - 'Collective' => 'Collective', - 'combine' => 'Combine System', - 'confuzzledbot' => 'ConfuzzledBot', - 'coolbot' => 'CoolBot', - 'core' => 'Web Core / Roots', - 'cosmos' => 'XYLEME Robot', - 'cruiser' => 'Internet Cruiser Robot', - 'cusco' => 'Cusco', - 'cyberspyder' => 'CyberSpyder Link Test', - 'cydralspider' => 'CydralSpider', - 'desertrealm' => 'Desert Realm Spider', - 'deweb' => 'DeWeb(c) Katalog/Index', - 'dienstspider' => 'DienstSpider', - 'digger' => 'Digger', - 'diibot' => 'Digital Integrity Robot', - 'directhit' => 'Direct Hit Grabber', - 'dnabot' => 'DNAbot', - 'download_express' => 'DownLoad Express', - 'dragonbot' => 'DragonBot', - 'e-collector' => 'e-collector', - 'ebiness' => 'EbiNess', - 'eit' => 'EIT Link Verifier Robot', - 'elfinbot' => 'ELFINBOT', - 'emacs' => 'Emacs-w3 Search Engine', - 'emcspider' => 'ananzi', - 'esculapio' => 'esculapio', - 'esther' => 'Esther', - 'evliyacelebi' => 'Evliya Celebi', - 'nzexplorer' => 'nzexplorer', - 'fdse' => 'Fluid Dynamics Search Engine robot', - 'felix' => 'Felix IDE', - 'ferret' => 'Wild Ferret Web Hopper #1, #2, #3', - 'fetchrover' => 'FetchRover', - 'fido' => 'fido', - 'finnish' => 'Hämähäkki', - 'fireball' => 'KIT-Fireball', - 'fish' => 'Fish search', - 'fouineur' => 'Fouineur', - 'francoroute' => 'Robot Francoroute', - 'freecrawl' => 'Freecrawl', - 'funnelweb' => 'FunnelWeb', - 'gama' => 'gammaSpider, FocusedCrawler', - 'gazz' => 'gazz', - 'gcreep' => 'GCreep', - 'getbot' => 'GetBot', - 'geturl' => 'GetURL', - 'golem' => 'Golem', - 'grapnel' => 'Grapnel/0.01 Experiment', - 'griffon' => 'Griffon ', - 'gromit' => 'Gromit', - 'gulliver' => 'Northern Light Gulliver', - 'gulperbot' => 'Gulper Bot', - 'hambot' => 'HamBot', - 'harvest' => 'Harvest', - 'havindex' => 'havIndex', - 'hi' => 'HI (HTML Index) Search', - 'hometown' => 'Hometown Spider Pro', - 'wired-digital' => 'Wired Digital', - 'htdig' => 'ht://Dig', - 'htmlgobble' => 'HTMLgobble', - 'hyperdecontextualizer' => 'Hyper-Decontextualizer', - 'iajabot' => 'iajaBot', - 'ibm' => 'IBM_Planetwide', - 'iconoclast' => 'Popular Iconoclast', - 'Ilse' => 'Ingrid', - 'imagelock' => 'Imagelock ', - 'incywincy' => 'IncyWincy', - 'informant' => 'Informant', - 'infoseeksidewinder' => 'Infoseek Sidewinder', - 'infospider' => 'InfoSpiders', - 'inspectorwww' => 'Inspector Web', - 'intelliagent' => 'IntelliAgent', - 'irobot' => 'I, Robot', - 'iron33' => 'Iron33', - 'israelisearch' => 'Israeli-search', - 'javabee' => 'JavaBee', - 'JBot' => 'JBot Java Web Robot', - 'jcrawler' => 'JCrawler', - 'jobo' => 'JoBo Java Web Robot', - 'jobot' => 'Jobot', - 'joebot' => 'JoeBot', - 'jubii' => 'The Jubii Indexing Robot', - 'jumpstation' => 'JumpStation', - 'kapsi' => 'image.kapsi.net', - 'katipo' => 'Katipo', - 'kdd' => 'KDD-Explorer', - 'kilroy' => 'Kilroy', - 'ko_yappo_robot' => 'KO_Yappo_Robot', - 'labelgrabber.txt' => 'LabelGrabber', - 'larbin' => 'larbin', - 'legs' => 'legs', - 'linkidator' => 'Link Validator', - 'linkscan' => 'LinkScan', - 'linkwalker' => 'LinkWalker', - 'lockon' => 'Lockon', - 'logo_gif' => 'logo.gif Crawler', - 'magpie' => 'Magpie', - 'marvin' => 'marvin/infoseek', - 'mattie' => 'Mattie', - 'mediafox' => 'MediaFox', - 'merzscope' => 'MerzScope', - 'meshexplorer' => 'NEC-MeshExplorer', - 'MindCrawler' => 'MindCrawler', - 'mnogosearch' => 'mnoGoSearch search engine software', - 'moget' => 'moget', - 'momspider' => 'MOMspider', - 'monster' => 'Monster', - 'motor' => 'Motor', - 'muncher' => 'Muncher', - 'muninn' => 'Muninn', - 'muscatferret' => 'Muscat Ferret', - 'mwdsearch' => 'Mwd.Search', - 'myweb' => 'Internet Shinchakubin', - 'NDSpider' => 'NDSpider', - 'netcarta' => 'NetCarta WebMap Engine', - 'netmechanic' => 'NetMechanic', - 'netscoop' => 'NetScoop', - 'newscan-online' => 'newscan-online', - 'nhse' => 'NHSE Web Forager', - 'nomad' => 'Nomad', - 'northstar' => 'The NorthStar Robot', - 'objectssearch' => 'ObjectsSearch', - 'occam' => 'Occam', - 'octopus' => 'HKU WWW Octopus', - 'OntoSpider' => 'OntoSpider', - 'openfind' => 'Openfind data gatherer', - 'orb_search' => 'Orb Search', - 'packrat' => 'Pack Rat', - 'pageboy' => 'PageBoy', - 'parasite' => 'ParaSite', - 'patric' => 'Patric', - 'pegasus' => 'pegasus', - 'perignator' => 'The Peregrinator', - 'perlcrawler' => 'PerlCrawler 1.0', - 'phantom' => 'Phantom', - 'phpdig' => 'PhpDig', - 'pitkow' => 'html_analyzer', - 'pjspider' => 'Portal Juice Spider', - 'pka' => 'PGP Key Agent', - 'poppi' => 'Poppi', - 'portalb' => 'PortalB Spider', - 'psbot' => 'psbot', - 'Puu' => 'GetterroboPlus Puu', - 'python' => 'The Python Robot', - 'raven ' => 'Raven Search', - 'rbse' => 'RBSE Spider', - 'resumerobot' => 'Resume Robot', - 'rhcs' => 'RoadHouse Crawling System', - 'rixbot' => 'RixBot', - 'roadrunner' => 'Road Runner: The ImageScape Robot', - 'robbie' => 'Robbie the Robot', - 'robi' => 'ComputingSite Robi/1.0', - 'robocrawl' => 'RoboCrawl Spider', - 'robofox' => 'RoboFox', - 'robozilla' => 'Robozilla', - 'roverbot' => 'Roverbot', - 'rules' => 'RuLeS', - 'safetynetrobot' => 'SafetyNet Robot', - 'scooter' => 'Scooter', - 'search_au' => 'Search.Aus-AU.COM', - 'search-info' => 'Sleek', - 'searchprocess' => 'SearchProcess', - 'senrigan' => 'Senrigan', - 'sgscout' => 'SG-Scout', - 'shaggy' => 'ShagSeeker', - 'sift' => 'Sift', - 'simbot' => 'Simmany Robot Ver1.0', - 'site-valet' => 'Site Valet', - 'sitetech' => 'SiteTech-Rover', - 'skymob' => 'Skymob.com', - 'slcrawler' => 'SLCrawler', - 'smartspider' => 'Smart Spider', - 'snooper' => 'Snooper', - 'solbot' => 'Solbot', - 'speedy' => 'Speedy Spider', - 'spider_monkey' => 'spider_monkey', - 'spiderbot' => 'SpiderBot', - 'spiderline' => 'Spiderline Crawler', - 'spiderman' => 'SpiderMan', - 'spiderview' => 'SpiderView(tm)', - 'spry' => 'Spry Wizard Robot', - 'ssearcher' => 'Site Searcher', - 'suke' => 'Suke', - 'suntek' => 'suntek search engine', - 'sven' => 'Sven', - 'sygol' => 'Sygol ', - 'tach_bw' => 'TACH Black Widow', - 'tarantula' => 'Tarantula', - 'tarspider' => 'tarspider', - 'tcl' => 'Tcl W3 Robot', - 'techbot' => 'TechBOT', - 'templeton' => 'Templeton', - 'titin' => 'TitIn', - 'titan' => 'TITAN', - 'tkwww' => 'The TkWWW Robot', - 'tlspider' => 'TLSpider', - 'ucsd' => 'UCSD Crawl', - 'udmsearch' => 'UdmSearch', - 'ultraseek' => 'Ultraseek', - 'uptimebot' => 'UptimeBot', - 'urlck' => 'URL Check', - 'valkyrie' => 'Valkyrie', - 'verticrawl' => 'Verticrawl', - 'victoria' => 'Victoria', - 'visionsearch' => 'vision-search', - 'voidbot' => 'void-bot', - 'voyager' => 'Voyager', - 'vwbot' => 'VWbot', - 'w3index' => 'The NWI Robot', - 'w3m2' => 'W3M2', - 'wallpaper' => 'WallPaper (alias crawlpaper)', - 'wanderer' => 'the World Wide Web Wanderer', - 'wapspider' => 'w@pSpider by wap4.com', - 'webbandit' => 'WebBandit Web Spider', - 'webcatcher' => 'WebCatcher', - 'webcopy' => 'WebCopy', - 'webfetcher' => 'webfetcher', - 'webfoot' => 'The Webfoot Robot', - 'webinator' => 'Webinator', - 'weblayers' => 'weblayers', - 'weblinker' => 'WebLinker', - 'webmirror' => 'WebMirror', - 'webmoose' => 'The Web Moose', - 'webquest' => 'WebQuest', - 'webreader' => 'Digimarc MarcSpider', - 'webreaper' => 'WebReaper', - 'webs' => 'webs', - 'websnarf' => 'Websnarf', - 'webspider' => 'WebSpider', - 'webvac' => 'WebVac', - 'webwalk' => 'webwalk', - 'webwalker' => 'WebWalker', - 'webwatch' => 'WebWatch', - 'wget' => 'Wget', - 'whatuseek' => 'whatUseek Winona', - 'whowhere' => 'WhoWhere Robot', - 'wlm' => 'Weblog Monitor', - 'wmir' => 'w3mir', - 'wolp' => 'WebStolperer', - 'wombat' => 'The Web Wombat ', - 'worm' => 'The World Wide Web Worm', - 'wwwc' => 'WWWC Ver 0.2.5', - 'wz101' => 'WebZinger', - 'xget' => 'XGET', - ); - - /** * Constructor @@ -430,8 +61,61 @@ function CI_User_agent() if ( ! is_null($this->agent)) { - $this->_compile_data(); + if ($this->_load_agent_file()) + { + $this->_compile_data(); + } + } + } + + + // -------------------------------------------------------------------- + + /** + * Compile the User Agent Data + * + * @access private + * @return bool + */ + function _load_agent_file() + { + if ( ! @include(APPPATH.'config/user_agent'.EXT)) + { + return FALSE; + } + + $return = FALSE; + + if (isset($platforms)) + { + $this->platforms = $platforms; + unset($platforms); + $return = TRUE; + } + + if (isset($browsers)) + { + $this->browsers = $browsers; + unset($browsers); + $return = TRUE; + } + + if (isset($mobiles)) + { + $this->browsers = $mobiles; + unset($mobiles); + $return = TRUE; } + + if (isset($robots)) + { + $this->robots = $robots; + unset($robots); + $return = TRUE; + } + + + return $return; } // -------------------------------------------------------------------- @@ -465,15 +149,17 @@ function _compile_data() */ function _set_platform() { - foreach ($this->platforms as $key => $val) + if (is_array($this->platforms) AND count($this->platforms) > 0) { - if (preg_match("|$key|i", $this->agent)) + foreach ($this->platforms as $key => $val) { - $this->platform = $val; - return TRUE; + if (preg_match("|".preg_quote($key)."|i", $this->agent)) + { + $this->platform = $val; + return TRUE; + } } } - $this->platform = 'Unknown Platform'; } @@ -487,17 +173,19 @@ function _set_platform() */ function _set_browser() { - foreach ($this->browsers as $key => $val) - { - if (preg_match("|".$key.".*?([0-9\.]+)|i", $this->agent, $match)) - { - $this->is_browser = TRUE; - $this->version = $match[1]; - $this->browser = $val; - return TRUE; + if (is_array($this->browsers) AND count($this->browsers) > 0) + { + foreach ($this->browsers as $key => $val) + { + if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match)) + { + $this->is_browser = TRUE; + $this->version = $match[1]; + $this->browser = $val; + return TRUE; + } } } - return FALSE; } @@ -511,39 +199,43 @@ function _set_browser() */ function _set_robot() { - foreach ($this->robots as $key => $val) - { - if (preg_match("|$key|i", $this->agent)) + if (is_array($this->robots) AND count($this->robots) > 0) + { + foreach ($this->robots as $key => $val) { - $this->is_robot = TRUE; - $this->robot = $val; - return TRUE; + if (preg_match("|".preg_quote($key)."|i", $this->agent)) + { + $this->is_robot = TRUE; + $this->robot = $val; + return TRUE; + } } } - return FALSE; } // -------------------------------------------------------------------- /** - * Set the Mobile Devise + * Set the Mobile Device * * @access private * @return bool */ function _set_mobile() { - foreach ($this->mobiles as $key => $val) - { - if (FALSE !== (strpos(strtolower($this->agent), $key))) + if (is_array($this->mobiles) AND count($this->mobiles) > 0) + { + foreach ($this->mobiles as $key => $val) { - $this->is_mobile = TRUE; - $this->mobile = $val; - return TRUE; + if (FALSE !== (strpos(strtolower($this->agent), $key))) + { + $this->is_mobile = TRUE; + $this->mobile = $val; + return TRUE; + } } - } - + } return FALSE; } @@ -559,7 +251,7 @@ function _set_languages() { if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') { - $languages = preg_replace('/(;q=.+)/i', '', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + $languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])); $this->languages = explode(',', $languages); } @@ -582,7 +274,7 @@ function _set_charsets() { if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') { - $charsets = preg_replace('/(;q=.+)/i', '', $_SERVER['HTTP_ACCEPT_CHARSET']); + $charsets = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_CHARSET'])); $this->charsets = explode(',', $charsets); } @@ -712,7 +404,7 @@ function robot() // -------------------------------------------------------------------- /** - * Get the Mobile Devise + * Get the Mobile Device * * @access public * @return string @@ -732,7 +424,7 @@ function mobile() */ function referrer() { - return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : $_SERVER['HTTP_REFERER']; + return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']); } // -------------------------------------------------------------------- From 2f0bac87c73febde8019e7cbab541905bcb0e5dd Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 17:36:45 +0000 Subject: [PATCH 0306/2544] --- system/libraries/Loader.php | 29 +++++++++++------------- system/libraries/User_agent.php | 3 +-- user_guide/libraries/loader.html | 38 +++++++++++++++++++------------- user_guide/libraries/table.html | 9 ++++---- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 05ee9395..452e39df 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -65,15 +65,15 @@ function CI_Loader() * * @access public * @param string the name of the class - * @param mixed any initialization parameters + * @param sring the optional class variable name to assign the library to * @return void */ - function library($class, $param = NULL) + function library($class, $varname = NULL) { if ($class == '') return; - $this->_ci_load_class($class, $param); + $this->_ci_load_class($class, $varname); $this->_ci_assign_to_models(); } @@ -595,7 +595,7 @@ function _ci_load($data) * @param mixed any additional parameters * @return void */ - function _ci_load_class($class, $params = NULL) + function _ci_load_class($class, $varname = NULL) { // Prep the class name $class = strtolower(str_replace(EXT, '', $class)); @@ -627,7 +627,7 @@ function _ci_load_class($class, $params = NULL) } } - return $this->_ci_init_class($filename, 'MY_', $params); + return $this->_ci_init_class($filename, 'MY_', $varname); } // Lets search for the requested library file and load it. @@ -642,7 +642,7 @@ function _ci_load_class($class, $params = NULL) if (file_exists($path.'libraries/'.$filename.EXT)) { include_once($path.'libraries/'.$filename.EXT); - return $this->_ci_init_class($filename, '', $params); + return $this->_ci_init_class($filename, '', $varname); } } } @@ -662,15 +662,12 @@ function _ci_load_class($class, $params = NULL) * @param string * @return null */ - function _ci_init_class($class, $prefix = '', $config = NULL) + function _ci_init_class($class, $prefix = '', $varname = NULL) { // Is there an associated config file for this class? - if ($config == NULL) + if (file_exists(APPPATH.'config/'.$class.EXT)) { - if (file_exists(APPPATH.'config/'.$class.EXT)) - { - include_once(APPPATH.'config/'.$class.EXT); - } + include_once(APPPATH.'config/'.$class.EXT); } if ($prefix == '') @@ -682,17 +679,17 @@ function _ci_init_class($class, $prefix = '', $config = NULL) $name = $prefix.$class; } - $varname = ( ! isset($remap[$class])) ? $class : $remap[$class]; - $varname = strtolower($varname); + $classvar = ( ! is_null($varname)) ? $varname : strtolower($class); + // Instantiate the class if ($config !== NULL) { - $this->CI->$varname = new $name($config); + $this->CI->$classvar = new $name($config); } else { - $this->CI->$varname = new $name; + $this->CI->$classvar = new $name; } } diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 21162388..39e12327 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -113,8 +113,7 @@ function _load_agent_file() unset($robots); $return = TRUE; } - - + return $return; } diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index b8da7aaf..b93d5fa7 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -72,6 +72,29 @@

    Loader Class

    +

    $this->load->library('class_name')

    + +

    This function is used to load core classes. Where class_name is the name of the class you want to load. +Note: We use the terms "class" and "library" interchangeably.

    + +

    For example, if you would like to send email with Code Igniter, the first step is to load the email class within your controller:

    + +$this->load->library('email'); + +

    Once loaded, the library will be ready for use, using $this->email->some_function(). + +Each library is described in detail in its own page, so please read theinformation regarding each one you would like to use.

    + +

    If you would like your libraries assigned to a different variable name then the default you can specify the name in the second paramter:

    + + +$this->load->library('email', 'E'); // Assigns the email object to "E"
    +
    +$this->E->some_function() +
    + + +

    $this->load->view('file_name', $data, true/false)

    This function is used to load your View files. If you haven't read the Views section of the @@ -92,21 +115,6 @@

    $this->load->view('file_name', $data, true/fals $string = $this->load->view('myfile', '', true); - -

    $this->load->library('class_name')

    - -

    This function is used to load core classes. Where class_name is the name of the class you want to load. -Note: We use the terms "class" and "library" interchangeably.

    - -

    For example, if you would like to send email with Code Igniter, the first step is to load the email class within your controller:

    - -$this->load->library('email'); - -

    Once loaded, the library will be ready for use. Each library is described in detail in its own page, so please read the -information regarding each one you would like to use.

    - - -

    $this->load->database('options', true/false)

    This function lets you load the database class. The two parameters are optional. Please see the diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index e80e53fd..61b5ce82 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -76,7 +76,8 @@

    Initializing the Class

    Examples

    Here is an example showing how you can create a table from a multi-dimensional array. -Note that the first array index will become the table heading.

    +Note that the first array index will become the table heading (or you can set your own headings using the +set_heading() function described in the function reference below).

    $this->load->library('table');
    @@ -92,8 +93,8 @@

    Examples

    Here is an example of a table created from a database query result. The table class will automatically generate the -headings based on the table names. Or you can set your own headings using the set_heading() function described -in the function reference below.

    +headings based on the table names (or you can set your own headings using the set_heading() function described +in the function reference below).

    $this->load->library('table');
    @@ -164,7 +165,7 @@

    Changing the Look of Your Table

    $this->table->set_template($tmpl);
    -

    You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each +

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data.

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. From b1fddc051af66a0a41a709862dd84d06139e2325 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 21:29:07 +0000 Subject: [PATCH 0307/2544] --- system/application/config/database.php | 2 +- system/application/config/mimes.php | 2 +- system/libraries/Loader.php | 16 +++++++++++++--- system/libraries/User_agent.php | 15 ++++++++++----- user_guide/installation/upgrade_150.html | 15 ++++++++------- user_guide/libraries/calendar.html | 2 ++ user_guide/libraries/encryption.html | 2 ++ user_guide/libraries/parser.html | 2 ++ user_guide/libraries/sessions.html | 1 + user_guide/libraries/table.html | 2 ++ user_guide/libraries/trackback.html | 1 + user_guide/libraries/unit_testing.html | 1 + user_guide/libraries/zip.html | 2 ++ 13 files changed, 46 insertions(+), 17 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index de781646..c594ba89 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -40,7 +40,7 @@ $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; -$db['default']['cache_on'] = TRUE; +$db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = APPPATH.'db_cache/'; diff --git a/system/application/config/mimes.php b/system/application/config/mimes.php index de0a9175..8b5036f2 100644 --- a/system/application/config/mimes.php +++ b/system/application/config/mimes.php @@ -4,7 +4,7 @@ | MIME TYPES | ------------------------------------------------------------------- | This file contains an array of mime types. It is used by the -| Upload class to help identyfiy allowed file types. +| Upload class to help identify allowed file types. | */ diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 452e39df..dc588bb0 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -30,12 +30,13 @@ class CI_Loader { var $CI; var $ob_level; + var $view_path = ''; var $cached_vars = array(); var $models = array(); var $helpers = array(); var $plugins = array(); var $scripts = array(); - var $view_path = ''; + var $varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); /** * Constructor @@ -665,6 +666,7 @@ function _ci_load_class($class, $varname = NULL) function _ci_init_class($class, $prefix = '', $varname = NULL) { // Is there an associated config file for this class? + $config = NULL; if (file_exists(APPPATH.'config/'.$class.EXT)) { include_once(APPPATH.'config/'.$class.EXT); @@ -678,9 +680,17 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) { $name = $prefix.$class; } - - $classvar = ( ! is_null($varname)) ? $varname : strtolower($class); + // Set the variable name we will assign the class to + if ( ! is_null($varname)) + { + $classvar = $varname; + } + else + { + $class = strtolower($class); + $classvar = ( ! isset($this->varmap[$class])) ? $class : $this->varmap[$class]; + } // Instantiate the class if ($config !== NULL) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 39e12327..11c2baa6 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -37,12 +37,16 @@ class CI_User_agent { var $languages = array(); var $charsets = array(); + var $platforms = array(); + var $browsers = array(); + var $mobiles = array(); + var $robots = array(); + var $platform = ''; var $browser = ''; var $version = ''; var $moble = ''; var $robot = ''; - /** * Constructor @@ -66,8 +70,9 @@ function CI_User_agent() $this->_compile_data(); } } + + log_message('debug', "Table Class Initialized"); } - // -------------------------------------------------------------------- @@ -79,7 +84,7 @@ function CI_User_agent() */ function _load_agent_file() { - if ( ! @include(APPPATH.'config/user_agent'.EXT)) + if ( ! @include(APPPATH.'config/user_agents'.EXT)) { return FALSE; } @@ -102,7 +107,7 @@ function _load_agent_file() if (isset($mobiles)) { - $this->browsers = $mobiles; + $this->mobiles = $mobiles; unset($mobiles); $return = TRUE; } @@ -344,7 +349,7 @@ function is_referral() * @access public * @return string */ - function agent() + function agent_string() { return $this->agent; } diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 55ebaa74..b532073f 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -71,16 +71,17 @@

    Upgrading from 1.4.1 to 1.5.0

    Step 1: Update your Code Igniter files

    -

    Replace these directories in your "system" folder with the new versions: +

    Replace these files and directories in your "system" folder with the new versions:

      -
    • system/codeigniter/
    • -
    • system/database/ (new for 1.5)
    • -
    • system/helpers/
    • -
    • system/language/
    • -
    • system/libraries/
    • -
    • system/scaffolding/
    • +
    • application/config/user_agents.php (new file for 1.5)
    • +
    • codeigniter/
    • +
    • database/ (new folder for 1.5. Replaces the "drivers" folder)
    • +
    • helpers/
    • +
    • language/
    • +
    • libraries/
    • +
    • scaffolding/

    Note: If you have any custom developed files in these folders please make copies of them first.

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index cd3e6644..9d2a01e1 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -75,6 +75,8 @@

    Initializing the Class

    $this->load->library('calendar');

    Once loaded, the Calendar object will be available using: $this->calendar

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    +

    Displaying a Calendar

    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 9be32cf4..92d128cd 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -110,6 +110,8 @@

    Initializing the Class

    $this->load->library('encrypt');

    Once loaded, the Encrypt library object will be available using: $this->encrypt

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    +

    $this->encrypt->encode()

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index bf7b1351..2f93baf0 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -103,6 +103,8 @@

    Initializing the Class

    $this->load->library('parser');

    Once loaded, the Parser library object will be available using: $this->parser

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    +

    The following functions are available in this library:

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5a1216f6..7a894fae 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -87,6 +87,7 @@

    Initializing a Session

    $this->load->library('session');

    Once loaded, the Sessions library object will be available using: $this->session

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    How do Sessions work?

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 61b5ce82..c2e32399 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -72,6 +72,8 @@

    Initializing the Class

    $this->load->library('table');

    Once loaded, the Table library object will be available using: $this->table

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    +

    Examples

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 0621d4e7..87f6f3a0 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -74,6 +74,7 @@

    Initializing the Class

    $this->load->library('trackback');

    Once loaded, the Trackback library object will be available using: $this->trackback

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    Sending Trackbacks

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 11a8fc26..aa747587 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -78,6 +78,7 @@

    Initializing the Class

    $this->load->library('unit');

    Once loaded, the Unit Test object will be available using: $this->unit

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    Running Tests

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 6171ed1c..32ef3bed 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -71,6 +71,8 @@

    Initializing the Class

    $this->load->library('zip');

    Once loaded, the Zip library object will be available using: $this->zip

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    +

    Usage Example

    From daaa0c8403a80d325d3ce2b85c5be62067a3854b Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 21:39:12 +0000 Subject: [PATCH 0308/2544] --- system/libraries/Unit_test.php | 331 +++++++++++++++++++++++++++++++++ 1 file changed, 331 insertions(+) create mode 100644 system/libraries/Unit_test.php diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php new file mode 100644 index 00000000..41516238 --- /dev/null +++ b/system/libraries/Unit_test.php @@ -0,0 +1,331 @@ +active == FALSE) + return FALSE; + + if (in_array($expected, array('is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'), TRUE)) + { + $expected = str_replace('is_float', 'is_double', $expected); + $result = ($expected($test)) ? TRUE : FALSE; + $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); + } + else + { + if ($this->strict == TRUE) + $result = ($test === $expected) ? TRUE : FALSE; + else + $result = ($test == $expected) ? TRUE : FALSE; + + $extype = gettype($expected); + } + + $back = $this->_backtrace(); + + $report[] = array ( + 'test_name' => $test_name, + 'test_datatype' => gettype($test), + 'res_datatype' => $extype, + 'result' => ($result === TRUE) ? 'passed' : 'failed', + 'file' => $back['file'], + 'line' => $back['line'] + ); + + $this->results[] = $report; + + return($this->report($this->result($report))); + } + + // -------------------------------------------------------------------- + + /** + * Generate a report + * + * Displays a table with the test data + * + * @access public + * @return string + */ + function report($result = array()) + { + if (count($result) == 0) + { + $result = $this->result(); + } + + $this->_parse_template(); + + $r = ''; + foreach ($result as $res) + { + $table = ''; + + foreach ($res as $key => $val) + { + $temp = $this->_template_rows; + $temp = str_replace('{item}', $key, $temp); + $temp = str_replace('{result}', $val, $temp); + $table .= $temp; + } + + $r .= str_replace('{rows}', $table, $this->_template); + } + + return $r; + } + + // -------------------------------------------------------------------- + + /** + * Use strict comparison + * + * Causes the evaluation to use === rather then == + * + * @access public + * @param bool + * @return null + */ + function use_strict($state = TRUE) + { + $this->strict = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Make Unit testing active + * + * Enables/disables unit testing + * + * @access public + * @param bool + * @return null + */ + function active($state = TRUE) + { + $this->active = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Result Array + * + * Returns the raw result data + * + * @access public + * @return array + */ + function result($results = array()) + { + $CI =& get_instance(); + $CI->load->language('unit_test'); + + if (count($results) == 0) + { + $results = $this->results; + } + + $retval = array(); + foreach ($results as $result) + { + $temp = array(); + foreach ($result as $key => $val) + { + if (is_array($val)) + { + foreach ($val as $k => $v) + { + if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v)))) + { + $v = $line; + } + $temp[$CI->lang->line('ut_'.$k)] = $v; + } + } + else + { + if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) + { + $val = $line; + } + $temp[$CI->lang->line('ut_'.$key)] = $val; + } + } + + $retval[] = $temp; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Set the template + * + * This lets us set the template to be used to display results + * + * @access public + * @params string + * @return void + */ + function set_template($template) + { + $this->_template = $template; + } + + // -------------------------------------------------------------------- + + /** + * Generate a backtrace + * + * This lets us show file names and line numbers + * + * @access private + * @return array + */ + function _backtrace() + { + if (function_exists('debug_backtrace')) + { + $back = debug_backtrace(); + + $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; + $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; + + return array('file' => $file, 'line' => $line); + } + return array('file' => 'Unknown', 'line' => 'Unknown'); + } + + // -------------------------------------------------------------------- + + /** + * Get Default Template + * + * @access private + * @return string + */ + function _default_template() + { + $this->_template = ' +
    + + {rows} +
    '; + + $this->_template_rows = ' + + {item} + {result} + + '; + } + + // -------------------------------------------------------------------- + + /** + * Parse Template + * + * Harvests the data within the template {pseudo-variables} + * + * @access private + * @return void + */ + function _parse_template() + { + if ( ! is_null($this->_template_rows)) + { + return; + } + + if (is_null($this->_template)) + { + $this->_default_template(); + return; + } + + if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) + { + $this->_default_template(); + return; + } + + $this->_template_rows = $match['1']; + $this->_template = str_replace($match['0'], '{rows}', $this->_template); + } + +} +// END Unit_test Class + +/** + * Helper functions to test boolean true/false + * + * + * @access private + * @return bool + */ +function is_true($test) +{ + return (is_bool($test) AND $test === TRUE) ? TRUE : FALSE; +} +function is_false($test) +{ + return (is_bool($test) AND $test === FALSE) ? TRUE : FALSE; +} + +?> \ No newline at end of file From 8d3f977d2c1d4dc01a72c0add3b14ffc73a54762 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 21:39:48 +0000 Subject: [PATCH 0309/2544] --- system/libraries/Loader.php | 7 - system/libraries/Unit.php | 331 ------------------------- user_guide/general/changelog.html | 3 +- user_guide/libraries/unit_testing.html | 2 +- 4 files changed, 2 insertions(+), 341 deletions(-) delete mode 100644 system/libraries/Unit.php diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index dc588bb0..ca4c4feb 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -601,13 +601,6 @@ function _ci_load_class($class, $varname = NULL) // Prep the class name $class = strtolower(str_replace(EXT, '', $class)); - // Bug fix for backward compat. - // Kill this at some point in the future - if ($class == 'unit_test') - { - $class = 'unit'; - } - // Is this a class extension request? if (substr($class, 0, 3) == 'my_') { diff --git a/system/libraries/Unit.php b/system/libraries/Unit.php deleted file mode 100644 index 439424fb..00000000 --- a/system/libraries/Unit.php +++ /dev/null @@ -1,331 +0,0 @@ -active == FALSE) - return FALSE; - - if (in_array($expected, array('is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'), TRUE)) - { - $expected = str_replace('is_float', 'is_double', $expected); - $result = ($expected($test)) ? TRUE : FALSE; - $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); - } - else - { - if ($this->strict == TRUE) - $result = ($test === $expected) ? TRUE : FALSE; - else - $result = ($test == $expected) ? TRUE : FALSE; - - $extype = gettype($expected); - } - - $back = $this->_backtrace(); - - $report[] = array ( - 'test_name' => $test_name, - 'test_datatype' => gettype($test), - 'res_datatype' => $extype, - 'result' => ($result === TRUE) ? 'passed' : 'failed', - 'file' => $back['file'], - 'line' => $back['line'] - ); - - $this->results[] = $report; - - return($this->report($this->result($report))); - } - - // -------------------------------------------------------------------- - - /** - * Generate a report - * - * Displays a table with the test data - * - * @access public - * @return string - */ - function report($result = array()) - { - if (count($result) == 0) - { - $result = $this->result(); - } - - $this->_parse_template(); - - $r = ''; - foreach ($result as $res) - { - $table = ''; - - foreach ($res as $key => $val) - { - $temp = $this->_template_rows; - $temp = str_replace('{item}', $key, $temp); - $temp = str_replace('{result}', $val, $temp); - $table .= $temp; - } - - $r .= str_replace('{rows}', $table, $this->_template); - } - - return $r; - } - - // -------------------------------------------------------------------- - - /** - * Use strict comparison - * - * Causes the evaluation to use === rather then == - * - * @access public - * @param bool - * @return null - */ - function use_strict($state = TRUE) - { - $this->strict = ($state == FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Make Unit testing active - * - * Enables/disables unit testing - * - * @access public - * @param bool - * @return null - */ - function active($state = TRUE) - { - $this->active = ($state == FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Result Array - * - * Returns the raw result data - * - * @access public - * @return array - */ - function result($results = array()) - { - $CI =& get_instance(); - $CI->load->language('unit_test'); - - if (count($results) == 0) - { - $results = $this->results; - } - - $retval = array(); - foreach ($results as $result) - { - $temp = array(); - foreach ($result as $key => $val) - { - if (is_array($val)) - { - foreach ($val as $k => $v) - { - if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v)))) - { - $v = $line; - } - $temp[$CI->lang->line('ut_'.$k)] = $v; - } - } - else - { - if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) - { - $val = $line; - } - $temp[$CI->lang->line('ut_'.$key)] = $val; - } - } - - $retval[] = $temp; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Set the template - * - * This lets us set the template to be used to display results - * - * @access public - * @params string - * @return void - */ - function set_template($template) - { - $this->_template = $template; - } - - // -------------------------------------------------------------------- - - /** - * Generate a backtrace - * - * This lets us show file names and line numbers - * - * @access private - * @return array - */ - function _backtrace() - { - if (function_exists('debug_backtrace')) - { - $back = debug_backtrace(); - - $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; - $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; - - return array('file' => $file, 'line' => $line); - } - return array('file' => 'Unknown', 'line' => 'Unknown'); - } - - // -------------------------------------------------------------------- - - /** - * Get Default Template - * - * @access private - * @return string - */ - function _default_template() - { - $this->_template = ' -
    - - {rows} -
    '; - - $this->_template_rows = ' - - {item} - {result} - - '; - } - - // -------------------------------------------------------------------- - - /** - * Parse Template - * - * Harvests the data within the template {pseudo-variables} - * - * @access private - * @return void - */ - function _parse_template() - { - if ( ! is_null($this->_template_rows)) - { - return; - } - - if (is_null($this->_template)) - { - $this->_default_template(); - return; - } - - if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) - { - $this->_default_template(); - return; - } - - $this->_template_rows = $match['1']; - $this->_template = str_replace($match['0'], '{rows}', $this->_template); - } - -} -// END Unit_test Class - -/** - * Helper functions to test boolean true/false - * - * - * @access private - * @return bool - */ -function is_true($test) -{ - return (is_bool($test) AND $test === TRUE) ? TRUE : FALSE; -} -function is_false($test) -{ - return (is_bool($test) AND $test === FALSE) ? TRUE : FALSE; -} - -?> \ No newline at end of file diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index f4e271d4..2a871acf 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -64,7 +64,7 @@

    Change Log

    Version 1.5.0

    -

    Release Date: Ocotber 15, 2006

    +

    Release Date: October 15, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • @@ -91,7 +91,6 @@

      Version 1.5.0

    • Fixed a bug in the validation class.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • -
    • Deprecated $this->load->library('unit_test'). USE $this->load->library('unit')
    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index aa747587..9951c824 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -76,7 +76,7 @@

    Initializing the Class

    Like most other classes in Code Igniter, the Unit Test class is initialized in your controller using the $this->load->library function:

    -$this->load->library('unit'); +$this->load->library('unit_test');

    Once loaded, the Unit Test object will be available using: $this->unit

    You can also set your own class variable name. Please see the Loader Class for more info.

    From ada5fa37c19c2f7f3de210869dca6243ca9b4174 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 21:40:36 +0000 Subject: [PATCH 0310/2544] --- user_guide/libraries/user_agent.html | 210 +++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 user_guide/libraries/user_agent.html diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html new file mode 100644 index 00000000..50f4b77f --- /dev/null +++ b/user_guide/libraries/user_agent.html @@ -0,0 +1,210 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    Code Igniter User Guide Version 1.5.0b1

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    User Agent Class

    + +

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. +In addition you can get referrer information as well as language and supported character-set information.

    + +

    Initializing the Class

    + +

    Like most other classes in Code Igniter, the User Agent class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('user_agent'); +

    Once loaded, the object will be available using: $this->agent

    +

    You can also set your own class variable name. Please see the Loader Class for more info.

    + +

    User Agent Definitions

    + +

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the +various user agent arrays if needed.

    + +

    Example

    + +

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is +a web browser, a mobile device, or a robot. It will also gather the platform information if it is available. + + + +$this->load->library('user_agent');
    +
    +if ($this->agent->is_browser())
    +{
    +    $agent = $this->agent->browser().' '.$this->agent->version();
    +}
    +elseif ($this->agent->is_robot())
    +{
    +    $agent = $this->agent->robot();
    +}
    +elseif ($this->agent->is_mobile())
    +{
    +    $agent = $this->agent->mobile();
    +}
    +else
    +{
    +    $agent = 'Unidentified User Agent';
    +}
    +
    +echo $agent;
    +
    +echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) +
    + + + + +
    +

    Function Reference

    + + +

    $this->agent->is_browser()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    + +

    $this->agent->is_mobile()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    + +

    $this->agent->is_robot()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    + +

    Note:  The user agent library only contains the most common robot +definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be +very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your +application/config/user_agents.php file.

    + +

    $this->agent->is_referral()

    +

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    + + +

    $this->agent->browser()

    +

    Returns a string containing the name of the web browser viewing your site.

    + +

    $this->agent->version()

    +

    Returns a string containing the version number of the web browser viewing your site.

    + +

    $this->agent->mobile()

    +

    Returns a string containing the name of the mobile device viewing your site.

    + +

    $this->agent->robot()

    +

    Returns a string containing the name of the robot viewing your site.

    + +

    $this->agent->platform()

    +

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    + +

    $this->agent->referrer()

    +

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    + + if ($this->agent->is_referral())
    +{
    +    echo $this->agent->referrer();
    +}
    + + +

    $this->agent->agent_string()

    +

    Returns a string containing the full user agent string. Typically it will be something like this:

    + +Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2 + + +

    $this->agent->accept_lang()

    +

    Lets you determine if the user agent accepts a particular language. Example:

    + +if ($this->agent->accept_lang('en'))
    +{
    +    echo 'You accept English!';
    +} + +

    Note: This function is not typically very reliable +since some browsers do not provide language info, and even among those that do, it is not always accurate.

    + + + +

    $this->agent->accept_charset()

    +

    Lets you determine if the user agent accepts a particular language. Example:

    + +if ($this->agent->accept_charset('utf-8'))
    +{
    +    echo 'You browser supports UTF-8!';
    +} + +

    Note: This function is not typically very reliable +since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    + + + +
    + + + + + + + \ No newline at end of file From cf49390d3d699d878eb6e151745e80285465ddb9 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 07:12:31 +0000 Subject: [PATCH 0311/2544] --- system/codeigniter/Base4.php | 29 ++- system/libraries/Controller.php | 17 +- system/libraries/Loader.php | 219 +++++++++++++++------ system/libraries/Model.php | 4 +- system/scaffolding/Scaffolding.php | 2 +- user_guide/general/changelog.html | 4 +- user_guide/general/creating_libraries.html | 3 + user_guide/libraries/calendar.html | 2 - user_guide/libraries/encryption.html | 2 - user_guide/libraries/loader.html | 4 + user_guide/libraries/parser.html | 1 - user_guide/libraries/sessions.html | 1 - user_guide/libraries/table.html | 2 - user_guide/libraries/trackback.html | 1 - user_guide/libraries/unit_testing.html | 1 - user_guide/libraries/user_agent.html | 1 - user_guide/libraries/zip.html | 1 - 17 files changed, 197 insertions(+), 97 deletions(-) diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index eccf58ed..115c1072 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -18,10 +18,18 @@ /** * CI_BASE - For PHP 4 * - * This file is used only when Code Igniter is being run under PHP 4. - * Since PHP 4 has such poor object handling we had to come up with - * a hack (and a really ugly one at that...) to resolve some scoping - * problems. PHP 5 doesn't suffer from this problem so we load one of + * This file is used only when Code Igniter is being run under PHP 4. + * + * In order to allow CI to work under PHP 4 we had to make the Loader class + * the parent class of the Controller Base class. It's the only way we + * could enable functions like $this->load->library('email') to instantiate + * classes that can then be used within controllers as $this->email->send() + * + * PHP 4 also has trouble referencing the CI super object within application + * constructors since objects do not exist until the class is fully + * instantiated. Basically PHP 4 sucks... + * + * Since PHP 5 doesn't suffer from this problem so we load one of * two files based on the version of PHP being run. * * @package CodeIgniter @@ -34,18 +42,25 @@ class CI_Base extends CI_Loader { function CI_Base() { - global $OBJ; parent::CI_Loader(); $this->load =& $this; + + global $OBJ; $OBJ = $this->load; } } function &get_instance() { - global $OBJ, $CI; + global $CI, $OBJ; + + if (is_object($CI)) + { + $CI->_ci_use_instance = TRUE; + return $CI; + } - return (is_object($CI)) ? $CI : $OBJ->load; + return $OBJ->load; } ?> \ No newline at end of file diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 4b9e3e96..c80097a1 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -80,20 +80,13 @@ function _ci_initialize() if (floor(phpversion()) >= 5) { $this->load = new CI_Loader(); + $this->load->_ci_use_instance = TRUE; + $this->load->_ci_autoloader(); } - - // Load everything specified in the autoload.php file - $this->load->_ci_autoloader(); - - // This allows anything loaded using $this->load (viwes, files, etc.) - // to become accessible from within the Controller class functions. - foreach (get_object_vars($this) as $key => $var) + else { - if (is_object($var)) - { - $this->load->$key =& $this->$key; - } - } + $this->_ci_autoloader(); + } } // -------------------------------------------------------------------- diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index ca4c4feb..1738438e 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -28,15 +28,18 @@ */ class CI_Loader { - var $CI; - var $ob_level; - var $view_path = ''; - var $cached_vars = array(); - var $models = array(); - var $helpers = array(); - var $plugins = array(); - var $scripts = array(); - var $varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); + var $_ci_ob_level; + var $_ci_view_path = ''; + var $_ci_cached_vars = array(); + var $_ci_models = array(); + var $_ci_helpers = array(); + var $_ci_plugins = array(); + var $_ci_scripts = array(); + var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); + + var $_ci_use_instance = FALSE; // This variable determines whether we should + // use $this or $CI =& get_instance() + // throughout this class. Don't mess with it. /** * Constructor @@ -47,11 +50,9 @@ class CI_Loader { * @access public */ function CI_Loader() - { - $this->CI =& get_instance(); - - $this->view_path = APPPATH.'views/'; - $this->ob_level = ob_get_level(); + { + $this->_ci_view_path = APPPATH.'views/'; + $this->_ci_ob_level = ob_get_level(); log_message('debug', "Loader Class Initialized"); } @@ -95,8 +96,7 @@ function model($model, $name = '', $db_conn = FALSE) if ($model == '') return; - // Is the model in a sub-folder? - // If so, parse out the filename and path. + // Is the model in a sub-folder? If so, parse out the filename and path. if (strpos($model, '/') === FALSE) { $path = ''; @@ -114,14 +114,25 @@ function model($model, $name = '', $db_conn = FALSE) $name = $model; } - if (in_array($name, $this->models, TRUE)) + if (in_array($name, $this->_ci_models, TRUE)) { return; - } + } - if (isset($this->CI->$name)) + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + if (isset($CI->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } + } + else { - show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + if (isset($this->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } } $model = strtolower($model); @@ -136,7 +147,14 @@ function model($model, $name = '', $db_conn = FALSE) if ($db_conn === TRUE) $db_conn = ''; - $this->CI->load->database($db_conn, FALSE, TRUE); + if ($this->_ci_use_instance) + { + $CI->load->database($db_conn, FALSE, TRUE); + } + else + { + $this->database($db_conn, FALSE, TRUE); + } } if ( ! class_exists('Model')) @@ -147,8 +165,17 @@ function model($model, $name = '', $db_conn = FALSE) require_once(APPPATH.'models/'.$path.$model.EXT); $model = ucfirst($model); - $this->CI->$name = new $model(); - $this->models[] = $name; + + if ($this->_ci_use_instance) + { + $CI->$name = new $model(); + } + else + { + $this->$name = new $model(); + } + + $this->_ci_models[] = $name; $this->_ci_assign_to_models(); } @@ -239,7 +266,7 @@ function vars($vars = array()) { foreach ($vars as $key => $val) { - $this->cached_vars[$key] = $val; + $this->_ci_cached_vars[$key] = $val; } } } @@ -264,7 +291,7 @@ function helper($helpers = array()) foreach ($helpers as $helper) { - if (isset($this->helpers[$helper])) + if (isset($this->_ci_helpers[$helper])) { continue; } @@ -287,7 +314,7 @@ function helper($helpers = array()) } } - $this->helpers[$helper] = TRUE; + $this->_ci_helpers[$helper] = TRUE; } log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); @@ -330,7 +357,7 @@ function plugin($plugins = array()) foreach ($plugins as $plugin) { - if (isset($this->plugins[$plugin])) + if (isset($this->_ci_plugins[$plugin])) { continue; } @@ -353,7 +380,7 @@ function plugin($plugins = array()) } } - $this->plugins[$plugin] = TRUE; + $this->_ci_plugins[$plugin] = TRUE; } log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); @@ -400,7 +427,7 @@ function script($scripts = array()) foreach ($scripts as $script) { - if (isset($this->scripts[$script])) + if (isset($this->_ci_scripts[$script])) { continue; } @@ -414,7 +441,7 @@ function script($scripts = array()) include_once(APPPATH.'scripts/'.$script.EXT); - $this->scripts[$script] = TRUE; + $this->_ci_scripts[$script] = TRUE; } log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); @@ -431,7 +458,15 @@ function script($scripts = array()) */ function language($file = '', $lang = '', $return = FALSE) { - return $this->CI->lang->load($file, $lang, $return); + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + return $CI->lang->load($file, $lang, $return); + } + else + { + return $this->lang->load($file, $lang, $return); + } } // -------------------------------------------------------------------- @@ -444,8 +479,16 @@ function language($file = '', $lang = '', $return = FALSE) * @return void */ function config($file = '') - { - $this->CI->config->load($file); + { + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + $CI->config->load($file); + } + else + { + $this->config->load($file); + } } // -------------------------------------------------------------------- @@ -471,9 +514,18 @@ function scaffolding($table = '') { show_error('You must include the name of the table you would like access when you initialize scaffolding'); } - - $this->CI->_ci_scaffolding = TRUE; - $this->CI->_ci_scaff_table = $table; + + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + $CI->_ci_scaffolding = TRUE; + $CI->_ci_scaff_table = $table; + } + else + { + $this->_ci_scaffolding = TRUE; + $this->_ci_scaff_table = $table; + } } // -------------------------------------------------------------------- @@ -491,14 +543,20 @@ function _ci_load($data) { // This allows anything loaded using $this->load (viwes, files, etc.) // to become accessible from within the Controller and Model functions. - foreach (get_object_vars($this->CI) as $key => $var) + // Only needed when running PHP 5 + + if ($this->_ci_use_instance) { - if (is_object($var)) + $CI =& get_instance(); + foreach (get_object_vars($CI) as $key => $var) { - $this->$key =& $this->CI->$key; + if ( ! isset($this->$key)) + { + $this->$key =& $CI->$key; + } } } - + // Set the default data variables foreach (array('view', 'vars', 'path', 'return') as $val) { @@ -515,16 +573,16 @@ function _ci_load($data) */ if (is_array($vars)) { - $this->cached_vars = array_merge($this->cached_vars, $vars); + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); } - extract($this->cached_vars); + extract($this->_ci_cached_vars); // Set the path to the requested file if ($path == '') { $ext = pathinfo($view, PATHINFO_EXTENSION); $file = ($ext == '') ? $view.EXT : $view; - $path = $this->view_path.$file; + $path = $this->_ci_view_path.$file; } else { @@ -572,14 +630,15 @@ function _ci_load($data) * it can be seen and included properly by the first included * template and any subsequent ones. Oy! * - */ - if (ob_get_level() > $this->ob_level + 1) + */ + if (ob_get_level() > $this->_ci_ob_level + 1) { ob_end_flush(); } else { - $this->CI->output->set_output(ob_get_contents()); + global $OUT; + $OUT->set_output(ob_get_contents()); ob_end_clean(); } } @@ -682,18 +741,33 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) else { $class = strtolower($class); - $classvar = ( ! isset($this->varmap[$class])) ? $class : $this->varmap[$class]; + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; } - // Instantiate the class - if ($config !== NULL) + // Instantiate the class + if ($this->_ci_use_instance) { - $this->CI->$classvar = new $name($config); + $CI =& get_instance(); + if ($config !== NULL) + { + $CI->$classvar = new $name($config); + } + else + { + $CI->$classvar = new $name; + } } else - { - $this->CI->$classvar = new $name; - } + { + if ($config !== NULL) + { + $this->$classvar = new $name($config); + } + else + { + $this->$classvar = new $name; + } + } } // -------------------------------------------------------------------- @@ -719,10 +793,21 @@ function _ci_autoloader() // Load any custome config file if (count($autoload['config']) > 0) - { - foreach ($autoload['config'] as $key => $val) + { + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + foreach ($autoload['config'] as $key => $val) + { + $CI->config->load($val); + } + } + else { - $this->CI->config->load($val); + foreach ($autoload['config'] as $key => $val) + { + $this->config->load($val); + } } } @@ -788,14 +873,26 @@ function _ci_autoloader() */ function _ci_assign_to_models() { - if (count($this->models) == 0) + if (count($this->_ci_models) == 0) { return; } - foreach ($this->models as $model) - { - $this->CI->$model->_assign_libraries(); - } + + if ($this->_ci_use_instance) + { + $CI =& get_instance(); + foreach ($this->_ci_models as $model) + { + $CI->$model->_assign_libraries(); + } + } + else + { + foreach ($this->_ci_models as $model) + { + $this->$model->_assign_libraries(); + } + } } // -------------------------------------------------------------------- diff --git a/system/libraries/Model.php b/system/libraries/Model.php index 46f0367c..48615e07 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -51,8 +51,8 @@ function _assign_libraries($use_reference = TRUE) { $CI =& get_instance(); foreach (get_object_vars($CI) as $key => $var) - { - if (is_object($var) AND ! isset($this->$key)) + { + if ( ! isset($this->$key)) { if ($use_reference === TRUE) { diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index c046d228..6c4b3a53 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -56,7 +56,7 @@ function Scaffolding($db_table) * the load->view function knows where to look. */ - $this->CI->load->view_path = BASEPATH.'scaffolding/views/'; + $this->CI->load->_ci_view_path = BASEPATH.'scaffolding/views/'; // Set the base URL $this->base_url = $this->CI->config->site_url().'/'.$this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'both'); diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 2a871acf..732e1c77 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -82,9 +82,9 @@

    Version 1.5.0

  • Added $query->free_result() to database class.
  • Added $query->field_names() function to database class
  • Added $this->db->platform() function
  • -
  • Added two more protocols to the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
  • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
  • -
  • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers.
  • +
  • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
  • +
  • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
  • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
  • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
  • Fixed a bug in the Email class related to SMTP Helo data.
  • diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 73bc4d60..fb3f4178 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -250,8 +250,11 @@

    Extending Native Libraries

    $this->load->library('my_email'); +

    Once loaded you will use the class variable as you normally would for the class you are extending. In the case of +the email class all calls will use: +$this->email->some_function(); diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 9d2a01e1..cd3e6644 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -75,8 +75,6 @@

    Initializing the Class

    $this->load->library('calendar');

    Once loaded, the Calendar object will be available using: $this->calendar

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    -

    Displaying a Calendar

    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 92d128cd..9be32cf4 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -110,8 +110,6 @@

    Initializing the Class

    $this->load->library('encrypt');

    Once loaded, the Encrypt library object will be available using: $this->encrypt

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    -

    $this->encrypt->encode()

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index b93d5fa7..347421d6 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -85,6 +85,10 @@

    $this->load->library('class_name')

    Each library is described in detail in its own page, so please read theinformation regarding each one you would like to use.

    +

    Parameters can be passed to the library via an array in the second parameter. + + +

    If you would like your libraries assigned to a different variable name then the default you can specify the name in the second paramter:

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 2f93baf0..ace408e0 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -103,7 +103,6 @@

    Initializing the Class

    $this->load->library('parser');

    Once loaded, the Parser library object will be available using: $this->parser

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    The following functions are available in this library:

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 7a894fae..5a1216f6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -87,7 +87,6 @@

    Initializing a Session

    $this->load->library('session');

    Once loaded, the Sessions library object will be available using: $this->session

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    How do Sessions work?

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index c2e32399..61b5ce82 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -72,8 +72,6 @@

    Initializing the Class

    $this->load->library('table');

    Once loaded, the Table library object will be available using: $this->table

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    -

    Examples

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 87f6f3a0..0621d4e7 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -74,7 +74,6 @@

    Initializing the Class

    $this->load->library('trackback');

    Once loaded, the Trackback library object will be available using: $this->trackback

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    Sending Trackbacks

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 9951c824..45b92abb 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -78,7 +78,6 @@

    Initializing the Class

    $this->load->library('unit_test');

    Once loaded, the Unit Test object will be available using: $this->unit

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    Running Tests

    diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 50f4b77f..8f3eb07d 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -72,7 +72,6 @@

    Initializing the Class

    $this->load->library('user_agent');

    Once loaded, the object will be available using: $this->agent

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    User Agent Definitions

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 32ef3bed..d072a570 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -71,7 +71,6 @@

    Initializing the Class

    $this->load->library('zip');

    Once loaded, the Zip library object will be available using: $this->zip

    -

    You can also set your own class variable name. Please see the Loader Class for more info.

    Usage Example

    From 34f7f2d0a84c59233689908c11d8d2c6c5ba0875 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 08:06:42 +0000 Subject: [PATCH 0312/2544] --- system/codeigniter/Base4.php | 1 - system/libraries/Controller.php | 3 +- system/libraries/Loader.php | 77 +++++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index 115c1072..8b3dc92f 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -56,7 +56,6 @@ function &get_instance() if (is_object($CI)) { - $CI->_ci_use_instance = TRUE; return $CI; } diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index c80097a1..7a3f5e5d 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -32,6 +32,8 @@ class Controller extends CI_Base { var $_ci_scaffolding = FALSE; var $_ci_scaff_table = FALSE; + + /** * Constructor * @@ -80,7 +82,6 @@ function _ci_initialize() if (floor(phpversion()) >= 5) { $this->load = new CI_Loader(); - $this->load->_ci_use_instance = TRUE; $this->load->_ci_autoloader(); } else diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 1738438e..43d1cbec 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -28,8 +28,11 @@ */ class CI_Loader { + // All these are set automatically. Don't mess with them. var $_ci_ob_level; var $_ci_view_path = ''; + var $_ci_is_php5 = FALSE; + var $_ci_use_instance = FALSE; // Whether we should use $this or $CI =& get_instance() var $_ci_cached_vars = array(); var $_ci_models = array(); var $_ci_helpers = array(); @@ -37,20 +40,17 @@ class CI_Loader { var $_ci_scripts = array(); var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); - var $_ci_use_instance = FALSE; // This variable determines whether we should - // use $this or $CI =& get_instance() - // throughout this class. Don't mess with it. /** * Constructor * - * Sets the path to the view files and gets the initial output - * buffering level + * Sets the path to the view files and gets the initial output buffering level * * @access public */ function CI_Loader() { + $this->_ci_is_php5 = (floor(phpversion()) >= 5) ? TRUE : FALSE; $this->_ci_view_path = APPPATH.'views/'; $this->_ci_ob_level = ob_get_level(); @@ -119,7 +119,7 @@ function model($model, $name = '', $db_conn = FALSE) return; } - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); if (isset($CI->$name)) @@ -147,7 +147,7 @@ function model($model, $name = '', $db_conn = FALSE) if ($db_conn === TRUE) $db_conn = ''; - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI->load->database($db_conn, FALSE, TRUE); } @@ -165,20 +165,34 @@ function model($model, $name = '', $db_conn = FALSE) require_once(APPPATH.'models/'.$path.$model.EXT); $model = ucfirst($model); - - if ($this->_ci_use_instance) + + if ($this->_ci_use_instance()) { - $CI->$name = new $model(); + $CI->$name = new $model(); + foreach (get_object_vars($CI) as $key => $var) + { + if ( ! isset($CI->$name->$key)) + { + $CI->$name->$key =& $CI->$key; + } + } } else { $this->$name = new $model(); - } + foreach (get_object_vars($this) as $key => $var) + { + if ( ! isset($this->$name->$key)) + { + $this->$name->$key =& $CI->$key; + } + } + } $this->_ci_models[] = $name; - $this->_ci_assign_to_models(); } + // -------------------------------------------------------------------- /** @@ -458,7 +472,7 @@ function script($scripts = array()) */ function language($file = '', $lang = '', $return = FALSE) { - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); return $CI->lang->load($file, $lang, $return); @@ -480,7 +494,7 @@ function language($file = '', $lang = '', $return = FALSE) */ function config($file = '') { - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); $CI->config->load($file); @@ -515,7 +529,7 @@ function scaffolding($table = '') show_error('You must include the name of the table you would like access when you initialize scaffolding'); } - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); $CI->_ci_scaffolding = TRUE; @@ -545,7 +559,7 @@ function _ci_load($data) // to become accessible from within the Controller and Model functions. // Only needed when running PHP 5 - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); foreach (get_object_vars($CI) as $key => $var) @@ -627,7 +641,7 @@ function _ci_load($data) * In order to permit views to be nested within * other views, we need to flush the content back out whenever * we are beyond the first level of output buffering so that - * it can be seen and included properly by the first included + * it can be seen and included properly by the first included * template and any subsequent ones. Oy! * */ @@ -637,6 +651,7 @@ function _ci_load($data) } else { + // PHP 4 requires that we use a global global $OUT; $OUT->set_output(ob_get_contents()); ob_end_clean(); @@ -745,7 +760,7 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) } // Instantiate the class - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); if ($config !== NULL) @@ -794,7 +809,7 @@ function _ci_autoloader() // Load any custome config file if (count($autoload['config']) > 0) { - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); foreach ($autoload['config'] as $key => $val) @@ -867,7 +882,7 @@ function _ci_autoloader() * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) * will be available to modles, if any exist. * - * @access public + * @access private * @param object * @return array */ @@ -878,7 +893,7 @@ function _ci_assign_to_models() return; } - if ($this->_ci_use_instance) + if ($this->_ci_use_instance()) { $CI =& get_instance(); foreach ($this->_ci_models as $model) @@ -902,7 +917,7 @@ function _ci_assign_to_models() * * Takes an object as input and convers the class variables to array key/vals * - * @access public + * @access private * @param object * @return array */ @@ -911,6 +926,24 @@ function _ci_object_to_array($object) return (is_object($object)) ? get_object_vars($object) : $object; } + // -------------------------------------------------------------------- + + /** + * Determines whether we should use the CI instance or $this + * + * @access private + * @return bool + */ + function _ci_use_instance() + { + if ($this->_ci_is_php5 == TRUE) + { + return TRUE; + } + + global $CI; + return (is_object($CI)) ? TRUE : FALSE; + } } ?> \ No newline at end of file From 1e3039878265b09e85f14e6b5ad3fbb6d4aa24c3 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 16:35:43 +0000 Subject: [PATCH 0313/2544] --- system/libraries/Loader.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 43d1cbec..96ec0c91 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -32,7 +32,7 @@ class CI_Loader { var $_ci_ob_level; var $_ci_view_path = ''; var $_ci_is_php5 = FALSE; - var $_ci_use_instance = FALSE; // Whether we should use $this or $CI =& get_instance() + var $_ci_is_instance = FALSE; // Whether we should use $this or $CI =& get_instance() var $_ci_cached_vars = array(); var $_ci_models = array(); var $_ci_helpers = array(); @@ -119,7 +119,7 @@ function model($model, $name = '', $db_conn = FALSE) return; } - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); if (isset($CI->$name)) @@ -147,7 +147,7 @@ function model($model, $name = '', $db_conn = FALSE) if ($db_conn === TRUE) $db_conn = ''; - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI->load->database($db_conn, FALSE, TRUE); } @@ -166,7 +166,7 @@ function model($model, $name = '', $db_conn = FALSE) $model = ucfirst($model); - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI->$name = new $model(); foreach (get_object_vars($CI) as $key => $var) @@ -472,7 +472,7 @@ function script($scripts = array()) */ function language($file = '', $lang = '', $return = FALSE) { - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); return $CI->lang->load($file, $lang, $return); @@ -494,7 +494,7 @@ function language($file = '', $lang = '', $return = FALSE) */ function config($file = '') { - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); $CI->config->load($file); @@ -529,7 +529,7 @@ function scaffolding($table = '') show_error('You must include the name of the table you would like access when you initialize scaffolding'); } - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); $CI->_ci_scaffolding = TRUE; @@ -559,7 +559,7 @@ function _ci_load($data) // to become accessible from within the Controller and Model functions. // Only needed when running PHP 5 - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); foreach (get_object_vars($CI) as $key => $var) @@ -760,7 +760,7 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) } // Instantiate the class - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); if ($config !== NULL) @@ -809,7 +809,7 @@ function _ci_autoloader() // Load any custome config file if (count($autoload['config']) > 0) { - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); foreach ($autoload['config'] as $key => $val) @@ -893,7 +893,7 @@ function _ci_assign_to_models() return; } - if ($this->_ci_use_instance()) + if ($this->_ci_is_instance()) { $CI =& get_instance(); foreach ($this->_ci_models as $model) @@ -934,7 +934,7 @@ function _ci_object_to_array($object) * @access private * @return bool */ - function _ci_use_instance() + function _ci_is_instance() { if ($this->_ci_is_php5 == TRUE) { From 7099a589d1719311427d7552523ec962ebc3b650 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 17:47:59 +0000 Subject: [PATCH 0314/2544] --- system/codeigniter/Base4.php | 4 +-- system/codeigniter/CodeIgniter.php | 20 ++++++------- system/codeigniter/Common.php | 28 +++++++++++-------- system/database/DB_driver.php | 12 +++++--- system/database/DB_utility.php | 3 +- system/database/drivers/oci8/oci8_driver.php | 3 +- .../drivers/postgre/postgre_utility.php | 2 +- system/libraries/Config.php | 2 +- system/libraries/Controller.php | 2 +- system/libraries/Hooks.php | 2 +- system/libraries/Input.php | 5 ++-- system/libraries/Log.php | 2 +- system/libraries/Output.php | 4 +-- system/libraries/Router.php | 2 +- system/libraries/URI.php | 2 +- user_guide/general/changelog.html | 2 +- 16 files changed, 53 insertions(+), 42 deletions(-) diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index 8b3dc92f..9366b458 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -21,8 +21,8 @@ * This file is used only when Code Igniter is being run under PHP 4. * * In order to allow CI to work under PHP 4 we had to make the Loader class - * the parent class of the Controller Base class. It's the only way we - * could enable functions like $this->load->library('email') to instantiate + * the parent of the Controller Base class. It's the only way we enabled + * enable functions like $this->load->library('email') to instantiate * classes that can then be used within controllers as $this->email->send() * * PHP 4 also has trouble referencing the CI super object within application diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 63ae4586..611b1a62 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -50,7 +50,7 @@ * ------------------------------------------------------ */ -$BM =& _load_class('Benchmark'); +$BM =& load_class('Benchmark'); $BM->mark('total_execution_time_start'); $BM->mark('loading_time_base_clases_start'); @@ -60,7 +60,7 @@ * ------------------------------------------------------ */ -$EXT =& _load_class('Hooks'); +$EXT =& load_class('Hooks'); /* * ------------------------------------------------------ @@ -75,9 +75,9 @@ * ------------------------------------------------------ */ -$CFG =& _load_class('Config'); -$RTR =& _load_class('Router'); -$OUT =& _load_class('Output'); +$CFG =& load_class('Config'); +$RTR =& load_class('Router'); +$OUT =& load_class('Output'); /* * ------------------------------------------------------ @@ -99,9 +99,9 @@ * ------------------------------------------------------ */ -$IN =& _load_class('Input'); -$URI =& _load_class('URI'); -$LANG =& _load_class('Language'); +$IN =& load_class('Input'); +$URI =& load_class('URI'); +$LANG =& load_class('Language'); /* * ------------------------------------------------------ @@ -116,7 +116,7 @@ * */ -_load_class('Loader', FALSE); +load_class('Loader', FALSE); if (floor(phpversion()) < 5) { @@ -127,7 +127,7 @@ require(BASEPATH.'codeigniter/Base5'.EXT); } -_load_class('Controller', FALSE); +load_class('Controller', FALSE); require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index a801c082..8ac80d63 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -41,7 +41,7 @@ * @param bool optional flag that lets classes get loaded but not instantiated * @return object */ -function _load_class($class, $instantiate = TRUE) +function &load_class($class, $instantiate = TRUE) { static $objects = array(); @@ -55,7 +55,8 @@ function _load_class($class, $instantiate = TRUE) // which we don't need to load. We only instantiate it. if ($class == 'Instance') { - return $objects[$class] =& new $class(); + $objects[$class] =& new $class(); + return $objects[$class]; } // If the requested class does not exist in the application/libraries @@ -104,18 +105,21 @@ function _load_class($class, $instantiate = TRUE) if ($instantiate == FALSE) { - return $objects[$class] = TRUE; + $objects[$class] = TRUE; + return $objects[$class]; } if ($is_subclass == TRUE) { $name = 'MY_'.$class; - return $objects[$class] =& new $name(); + $objects[$class] =& new $name(); + return $objects[$class]; } $name = ($class != 'Controller') ? 'CI_'.$class : $class; - return $objects[$class] =& new $name(); + $objects[$class] =& new $name(); + return $objects[$class]; } /** @@ -124,7 +128,7 @@ function _load_class($class, $instantiate = TRUE) * @access private * @return array */ -function &_get_config() +function &get_config() { static $main_conf; @@ -162,7 +166,7 @@ function &_get_config() */ function show_error($message) { - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); echo $error->show_error('An Error Was Encountered', $message); exit; } @@ -180,7 +184,7 @@ function show_error($message) */ function show_404($page = '') { - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); $error->show_404($page); exit; } @@ -199,13 +203,13 @@ function log_message($level = 'error', $message, $php_error = FALSE) { static $LOG; - $config =& _get_config(); + $config = get_config(); if ($config['log_errors'] === FALSE) { return; } - $LOG =& _load_class('Log'); + $LOG =& load_class('Log'); $LOG->write_log($level, $message, $php_error); } @@ -238,7 +242,7 @@ function _exception_handler($severity, $message, $filepath, $line) return; } - $error =& _load_class('Exceptions'); + $error =& load_class('Exceptions'); // Should we display the error? // We'll get the current error_reporting level and add its bits @@ -250,7 +254,7 @@ function _exception_handler($severity, $message, $filepath, $line) } // Should we log the error? No? We're done... - $config =& _get_config(); + $config = get_config(); if ($config['log_errors'] === FALSE) { return; diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index c8a00b7b..99c95a6f 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -682,7 +682,8 @@ function list_tables() } } - return $this->data_cache['table_names'] =& $retval; + $this->data_cache['table_names'] = $retval; + return $this->data_cache['table_names']; } // -------------------------------------------------------------------- @@ -747,7 +748,8 @@ function list_fields($table = '') } } - return $this->data_cache['field_names'][$table] =& $retval; + $this->data_cache['field_names'][$table] = $retval; + return $this->data_cache['field_names'][$table]; } // -------------------------------------------------------------------- @@ -931,7 +933,8 @@ function cache_set_path($path = '') */ function cache_on() { - return $this->cache_on = TRUE; + $this->cache_on = TRUE; + return TRUE; } // -------------------------------------------------------------------- @@ -944,7 +947,8 @@ function cache_on() */ function cache_off() { - return $this->cache_on = FALSE; + $this->cache_on = FALSE; + return FALSE; } diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index c2c5f1fe..51e43a7c 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -110,7 +110,8 @@ function list_databases() } } - return $this->data_cache['db_names'] =& $dbs; + $this->data_cache['db_names'] = $dbs; + return $this->data_cache['db_names']; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index e83c640b..794405a0 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -163,7 +163,8 @@ function _prep_query($sql) */ function get_cursor() { - return $this->curs_id = ocinewcursor($this->conn_id); + $this->curs_id = ocinewcursor($this->conn_id); + return $this->curs_id; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index 0c265de1..b08b879d 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -106,7 +106,7 @@ function _optimize_table($table) */ function _repair_table($table) { - return return FALSE; + return FALSE; } // -------------------------------------------------------------------- diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 26770cc4..82836b1f 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -44,7 +44,7 @@ class CI_Config { */ function CI_Config() { - $this->config =& _get_config(); + $this->config = get_config(); log_message('debug', "Config Class Initialized"); } // END CI_Config() diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 7a3f5e5d..938c46e4 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -73,7 +73,7 @@ function _ci_initialize() foreach ($classes as $var => $class) { - $this->$var =& _load_class($class); + $this->$var =& load_class($class); } diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 8767e10d..e2d0500c 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -53,7 +53,7 @@ function CI_Hooks() */ function _initialize() { - $CFG =& _load_class('Config'); + $CFG =& load_class('Config'); // If hooks are not enabled in the config file // there is nothing else to do diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 0d3c87b4..72344e34 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -44,7 +44,7 @@ function CI_Input() { log_message('debug', "Input Class Initialized"); - $CFG =& _load_class('Config'); + $CFG =& load_class('Config'); $this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; $this->_sanitize_globals(); @@ -306,7 +306,8 @@ function ip_address() if ($this->ip_address === FALSE) { - return $this->ip_address = '0.0.0.0'; + $this->ip_address = '0.0.0.0'; + return $this->ip_address; } if (strstr($this->ip_address, ',')) diff --git a/system/libraries/Log.php b/system/libraries/Log.php index eff7cb7f..09538fa0 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -42,7 +42,7 @@ class CI_Log { */ function CI_Log() { - $config =& _get_config(); + $config = get_config(); $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 507beab5..7e859453 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -299,8 +299,8 @@ function _write_cache($output) */ function _display_cache(&$CFG, &$RTR) { - $CFG =& _load_class('Config'); - $RTR =& _load_class('Router'); + $CFG =& load_class('Config'); + $RTR =& load_class(('Router'); $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 27e3c27c..dab84883 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -48,7 +48,7 @@ class CI_Router { */ function CI_Router() { - $this->config =& _load_class('Config'); + $this->config =& load_class('Config'); $this->_set_route_mapping(); log_message('debug', "Router Class Initialized"); } diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 80b11266..fcf6afe4 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -42,7 +42,7 @@ class CI_URI { */ function CI_URI() { - $this->router =& _load_class('Router'); + $this->router =& load_class('Router'); log_message('debug', "URI Class Initialized"); } diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 732e1c77..9836671e 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -116,7 +116,7 @@

    Version 1.4.1

  • Removed the is_numeric test from the db->escape() function.
  • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
  • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
  • -
  • Fixed a bug that was causing a PHP error when the Exceptions class was called within the _get_config() function since it was causing problems.
  • +
  • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
  • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
  • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
  • Added some code to allow email attachments to be reset when sending batches of email.
  • From adb899a14b65e553d24eabd9de0d38c6dd5d340c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 23:11:33 +0000 Subject: [PATCH 0315/2544] --- user_guide/database/caching.html | 46 ++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 05c6b330..0e31eac2 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -81,7 +81,7 @@

    Enabling Caching

  • Enable the caching feature, either globally by setting the preference in your application/config/database.php file, or manually as described below.
  • -

    Once enabled, caching will happen automatically whenever a web pages that contains database queries is loaded.

    +

    Once enabled, caching will happen automatically whenever a page is loaded that contains database queries.

    How Does Caching Work?

    @@ -103,11 +103,11 @@

    Will Caching Improve Your Site's Performance?

    Getting a performance gain as a result of caching depends on many factors. If you have a highly optimized database under very little load, you probably won't see a performance boost. -If your database is under heavy use you probably will see an improved response, assuming your filesystem is not +If your database is under heavy use you probably will see an improved response, assuming your file-system is not overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database -operation to a filesystem one.

    +operation to a file-system one.

    -

    In some clustered server environments, for example, caching may be detrimental since filesystem operations are so intense. +

    In some clustered server environments, for example, caching may be detrimental since file-system operations are so intense. On single servers in shared environments, caching will probably be beneficial. Unfortunately there is no single answer to the question of whether you should cache your database. It really depends on your situation.

    @@ -119,7 +119,7 @@

    How are Cache Files Stored?

    For example, let's say you have a controller called blog with a function called comments that contains three queries. The caching system will create a cache folder -called blog_comments, into which it will write three cache files.

    +called blog+comments, into which it will write three cache files.

    If you use dynamic queries that change based on information in your URI (when using pagination, for example), each instance of the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have @@ -158,8 +158,44 @@

    Function Reference

    +

    $this->db->cache_on()  /   $this->db->cache_off()

    +

    Manually enables/disables caching. This can be useful if you want to +keep certain queries from being cached. Example:

    + +// Turn caching on
    +$this->db->cache_on();
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +// Turn caching off for this one query
    +$this->db->cache_off();
    +$query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'");
    +
    +// Turn caching back on
    +$this->db->cache_on();
    +$query = $this->db->query("SELECT * FROM another_table"); +
    + + +

    $this->db->cache_delete()

    + +

    Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.

    + +

    The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing +a page at www.your-site.com/index.php/blog/comments, the caching system will put all cache files associated with it in a folder +called blog+comments. To delete those particular cache files you will use:

    + +$this->db->cache_delete('blog', 'comments'); + +

    If you do not use any parameters the current URI will be used when determining what should be cleared.

    + + +

    $this->db->cache_delete_all()

    + +

    Clears all existing cache files. Example:

    + +$this->db->cache_delete_all(); From f66de86a85676771d61759fb63e851fc496b0a3b Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 23:30:04 +0000 Subject: [PATCH 0316/2544] --- user_guide/database/utilities.html | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 68cf7ffb..1fdc4b00 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -138,12 +138,15 @@

    $this->dbutil->list_databases()

    $this->dbutil->optimize_table('table_name');

    +

    Note:  This features is only available for MySQL/MySQLi databases.

    + +

    Permits you to optimize a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    if ($this->dbutil->optimize_table('table_name'))
    {
    -    echo 'Success!'
    +    echo 'Success!';
    }
    @@ -153,12 +156,15 @@

    $this->dbutil->optimize_table('table_name');

    $this->dbutil->repair_table('table_name');

    +

    Note:  This features is only available for MySQL/MySQLi databases.

    + +

    Permits you to repair a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    if ($this->dbutil->optimize_table('table_name'))
    {
    -    echo 'Success!'
    +    echo 'Success!';
    }
    @@ -168,10 +174,12 @@

    $this->dbutil->repair_table('table_name');

    $this->dbutil->optimize_database();

    +

    Note:  This features is only available for MySQL/MySQLi databases.

    +

    Permits you to optimize the database your DB class is currently connected to. Returns an array containing the returned status messages or FALSE on failure.

    -$result = $this->dbutil->optimize_databass();
    +$result = $this->dbutil->optimize_database();

    if ($result !== FALSE)
    {
    @@ -206,7 +214,7 @@

    $this->dbutil->csv_from_result($db_result)

    echo $this->dbutil->csv_from_result($query, $delimiter, $newline);
    -

    Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. +

    Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. If you need to write the file use the File Helper.

    @@ -231,7 +239,7 @@

    $this->dbutil->xml_from_result($db_result)

    echo $this->dbutil->xml_from_result($query, $config);
    -

    Important:  This function will NOT write the XML file for you. It simply creates the XML layout. +

    Important:  This function will NOT write the XML file for you. It simply creates the XML layout. If you need to write the file use the File Helper.

    @@ -240,6 +248,8 @@

    $this->dbutil->backup()

    Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

    +

    Note:  This features is only available for MySQL/MySQLi databases.

    +

    Note: Due to the limited execution time and memory available to PHP, backing up very large databases may not be possible. If your database is very large you might need to backup directly from your SQL server via the command line, or have your server admin do it for you if you do not have root privileges.

    From 1b0ab4665720446eee6b03f864bb5576e6065a4a Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 23:30:21 +0000 Subject: [PATCH 0317/2544] --- system/database/DB_driver.php | 4 ++-- system/database/DB_utility.php | 8 ++++---- system/libraries/Output.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 99c95a6f..6da645a3 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -960,13 +960,13 @@ function cache_off() * @access public * @return void */ - function cache_delete() + function cache_delete($segment_one = '', $segment_two = '') { if ( ! $this->_cache_init()) { return FALSE; } - return $this->CACHE->delete(); + return $this->CACHE->delete($segment_one, $segment_two); } // -------------------------------------------------------------------- diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 51e43a7c..13fcaa5c 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -37,7 +37,7 @@ function CI_DB_utility() { // Assign the main database object to $this->db $CI =& get_instance(); - $this->CI =& $obj->db; + $this->db =& $CI->db; log_message('debug', "Database Utility Class Initialized"); } @@ -100,7 +100,7 @@ function list_databases() return $this->data_cache['db_names']; } - $query = $this->db->query($this->_list_database()); + $query = $this->db->query($this->_list_databases()); $dbs = array(); if ($query->num_rows() > 0) { @@ -147,7 +147,7 @@ function optimize_table($table_name) function optimize_database() { $result = array(); - foreach ($this->list_tables() as $table_name) + foreach ($this->db->list_tables() as $table_name) { $sql = $this->_optimize_table($table_name); @@ -356,7 +356,7 @@ function backup($params = array()) // If no table names were submitted we'll fetch the entire table list if (count($prefs['tables']) == 0) { - $prefs['tables'] = $this->list_tables(); + $prefs['tables'] = $this->db->list_tables(); } // ------------------------------------------------------ diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 7e859453..9c48bbb8 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -300,7 +300,7 @@ function _write_cache($output) function _display_cache(&$CFG, &$RTR) { $CFG =& load_class('Config'); - $RTR =& load_class(('Router'); + $RTR =& load_class('Router'); $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); From a33ec0a3efc6e1c623966a210a83a67e1e253b9f Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 23:38:05 +0000 Subject: [PATCH 0318/2544] --- user_guide/database/transactions.html | 4 ++-- user_guide/general/changelog.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index cf095ea8..8077155e 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -67,11 +67,11 @@

    Transactions

    Code Igniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need -to be running InnoDB or BDB table types rather then the more common MyISAM. Most other databases support transactions natively.

    +to be running InnoDB or BDB table types rather then the more common MyISAM. Most other database platforms support transactions natively.

    If you are not familiar with transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you -have a basic understanding of transactions. For most sites, however, transactions won't be necessary. +have a basic understanding of transactions.

    Code Igniter's Approach to Transactions

    diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 9836671e..81dbcff9 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -63,8 +63,8 @@

    Change Log

    -

    Version 1.5.0

    -

    Release Date: October 15, 2006

    +

    Version 1.5.0 Beta

    +

    Release Date: October 11, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • From 19ec9b171508e590f8503cf8c1408d6729bad18d Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Oct 2006 23:57:08 +0000 Subject: [PATCH 0319/2544] --- system/application/config/autoload.php | 2 +- system/application/config/database.php | 18 +----------------- system/application/config/routes.php | 2 +- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index f3b30a41..06d8780c 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -37,7 +37,7 @@ | $autoload['libraries'] = array('database', 'session', 'xmlrpc'); */ -$autoload['libraries'] = array('database'); +$autoload['libraries'] = array(); /* diff --git a/system/application/config/database.php b/system/application/config/database.php index c594ba89..32b23058 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -41,23 +41,7 @@ $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; -$db['default']['cachedir'] = APPPATH.'db_cache/'; - - - -$db['test']['hostname'] = "localhost"; -$db['test']['username'] = "root"; -$db['test']['password'] = ""; -$db['test']['database'] = "exp4"; -$db['test']['dbdriver'] = "mysql"; -$db['test']['dbprefix'] = ""; -$db['test']['active_r'] = TRUE; -$db['test']['pconnect'] = FALSE; -$db['test']['db_debug'] = TRUE; - - - - +$db['default']['cachedir'] = ''; ?> \ No newline at end of file diff --git a/system/application/config/routes.php b/system/application/config/routes.php index 097037e3..8fa16780 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -40,7 +40,7 @@ */ $route['default_controller'] = "welcome"; -$route['scaffolding_trigger'] = "scaffolding"; +$route['scaffolding_trigger'] = ""; From 2799120c10b8d2544dd71e37b3a48c1eaa834c48 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 01:38:08 +0000 Subject: [PATCH 0320/2544] --- system/libraries/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 4771295a..0f2c49d9 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -50,7 +50,7 @@ function CI_Table() */ function set_template($template) { - if ( ! is_array()) + if ( ! is_array($template)) { return FALSE; } From 4003718f35247ef9b4a8d678389bda639677bac7 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:16:58 +0000 Subject: [PATCH 0321/2544] --- system/codeigniter/Base4.php | 6 ++++-- system/database/DB_driver.php | 2 +- system/libraries/Controller.php | 3 +-- system/libraries/Table.php | 8 ++++++-- user_guide/database/utilities.html | 4 ++-- user_guide/general/changelog.html | 2 +- user_guide/general/controllers.html | 1 + user_guide/installation/upgrade_150.html | 8 +++++++- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/table.html | 4 ++-- user_guide/libraries/trackback.html | 2 +- user_guide/nav/nav.js | 2 +- user_guide/toc.html | 2 +- 14 files changed, 30 insertions(+), 18 deletions(-) diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index 9366b458..2793317e 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -21,7 +21,7 @@ * This file is used only when Code Igniter is being run under PHP 4. * * In order to allow CI to work under PHP 4 we had to make the Loader class - * the parent of the Controller Base class. It's the only way we enabled + * the parent of the Controller Base class. It's the only way we can * enable functions like $this->load->library('email') to instantiate * classes that can then be used within controllers as $this->email->send() * @@ -42,11 +42,13 @@ class CI_Base extends CI_Loader { function CI_Base() { + // This allows syntax like $this->load->foo() to work parent::CI_Loader(); $this->load =& $this; + // This allows resources used within controller constructors to work global $OBJ; - $OBJ = $this->load; + $OBJ = $this->load; // Do NOT use a reference. } } diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 6da645a3..22f91ed4 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -400,7 +400,7 @@ function simple_query($sql) $this->initialize(); } - return $this->_execute($sql, $this->conn_id); + return $this->_execute($sql); } // -------------------------------------------------------------------- diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 938c46e4..88ab4616 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -75,8 +75,7 @@ function _ci_initialize() { $this->$var =& load_class($class); } - - + // In PHP 5 the Controller class is run as a discreet // class. In PHP 4 it extends the Controller if (floor(phpversion()) >= 5) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 0f2c49d9..61d04eef 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -211,9 +211,13 @@ function _set_from_object($query) } // Next blast through the result array and build out the rows - foreach ($query->result_array() as $row) + + if ($query->num_rows() > 0) { - $this->rows[] = $row; + foreach ($query->result_array() as $row) + { + $this->rows[] = $row; + } } } diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 1fdc4b00..de025ea3 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -311,9 +311,9 @@

      Description of Backup Preferences

      add_dropTRUETRUE/FALSEWhether to include DROP TABLE statements in your SQL export file. -add_insert/strong>TRUETRUE/FALSEWhether to include INSERT statements in your SQL export file. +add_insertTRUETRUE/FALSEWhether to include INSERT statements in your SQL export file. -newline/strong>"\n""\n", "\r", "\r\n"Type of newline to use in your SQL export file. +newline"\n""\n", "\r", "\r\n"Type of newline to use in your SQL export file. diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 81dbcff9..6fac208f 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -80,7 +80,7 @@

      Version 1.5.0 Beta

    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • -
    • Added $query->field_names() function to database class
    • +
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 49f8e58a..db488c54 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -398,6 +398,7 @@

      Reserved Function Names

    • _ci_autoloader
    • _ci_init_class
    • _ci_init_scaffolding
    • +
    • _ci_is_instance
    • _ci_load
    • _ci_load_class
    • _ci_object_to_array
    • diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index b532073f..e757d35a 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -97,8 +97,14 @@

      Step 2: Update your database.php file

    +

    Step 3: Update your main index.php file

    -

    Step 3: Update your user guide

    +

    If you are running a stock index.php file simply replace your version with the new one. If you are running one with +internal modifications, open it and add this line of code near the bottom:

    + +define('FCPATH', __FILE__); + +

    Step 4: Update your user guide

    Please also replace your local copy of the user guide with the new version.

    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 9e779579..600a7fb3 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -426,7 +426,7 @@

    Explanation

       ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Image Manipulation Class +Next Topic:  HTML Table Class

    Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index c33ec20e..4538e863 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -656,7 +656,7 @@

    Overlay Preferences

    diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index a5480b91..2f2e9b3c 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 8ae88957..a8f924e1 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 6fac208f..255a4b63 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index db488c54..8cb54c8e 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 53a674b4..7466b544 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index fb3f4178..b57d739c 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 02777b04..49ba02e6 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 42981275..cf829027 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 82daa74c..23584d62 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 176adf6d..4fcbfbb0 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index a00b46f7..fe9a1a1e 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 44b1eb0b..55585b30 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 0e1d2a69..957a734f 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 09683c69..3fdc4d6c 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    From 939906b0ba774948a49e1b9b0bc22d265ecb451a Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:39:48 +0000 Subject: [PATCH 0325/2544] --- user_guide/general/alternative_php.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/multiple_apps.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index e1bc5cc8..ef90f2a4 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 8eb6fae3..8d2cbe55 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 5511c229..868d0cb0 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 557a49ef..4aa2e857 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 5999af7f..168aee8b 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html index 8537658d..481a24ef 100644 --- a/user_guide/general/multiple_apps.html +++ b/user_guide/general/multiple_apps.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 536c8481..cb402cb2 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 2c8d41ba..a4057817 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 7242cd39..2cb99574 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 8f0be887..9d77e5da 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index cd3e6644..9f35d3f9 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 79921e8c..88f26a2c 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 4538e863..2cd9540d 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 4e5ac3b7..3bfea14f 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 347421d6..eb87231e 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 015e7ea8..487b5844 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5a1216f6..daf5dfe6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index e221f4c6..b9d4ebb3 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index f25e6979..b08b7b81 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index d072a570..8d2f06de 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -34,7 +34,7 @@ - +

    Code Igniter User Guide Version 1.5.0b1

    From 4979a12de4e18edb54af07cd187e2a193bc518eb Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:40:07 +0000 Subject: [PATCH 0326/2544] --- user_guide/changelog.html | 105 +++++++++++------------ user_guide/index.html | 4 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 18 files changed, 70 insertions(+), 71 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6fac208f..4407b7f1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -4,12 +4,12 @@ Code Igniter User Guide - - + + - - - + + + - + +
    - +

    Code Igniter User Guide Version 1.5.0b1

    @@ -46,7 +46,7 @@ Code Igniter Home  ›  -User Guide Home  ›  +User Guide Home  ›  Change Log
    Search User Guide   
    @@ -67,26 +67,26 @@

    Version 1.5.0 Beta

    Release Date: October 11, 2006

      -
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • -
    • Added Database Caching Class.
    • -
    • Added transaction support to the database classes.
    • -
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • -
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • -
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • -
    • Added Zip Encoding Library.
    • +
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • +
    • Added Database Caching Class.
    • +
    • Added transaction support to the database classes.
    • +
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • +
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • +
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • +
    • Added Zip Encoding Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • -
    • Added Download Helper.
    • -
    • Added simple_query() function to the database classes
    • -
    • Added standard_date() function to the Date Helper.
    • -
    • Added $query->free_result() to database class.
    • -
    • Added $query->list_fields() function to database class
    • -
    • Added $this->db->platform() function
    • +
    • Added Download Helper.
    • +
    • Added simple_query() function to the database classes
    • +
    • Added standard_date() function to the Date Helper.
    • +
    • Added $query->free_result() to database class.
    • +
    • Added $query->list_fields() function to database class
    • +
    • Added $this->db->platform() function
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • -
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • +
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the validation class.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • @@ -103,13 +103,13 @@

      Version 1.4.1

      • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
      • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
      • -
      • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
      • -
      • Added $this->output->set_header() function, which allows you to set server headers.
      • +
      • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
      • +
      • Added $this->output->set_header() function, which allows you to set server headers.
      • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
      • -
      • Added Inflector helper.
      • -
      • Added element() function in the array helper.
      • +
      • Added Inflector helper.
      • +
      • Added element() function in the array helper.
      • Added RAND() to active record orderby() function.
      • -
      • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
      • +
      • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
      • Added Oracle database driver (still undergoing testing so it might have some bugs).
      • Added the ability to combine pseudo-variables and php variables in the template parser class.
      • Added output compression option to the config file.
      • @@ -121,7 +121,7 @@

        Version 1.4.1

      • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
      • Added some code to allow email attachments to be reset when sending batches of email.
      • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
      • +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
      • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
      • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
      @@ -138,13 +138,13 @@

      Version 1.4.0

    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • -
    • Added the ability to supply full URLs using the anchor() helper function.
    • -
    • Added mode parameter to file_write() helper.
    • -
    • Added support for changing the port number in the Postgre driver.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • +
    • Added mode parameter to file_write() helper.
    • +
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • -
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • -
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • +
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • +
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • @@ -189,7 +189,7 @@

      Version 1.3.3

        -
      • Models do not connect automatically to the database as of this version. More info here. +
      • Models do not connect automatically to the database as of this version. More info here.
      • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
      • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
      • Fixed a bug in the active record "having" function.
      • @@ -224,14 +224,14 @@

        Version 1.3.1

        Release Date: April 11, 2006

          -
        • Added a Unit Testing Library.
        • +
        • Added a Unit Testing Library.
        • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
        • -
        • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
        • -
        • Added getwhere function to Active Record class.
        • -
        • Added count_all function to Active Record class.
        • +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details. +
        • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
        • +
        • Added getwhere function to Active Record class.
        • +
        • Added count_all function to Active Record class.
        • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
        • -
        • Added $this->db->last_query(), which allows you to view your last query that was run.
        • +
        • Added $this->db->last_query(), which allows you to view your last query that was run.
        • Added a new mime type to the upload class for better compatibility.
        • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
        • Fixed a bug in a couple of the active record functions (where and orderby).
        • @@ -248,20 +248,20 @@

          Version 1.3

          • Added support for Models.
          • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
          • -
          • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
          • -
          • Added a feature to the database class that lets you run custom function calls.
          • +
          • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
          • +
          • Added a feature to the database class that lets you run custom function calls.
          • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
          • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
          • Added support for running standard query string URLs. These can be optionally enabled in your config file.
          • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
          • Added a new error template for use with native PHP errors.
          • -
          • Added "alternator" function in the string helpers.

            +
          • Added "alternator" function in the string helpers.

          • Removed slashing from the input class. After much debate we decided to kill this feature.
          • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
          • Added better class and function name-spacing to avoid collisions with user developed classes. All Code Igniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
          • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
          • -
          • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
          • +
          • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
          • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
          • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
          • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
          • @@ -282,10 +282,10 @@

            Version 1.2

            • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
            • Added a global function named get_instance() allowing the main Code Igniter object to be accessible throughout your own classes.
            • -
            • Added new File Helper: delete_files()
            • -
            • Added new URL Helpers: base_url(), index_page()
            • +
            • Added new File Helper: delete_files()
            • +
            • Added new URL Helpers: base_url(), index_page()
            • Added the ability to create your own core libraries and store them in your local application directory.
            • -
            • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
            • +
            • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
            • Added Javascript Calendar plugin.
            • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
            • Updated the parser class so that it allows tag pars within other tag pairs.
            • @@ -303,7 +303,7 @@

              Version Beta 1.1

              Release Date: March 10, 2006

                -
              • Added a Calendaring class.
              • +
              • Added a Calendaring class.
              • Added support for running multiple applications that share a common Code Igniter backend.
              • Moved the "uri protocol" variable from the index.php file into the config.php file
              • Fixed a problem that was preventing certain function calls from working within constructors.
              • @@ -332,14 +332,13 @@

                Version Beta 1.0

                diff --git a/user_guide/index.html b/user_guide/index.html index bb399f24..f55e7af6 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                @@ -84,7 +84,7 @@

                Who is Code Igniter For?

              • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
              • You want a framework that requires nearly zero configuration.
              • You want a framework that does not require you to use the command line.
              • -
              • You want a framework that doesn't require you to adhere to restrictive coding rules.
              • +
              • You want a framework that does not require you to adhere to restrictive coding rules.
              • You are not interested in large-scale monolithic libraries like PEAR.
              • You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
              • You eschew complexity, favoring simple solutions.
              • diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 825b9ded..3dc4551b 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 20597c9e..f97ab6f6 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 9be32cf4..df5c6eb6 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 600a7fb3..e8f58fad 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index d26a998b..eb17cdbf 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index d8ac8cd9..14796a78 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index ace408e0..d6279f9c 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 77f57087..a9d11c34 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index c4caf5e4..d060b392 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 45b92abb..f48681c1 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 8f3eb07d..82f8757d 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 38356708..f72ba9cd 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 96ce4d14..e76f57b8 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index ad14006c..dd77e6a6 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index e78e6a48..c9155efc 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/toc.html b/user_guide/toc.html index 7eaa5ae4..5d959e75 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -68,7 +68,7 @@

                Basic Info

                From 4d02a4feaf2ad7b5e5e29cedf446b777a5547321 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:40:24 +0000 Subject: [PATCH 0327/2544] --- user_guide/database/active_record.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/license.html | 2 +- user_guide/nav/nav.js | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index bbc0a446..afb93404 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 6010d8b9..0da65977 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 63fc6734..fa8ed63b 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 40a3b8c9..31e687ae 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index d9a2dcab..47395ff3 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index f6e93a95..f8609c77 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index ed1855ce..7ad559ca 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/index.html b/user_guide/database/index.html index ccc8060c..1805cdea 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/results.html b/user_guide/database/results.html index d4108819..e377c311 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index b7e80a37..b642e6c9 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 8077155e..fb1f1fc2 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index de025ea3..8defbc1b 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/license.html b/user_guide/license.html index 8a046f4a..0a758b1a 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index 150c7caf..3906038d 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -12,7 +12,7 @@ function create_menu(basepath) '' + diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 4ff54f39..720122a7 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 241b522b..50b5637c 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index d20ed486..6ee87022 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                From 43c36af048872d540a93abd0c8cc5546f4d84162 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:40:39 +0000 Subject: [PATCH 0328/2544] --- user_guide/database/caching.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/userguide.css | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 0e31eac2..6abc4938 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 9ae382b4..d22113d5 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index f489d381..c45d3df1 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index c87eff78..f667e80b 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index ff0a44d2..ca88ba08 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index c1378f29..af1f87bc 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 7e7a9dcd..806c3a26 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index b48d3bf5..740cbc14 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index affdae3e..e8ee3f33 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index bd9527bc..1c565c17 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index f61d599d..9de65ae4 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index cb12d966..de566767 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index d6b286a3..e37902c3 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/userguide.css b/user_guide/userguide.css index 5cd6734f..d58ec96f 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -48,7 +48,7 @@ a:hover { } #nav2 { background: #fff url(images/nav_bg.jpg) repeat-x left top; - padding: 0 180px 0 0; + padding: 0 240px 0 0; margin: 0; text-align: right; } From 0a6973460d4a2942a7f8134b51171052a53145a3 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:40:55 +0000 Subject: [PATCH 0329/2544] --- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 3a201732..f006cd3f 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index d06f7da5..15783890 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 69712c6d..05f14fe4 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index d4ed8339..273a177f 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index b470c71b..ab6e83c2 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 56036915..af3c3031 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 438a9b19..28189962 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 66ae7b63..03c50960 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 25a4bbac..90094bd4 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 4ae790d9..f1f4e9e1 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 78ce2543..d4aa8ec9 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index c8db0479..ece00c81 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 245ab635..6ab237e0 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                From 75247ee81ed3e4b1248f9e5cf7efb41790bb4d3d Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 19:41:10 +0000 Subject: [PATCH 0330/2544] --- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrading.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 8add34b3..78adaa40 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 7f0c1832..58e5d07b 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index a3d16fa7..10e53056 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index e757d35a..990c2bed 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index a05b25fe..134063a6 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -34,7 +34,7 @@ - +

                Code Igniter User Guide Version 1.5.0b1

                From 4c1ab6c826c3f5c3158a38443c2d3c30203f0f5a Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 21:48:33 +0000 Subject: [PATCH 0331/2544] --- system/libraries/Router.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index dab84883..ead1439f 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -366,24 +366,30 @@ function _get_uri_string() */ function _parse_request_uri() { - if (($request_uri = getenv('REQUEST_URI')) == '') + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') { return ''; } - $fc_path = FCPATH; + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '') + { + return ''; + } + $fc_path = FCPATH; if (strpos($request_uri, '?') !== FALSE) { $fc_path .= '?'; } - $parsed_uri = explode("/", preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $request_uri))); - + $parsed_uri = explode("/", $request_uri); + $i = 0; foreach(explode("/", $fc_path) as $segment) { - if ($segment == $parsed_uri[$i]) + if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) { $i++; } From 606f99c043272f96f21911d89c21cd36c2ef59e4 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 11 Oct 2006 23:48:41 +0000 Subject: [PATCH 0332/2544] --- system/codeigniter/CodeIgniter.php | 2 +- system/database/DB_driver.php | 3 ++- system/database/DB_result.php | 6 +++--- system/database/drivers/mssql/mssql_result.php | 8 +++++++- system/database/drivers/mysql/mysql_result.php | 8 +++++++- system/database/drivers/mysqli/mysqli_result.php | 8 +++++++- system/database/drivers/oci8/oci8_result.php | 8 +++++++- system/database/drivers/odbc/odbc_result.php | 8 +++++++- system/database/drivers/postgre/postgre_result.php | 8 +++++++- system/database/drivers/sqlite/sqlite_result.php | 8 +++++++- system/libraries/Loader.php | 11 +++-------- system/libraries/Table.php | 4 ++-- 12 files changed, 60 insertions(+), 22 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 611b1a62..49347715 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -241,7 +241,7 @@ /* * ------------------------------------------------------ - * Close the DB connection of one exists + * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB')) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 22f91ed4..a4131fd7 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -172,6 +172,7 @@ function load_utilities() $CI =& get_instance(); $CI->dbutil = new $class(); + $CI->_ci_assign_to_models(); } // -------------------------------------------------------------------- @@ -629,7 +630,7 @@ function escape($str) */ function primary($table = '') { - $fields = $this->field_names($table); + $fields = $this->list_fields($table); if ( ! is_array($fields)) { diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 1c8ad6be..b163bb5e 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -261,14 +261,14 @@ function previous_row($type = 'object') */ function num_rows() { return $this->num_rows; } function num_fields() { return 0; } - function field_names() { return array(); } + function list_fields() { return array(); } + function field_names() { return array(); } // Deprecated 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(); } - - + } // END DB_result class ?> \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index 498deae0..0ba0b8c5 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); while ($field = mssql_fetch_field($this->result_id)) @@ -70,6 +70,12 @@ function field_names() return $field_names; } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 3fdfc818..1cf6ff18 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); while ($field = mysql_fetch_field($this->result_id)) @@ -70,6 +70,12 @@ function field_names() return $field_names; } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 08db13f1..215403e9 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); while ($field = mysql_fetch_field($this->result_id)) @@ -71,6 +71,12 @@ function field_names() return $field_names; } + // Deprecated + function field_names() + { + return $this->list_fields(); + } + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index a3da8002..ab13a393 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -84,7 +84,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); $fieldCount = $this->num_fields(); @@ -95,6 +95,12 @@ function field_names() return $field_names; } + // Deprecated + function field_names() + { + return $this->list_fields(); + } + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 9204d868..ea834f9b 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -71,6 +71,12 @@ function field_names() return $field_names; } + // Deprecated + function field_names() + { + return $this->list_fields(); + } + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 8c25c5d4..e792544a 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -71,6 +71,12 @@ function field_names() return $field_names; } + // Deprecated + function field_names() + { + return $this->list_fields(); + } + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index a3e94b47..55364bb2 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -60,7 +60,7 @@ function num_fields() * @access public * @return array */ - function field_names() + function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -71,6 +71,12 @@ function field_names() return $field_names; } + // Deprecated + function field_names() + { + return $this->list_fields(); + } + // -------------------------------------------------------------------- /** diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 96ec0c91..7a6637ac 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -171,10 +171,7 @@ function model($model, $name = '', $db_conn = FALSE) $CI->$name = new $model(); foreach (get_object_vars($CI) as $key => $var) { - if ( ! isset($CI->$name->$key)) - { - $CI->$name->$key =& $CI->$key; - } + $CI->$name->$key =& $CI->$key; } } else @@ -182,14 +179,12 @@ function model($model, $name = '', $db_conn = FALSE) $this->$name = new $model(); foreach (get_object_vars($this) as $key => $var) { - if ( ! isset($this->$name->$key)) - { - $this->$name->$key =& $CI->$key; - } + $this->$name->$key =& $this->$key; } } $this->_ci_models[] = $name; + $this->_ci_assign_to_models(); } diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 61d04eef..758676e2 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -202,12 +202,12 @@ function _set_from_object($query) // First generate the headings from the table column names if (count($this->heading) == 0) { - if ( ! method_exists($query, 'field_names')) + if ( ! method_exists($query, 'list_fields')) { return FALSE; } - $this->heading = $query->field_names(); + $this->heading = $query->list_fields(); } // Next blast through the result array and build out the rows From 0aef222d246da84c90e9a89f31f6677cbe6b4ddc Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 18:00:22 +0000 Subject: [PATCH 0333/2544] --- system/database/DB.php | 19 +--- system/database/DB_driver.php | 19 ---- system/libraries/Controller.php | 2 +- system/libraries/Loader.php | 173 ++++++++++++-------------------- system/libraries/Model.php | 28 ++---- 5 files changed, 74 insertions(+), 167 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index 62237440..a148c9ff 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -22,14 +22,8 @@ * @author Rick Ellis * @link http://www.codeigniter.com/user_guide/database/ */ -function DB($params = '', $return = FALSE, $active_record = FALSE) +function DB($params = '', $active_record = FALSE) { - // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) - { - return FALSE; - } - // Load the DB config file if a DSN string wasn't passed if (is_string($params) AND strpos($params, '://') === FALSE) { @@ -84,15 +78,8 @@ function DB($params = '', $return = FALSE, $active_record = FALSE) // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; - $DB = new $driver($params); - - if ($return === TRUE) - { - return $DB; - } - - $CI =& get_instance(); - $CI->db =& $DB; + $DB = new $driver($params); + return $DB; } diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index a4131fd7..848d4f1c 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -155,26 +155,7 @@ function initialize($params = '') } } } - - // -------------------------------------------------------------------- - - /** - * Load the Utilities Class - * - * @access public - * @return string - */ - function load_utilities() - { - require_once(BASEPATH.'database/DB_utility'.EXT); - require_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_utility'.EXT); - $class = 'CI_DB_'.$this->dbdriver.'_utility'; - $CI =& get_instance(); - $CI->dbutil = new $class(); - $CI->_ci_assign_to_models(); - } - // -------------------------------------------------------------------- /** diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 88ab4616..0bbc7773 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -88,7 +88,7 @@ function _ci_initialize() $this->_ci_autoloader(); } } - + // -------------------------------------------------------------------- /** diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 7a6637ac..1f6a8bce 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -119,20 +119,10 @@ function model($model, $name = '', $db_conn = FALSE) return; } - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - if (isset($CI->$name)) - { - show_error('The model name you are loading is the name of a resource that is already being used: '.$name); - } - } - else + $CI =& get_instance(); + if (isset($CI->$name)) { - if (isset($this->$name)) - { - show_error('The model name you are loading is the name of a resource that is already being used: '.$name); - } + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); } $model = strtolower($model); @@ -147,14 +137,7 @@ function model($model, $name = '', $db_conn = FALSE) if ($db_conn === TRUE) $db_conn = ''; - if ($this->_ci_is_instance()) - { - $CI->load->database($db_conn, FALSE, TRUE); - } - else - { - $this->database($db_conn, FALSE, TRUE); - } + $CI->load->database($db_conn, FALSE, TRUE); } if ( ! class_exists('Model')) @@ -166,28 +149,12 @@ function model($model, $name = '', $db_conn = FALSE) $model = ucfirst($model); - if ($this->_ci_is_instance()) - { - $CI->$name = new $model(); - foreach (get_object_vars($CI) as $key => $var) - { - $CI->$name->$key =& $CI->$key; - } - } - else - { - $this->$name = new $model(); - foreach (get_object_vars($this) as $key => $var) - { - $this->$name->$key =& $this->$key; - } - } + $CI->$name = new $model(); + $CI->$name->_assign_libraries(); - $this->_ci_models[] = $name; - $this->_ci_assign_to_models(); + $this->_ci_models[] = $name; } - - + // -------------------------------------------------------------------- /** @@ -201,19 +168,49 @@ function model($model, $name = '', $db_conn = FALSE) */ function database($params = '', $return = FALSE, $active_record = FALSE) { + // Do we even need to load the database class? + if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) + { + return FALSE; + } + require_once(BASEPATH.'database/DB'.EXT); if ($return === TRUE) { - return DB($params, $return, $active_record); + return DB($params, $active_record); } - else + + $CI =& get_instance(); + $CI->db =& DB($params, $active_record); + $this->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Load the Utilities Class + * + * @access public + * @return string + */ + function dbutil() + { + if ( ! class_exists('CI_DB')) { - DB($params, $return, $active_record); - $this->_ci_assign_to_models(); + $this->database(); } - } + $CI =& get_instance(); + + require_once(BASEPATH.'database/DB_utility'.EXT); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); + $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; + + $CI->dbutil = new $class(); + $CI->load->_ci_assign_to_models(); + } + // -------------------------------------------------------------------- /** @@ -467,15 +464,8 @@ function script($scripts = array()) */ function language($file = '', $lang = '', $return = FALSE) { - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - return $CI->lang->load($file, $lang, $return); - } - else - { - return $this->lang->load($file, $lang, $return); - } + $CI =& get_instance(); + return $CI->lang->load($file, $lang, $return); } // -------------------------------------------------------------------- @@ -489,15 +479,8 @@ function language($file = '', $lang = '', $return = FALSE) */ function config($file = '') { - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - $CI->config->load($file); - } - else - { - $this->config->load($file); - } + $CI =& get_instance(); + $CI->config->load($file); } // -------------------------------------------------------------------- @@ -524,17 +507,9 @@ function scaffolding($table = '') show_error('You must include the name of the table you would like access when you initialize scaffolding'); } - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - $CI->_ci_scaffolding = TRUE; - $CI->_ci_scaff_table = $table; - } - else - { - $this->_ci_scaffolding = TRUE; - $this->_ci_scaff_table = $table; - } + $CI =& get_instance(); + $CI->_ci_scaffolding = TRUE; + $CI->_ci_scaff_table = $table; } // -------------------------------------------------------------------- @@ -755,29 +730,15 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) } // Instantiate the class - if ($this->_ci_is_instance()) + $CI =& get_instance(); + if ($config !== NULL) { - $CI =& get_instance(); - if ($config !== NULL) - { - $CI->$classvar = new $name($config); - } - else - { - $CI->$classvar = new $name; - } + $CI->$classvar = new $name($config); } else - { - if ($config !== NULL) - { - $this->$classvar = new $name($config); - } - else - { - $this->$classvar = new $name; - } - } + { + $CI->$classvar = new $name; + } } // -------------------------------------------------------------------- @@ -804,20 +765,10 @@ function _ci_autoloader() // Load any custome config file if (count($autoload['config']) > 0) { - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - foreach ($autoload['config'] as $key => $val) - { - $CI->config->load($val); - } - } - else + $CI =& get_instance(); + foreach ($autoload['config'] as $key => $val) { - foreach ($autoload['config'] as $key => $val) - { - $this->config->load($val); - } + $CI->config->load($val); } } @@ -893,14 +844,14 @@ function _ci_assign_to_models() $CI =& get_instance(); foreach ($this->_ci_models as $model) { - $CI->$model->_assign_libraries(); + $CI->$model->_assign_libraries(); } } else - { + { foreach ($this->_ci_models as $model) { - $this->$model->_assign_libraries(); + $this->$model->_assign_libraries(); } } } diff --git a/system/libraries/Model.php b/system/libraries/Model.php index 48615e07..017a9c6d 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -33,10 +33,9 @@ class Model { */ function Model() { - $this->_assign_libraries(FALSE); + $this->_assign_libraries(); log_message('debug', "Model Class Initialized"); } - // END Model() /** * Assign Libraries @@ -47,26 +46,15 @@ function Model() * * @access private */ - function _assign_libraries($use_reference = TRUE) + function _assign_libraries() { - $CI =& get_instance(); - foreach (get_object_vars($CI) as $key => $var) - { - if ( ! isset($this->$key)) - { - if ($use_reference === TRUE) - { - $this->$key =& $CI->$key; - } - else - { - $this->$key = $CI->$key; - } - } - } - + $CI =& get_instance(); + + foreach (array_keys(get_object_vars($CI)) as $key) + { + $this->$key =& $CI->$key; + } } - // END _assign_libraries() } // END Model Class From 572ed815e69fdd79bfc9cad63afcd370a4eba0aa Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 18:01:52 +0000 Subject: [PATCH 0334/2544] --- user_guide/database/utilities.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 8defbc1b..615c0c52 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -86,11 +86,11 @@

                Table of Contents

                Initializing the Utility Class

                Important:  In order to initialize the Utility class, your database driver must -already be running, since the utilities class is loaded from within the main DB class.

                +already be running, since the utilities class relies on it.

                Load the Utility Class as follows:

                -$this->db->load_utilities() +$this->load->dbutil()

                Once initialized you will access the functions using the $this->dbutil object:

                From 9fa003797d794a63aa58356926fac9649269c668 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 18:20:13 +0000 Subject: [PATCH 0335/2544] --- system/libraries/Encrypt.php | 10 +++++----- user_guide/libraries/encryption.html | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 50b3fab3..b7dba252 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -272,15 +272,15 @@ function mcrypt_decode($data, $key) // -------------------------------------------------------------------- /** - * Set the Mcrypt Cypher + * Set the Mcrypt Cipher * * @access public * @param constant * @return string */ - function set_cypher($cypher) + function set_cipher($cipher) { - $this->_mcrypt_cipher = $cypher; + $this->_mcrypt_cipher = $cipher; } // -------------------------------------------------------------------- @@ -300,12 +300,12 @@ function set_mode($mode) // -------------------------------------------------------------------- /** - * Get Mcrypt Cypher Value + * Get Mcrypt cipher Value * * @access private * @return string */ - function _get_cypher() + function _get_cipher() { if ($this->_mcrypt_cipher == '') { diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index df5c6eb6..3a774e2c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -138,11 +138,11 @@

                $this->encrypt->decode()

                $plaintext_string = $this->encrypt->decode($encrypted_string);
                -

                $this->encrypt->set_cypher();

                +

                $this->encrypt->set_cipher();

                -

                Permits you to set an Mcrypt cypher. By default it uses MCRYPT_RIJNDAEL_256. Example: -$this->encrypt->set_cypher('MCRYPT_BLOWFISH'); -

                Please visit php.net for a list of available cyphers.

                +

                Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example: +$this->encrypt->set_cipher('MCRYPT_BLOWFISH'); +

                Please visit php.net for a list of available ciphers.

                If you'd like to manually test whether your server supports Mcrypt you can use:

                echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; From 80b2bd9b7f1ecafed0d0170be60bd0a2d8a4201c Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 18:30:36 +0000 Subject: [PATCH 0336/2544] --- system/libraries/Loader.php | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 1f6a8bce..2d312e9e 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -67,15 +67,15 @@ function CI_Loader() * * @access public * @param string the name of the class - * @param sring the optional class variable name to assign the library to + * @param mixed the optional parameters * @return void */ - function library($class, $varname = NULL) + function library($class, $params = FALSE) { if ($class == '') return; - $this->_ci_load_class($class, $varname); + $this->_ci_load_class($class, $params); $this->_ci_assign_to_models(); } @@ -640,7 +640,7 @@ function _ci_load($data) * @param mixed any additional parameters * @return void */ - function _ci_load_class($class, $varname = NULL) + function _ci_load_class($class, $params = FALSE) { // Prep the class name $class = strtolower(str_replace(EXT, '', $class)); @@ -665,7 +665,7 @@ function _ci_load_class($class, $varname = NULL) } } - return $this->_ci_init_class($filename, 'MY_', $varname); + return $this->_ci_init_class($filename, 'MY_', $params); } // Lets search for the requested library file and load it. @@ -680,7 +680,7 @@ function _ci_load_class($class, $varname = NULL) if (file_exists($path.'libraries/'.$filename.EXT)) { include_once($path.'libraries/'.$filename.EXT); - return $this->_ci_init_class($filename, '', $varname); + return $this->_ci_init_class($filename, '', $params); } } } @@ -700,13 +700,16 @@ function _ci_load_class($class, $varname = NULL) * @param string * @return null */ - function _ci_init_class($class, $prefix = '', $varname = NULL) + function _ci_init_class($class, $prefix = '', $config = FALSE) { // Is there an associated config file for this class? - $config = NULL; - if (file_exists(APPPATH.'config/'.$class.EXT)) + if ($config !== FALSE) { - include_once(APPPATH.'config/'.$class.EXT); + $config = FALSE; + if (file_exists(APPPATH.'config/'.$class.EXT)) + { + include_once(APPPATH.'config/'.$class.EXT); + } } if ($prefix == '') @@ -719,16 +722,9 @@ function _ci_init_class($class, $prefix = '', $varname = NULL) } // Set the variable name we will assign the class to - if ( ! is_null($varname)) - { - $classvar = $varname; - } - else - { - $class = strtolower($class); - $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; - } - + $class = strtolower($class); + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + // Instantiate the class $CI =& get_instance(); if ($config !== NULL) From f6615e650f7f871fbb4a2e0e1a75fd9afa2e3647 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 19:16:57 +0000 Subject: [PATCH 0337/2544] --- system/libraries/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index ead1439f..bbfa0d19 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -373,7 +373,7 @@ function _parse_request_uri() $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - if ($request_uri == '') + if ($request_uri == '' OR $request_uri == SELF) { return ''; } From 5a14ea1599841bdaac15b45e3efd4cba01601f49 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Oct 2006 20:42:55 +0000 Subject: [PATCH 0338/2544] --- system/codeigniter/CodeIgniter.php | 2 +- system/libraries/Loader.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 49347715..93c1dba5 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -244,7 +244,7 @@ * Close the DB connection if one exists * ------------------------------------------------------ */ -if (class_exists('CI_DB')) +if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 2d312e9e..7bf11609 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -70,7 +70,7 @@ function CI_Loader() * @param mixed the optional parameters * @return void */ - function library($class, $params = FALSE) + function library($class, $params = NULL) { if ($class == '') return; @@ -640,7 +640,7 @@ function _ci_load($data) * @param mixed any additional parameters * @return void */ - function _ci_load_class($class, $params = FALSE) + function _ci_load_class($class, $params = NULL) { // Prep the class name $class = strtolower(str_replace(EXT, '', $class)); @@ -700,12 +700,12 @@ function _ci_load_class($class, $params = FALSE) * @param string * @return null */ - function _ci_init_class($class, $prefix = '', $config = FALSE) + function _ci_init_class($class, $prefix = '', $config = NULL) { // Is there an associated config file for this class? - if ($config !== FALSE) + if ($config !== NULL) { - $config = FALSE; + $config = NULL; if (file_exists(APPPATH.'config/'.$class.EXT)) { include_once(APPPATH.'config/'.$class.EXT); From b06d69f03f5149877390d7e99882006a141268ff Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 13 Oct 2006 21:44:17 +0000 Subject: [PATCH 0339/2544] --- system/codeigniter/Common.php | 4 ++-- system/libraries/Profiler.php | 15 +++++++++++++-- system/libraries/Session.php | 18 +++--------------- user_guide/changelog.html | 2 +- user_guide/general/errors.html | 8 ++++---- user_guide/general/models.html | 5 ----- 6 files changed, 23 insertions(+), 29 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 8ac80d63..07b468fe 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -204,7 +204,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) static $LOG; $config = get_config(); - if ($config['log_errors'] === FALSE) + if ($config['log_threshold'] == 0) { return; } @@ -255,7 +255,7 @@ function _exception_handler($severity, $message, $filepath, $line) // Should we log the error? No? We're done... $config = get_config(); - if ($config['log_errors'] === FALSE) + if ($config['log_threshold'] == 0) { return; } diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 3370c911..7fecabd2 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -94,7 +94,12 @@ function _compile_benchmarks() // -------------------------------------------------------------------- - + /** + * Compile Queries + * + * @access private + * @return string + */ function _compile_queries() { $output = "\n\n"; @@ -130,7 +135,13 @@ function _compile_queries() } // -------------------------------------------------------------------- - + + /** + * Compile $_POST Data + * + * @access private + * @return string + */ function _compile_post() { $output = "\n\n"; diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 16f373fd..8390fd6d 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -112,10 +112,8 @@ function sess_run() } } - // Do we need encryption? - $this->encryption = $this->CI->config->item('sess_encrypt_cookie'); - - if ($this->encryption == TRUE) + // Do we need encryption? + if ($this->CI->config->item('sess_encrypt_cookie') == TRUE) { $this->CI->load->library('encrypt'); } @@ -160,7 +158,6 @@ function sess_run() $this->sess_gc(); } } - // END sess_run() // -------------------------------------------------------------------- @@ -257,7 +254,6 @@ function sess_read() return TRUE; } - // END sess_read() // -------------------------------------------------------------------- @@ -285,7 +281,6 @@ function sess_write() 0 ); } - // END sess_read() // -------------------------------------------------------------------- @@ -321,7 +316,6 @@ function sess_create() $this->userdata['last_visit'] = 0; $this->sess_write(); } - // END sess_read() // -------------------------------------------------------------------- @@ -349,7 +343,6 @@ function sess_update() // Write the cookie $this->sess_write(); } - // END sess_update() // -------------------------------------------------------------------- @@ -370,7 +363,6 @@ function sess_destroy() 0 ); } - // END sess_destroy() // -------------------------------------------------------------------- @@ -396,7 +388,6 @@ function sess_gc() log_message('debug', 'Session garbage collection performed.'); } } - // END sess_destroy() // -------------------------------------------------------------------- @@ -411,7 +402,6 @@ function userdata($item) { return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; } - // END sess_destroy() // -------------------------------------------------------------------- @@ -440,7 +430,6 @@ function set_userdata($newdata = array(), $newval = '') $this->sess_write(); } - // END set_userdata() // -------------------------------------------------------------------- @@ -467,7 +456,6 @@ function unset_userdata($newdata = array()) $this->sess_write(); } - // END set_userdata() // -------------------------------------------------------------------- @@ -494,7 +482,7 @@ function strip_slashes($vals) return $vals; } - // END strip_slashes() + } // END Session Class ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4407b7f1..75d3838f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,7 +91,7 @@

                Version 1.5.0 Beta

              • Fixed a bug in the validation class.
              • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
              • Deprecated $this->db->field_names() USE $this->db->list_fields()
              • - +
              • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
              diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 8d2cbe55..a2626ab3 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -116,10 +116,10 @@

              log_message('level', 'message')

              -

              Note: In order for the log file to actually be written, the "log_errors" -option must be enabled in your application/config/config.php file, and the "logs" folder must be writable. -In addition, you'll can set the "threshold" for logging. -You might, for example, only want error messages to be logged, and not the other two types.

              +

              Note: In order for the log file to actually be written, the + "logs" folder must be writable. In addition, you must set the "threshold" for logging. +You might, for example, only want error messages to be logged, and not the other two types. +If you set it to zero logging will be disabled.

              diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 168aee8b..3009e505 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -240,11 +240,6 @@

              Connecting to your Database

            - - - - - From 9a661810d2b9b96c458c1f369f0059b31012b6a8 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 16 Oct 2006 19:02:48 +0000 Subject: [PATCH 0340/2544] --- system/database/DB.php | 4 ++-- system/database/drivers/mssql/mssql_utility.php | 2 +- system/database/drivers/oci8/oci8_utility.php | 2 +- system/database/drivers/sqlite/sqlite_utility.php | 2 +- system/libraries/Loader.php | 5 ++--- system/libraries/Router.php | 2 +- user_guide/index.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index a148c9ff..d2afce98 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -22,7 +22,7 @@ * @author Rick Ellis * @link http://www.codeigniter.com/user_guide/database/ */ -function DB($params = '', $active_record = FALSE) +function &DB($params = '', $active_record = FALSE) { // Load the DB config file if a DSN string wasn't passed if (is_string($params) AND strpos($params, '://') === FALSE) @@ -78,7 +78,7 @@ function DB($params = '', $active_record = FALSE) // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; - $DB = new $driver($params); + $DB =& new $driver($params); return $DB; } diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 129ba686..24ff1e13 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -106,7 +106,7 @@ function _optimize_table($table) */ function _repair_table($table) { - return return FALSE; // Is this supported in MS SQL? + return FALSE; // Is this supported in MS SQL? } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 96be0950..f4e91218 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -106,7 +106,7 @@ function _optimize_table($table) */ function _repair_table($table) { - return return FALSE; // Is this supported in Oracle? + return FALSE; // Is this supported in Oracle? } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 9cb2cf02..ecce5be4 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -131,7 +131,7 @@ function _optimize_table($table) */ function _repair_table($table) { - return return FALSE; + return FALSE; } // -------------------------------------------------------------------- diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 7bf11609..b402464e 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -703,9 +703,8 @@ function _ci_load_class($class, $params = NULL) function _ci_init_class($class, $prefix = '', $config = NULL) { // Is there an associated config file for this class? - if ($config !== NULL) - { - $config = NULL; + if ($config === NULL) + { if (file_exists(APPPATH.'config/'.$class.EXT)) { include_once(APPPATH.'config/'.$class.EXT); diff --git a/system/libraries/Router.php b/system/libraries/Router.php index bbfa0d19..06037209 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -373,7 +373,7 @@ function _parse_request_uri() $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - if ($request_uri == '' OR $request_uri == SELF) + if ($request_uri == '' OR $request_uri == $this->config->item('index_page')) { return ''; } diff --git a/user_guide/index.html b/user_guide/index.html index f55e7af6..395d7390 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -65,7 +65,7 @@

            Welcome to Code Igniter

            Code Igniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. -Its goal is to enable you to develop projects must faster than you could if you were writing code +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. Code Igniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

            diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 720122a7..bf8a4e0d 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -65,7 +65,7 @@

            Code Igniter at a Glance

            Code Igniter is an Application Framework

            -

            Code Igniter is a toolkit for people who build web application using PHP. Its goal is to enable you to develop projects must faster than you could if you were writing code +

            Code Igniter is a toolkit for people who build web application 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. Code Igniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

            From 30578eadecee1b7fd96e82b17100bba5347d362e Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 17 Oct 2006 02:31:06 +0000 Subject: [PATCH 0341/2544] --- system/libraries/Loader.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index b402464e..336caf7d 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -592,8 +592,24 @@ function _ci_load($data) } ob_start(); + + // If the PHP installation does not support short tags we'll + // do a little string replacement, changing the short tags + // to standard PHP echo statements. + if (ini_get("short_open_tag") == 0) + { + $file = file_get_contents($path); + + $file = str_replace('/", " ;?>", $file); + + echo eval('?>'.$file.' Date: Tue, 17 Oct 2006 02:32:59 +0000 Subject: [PATCH 0342/2544] --- system/libraries/Loader.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 336caf7d..ba98a642 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -599,7 +599,6 @@ function _ci_load($data) if (ini_get("short_open_tag") == 0) { $file = file_get_contents($path); - $file = str_replace('/", " ;?>", $file); From 94fe038a62c5d535920464266ae404b5e028f662 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 17 Oct 2006 02:36:31 +0000 Subject: [PATCH 0343/2544] --- system/libraries/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index ba98a642..bc2e9dec 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -599,8 +599,8 @@ function _ci_load($data) if (ini_get("short_open_tag") == 0) { $file = file_get_contents($path); - $file = str_replace('/", " ;?>", $file); + $file = str_replace('/", ' ;?>', $file); echo eval('?>'.$file.' Date: Tue, 17 Oct 2006 03:40:51 +0000 Subject: [PATCH 0344/2544] --- system/libraries/Loader.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index bc2e9dec..4252f163 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -596,13 +596,10 @@ function _ci_load($data) // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. - if (ini_get("short_open_tag") == 0) - { - $file = file_get_contents($path); - $file = str_replace('/", ' ;?>', $file); - echo eval('?>'.$file.''.preg_replace("/;*\s*\?>/", "; ?>", str_replace(' Date: Thu, 19 Oct 2006 16:38:23 +0000 Subject: [PATCH 0345/2544] --- system/application/config/config.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 31094f3b..3f26d48f 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -140,26 +140,15 @@ */ $config['time_reference'] = 'local'; -/* -|-------------------------------------------------------------------------- -| Enable/Disable Error Logging -|-------------------------------------------------------------------------- -| -| If you would like errors or debug messages logged set this variable to -| TRUE (boolean). Note: You must set the file permissions on the "logs" folder -| such that it is writable. -| -*/ -$config['log_errors'] = FALSE; - /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | -| If you have enabled error logging, you can set an error threshold to -| determine what gets logged. Threshold options are: +| You can enable error logging by setting a threshold over zero. The +| threshold determines what gets logged. Threshold options are: | +| 0 = Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages From 3ba33e79963beaf0c177371d175003a9c9151e00 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 19 Oct 2006 16:40:03 +0000 Subject: [PATCH 0346/2544] --- system/libraries/Hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index e2d0500c..3c35c908 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -39,8 +39,8 @@ class CI_Hooks { */ function CI_Hooks() { - log_message('debug', "Hooks Class Initialized"); $this->_initialize(); + log_message('debug', "Hooks Class Initialized"); } // -------------------------------------------------------------------- From d54078fff55f74ee4fd320b27f8129b48bdcd3fa Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 00:38:16 +0000 Subject: [PATCH 0347/2544] --- system/helpers/typography_helper.php | 72 ++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 65924f91..84ca0ed6 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -129,7 +129,7 @@ function convert($str) * * We don't want quotes converted within * tags so we'll temporarily convert them to - * {{{DQ}}} and {{{SQ}}} + * {@DQ} and {@SQ} * */ if (preg_match_all("#\<.+?>#si", $str, $matches)) @@ -137,11 +137,24 @@ function convert($str) for ($i = 0; $i < count($matches['0']); $i++) { $str = str_replace($matches['0'][$i], - str_replace(array("'",'"'), array('{{{SQ}}}', '{{{DQ}}}'), $matches['0'][$i]), + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches['0'][$i]), $str); } } - + + + /* + * Add closing/opening paragraph tags before/after "block" elements + * + * Since block elements (like ,
            , etc.) do not get
            +		 * wrapped in paragraph tags we will add a closing 

            tag just before + * each block element starts and an opening

            tag right after the block element + * ends. Later on we'll do some further clean up. + * + */ + $str = preg_replace("#(<.*?)(".$this->block_elements.")(.*?>)#", "

            \\1\\2\\3", $str); + $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

            ", $str); + /* * Convert "ignore" tags to tempoarary marker * @@ -149,10 +162,10 @@ function convert($str) * it encounters. Certain inline tags, like image * tags, links, span tags, etc. will be adversely * affected if they are split out so we'll convert - * the opening < temporarily to: {{{tag}}} + * the opening < temporarily to: {@TAG} * - */ - $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{{{tag}}}\\1\\2", $str); + */ + $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{@TAG}\\1\\2", $str); /* * Split the string at every tag @@ -188,7 +201,7 @@ function convert($str) * Well also set the "process" flag which allows us * to skip

             tags and a few other things.
             			 *
            -			 */			
            +			 */
             			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match)) 
             			{
             				if (preg_match("#".$this->skip_elements."#", $match['2']))
            @@ -210,20 +223,51 @@ function convert($str)
             			$str .= $this->format_newlines($chunk);
             		}
             
            +
            +		/*
            +		 * Clean up paragraph tags before/after "block" elements
            +		 *
            +		 * Earlier we added 

            tags before/after block level elements. + * Then, we added paragraph tags around double line breaks. This + * potentially created incorrectly formatted paragraphs so we'll + * clean it up here. + * + */ + $str = preg_replace("#

            ({@TAG}.*?)(".$this->block_elements.")(.*?>)#", "\\1\\2\\3", $str); + $str = preg_replace("#({@TAG}/.*?)(".$this->block_elements.")(.*?>)

            #", "\\1\\2\\3", $str); + // Convert Quotes and other characters $str = $this->format_characters($str); - - // We'll swap our temporary markers back and do some clean up. + + // Final clean up $str = preg_replace('#(

            \n*

            )#', '', $str); $str = preg_replace('#()

            #', "\\1", $str); - + $str = str_replace( - array('

            ', '

            ', '{{{tag}}}', '{{{DQ}}}', '{{{SQ}}}'), - array('

            ', '

            ', '<', '"', "'"), + array( + '

            ', + '

            ', + '

            ', + '

            ', + '{@TAG}', + '{@DQ}', + '{@SQ}', + '

            ' + ), + array( + '

            ', + '

            ', + '

            ', + '

            ', + '<', + '"', + "'", + '' + ), $str - ); + ); - return trim($str); + return $str; } // -------------------------------------------------------------------- From f4c010098af532d9eb843743ef6bb8ed05689765 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 00:53:22 +0000 Subject: [PATCH 0348/2544] --- system/helpers/typography_helper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 84ca0ed6..ba680487 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -223,7 +223,9 @@ function convert($str) $str .= $this->format_newlines($chunk); } - + // FINAL CLEAN UP + // IMPORTANT: DO NOT ALTER THE ORDER OF THE ITEMS BELOW! + /* * Clean up paragraph tags before/after "block" elements * @@ -239,10 +241,14 @@ function convert($str) // Convert Quotes and other characters $str = $this->format_characters($str); - // Final clean up + // Fix an artifact that happens during the paragraph replacement $str = preg_replace('#(

            \n*

            )#', '', $str); + + // If the user submitted their own paragraph tags with class data + // in them we will retain them instead of using our tags. $str = preg_replace('#()

            #', "\\1", $str); + // Final clean up $str = str_replace( array( '

            ', From 3dd2528900020866db7260c8dfd5ad91120a7299 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 00:55:00 +0000 Subject: [PATCH 0349/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 75d3838f..f7e597cd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,6 +89,7 @@

            Version 1.5.0 Beta

          • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
          • Fixed a bug in the Email class related to SMTP Helo data.
          • Fixed a bug in the validation class.
          • +
          • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
          • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
          • Deprecated $this->db->field_names() USE $this->db->list_fields()
          • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
          • From 90931313c2d8a90f84e3a62b59d9603f4ebe4127 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 00:59:17 +0000 Subject: [PATCH 0350/2544] --- system/libraries/Router.php | 64 +++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 06037209..94a9a524 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -292,7 +292,7 @@ function _get_uri_string() // If the URL has a question mark then it's simplest to just // build the URI string from the zero index of the $_GET array. // This avoids having to deal with $_SERVER variables, which - // can be unreliable on some servers + // can be unreliable in some environments if (is_array($_GET) AND count($_GET) == 1) { return current(array_keys($_GET)); @@ -300,44 +300,38 @@ function _get_uri_string() // Is there a PATH_INFO variable? // Note: some servers seem to have trouble with getenv() so we'll test it two ways - $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if ($path != '' AND $path != "/".SELF) + { + return $path; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if ($path != '') + { + return $path; + } - if ($path_info != '' AND $path_info != "/".SELF) + // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? + $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + if ($path != '' AND $path != "/".SELF) { - return $path_info; + return $path; } - else + + // OK, how about REQUEST_URI? + // Note: REQUEST_URI is not supplied in a consistent manner with all platforms so it's + // a diffucult variable to use. We'll try to parse it out correctly. Hopfully one + // of the other variables above was available. + $path = $this->_parse_request_uri(); + if ($path != "") { - // OK, how about REQUEST_URI? - $req_uri = $this->_parse_request_uri(); - - if ($req_uri != "") - { - return $req_uri; - } - else - { - // Hm... maybe the ORIG_PATH_INFO variable exists? - $path_info = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if ($path_info != '' AND $path_info != "/".SELF) - { - return $path_info; - } - else - { - // At this point we've exhauseted all our options. - // Hopefully QUERY_STRING exists. If not, there's nothing else we can try. - $query_string = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - - if ($query_string != '') - { - return $query_string; - } - - return ''; - } - } + return $path; } + + // We've exhausted all our options... + return ''; } else { @@ -373,7 +367,7 @@ function _parse_request_uri() $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - if ($request_uri == '' OR $request_uri == $this->config->item('index_page')) + if ($request_uri == '' OR $request_uri == SELF) { return ''; } From e0cd609abeaeb1be5ed0ef7ac88bb6de86627881 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 01:00:31 +0000 Subject: [PATCH 0351/2544] --- system/application/config/config.php | 2 +- system/libraries/Exceptions.php | 12 ++++++++++-- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/changelog.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/multiple_apps.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 102 files changed, 111 insertions(+), 103 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 3f26d48f..bf15525c 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -78,7 +78,7 @@ | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = FALSE; +$config['enable_hooks'] = TRUE; /* diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index c3af801a..4bdbe4f8 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -117,7 +117,11 @@ function show_404($page = '') function show_error($heading, $message, $template = 'error_general') { $message = '

            '.implode('

            ', ( ! is_array($message)) ? array($message) : $message).'

            '; - + + if (ob_get_level() > 1) + { + ob_end_flush(); + } ob_start(); include_once(APPPATH.'errors/'.$template.EXT); $buffer = ob_get_contents(); @@ -151,7 +155,11 @@ function show_php_error($severity, $message, $filepath, $line) $x = explode('/', $filepath); $filepath = $x[count($x)-2].'/'.end($x); } - + + if (ob_get_level() > 1) + { + ob_end_flush(); + } ob_start(); include_once(APPPATH.'errors/error_php'.EXT); $buffer = ob_get_contents(); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f7e597cd..bce31d56 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index afb93404..10b018b4 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 6abc4938..8a43268e 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 0da65977..43bc9729 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index fa8ed63b..ea287d77 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 31e687ae..c057f69f 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 47395ff3..8916b5ee 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index f8609c77..d70314b5 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 7ad559ca..102794b2 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 1805cdea..4f3876ec 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index d22113d5..39ad00f1 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/results.html b/user_guide/database/results.html index e377c311..a301bc3f 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index b642e6c9..511cc781 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index fb1f1fc2..ef1f1a6e 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 615c0c52..f1692808 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index ef90f2a4..a06a208e 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 2026990e..f04556de 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 2f2e9b3c..a7e907e7 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index a8f924e1..6b4c3d1a 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 255a4b63..7b261791 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 8cb54c8e..f83cab89 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 7466b544..556a4efc 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index b57d739c..3f168909 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 49ba02e6..770b0118 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index a2626ab3..72c9120d 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index cf829027..a0042b5c 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 868d0cb0..6bfa94ee 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 23584d62..9ca01f09 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 4aa2e857..5a191bb0 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 3009e505..3f1c1e22 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html index 481a24ef..db4a0cff 100644 --- a/user_guide/general/multiple_apps.html +++ b/user_guide/general/multiple_apps.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index cb402cb2..2e603dd6 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 4fcbfbb0..42cba043 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index fe9a1a1e..b9a293f3 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index a4057817..bf5470c5 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 55585b30..102f34db 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 2cb99574..b22b351e 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 957a734f..c3218cdb 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 9d77e5da..e62ac2f2 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 3fdc4d6c..daba7594 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index f006cd3f..2bd4dc21 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index c45d3df1..1e352fc1 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 15783890..6c21ee00 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index f667e80b..35b2d6db 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index ca88ba08..5b2f1ecf 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 05f14fe4..319ebfa9 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index af1f87bc..a71aa513 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 806c3a26..17157bbf 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 740cbc14..2a5c6936 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 273a177f..ace1b2e0 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index e8ee3f33..516e3c0c 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 1c565c17..55cb1ae4 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index ab6e83c2..27f6c63d 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 9de65ae4..a95eecc6 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index de566767..d54acc12 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index e37902c3..22e7009b 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/index.html b/user_guide/index.html index 395d7390..00bf4464 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index af3c3031..c95f6b3c 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 28189962..4c572de6 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 03c50960..521d6388 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 90094bd4..03aeba13 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index f1f4e9e1..923f789e 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index d4aa8ec9..b685b407 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 78adaa40..9af6d96f 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 58e5d07b..eed40cde 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index ece00c81..b6e4abbb 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 10e53056..e1590e75 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 990c2bed..cf41dc40 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 6ab237e0..c7563a6f 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 134063a6..fa6f2acf 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 3dc4551b..37252b61 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 9f35d3f9..a13cadf0 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 88f26a2c..2797cd22 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index f97ab6f6..2064a3cf 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 3a774e2c..b27a3764 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index e8f58fad..390b4537 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 2cd9540d..f2a7a555 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 3bfea14f..0ae95662 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index eb17cdbf..042a1dbf 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index eb87231e..44bae34a 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 487b5844..d577fbba 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 14796a78..19cfc744 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index d6279f9c..091817e1 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index daf5dfe6..e9302d2c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index a9d11c34..10bb4b3d 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index d060b392..ff71ea93 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index f48681c1..f0b3782a 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index b9d4ebb3..9218c0d7 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 82f8757d..6028f798 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index f72ba9cd..3a724831 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index b08b7b81..34d47d22 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 8d2f06de..c03b54fb 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/license.html b/user_guide/license.html index 0a758b1a..681ebba7 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index e76f57b8..a0ae1dee 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index bf8a4e0d..ad2a0e79 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 50b5637c..4e013f50 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 6ee87022..97d0774e 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index dd77e6a6..83a59f76 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index c9155efc..0f5fbe89 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            diff --git a/user_guide/toc.html b/user_guide/toc.html index 5d959e75..7f16ee8c 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -34,7 +34,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b1

            Code Igniter User Guide Version 1.5.0b3

            From 1168557f576c88b065b72ff8fd8a924156a5a5bd Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 01:01:35 +0000 Subject: [PATCH 0352/2544] --- user_guide/changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bce31d56..0be18089 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,8 +63,8 @@

            Change Log

            -

            Version 1.5.0 Beta

            -

            Release Date: October 11, 2006

            +

            Version 1.5.0 Beta 3

            +

            Release Date: October 19, 2006

            • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
            • From b807f32ab209a537bbb0a85d6129d495675b189f Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 04:55:37 +0000 Subject: [PATCH 0353/2544] --- system/libraries/Loader.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 4252f163..3b1a7f2c 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -221,7 +221,7 @@ function dbutil() * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. * 3. TRUE/FALSE - whether to return the data or load it. In - * some cases it's advantageous to be able to retun data so that + * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * * @access public @@ -257,7 +257,7 @@ function file($path, $return = FALSE) /** * Set Variables * - * Once variables are set they become availabe within + * Once variables are set they become available within * the controller class and its "view" files. * * @access public @@ -525,7 +525,7 @@ function scaffolding($table = '') */ function _ci_load($data) { - // This allows anything loaded using $this->load (viwes, files, etc.) + // This allows anything loaded using $this->load (views, files, etc.) // to become accessible from within the Controller and Model functions. // Only needed when running PHP 5 @@ -584,7 +584,7 @@ function _ci_load($data) * need post processing? For one thing, in order to * show the elapsed page load time. Unless we * can intercept the content right before it's sent to - * the browser and then stop the timer it won't be acurate. + * the browser and then stop the timer it won't be accurate. */ if ( ! file_exists($path)) { From fe9754ca6af8c6242c7d2761047eb409af354930 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 05:00:34 +0000 Subject: [PATCH 0354/2544] --- system/application/config/database.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index 32b23058..8a1822e9 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -32,16 +32,16 @@ $active_group = "default"; $db['default']['hostname'] = "localhost"; -$db['default']['username'] = "root"; +$db['default']['username'] = ""; $db['default']['password'] = ""; -$db['default']['database'] = "test"; +$db['default']['database'] = ""; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; -$db['default']['cachedir'] = ''; +$db['default']['cachedir'] = ""; ?> \ No newline at end of file From 6dfa713d204056d42027b54e851785646d00355a Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 05:01:30 +0000 Subject: [PATCH 0355/2544] --- system/application/config/database.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/application/config/database.php b/system/application/config/database.php index 8a1822e9..082e34a0 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -23,6 +23,8 @@ | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. | ['active_r'] TRUE/FALSE - Whether to load the active record class +| ['cache_on'] TRUE/FALSE - Enables/disables query caching +| ['cachedir'] The path to the folder where cache files should be stored | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the "default" group). From 31eeb0587cd5fcef8209ca5083f28a39435c135d Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 05:11:33 +0000 Subject: [PATCH 0356/2544] --- system/database/DB_result.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/database/DB_result.php b/system/database/DB_result.php index b163bb5e..4e8c4fc7 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -63,6 +63,11 @@ function result_object() return $this->result_object; } + if ($this->num_rows == 0) + { + return array(); + } + $this->_data_seek(0); while ($row = $this->_fetch_object()) { @@ -87,6 +92,11 @@ function result_array() return $this->result_array; } + if ($this->num_rows == 0) + { + return array(); + } + $this->_data_seek(0); while ($row = $this->_fetch_assoc()) { From 0625e19f3318874d6f95b546312601538edb0f14 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 22:16:54 +0000 Subject: [PATCH 0357/2544] --- system/application/config/config.php | 43 ++++++++---- system/codeigniter/Common.php | 78 ++++++++++------------ system/libraries/Benchmark.php | 1 - system/libraries/Loader.php | 50 +++++--------- user_guide/general/core_classes.html | 15 +++-- user_guide/general/creating_libraries.html | 34 ++++++++-- 6 files changed, 121 insertions(+), 100 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index bf15525c..b0d2bf50 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -81,6 +81,21 @@ $config['enable_hooks'] = TRUE; +/* +|-------------------------------------------------------------------------- +| Class Extension Prefix +|-------------------------------------------------------------------------- +| +| This item allows you to set the filename/classname prefix when extending +| native libraries. For more information please see the user guide: +| +| http://www.codeigniter.com/user_guide/general/core_classes.html +| http://www.codeigniter.com/user_guide/general/creating_libraries.html +| +*/ +$config['subclass_prefix'] = 'MY_'; + + /* |-------------------------------------------------------------------------- | Allowed URL Characters @@ -129,20 +144,7 @@ /* |-------------------------------------------------------------------------- -| Master Time Reference -|-------------------------------------------------------------------------- -| -| Options are "local" or "gmt". This pref tells the system whether to use -| your server's local time as the master "now" reference, or convert it to -| GMT. See the "date helper" page of the user guide for information -| regarding date handling. -| -*/ -$config['time_reference'] = 'local'; - -/* -|-------------------------------------------------------------------------- -| Error Logging Threshold +| Error Logging |-------------------------------------------------------------------------- | | You can enable error logging by setting a threshold over zero. The @@ -267,5 +269,18 @@ */ $config['compress_output'] = FALSE; +/* +|-------------------------------------------------------------------------- +| Master Time Reference +|-------------------------------------------------------------------------- +| +| Options are "local" or "gmt". This pref tells the system whether to use +| your server's local time as the master "now" reference, or convert it to +| GMT. See the "date helper" page of the user guide for information +| regarding date handling. +| +*/ +$config['time_reference'] = 'local'; + ?> \ No newline at end of file diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 07b468fe..a82d486e 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -50,57 +50,27 @@ function &load_class($class, $instantiate = TRUE) { return $objects[$class]; } - - // This is a special case. It's a class in the Base5.php file - // which we don't need to load. We only instantiate it. - if ($class == 'Instance') - { - $objects[$class] =& new $class(); - return $objects[$class]; - } - + // If the requested class does not exist in the application/libraries - // folder we'll load the native class from the system/libraries folder. - - $is_subclass = FALSE; - if ( ! file_exists(APPPATH.'libraries/'.$class.EXT)) + // folder we'll load the native class from the system/libraries folder. + if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) { - require(BASEPATH.'libraries/'.$class.EXT); + require(BASEPATH.'libraries/'.$class.EXT); + require(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + $is_subclass = TRUE; } else { - // A core class can either be extended or replaced by putting an - // identically named file in the application/libraries folder.  - // We need to determine, however, if the class being requested is - // a sub-class of an existing library or an independent instance - // since each needs to be handled slightly different.  - // To do this we'll open the requested class and read the top portion - // of it. If the class extends a base class we will load the base first. - // If it doesn't extend the base we'll only load the requested class. - - // Note: I'm not thrilled with this approach since it requires us to - // read the top part of the file (I set a character limit of 5000 bytes, - // which correlates to roughly the first 100 lines of code), but - // I can't think of a better way to allow classes to be extended or - // replaced on-the-fly with nothing required for the user to do - // except write the declaration.  Fortunately PHP is ridiculously fast - // at file reading operations so I'm not able to discern a performance - // hit based on my benchmarks, assuming only a small number of core - // files are being extended, which will usually be the case. - - $fp = fopen(APPPATH.'libraries/'.$class.EXT, "rb"); - - if (preg_match("/MY_".$class."\s+extends\s+CI_".$class."/i", fread($fp, '6000'))) + if (file_exists(APPPATH.'libraries/'.$class.EXT)) { - require(BASEPATH.'libraries/'.$class.EXT); - require(APPPATH.'libraries/'.$class.EXT); - $is_subclass = TRUE; + require(APPPATH.'libraries/'.$class.EXT); + $is_subclass = FALSE; } else { - require(APPPATH.'libraries/'.$class.EXT); + require(BASEPATH.'libraries/'.$class.EXT); + $is_subclass = FALSE; } - fclose($fp); } if ($instantiate == FALSE) @@ -111,7 +81,7 @@ function &load_class($class, $instantiate = TRUE) if ($is_subclass == TRUE) { - $name = 'MY_'.$class; + $name = config_item('subclass_prefix').$class; $objects[$class] =& new $name(); return $objects[$class]; } @@ -151,6 +121,30 @@ function &get_config() return $main_conf[0]; } +/** +* Gets a config item +* +* @access public +* @return mixed +*/ +function &config_item($item) +{ + static $config_item = array(); + + if ( ! isset($config_item[$item])) + { + $config =& get_config(); + + if ( ! isset($config[$item])) + { + return FALSE; + } + $config_item[$item] = $config[$item]; + } + + return $config_item[$item]; +} + /** * Error Handler diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index c20a5426..d4262792 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -31,7 +31,6 @@ class CI_Benchmark { var $marker = array(); - // -------------------------------------------------------------------- /** diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 3b1a7f2c..b313c6d5 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -655,51 +655,37 @@ function _ci_load($data) function _ci_load_class($class, $params = NULL) { // Prep the class name - $class = strtolower(str_replace(EXT, '', $class)); - - // Is this a class extension request? - if (substr($class, 0, 3) == 'my_') - { - $class = preg_replace("/my_(.+)/", "\\1", $class); + $class = ucfirst(strtolower(str_replace(EXT, '', $class))); - // Load the requested library from the main system/libraries folder - if (file_exists(BASEPATH.'libraries/'.ucfirst($class).EXT)) - { - include_once(BASEPATH.'libraries/'.ucfirst($class).EXT); - } - - // Now look for a matching library - foreach (array(ucfirst($class), $class) as $filename) + // Is this a class extension request? + if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) + { + if ( ! file_exists(BASEPATH.'libraries/'.$class.EXT)) { - if (file_exists(APPPATH.'libraries/'.$filename.EXT)) - { - include_once(APPPATH.'libraries/'.$filename.EXT); - } + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); } - - return $this->_ci_init_class($filename, 'MY_', $params); + + include_once(BASEPATH.'libraries/'.ucfirst($class).EXT); + include_once(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + + return $this->_ci_init_class($filename, config_item('subclass_prefix'), $params); } // Lets search for the requested library file and load it. - // For backward compatibility we'll test for filenames that are - // both uppercase and lower. - foreach (array(ucfirst($class), $class) as $filename) + for ($i = 1; $i < 3; $i++) { - for ($i = 1; $i < 3; $i++) + $path = ($i % 2) ? APPPATH : BASEPATH; + if (file_exists($path.'libraries/'.$filename.EXT)) { - $path = ($i % 2) ? APPPATH : BASEPATH; - - if (file_exists($path.'libraries/'.$filename.EXT)) - { - include_once($path.'libraries/'.$filename.EXT); - return $this->_ci_init_class($filename, '', $params); - } + include_once($path.'libraries/'.$filename.EXT); + return $this->_ci_init_class($filename, '', $params); } } // If we got this far we were unable to find the requested class log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the class: ".$class); + show_error("Unable to load the requested class: ".$class); } // -------------------------------------------------------------------- diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 556a4efc..6d2f3804 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -113,11 +113,15 @@

              Replacing Core Classes

              Extending Core Class

              If all you need to do is add some functionality to an existing library - perhaps add a function or two - then -it's overkill to replace the entire library with your version. In this case it's better to simply extend the class.

              +it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. +Extending a class is nearly identical to replacing a class with a couple exceptions:

              -

              Extending a class is identical to replacing a class with one exception: The class declaration must extend the parent class -and your new class must be prefixed with MY_. For example, to extend the native Input class -you'll create a file named application/libraries/Input.php, and declare your class with:

              +
                +
              • The class declaration must extend the parent class.
              • +
              • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
              • +
              + +

              For example, to extend the native Input class you'll create a file named application/libraries/MY_Input.php, and declare your class with:

              class MY_Input extends CI_Input {

              @@ -135,7 +139,8 @@

              Extending Core Class

                  }
              }
              -

              Any functions in your class that are named identically to the functions in the parent class will be used instead of the native ones. +

              Tip:  Any functions in your class that are named identically to the functions in the parent class will be used instead of the native ones +(this is known as "method overloading"). This allows you to substantially alter the Code Igniter core.

              diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 3f168909..d7646412 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -226,17 +226,24 @@

              Replacing Native Libraries with Your Versions

              Extending Native Libraries

              If all you need to do is add some functionality to an existing library - perhaps add a function or two - then -it's overkill to replace the entire library with your version. In this case it's better to simply extend the class.

              +it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. +Extending a class is nearly identical to replacing a class with a couple exceptions:

              -

              Extending a class is identical to replacing a class with one exception: The class declaration must extend the parent class -and your new class must be prefixed with MY_. For example, to extend the native Email class -you'll create a file named application/libraries/Email.php, and declare your class with:

              +
                +
              • The class declaration must extend the parent class.
              • +
              • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
              • +
              + +

              For example, to extend the native Email class you'll create a file named application/libraries/MY_Email.php, and declare your class with:

              class MY_Email extends CI_Email {

              }
              +

              Note: If you need to use a constructor in your class make sure you extend the parent constructor:

              + + class MY_Email extends CI_Email {

              @@ -246,9 +253,13 @@

              Extending Native Libraries

                  }
              }
              -

              Important: To tell Code Igniter to load your sub-class you MUST include my_ in the loading function:

              -$this->load->library('my_email'); +

              Loading Your Sub-class

              + +

              To load your sub-class you'll use the standard syntax normally used. DO NOT include your prefix. For example, +to load the example above, which extends the Email class, you will use:

              + +$this->load->library('email');

              Once loaded you will use the class variable as you normally would for the class you are extending. In the case of the email class all calls will use: @@ -256,6 +267,17 @@

              Extending Native Libraries

              $this->email->some_function(); + +

              Setting Your Own Prefix

              + +

              To set your own sub-class prefix, open your application/config/config.php file and look for this item:

              + +$config['subclass_prefix'] = 'MY_'; + +

              Please note that all native Code Igniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

              + + +
            From 420ba03fcc3ab0ca1ed60c92a7502a78b994bfc9 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 22:19:09 +0000 Subject: [PATCH 0358/2544] --- user_guide/changelog.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0be18089..2771a14e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,9 @@

            Change Log

            Version 1.5.0 Beta 3

            Release Date: October 19, 2006

            +

            Important:  In Beta 3, the way native libraries are extended has changed slightly thanks to +a suggestion offered by coolfactor in our forums. Please check the documentation below if you are extending classes.

            +
            • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
            • Added Database Caching Class.
            • From afe3aaa5292132e3f2c4604a413957fa18a603e5 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 22:22:55 +0000 Subject: [PATCH 0359/2544] --- system/codeigniter/CodeIgniter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 93c1dba5..409cf776 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -52,11 +52,11 @@ $BM =& load_class('Benchmark'); $BM->mark('total_execution_time_start'); -$BM->mark('loading_time_base_clases_start'); +$BM->mark('loading_time_base_classes_start'); /* * ------------------------------------------------------ - * Instantiate the hooks classe + * Instantiate the hooks class * ------------------------------------------------------ */ @@ -109,7 +109,7 @@ * ------------------------------------------------------ * * Note: Due to the poor object handling in PHP 4 we'll - * contditionally load different versions of the base + * conditionally load different versions of the base * class. Retaining PHP 4 compatibility requires a bit of a hack. * * Note: The Loader class needs to be included first @@ -132,7 +132,7 @@ require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking -$BM->mark('loading_time_base_clases_end'); +$BM->mark('loading_time_base_classes_end'); /* From 570c161b4c22c1fcdc0345b0d57a9ea127db4b4a Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 22:28:39 +0000 Subject: [PATCH 0360/2544] --- system/libraries/Loader.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index b313c6d5..253d916c 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -669,17 +669,17 @@ function _ci_load_class($class, $params = NULL) include_once(BASEPATH.'libraries/'.ucfirst($class).EXT); include_once(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); - return $this->_ci_init_class($filename, config_item('subclass_prefix'), $params); + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); } // Lets search for the requested library file and load it. for ($i = 1; $i < 3; $i++) { $path = ($i % 2) ? APPPATH : BASEPATH; - if (file_exists($path.'libraries/'.$filename.EXT)) + if (file_exists($path.'libraries/'.$class.EXT)) { - include_once($path.'libraries/'.$filename.EXT); - return $this->_ci_init_class($filename, '', $params); + include_once($path.'libraries/'.$class.EXT); + return $this->_ci_init_class($class, '', $params); } } From 82654c38441540e14096ec0fd95623af14d165ee Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 23:07:40 +0000 Subject: [PATCH 0361/2544] --- user_guide/changelog.html | 1 + user_guide/libraries/validation.html | 39 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2771a14e..01acd0f4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

              Version 1.5.0 Beta 3

            • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
            • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
            • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
            • +
            • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
            • Fixed a bug in the Email class related to SMTP Helo data.
            • Fixed a bug in the validation class.
            • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
            • diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 3a724831..1af3c32f 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -664,6 +664,45 @@

              Setting Custom Error Messages

              Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

              +

              Dealing with Select Menus, Radio Buttons, and Checkboxes

              + +

              If you use select menues, radio buttons or checkboxes, you will want the state of +these items to be retained in the event of an error. The Validation class has three functions taht help you do this:

              + +

              set_select()

              + +

              Permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item. Example:

              + + +<select name="myselect">
              +<option value="one" <?= $this->validation->set_select('myselect', 'one'); ?> >One</option>
              +<option value="two" <?= $this->validation->set_select('myselect', 'two'); ?> >Three</option>
              +<option value="three" <?= $this->validation->set_select('myselect', 'three'); ?> >Three</option>
              +</select> +
              + + +

              set_checkbox()

              + +

              Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value. Example:

              + +<input type="checkbox" name="mycheck" value="1" <?= $this->validation->set_checkbox('mycheck', 1); ?> /> + + +

              set_radio()

              + +

              Permits you to display radio buttons in the state they were submitted. The first parameter +must contain the name of the radio button, the second parameter must contain its value. Example:

              + +<input type="radio" name="myradio" value="1" <?= $this->validation->set_radio('myradio', 1); ?> /> + + + + +
            From ae3fbabe663d4f5f853e511b2e4619553787d3ad Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Oct 2006 23:20:12 +0000 Subject: [PATCH 0362/2544] --- user_guide/installation/upgrade_150.html | 49 +++++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index cf41dc40..4e25c54b 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -97,14 +97,59 @@

            Step 2: Update your database.php file

            -

            Step 3: Update your main index.php file

            + +

            Step 2: Update your config.php file

            + +

            Open your application/config/config.php file and ADD this new item:

            + +
            +/*
            +|--------------------------------------------------------------------------
            +| Class Extension Prefix
            +|--------------------------------------------------------------------------
            +|
            +| This item allows you to set the filename/classname prefix when extending
            +| native libraries.  For more information please see the user guide:
            +| 
            +| http://www.codeigniter.com/user_guide/general/core_classes.html
            +| http://www.codeigniter.com/user_guide/general/creating_libraries.html
            +|
            +*/
            +$config['subclass_prefix'] = 'MY_';
            +
            + +

            In that same file REMOVE this item:

            + + +
            +/*
            +|--------------------------------------------------------------------------
            +| Enable/Disable Error Logging
            +|--------------------------------------------------------------------------
            +|
            +| If you would like errors or debug messages logged set this variable to 
            +| TRUE (boolean).  Note: You must set the file permissions on the "logs" folder
            +| such that it is writable.
            +|
            +*/
            +$config['log_errors'] = FALSE;
            +
            + +

            Error logging is now disabled simply by setting the threshold to zero.

            + + + +

            Step 4: Update your main index.php file

            If you are running a stock index.php file simply replace your version with the new one. If you are running one with internal modifications, open it and add this line of code near the bottom:

            define('FCPATH', __FILE__); -

            Step 4: Update your user guide

            + + + +

            Step 5: Update your user guide

            Please also replace your local copy of the user guide with the new version.

            From 9fcc28a29299fbbc242f87bf1b1e61fda6543886 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 17:49:47 +0000 Subject: [PATCH 0363/2544] --- system/database/DB_cache.php | 2 +- system/database/DB_driver.php | 1 + system/helpers/file_helper.php | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 86493e77..aee5ce6f 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -171,7 +171,7 @@ function delete($segment_one = '', $segment_two = '') $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); } - $dir_path = $this->CI->db->cachedir.md5($segment_one.'+'.$segment_two).'/'; + $dir_path = $this->CI->db->cachedir.$segment_one.'+'.$segment_two.'/'; delete_files($dir_path, TRUE); } diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 848d4f1c..a24bd20d 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -236,6 +236,7 @@ function query($sql, $binds = FALSE, $return_object = TRUE) { if (FALSE !== ($cache = $this->CACHE->read($sql))) { + $this->load_rdriver(); return $cache; } } diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index c0f52568..635ef1ba 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -110,7 +110,7 @@ function write_file($path, $data, $mode = 'wb') * @param bool whether to delete any directories found in the path * @return bool */ -function delete_files($path, $del_dir = FALSE) +function delete_files($path, $del_dir = FALSE, $level = 0) { // Trim the trailing slash $path = preg_replace("|^(.+?)/*$|", "\\1", $path); @@ -124,7 +124,8 @@ function delete_files($path, $del_dir = FALSE) { if (is_dir($path.'/'.$filename)) { - delete_files($path.'/'.$filename, $del_dir); + $level++; + delete_files($path.'/'.$filename, $del_dir, $level); } else { @@ -134,7 +135,7 @@ function delete_files($path, $del_dir = FALSE) } @closedir($current_dir); - if ($del_dir == TRUE) + if ($del_dir == TRUE AND $level > 0) { @rmdir($path); } From e7e1dcd452a15abaaa01c03cd1ade564e3a59453 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 18:04:01 +0000 Subject: [PATCH 0364/2544] --- system/application/config/config.php | 2 +- system/application/config/database.php | 8 ++++---- system/helpers/array_helper.php | 2 +- system/helpers/directory_helper.php | 2 +- system/libraries/Benchmark.php | 2 +- system/libraries/Controller.php | 2 +- system/libraries/Zip.php | 2 +- user_guide/database/active_record.html | 2 +- user_guide/database/fields.html | 6 +++--- user_guide/database/queries.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/plugins.html | 4 ++-- user_guide/general/profiling.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/date_helper.html | 4 ++-- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 4 ++-- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/validation.html | 4 ++-- user_guide/libraries/xmlrpc.html | 6 +++--- 32 files changed, 43 insertions(+), 43 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index b0d2bf50..ab4f445f 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -160,7 +160,7 @@ | your log files will fill up very fast. | */ -$config['log_threshold'] = 4; +$config['log_threshold'] = 0; /* |-------------------------------------------------------------------------- diff --git a/system/application/config/database.php b/system/application/config/database.php index 082e34a0..9d8c7783 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -34,16 +34,16 @@ $active_group = "default"; $db['default']['hostname'] = "localhost"; -$db['default']['username'] = ""; +$db['default']['username'] = "root"; $db['default']['password'] = ""; -$db['default']['database'] = ""; +$db['default']['database'] = "tester"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; -$db['default']['cache_on'] = FALSE; -$db['default']['cachedir'] = ""; +$db['default']['cache_on'] = TRUE; +$db['default']['cachedir'] = APPPATH.'dbcache/'; ?> \ No newline at end of file diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index de0faeef..8adbd854 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -31,7 +31,7 @@ * Element * * Lets you determine whether an array index is set and whether it has a value. - * If the element is empty it returns FALSE (or whater you specify as the default value.) + * If the element is empty it returns FALSE (or whatever you specify as the default value.) * * @access public * @param string diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 69eb13d1..4b7a383b 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -28,7 +28,7 @@ // ------------------------------------------------------------------------ /** - * Create a Direcotry Map + * Create a Directory Map * * Reads the specified directory and builds an array * representation of it. Sub-folders contained with the diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index d4262792..5fd24b05 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -54,7 +54,7 @@ function mark($name) * Calculates the time difference between two marked points. * * If the first parameter is empty this function instead returns the - * {elapsed_time} pseudo-variable. This permits the the full system + * {elapsed_time} pseudo-variable. This permits the full system * execution time to be shown in a template. The output class will * swap the real value for this variable. * diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 0bbc7773..3db408be 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -18,7 +18,7 @@ /** * Code Igniter Application Controller Class * - * This class object is the the super class the every library in + * This class object is the super class the every library in * Code Igniter will be assigned to. * * @package CodeIgniter diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index e13c713f..6af1ca97 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -228,7 +228,7 @@ function get_zip() // -------------------------------------------------------------------- /** - * Write File to the specified direcotry + * Write File to the specified directory * * Lets you write a file * diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 10b018b4..f30b3d8b 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -221,7 +221,7 @@

            $this->db->where();

          • Custom key/value method: -

            You can include an operator in the first parameter in order to to control the comparison:

            +

            You can include an operator in the first parameter in order to control the comparison:

            $this->db->where('name !=', $name);
            $this->db->where('id <', $id); diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index d70314b5..1ae1a392 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -80,7 +80,7 @@

            $this->db->list_fields()

            }
            -

            2. You can gather the feild names associated with any query you run by calling the function +

            2. You can gather the field names associated with any query you run by calling the function from your query result object:

            @@ -96,7 +96,7 @@

            $this->db->list_fields()

            $this->db->field_exists()

            -

            Sometimes it's helpful to know whether a particular field exists befor performing an action. +

            Sometimes it's helpful to know whether a particular field exists before performing an action. Returns a boolean TRUE/FALSE. Usage example:

            @@ -133,7 +133,7 @@

            $this->db->field_data()

            }
            -

            If you have run a query already you can use the result oject instead of supplying the table name:

            +

            If you have run a query already you can use the result object instead of supplying the table name:

            $query = $this->db->query("YOUR QUERY")
            diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 39ad00f1..a13e2d6a 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -87,7 +87,7 @@

            $this->db->simple_query();

            Escaping Queries

            -

            It's a very good security practice to escape your data before sumbiting it into your database. +

            It's a very good security practice to escape your data before submitting it into your database. Code Igniter has two functions that help you do this:

              diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index a7e907e7..36893e91 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -92,7 +92,7 @@

              Auto-loading Resources

              diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index b27a3764..d541174f 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -75,7 +75,7 @@

              Setting your Key

              A key is a piece of information that controls the cryptographic process and permits an encrypted string to be decoded. In fact, the key you chose will provide the only means to decode data that was encrypted with that key, -so not only must you chose the key carefully, you must must never change it if you intend use it for persistent data.

              +so not only must you chose the key carefully, you must never change it if you intend use it for persistent data.

              It goes without saying that you should guard your key carefully. Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 042a1dbf..10786531 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -70,7 +70,7 @@

              Language Class

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside your application folder and store them there. Code Igniter will look first in your system/application/language -directory. If the direcotry does not exist or the specified language is not located there CI will instead look in your global +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

              Note:  Each language should be stored in its own folder. For example, the English files are located at: diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 44bae34a..32bbddfe 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -83,13 +83,13 @@

              $this->load->library('class_name')

              Once loaded, the library will be ready for use, using $this->email->some_function(). -Each library is described in detail in its own page, so please read theinformation regarding each one you would like to use.

              +Each library is described in detail in its own page, so please read the information regarding each one you would like to use.

              Parameters can be passed to the library via an array in the second parameter. -

              If you would like your libraries assigned to a different variable name then the default you can specify the name in the second paramter:

              +

              If you would like your libraries assigned to a different variable name then the default you can specify the name in the second parameter:

              $this->load->library('email', 'E'); // Assigns the email object to "E"
              diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index d577fbba..dd3ce423 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -110,7 +110,7 @@

              $this->output->enable_profiler();

              Permits you to enable/disable the Profiler, which will display benchmark and other data at the bottom of your pages for debugging and optimization purposes.

              -

              To enable the profiler place the the following function anywhere within your Controller functions:

              +

              To enable the profiler place the following function anywhere within your Controller functions:

              $this->output->enable_profiler(TRUE);

              When enabled a report will be generated and inserted at the bottom of your pages.

              diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 19cfc744..317878a0 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -122,7 +122,7 @@

              $config['uri_segment'] = 3;

              $config['num_links'] = 2;

              -

              The number of "digit" links you would like before and after the the selected page number. For example, the number 2 +

              The number of "digit" links you would like before and after the selected page number. For example, the number 2 will place two digits on either side, as in the example links at the very top of this page.

              Adding Enclosing Markup

              diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 1af3c32f..0a4905a7 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -666,8 +666,8 @@

              Setting Custom Error Messages

              Dealing with Select Menus, Radio Buttons, and Checkboxes

              -

              If you use select menues, radio buttons or checkboxes, you will want the state of -these items to be retained in the event of an error. The Validation class has three functions taht help you do this:

              +

              If you use select menus, radio buttons or checkboxes, you will want the state of +these items to be retained in the event of an error. The Validation class has three functions that help you do this:

              set_select()

              diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 34d47d22..7cd00a26 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -82,7 +82,7 @@

              What is XML-RPC?

              When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. Once processed, the server will then send back a response message.

              -

              For detailed spcifications, you can visit the XML-RPC site.

              +

              For detailed specifications, you can visit the XML-RPC site.

              Initializing the Class

              @@ -145,7 +145,7 @@

              Anatomy of a Request

              is referred to as a request parameter. The above example has two parameters: The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

              -

              Request parameters must be placed into an array for transportation, and each parameter can can be one +

              Request parameters must be placed into an array for transportation, and each parameter can be one of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings you will have to include the data type in the request array.

              @@ -447,7 +447,7 @@

              $this->xmlrpc->send_error_message()

              return $this->xmlrpc->send_error_message('123', 'Requested data not available');

              $this->xmlrpc->send_response()

              -

              Lets you send the response from your server to the client. An array of of valid data values must be sent with this method.

              +

              Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

              $response = array(
                               array(
                                      'flerror' => array(FALSE, 'boolean'),
              From fafe28bec4f414e48f63e01ed9105ae5c2c99802 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:08:17 +0000 Subject: [PATCH 0365/2544] --- system/database/DB_active_rec.php | 2 +- system/database/DB_cache.php | 2 +- system/database/DB_driver.php | 6 +- system/database/DB_result.php | 2 +- .../database/drivers/mssql/mssql_driver.php | 2 +- .../database/drivers/mysql/mysql_driver.php | 2 +- .../database/drivers/mysqli/mysqli_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- .../drivers/postgre/postgre_driver.php | 2 +- .../database/drivers/sqlite/sqlite_driver.php | 2 +- system/helpers/date_helper.php | 2 +- system/helpers/file_helper.php | 4 +- system/helpers/form_helper.php | 4 +- system/helpers/security_helper.php | 8 +- system/helpers/typography_helper.php | 6 +- system/helpers/user_agent_helper.php | 89 ------------------- system/libraries/Calendar.php | 2 +- 18 files changed, 26 insertions(+), 115 deletions(-) delete mode 100644 system/helpers/user_agent_helper.php diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 1fa4f955..8db6161a 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -804,7 +804,7 @@ function _compile_select() /** * Object to Array * - * Takes an object as input and convers the class variables to array key/vals + * Takes an object as input and converts the class variables to array key/vals * * @access public * @param object diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index aee5ce6f..b469b0e1 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -82,7 +82,7 @@ function check_path($path = '') // -------------------------------------------------------------------- /** - * Retreive a cached query + * Retrieve a cached query * * The URI being requested will become the name of the cache sub-folder. * An MD5 hash of the SQL statement will become the cache file name diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index a24bd20d..8a7b88f1 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -368,7 +368,7 @@ function load_rdriver() /** * Simple Query - * This is a simiplified version of the query() function. Internally + * This is a simplified version of the query() function. Internally * we only use it when running transaction commands since they do * not require all the features of the main query() function. * @@ -535,7 +535,7 @@ function is_write_type($sql) * Calculate the aggregate query elapsed time * * @access public - * @param intiger The number of decimal places + * @param integer The number of decimal places * @return integer */ function elapsed_time($decimals = 6) @@ -1021,7 +1021,7 @@ function close() * @param string the error message * @param string any "swap" values * @param boolean whether to localize the message - * @return string sends the application/errror_db.php template + * @return string sends the application/error_db.php template */ function display_error($error = '', $swap = '', $native = FALSE) { diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 4e8c4fc7..d02bfb96 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -63,7 +63,7 @@ function result_object() return $this->result_object; } - if ($this->num_rows == 0) + if ($this->numerous == 0) { return array(); } diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index cb2f48dc..4dc8792c 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -277,7 +277,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * List columnn query + * List column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 253627cd..20311ffa 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -311,7 +311,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 4fd9f3aa..ea2adbea 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -303,7 +303,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 794405a0..4f5470c1 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -418,7 +418,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 4bd6e110..17a6dfbd 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -278,7 +278,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 340d6504..f74e652d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -305,7 +305,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 9da50b67..fd9fd2c5 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -297,7 +297,7 @@ function _list_tables() // -------------------------------------------------------------------- /** - * Show columnn query + * Show column query * * Generates a platform-specific query string so that the column names can be fetched * diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 03519e68..91186242 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -507,7 +507,7 @@ function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') * Timezones * * Returns an array of timezones. This is a helper function - * for varios other ones in this library + * for various other ones in this library * * @access public * @param string timezone diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 635ef1ba..7a04324e 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -73,7 +73,7 @@ function read_file($file) * Write File * * Writes data to the file specified in the path. - * Creats a new file if non-existant. + * Creates a new file if non-existent. * * @access public * @param string path to file @@ -102,7 +102,7 @@ function write_file($path, $data, $mode = 'wb') * * Deletes all files contained in the supplied directory path. * Files must be writable or owned by the system in order to be deleted. - * If the second parameter is set to TRUE, any direcotries contained + * If the second parameter is set to TRUE, any directories contained * within the supplied base directory will be nuked as well. * * @access public diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 3fd36104..e12d8931 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -204,7 +204,7 @@ function form_textarea($data = '', $value = '', $extra = '') // ------------------------------------------------------------------------ /** - * Dropdown Menu + * Drop-down Menu * * @access public * @param string @@ -348,7 +348,7 @@ function form_prep($str = '') * * @access private * @param array - * @parm array + * @param array * @return string */ function parse_form_attributes($attributes, $default) diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 347cab42..34386ffe 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -31,8 +31,8 @@ * XSS Filtering * * @access public - * @parm string - * @parm string the character set of your data + * @param string + * @param string the character set of your data * @return string */ function xss_clean($str, $charset = 'ISO-8859-1') @@ -84,7 +84,7 @@ function dohash($str, $type = 'sha1') * Strip Image Tags * * @access public - * @parm string + * @param string * @return string */ function strip_image_tags($str) @@ -101,7 +101,7 @@ function strip_image_tags($str) * Convert PHP tags to entities * * @access public - * @parm string + * @param string * @return string */ function encode_php_tags($str) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index ba680487..fe9e3bb9 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -65,7 +65,7 @@ function nl2br_except_pre($str) * * * @access public - * @parm string + * @param string * @return string */ function auto_typography($str) @@ -125,7 +125,7 @@ function convert($str) $str = preg_replace("/\n\n+/", "\n\n", $str); /* - * Convert quotes within tags to tempoarary marker + * Convert quotes within tags to temporary marker * * We don't want quotes converted within * tags so we'll temporarily convert them to @@ -156,7 +156,7 @@ function convert($str) $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

              ", $str); /* - * Convert "ignore" tags to tempoarary marker + * Convert "ignore" tags to temporary marker * * The parser splits out the string at every tag * it encounters. Certain inline tags, like image diff --git a/system/helpers/user_agent_helper.php b/system/helpers/user_agent_helper.php deleted file mode 100644 index 3c6085e7..00000000 --- a/system/helpers/user_agent_helper.php +++ /dev/null @@ -1,89 +0,0 @@ - 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - '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', - 'mac os x' => 'Mac OS X', - 'freebsd' => 'FreeBSD', - 'ppc' => 'Macintosh', - 'sunos' => 'Sun Solaris', - 'linux' => 'Linux', - 'debian' => 'Debian', - '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' - ); - - - foreach ($os as $key => $val) - { - if (preg_match("|$key|i", $_SERVER['HTTP_USER_AGENT'])) - { - return $val; - } - } - - return 'Unknown OS'; -} - - -?> \ No newline at end of file diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 048934b8..52e99b5a 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -250,7 +250,7 @@ function generate($year = '', $month = '', $data = array()) * month provided. * * @access public - * @parm integer the month + * @param integer the month * @return string */ function get_month_name($month) From 1604062c207cc70eaa8f528e59756a807ba045db Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:09:49 +0000 Subject: [PATCH 0366/2544] --- system/libraries/Benchmark.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index 5fd24b05..44c32a87 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -59,8 +59,8 @@ function mark($name) * swap the real value for this variable. * * @access public - * @param string a paricular marked point - * @param string a paricular marked point + * @param string a particular marked point + * @param string a particular marked point * @param integer the number of decimal places * @return mixed */ From 5f95aab62d3923e05dacf65d94eeefb2283edc4d Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:10:51 +0000 Subject: [PATCH 0367/2544] --- system/libraries/Calendar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 52e99b5a..ec355d24 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -246,7 +246,7 @@ function generate($year = '', $month = '', $data = array()) /** * Get Month Name * - * Generates a texual month name based on the numeric + * Generates a textual month name based on the numeric * month provided. * * @access public From 23db0ddcd518b8a6ab8b7688a3eab756a73463f0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:16:50 +0000 Subject: [PATCH 0368/2544] --- system/libraries/Email.php | 63 ++++---------------------------------- 1 file changed, 6 insertions(+), 57 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 23f7fe45..eb04ae9d 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -87,7 +87,6 @@ function CI_Email($config = array()) log_message('debug', "Email Class Initialized"); } - // END CI_Email() // -------------------------------------------------------------------- @@ -120,7 +119,6 @@ function initialize($config = array()) $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; $this->_safe_mode = (@ini_get("safe_mode") == 0) ? FALSE : TRUE; } - // END initialize() // -------------------------------------------------------------------- @@ -151,7 +149,6 @@ function clear($clear_attachments = FALSE) $this->_attach_disp = array(); } } - // END clear() // -------------------------------------------------------------------- @@ -179,7 +176,6 @@ function from($from, $name = '') $this->_set_header('From', $name.' <'.$from.'>'); $this->_set_header('Return-Path', '<'.$from.'>'); } - // END from() // -------------------------------------------------------------------- @@ -212,7 +208,6 @@ function reply_to($replyto, $name = '') $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); $this->_replyto_flag = TRUE; } - // END reply_to() // -------------------------------------------------------------------- @@ -244,7 +239,6 @@ function to($to) break; } } - // END to() // -------------------------------------------------------------------- @@ -268,7 +262,6 @@ function cc($cc) if ($this->_get_protocol() == "smtp") $this->_cc_array = $cc; } - // END cc() // -------------------------------------------------------------------- @@ -299,7 +292,6 @@ function bcc($bcc, $limit = '') else $this->_set_header('Bcc', implode(", ", $bcc)); } - // END bcc() // -------------------------------------------------------------------- @@ -317,7 +309,6 @@ function subject($subject) $this->_set_header('Subject', trim($subject)); } - // END subject() // -------------------------------------------------------------------- @@ -339,7 +330,6 @@ function message($body) $this->_body = stripslashes($this->_body); } - // END message() // -------------------------------------------------------------------- @@ -356,7 +346,6 @@ function attach($filename, $disposition = 'attachment') $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters } - // END attach() // -------------------------------------------------------------------- @@ -372,7 +361,6 @@ function _set_header($header, $value) { $this->_headers[$header] = $value; } - // END _set_header() // -------------------------------------------------------------------- @@ -409,7 +397,6 @@ function _str_to_array($email) } return $email; } - // END _str_to_array() // -------------------------------------------------------------------- @@ -424,7 +411,6 @@ function set_alt_message($str = '') { $this->alt_message = ($str == '') ? '' : $str; } - // END set_alt_message() // -------------------------------------------------------------------- @@ -439,7 +425,6 @@ function set_mailtype($type = 'text') { $this->mailtype = ($type == 'html') ? 'html' : 'text'; } - // END set_mailtype() // -------------------------------------------------------------------- @@ -454,12 +439,11 @@ function set_wordwrap($wordwrap = TRUE) { $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; } - // END set_wordwrap() // -------------------------------------------------------------------- /** - * Set Protocal + * Set Protocol * * @access public * @param string @@ -469,7 +453,6 @@ function set_protocol($protocol = 'mail') { $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); } - // END set_protocol() // -------------------------------------------------------------------- @@ -496,7 +479,6 @@ function set_priority($n = 3) $this->priority = $n; } - // END set_priority() // -------------------------------------------------------------------- @@ -517,22 +499,20 @@ function set_newline($newline = "\n") $this->newline = $newline; } - // END set_newline() // -------------------------------------------------------------------- /** - * Set Message Boundry + * Set Message Boundary * * @access private * @return void */ function _set_boundaries() { - $this->_alt_boundary = "B_ALT_".uniqid(''); // mulipart/alternative + $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary } - // END _set_boundaries() // -------------------------------------------------------------------- @@ -550,7 +530,6 @@ function _get_message_id() return "<".uniqid('').strstr($from, '@').">"; } - // END _get_message_id() // -------------------------------------------------------------------- @@ -569,7 +548,6 @@ function _get_protocol($return = true) if ($return == true) return $this->protocol; } - // END _get_protocol() // -------------------------------------------------------------------- @@ -590,7 +568,6 @@ function _get_encoding($return = true) if ($return == true) return $this->_encoding; } - // END _get_encoding() // -------------------------------------------------------------------- @@ -613,7 +590,6 @@ function _get_content_type() else return 'plain'; } - // END _get_content_type() // -------------------------------------------------------------------- @@ -632,7 +608,6 @@ function _set_date() return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); } - // END _set_date() // -------------------------------------------------------------------- @@ -646,7 +621,6 @@ function _get_mime_message() { return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; } - // END _get_mime_message() // -------------------------------------------------------------------- @@ -674,7 +648,6 @@ function validate_email($email) } } } - // END validate_email() // -------------------------------------------------------------------- @@ -692,7 +665,6 @@ function valid_email($address) else return TRUE; } - // END valid_email() // -------------------------------------------------------------------- @@ -725,7 +697,6 @@ function clean_email($email) return $clean_email; } - // END clean_email() // -------------------------------------------------------------------- @@ -773,7 +744,6 @@ function _get_alt_message() return $this->word_wrap($body, '76'); } - // END _get_alt_message() // -------------------------------------------------------------------- @@ -846,7 +816,6 @@ function word_wrap($str, $chars = '') return $output; } - // END word_wrap() // -------------------------------------------------------------------- @@ -865,7 +834,6 @@ function _build_headers() $this->_set_header('Message-ID', $this->_get_message_id()); $this->_set_header('Mime-Version', '1.0'); } - // END _build_headers() // -------------------------------------------------------------------- @@ -899,7 +867,6 @@ function _write_headers() if ($this->_get_protocol() == 'mail') $this->_header_str = substr($this->_header_str, 0, -1); } - // END _write_headers() // -------------------------------------------------------------------- @@ -1062,7 +1029,6 @@ function _build_message() return; } - // END _build_message() // -------------------------------------------------------------------- @@ -1102,12 +1068,11 @@ function send() else return TRUE; } - // END send() // -------------------------------------------------------------------- /** - * Batch Bcc Send. Sends groups of Bccs in batches + * Batch Bcc Send. Sends groups of BCCs in batches * * @access public * @return bool @@ -1154,7 +1119,6 @@ function batch_bcc_send() $this->_spool_email(); } } - // END batch_bcc_send() // -------------------------------------------------------------------- @@ -1168,7 +1132,6 @@ function _unwrap_specials() { $this->_finalbody = preg_replace_callback("/\{unwrap\}(.*?)\{\/unwrap\}/si", array($this, '_remove_nl_callback'), $this->_finalbody); } - // END _unwrap_specials() // -------------------------------------------------------------------- @@ -1182,7 +1145,6 @@ function _remove_nl_callback($matches) { return preg_replace("/(\r\n)|(\r)|(\n)/", "", $matches['1']); } - // END _remove_nl_callback() // -------------------------------------------------------------------- @@ -1190,7 +1152,7 @@ function _remove_nl_callback($matches) * Spool mail to the mail server * * @access private - * @return bol + * @return bool */ function _spool_email() { @@ -1228,7 +1190,6 @@ function _spool_email() $this->_set_error_message('email_sent', $this->_get_protocol()); return true; } - // END _spool_email() // -------------------------------------------------------------------- @@ -1255,7 +1216,6 @@ function _send_with_mail() return TRUE; } } - // END _send_with_mail() // -------------------------------------------------------------------- @@ -1281,7 +1241,6 @@ function _send_with_sendmail() return TRUE; } - // END _send_with_sendmail() // -------------------------------------------------------------------- @@ -1344,7 +1303,6 @@ function _send_with_smtp() $this->_send_command('quit'); return true; } - // END _send_with_smtp() // -------------------------------------------------------------------- @@ -1373,7 +1331,6 @@ function _smtp_connect() $this->_set_error_message($this->_get_smtp_data()); return $this->_send_command('hello'); } - // END _smtp_connect() // -------------------------------------------------------------------- @@ -1439,7 +1396,6 @@ function _send_command($cmd, $data = '') return true; } - // END _send_command() // -------------------------------------------------------------------- @@ -1492,7 +1448,6 @@ function _smtp_authenticate() return true; } - // END _smtp_authenticate() // -------------------------------------------------------------------- @@ -1512,7 +1467,6 @@ function _send_data($data) else return true; } - // END _send_data() // -------------------------------------------------------------------- @@ -1536,7 +1490,6 @@ function _get_smtp_data() return $data; } - // END _get_smtp_data() // -------------------------------------------------------------------- @@ -1550,7 +1503,6 @@ function _get_hostname() { return (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain'; } - // END _get_hostname() // -------------------------------------------------------------------- @@ -1591,12 +1543,11 @@ function _get_ip() return $this->_IP; } - // END _get_ip() // -------------------------------------------------------------------- /** - * Get Debugg Message + * Get Debug Message * * @access public * @return string @@ -1641,7 +1592,6 @@ function _set_error_message($msg, $val = '') $this->_debug_msg[] = str_replace('%s', $val, $line)."
              "; } } - // END _set_error_message() // -------------------------------------------------------------------- @@ -1745,7 +1695,6 @@ function _mime_types($ext = "") return ( ! isset($mimes[strtolower($ext)])) ? "application/x-unknown-content-type" : $mimes[strtolower($ext)]; } - // END _mime_types() } // END CI_Email class From bd6bee75dd26ade1c8d9cfd104bb913065797c59 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:39:00 +0000 Subject: [PATCH 0369/2544] --- system/libraries/Config.php | 14 ++----------- system/libraries/Exceptions.php | 11 +++------- system/libraries/Hooks.php | 3 --- system/libraries/Image_lib.php | 36 ++++++--------------------------- system/libraries/Input.php | 12 +++++------ system/libraries/Language.php | 3 --- system/libraries/Loader.php | 4 ++-- system/libraries/Pagination.php | 2 +- system/libraries/Parser.php | 5 ----- system/libraries/Profiler.php | 2 +- system/libraries/Router.php | 8 ++++---- system/libraries/Session.php | 4 +--- system/libraries/Sha1.php | 5 ----- system/libraries/Table.php | 2 +- system/libraries/Trackback.php | 19 +++-------------- system/libraries/Unit_test.php | 2 +- system/libraries/Upload.php | 4 ++-- 17 files changed, 33 insertions(+), 103 deletions(-) diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 82836b1f..ef6d46a2 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -46,9 +46,7 @@ function CI_Config() { $this->config = get_config(); log_message('debug', "Config Class Initialized"); - } - // END CI_Config() - + } // -------------------------------------------------------------------- @@ -110,7 +108,6 @@ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) log_message('debug', 'Config file loaded: config/'.$file.EXT); return TRUE; } - // END load() // -------------------------------------------------------------------- @@ -152,7 +149,6 @@ function item($item, $index = '') return $pref; } - // END item() // -------------------------------------------------------------------- @@ -186,9 +182,6 @@ function slash_item($item) return $pref; } - // END item() - - // -------------------------------------------------------------------- @@ -216,8 +209,7 @@ function site_url($uri = '') return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; } } - // END site_url() - + // -------------------------------------------------------------------- /** @@ -231,7 +223,6 @@ function system_url() $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); return $this->slash_item('base_url').end($x).'/'; } - // END system_url() // -------------------------------------------------------------------- @@ -247,7 +238,6 @@ function set_item($item, $value) { $this->config[$item] = $value; } - // END set_item() } diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 4bdbe4f8..a0591e4e 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -55,7 +55,6 @@ function CI_Exceptions() { // Note: Do not log messages from this constructor. } - // END CI_Exceptions() // -------------------------------------------------------------------- @@ -77,7 +76,6 @@ function log_exception($severity, $message, $filepath, $line) log_message('error', 'Severity: '.$severity.' '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); } - // END log_exception() // -------------------------------------------------------------------- @@ -97,7 +95,6 @@ function show_404($page = '') echo $this->show_error($heading, $message, 'error_404'); exit; } - // END show_404() // -------------------------------------------------------------------- @@ -105,7 +102,7 @@ function show_404($page = '') * General Error Page * * This function takes an error message as input - * (either as a string or an array) and displayes + * (either as a string or an array) and displays * it using the specified template. * * @access private @@ -128,8 +125,6 @@ function show_error($heading, $message, $template = 'error_general') ob_end_clean(); return $buffer; } - // END show_error() - // -------------------------------------------------------------------- @@ -166,8 +161,8 @@ function show_php_error($severity, $message, $filepath, $line) ob_end_clean(); echo $buffer; } - // END show_php_error() -// END Exceptions Class + } +// END Exceptions Class ?> \ No newline at end of file diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 3c35c908..6f48723f 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -109,7 +109,6 @@ function _call_hook($which = '') return TRUE; } - // END hook_exists() // -------------------------------------------------------------------- @@ -218,8 +217,6 @@ function _run_hook($data) $this->in_progress = FALSE; return TRUE; } - // END _run_hook() - } diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 16583c06..f8c05f83 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -92,7 +92,6 @@ function CI_Image_lib($props = array()) log_message('debug', "Image Lib Class Initialized"); } - // END CI_Image_lib() // -------------------------------------------------------------------- @@ -113,7 +112,6 @@ function clear() $this->$val = ''; } } - // END clear() // -------------------------------------------------------------------- @@ -186,7 +184,7 @@ function initialize($props = array()) $this->source_image = end($x); $this->source_folder = str_replace($this->source_image, '', $full_source_path); - // Set the Image Propterties + // Set the Image Properties if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) { return FALSE; @@ -333,7 +331,6 @@ function initialize($props = array()) return TRUE; } - // END initialize() // -------------------------------------------------------------------- @@ -357,7 +354,6 @@ function resize() return $this->$protocol('resize'); } - // END resize() // -------------------------------------------------------------------- @@ -381,7 +377,6 @@ function crop() return $this->$protocol('crop'); } - // END crop() // -------------------------------------------------------------------- @@ -435,7 +430,6 @@ function rotate() return $this->image_rotate_gd(); } } - // END rotate() // -------------------------------------------------------------------- @@ -540,7 +534,6 @@ function image_process_gd($action = 'resize') return TRUE; } - // END image_process_gd() // -------------------------------------------------------------------- @@ -611,7 +604,6 @@ function image_process_imagemagick($action = 'resize') return TRUE; } - // END image_process_imagemagick() // -------------------------------------------------------------------- @@ -698,7 +690,6 @@ function image_process_netpbm($action = 'resize') return TRUE; } - // END image_process_netpbm() // -------------------------------------------------------------------- @@ -758,7 +749,6 @@ function image_rotate_gd() return true; } - // END image_rotate_gd() // -------------------------------------------------------------------- @@ -843,7 +833,6 @@ function image_mirror_gd() return TRUE; } - // END image_mirror_gd() // -------------------------------------------------------------------- @@ -868,7 +857,6 @@ function watermark() return $this->text_watermark(); } } - // END image_mirror_gd() // -------------------------------------------------------------------- @@ -969,7 +957,6 @@ function overlay_watermark() return TRUE; } - // END overlay_watermark() // -------------------------------------------------------------------- @@ -1110,7 +1097,6 @@ function text_watermark() return TRUE; } - // END text_watermark() // -------------------------------------------------------------------- @@ -1168,12 +1154,11 @@ function image_create_gd($path = '', $image_type = '') $this->set_error(array('imglib_unsupported_imagecreate')); return FALSE; } - // END image_create_gd() // -------------------------------------------------------------------- /** - * Write imge file to disk - GD + * Write image file to disk - GD * * Takes an image resource as input and writes the file * to the specified destination @@ -1226,12 +1211,11 @@ function image_save_gd($resource) return TRUE; } - // END image_save_gd() // -------------------------------------------------------------------- /** - * Dynamically ouputs an image + * Dynamically outputs an image * * @access public * @param resource @@ -1256,18 +1240,17 @@ function image_display_gd($resource) break; } } - // END image_display_gd() // -------------------------------------------------------------------- /** - * Reproportion Image Width/Height + * Re-proportion Image Width/Height * * When creating thumbs, the desired width/height * can end up warping the image due to an incorrect * ratio between the full-sized image and the thumb. * - * This function lets us reproportion the width/height + * This function lets us re-proportion the width/height * if users choose to maintain the aspect ratio when resizing. * * @access public @@ -1303,7 +1286,6 @@ function image_reproportion() } } } - // END image_reproportion() // -------------------------------------------------------------------- @@ -1355,7 +1337,6 @@ function get_image_properties($path = '', $return = FALSE) return TRUE; } - // END get_image_properties() // -------------------------------------------------------------------- @@ -1406,7 +1387,6 @@ function size_calculator($vals) return $vals; } - // END size_calculator() // -------------------------------------------------------------------- @@ -1447,7 +1427,6 @@ function explode_name($source_image) return $ret; } - // END explode_name() // -------------------------------------------------------------------- @@ -1469,7 +1448,6 @@ function gd_loaded() return TRUE; } - // END gd_loaded() // -------------------------------------------------------------------- @@ -1491,7 +1469,6 @@ function gd_version() return FALSE; } - // END gd_version() // -------------------------------------------------------------------- @@ -1524,7 +1501,6 @@ function set_error($msg) log_message('error', $msg); } } - // END set_error() // -------------------------------------------------------------------- @@ -1545,7 +1521,7 @@ function display_errors($open = '

              ', $close = '

              ') return $str; } - // END display_errors() + } // END Image_lib Class ?> \ No newline at end of file diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 72344e34..57696c8a 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -55,7 +55,7 @@ function CI_Input() /** * Sanitize Globals * - * This function does the folowing: + * This function does the following: * * Unsets $_GET data (if query strings are not enabled) * @@ -114,7 +114,7 @@ function _sanitize_globals() // -------------------------------------------------------------------- /** - * Clean Intput Data + * Clean Input Data * * This is a helper function. It escapes data and * standardizes newline characters to \n @@ -399,7 +399,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') $str = preg_replace('/(\\\\0)+/', '', $str); /* - * Validate standard character entites + * Validate standard character entities * * Add a semicolon if missing. We do this to enable * the conversion of entities to ASCII later. @@ -408,7 +408,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') $str = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$str); /* - * Validate UTF16 two byte encodeing (x00) + * Validate UTF16 two byte encoding (x00) * * Just as above, adds a semicolon if missing. * @@ -501,7 +501,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * * Note: This code is a little blunt. It removes * the event handler and anything up to the closing >, - * but it's unlkely to be a problem. + * but it's unlikely to be a problem. * */ $str = preg_replace('#(<[^>]+.*?)(onblur|onchange|onclick|onfocus|onload|onmouseover|onmouseup|onmousedown|onselect|onsubmit|onunload|onkeypress|onkeydown|onkeyup|onresize)[^>]*>#iU',"\\1>",$str); @@ -525,7 +525,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * tags it looks for PHP and JavaScript commands * that are disallowed. Rather than removing the * code, it simply converts the parenthesis to entities - * rendering the code unexecutable. + * rendering the code un-executable. * * For example: eval('some code') * Becomes: eval('some code') diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 00e2fb7e..82508074 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -38,7 +38,6 @@ function CI_Language() { log_message('debug', "Language Class Initialized"); } - // END CI_Language() // -------------------------------------------------------------------- @@ -103,7 +102,6 @@ function load($langfile = '', $idiom = '', $return = FALSE) log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); return TRUE; } - // END load() // -------------------------------------------------------------------- @@ -118,7 +116,6 @@ function line($line = '') { return ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; } - // END line() } // END Language Class diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 253d916c..849ee731 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -820,7 +820,7 @@ function _ci_autoloader() * Assign to Models * * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) - * will be available to modles, if any exist. + * will be available to models, if any exist. * * @access private * @param object @@ -855,7 +855,7 @@ function _ci_assign_to_models() /** * Object to Array * - * Takes an object as input and convers the class variables to array key/vals + * Takes an object as input and converts the class variables to array key/vals * * @access private * @param object diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index b29571ee..26fb93ee 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -199,7 +199,7 @@ function create_links() } // Kill double slashes. Note: Sometimes we can end up with a double slash - // in the penultimate link so we'll kill all double shashes. + // in the penultimate link so we'll kill all double slashes. $output = preg_replace("#([^:])//+#", "\\1/", $output); // Add the wrapper HTML if exists diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index a0c9dab9..ebf7644a 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -71,7 +71,6 @@ function parse($template, $data, $return = FALSE) return $template; } - // END set_method() // -------------------------------------------------------------------- @@ -88,7 +87,6 @@ function set_delimiters($l = '{', $r = '}') $this->l_delim = $l; $this->r_delim = $r; } - // END set_method() // -------------------------------------------------------------------- @@ -105,7 +103,6 @@ function _parse_single($key, $val, $string) { return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); } - // END set_method() // -------------------------------------------------------------------- @@ -148,7 +145,6 @@ function _parse_pair($variable, $data, $string) return str_replace($match['0'], $str, $string); } - // END set_method() // -------------------------------------------------------------------- @@ -169,7 +165,6 @@ function _match_pair($string, $variable) return $match; } - // END _match_pair() } // END Parser Class diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 7fecabd2..6e6fb675 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -46,7 +46,7 @@ function CI_Profiler() * Auto Profiler * * This function cycles through the entire array of mark points and - * matches any two points that are named identially (ending in "_start" + * matches any two points that are named identically (ending in "_start" * and "_end" respectively). It then compiles the execution times for * all points and returns it as an array * diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 94a9a524..6002027d 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -58,7 +58,7 @@ function CI_Router() /** * Set the route mapping * - * This function determies what should be served based on the URI request, + * This function determines what should be served based on the URI request, * as well as any "routes" that have been set in the routing config file. * * @access private @@ -322,7 +322,7 @@ function _get_uri_string() // OK, how about REQUEST_URI? // Note: REQUEST_URI is not supplied in a consistent manner with all platforms so it's - // a diffucult variable to use. We'll try to parse it out correctly. Hopfully one + // a difficult variable to use. We'll try to parse it out correctly. Hopefully one // of the other variables above was available. $path = $this->_parse_request_uri(); if ($path != "") @@ -452,10 +452,10 @@ function _parse_routes() return; } - // Loop through the route array looking for wildcards + // Loop through the route array looking for wild-cards foreach (array_slice($this->routes, 1) as $key => $val) { - // Convert wildcards to RegEx + // Convert wild-cards to RegEx $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); // Does the RegEx match? diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 8390fd6d..a47599d1 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -35,8 +35,7 @@ class CI_Session { var $sess_cookie = 'ci_session'; var $userdata = array(); var $gc_probability = 5; - - + /** * Session Constructor @@ -51,7 +50,6 @@ function CI_Session() log_message('debug', "Session Class Initialized"); $this->sess_run(); } - // END display_errors() // -------------------------------------------------------------------- diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index 13196eb6..971c091a 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -117,7 +117,6 @@ function generate($str) return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e); } - // END generate() // -------------------------------------------------------------------- @@ -139,7 +138,6 @@ function _hex($str) return $str; } - // END _hex() // -------------------------------------------------------------------- @@ -160,7 +158,6 @@ function _ft($t, $b, $c, $d) return $b ^ $c ^ $d; } - // END _ft() // -------------------------------------------------------------------- @@ -189,7 +186,6 @@ function _kt($t) return -899497514; } } - // END _kt() // -------------------------------------------------------------------- @@ -206,7 +202,6 @@ function _safe_add($x, $y) return ($msw << 16) | ($lsw & 0xFFFF); } - // END _safe_add() // -------------------------------------------------------------------- diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 758676e2..c40c85e1 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -123,7 +123,7 @@ function generate($table_data = NULL) return 'Undefined table data'; } - // Compile and validate the templata date + // Compile and validate the template date $this->_compile_template(); diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 8b6cce16..74649151 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -120,8 +120,7 @@ function send($tb_data) } return $return; - } - // END send() + } // -------------------------------------------------------------------- @@ -165,14 +164,13 @@ function receive() return TRUE; } - // END receive() // -------------------------------------------------------------------- /** * Send Trackback Error Message * - * Allows custom errros to be set. By default it + * Allows custom errors to be set. By default it * sends the "incomplete information" error, as that's * the most common one. * @@ -185,7 +183,6 @@ function send_error($message = 'Incomplete Information') echo "\n\n1\n".$message."\n"; exit; } - // END send_error() // -------------------------------------------------------------------- @@ -203,7 +200,6 @@ function send_success() echo "\n\n0\n"; exit; } - // END send_success() // -------------------------------------------------------------------- @@ -218,7 +214,6 @@ function data($item) { return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; } - // END data() // -------------------------------------------------------------------- @@ -287,7 +282,6 @@ function process($url, $data) return TRUE; } - // END process() // -------------------------------------------------------------------- @@ -326,7 +320,6 @@ function extract_urls($urls) return $urls; } - // END extract_urls() // -------------------------------------------------------------------- @@ -348,7 +341,6 @@ function validate_url($url) $url = "http://".$url; } } - // END validate_url() // -------------------------------------------------------------------- @@ -401,7 +393,6 @@ function get_id($url) return $tb_id; } } - // END get_id() // -------------------------------------------------------------------- @@ -428,7 +419,6 @@ function convert_xml($str) return $str; } - // END get_id() // -------------------------------------------------------------------- @@ -467,7 +457,6 @@ function limit_characters($str, $n = 500, $end_char = '…') } } } - // END get_id() // -------------------------------------------------------------------- @@ -517,7 +506,6 @@ function convert_ascii($str) return $out; } - // END convert_ascii() // -------------------------------------------------------------------- @@ -533,7 +521,6 @@ function set_error($msg) log_message('error', $msg); $this->error_msg[] = $msg; } - // END convert_ascii() // -------------------------------------------------------------------- @@ -555,7 +542,7 @@ function display_errors($open = '

              ', $close = '

              ') return $str; } - // END display_errors() + } // END Trackback Class ?> \ No newline at end of file diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index 41516238..6bfc59dc 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -220,7 +220,7 @@ function result($results = array()) * This lets us set the template to be used to display results * * @access public - * @params string + * @param string * @return void */ function set_template($template) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 5bb506cd..09a47943 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -284,8 +284,8 @@ function set_upload_path($path) * Set the file name * * This function takes a filename/path as input and looks for the - * existnace of a file with the same name. If found, it will append a - * number to the end of the filename to avoid overwritting a pre-existing file. + * existence of a file with the same name. If found, it will append a + * number to the end of the filename to avoid overwriting a pre-existing file. * * @access public * @param string From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:44:22 +0000 Subject: [PATCH 0370/2544] --- index.php | 8 +- license.txt | 28 +- system/application/config/config.php | 44 +- system/application/config/database.php | 6 +- system/application/config/routes.php | 10 +- system/application/config/user_agents.php | 2 +- system/application/errors/error_404.php | 6 +- system/application/errors/error_db.php | 6 +- system/application/errors/error_general.php | 6 +- system/application/views/welcome_message.php | 6 +- system/codeigniter/Base4.php | 20 +- system/codeigniter/Base5.php | 34 +- system/codeigniter/CodeIgniter.php | 34 +- system/codeigniter/Common.php | 26 +- system/database/DB.php | 6 +- system/database/DB_active_rec.php | 34 +- system/database/DB_cache.php | 2 +- system/database/DB_driver.php | 176 ++-- system/database/DB_result.php | 52 +- system/database/DB_utility.php | 14 +- .../database/drivers/mssql/mssql_driver.php | 26 +- .../database/drivers/mssql/mssql_result.php | 10 +- .../database/drivers/mssql/mssql_utility.php | 6 +- .../database/drivers/mysql/mysql_driver.php | 44 +- .../database/drivers/mysql/mysql_result.php | 8 +- .../database/drivers/mysql/mysql_utility.php | 52 +- .../database/drivers/mysqli/mysqli_driver.php | 34 +- .../database/drivers/mysqli/mysqli_result.php | 10 +- .../drivers/mysqli/mysqli_utility.php | 54 +- system/database/drivers/oci8/oci8_driver.php | 902 +++++++++--------- system/database/drivers/oci8/oci8_result.php | 308 +++--- system/database/drivers/oci8/oci8_utility.php | 4 +- system/database/drivers/odbc/odbc_driver.php | 28 +- system/database/drivers/odbc/odbc_result.php | 8 +- system/database/drivers/odbc/odbc_utility.php | 8 +- .../drivers/postgre/postgre_driver.php | 28 +- .../drivers/postgre/postgre_result.php | 8 +- .../drivers/postgre/postgre_utility.php | 6 +- .../database/drivers/sqlite/sqlite_driver.php | 38 +- .../database/drivers/sqlite/sqlite_result.php | 6 +- .../drivers/sqlite/sqlite_utility.php | 6 +- system/fonts/texb.ttf | Bin 143830 -> 143821 bytes system/helpers/array_helper.php | 4 +- system/helpers/cookie_helper.php | 10 +- system/helpers/date_helper.php | 32 +- system/helpers/directory_helper.php | 20 +- system/helpers/download_helper.php | 8 +- system/helpers/file_helper.php | 14 +- system/helpers/form_helper.php | 10 +- system/helpers/html_helper.php | 4 +- system/helpers/inflector_helper.php | 4 +- system/helpers/security_helper.php | 8 +- system/helpers/string_helper.php | 20 +- system/helpers/text_helper.php | 68 +- system/helpers/typography_helper.php | 32 +- system/helpers/url_helper.php | 38 +- system/helpers/xml_helper.php | 6 +- system/libraries/Benchmark.php | 62 +- system/libraries/Calendar.php | 132 +-- system/libraries/Config.php | 32 +- system/libraries/Controller.php | 30 +- system/libraries/Email.php | 127 ++- system/libraries/Encrypt.php | 32 +- system/libraries/Exceptions.php | 14 +- system/libraries/Hooks.php | 12 +- system/libraries/Image_lib.php | 136 +-- system/libraries/Input.php | 38 +- system/libraries/Language.php | 10 +- system/libraries/Loader.php | 34 +- system/libraries/Log.php | 8 +- system/libraries/Model.php | 6 +- system/libraries/Output.php | 48 +- system/libraries/Pagination.php | 122 +-- system/libraries/Parser.php | 6 +- system/libraries/Profiler.php | 4 +- system/libraries/Router.php | 24 +- system/libraries/Session.php | 102 +- system/libraries/Sha1.php | 292 +++--- system/libraries/Table.php | 6 +- system/libraries/Trackback.php | 54 +- system/libraries/URI.php | 18 +- system/libraries/Unit_test.php | 16 +- system/libraries/Upload.php | 418 ++++---- system/libraries/User_agent.php | 20 +- system/libraries/Validation.php | 52 +- system/libraries/Xmlrpc.php | 152 +-- system/libraries/Xmlrpcs.php | 50 +- system/libraries/Zip.php | 46 +- system/plugins/captcha_pi.php | 54 +- system/plugins/js_calendar_pi.php | 26 +- system/scaffolding/Scaffolding.php | 8 +- system/scaffolding/views/stylesheet.css | 2 +- user_guide/changelog.html | 6 +- user_guide/database/active_record.html | 14 +- user_guide/database/caching.html | 24 +- user_guide/database/call_function.html | 8 +- user_guide/database/configuration.html | 28 +- user_guide/database/connecting.html | 12 +- user_guide/database/examples.html | 4 +- user_guide/database/fields.html | 6 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 10 +- user_guide/database/results.html | 6 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 8 +- user_guide/database/utilities.html | 10 +- user_guide/general/alternative_php.html | 10 +- user_guide/general/ancillary_classes.html | 6 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 6 +- user_guide/general/changelog.html | 4 +- user_guide/general/controllers.html | 22 +- user_guide/general/core_classes.html | 6 +- user_guide/general/creating_libraries.html | 20 +- user_guide/general/credits.html | 4 +- user_guide/general/errors.html | 14 +- user_guide/general/helpers.html | 6 +- user_guide/general/hooks.html | 22 +- user_guide/general/index.html | 10 +- user_guide/general/libraries.html | 4 +- user_guide/general/models.html | 12 +- user_guide/general/multiple_apps.html | 2 +- user_guide/general/plugins.html | 8 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 14 +- user_guide/general/scaffolding.html | 10 +- user_guide/general/security.html | 12 +- user_guide/general/urls.html | 10 +- user_guide/general/views.html | 8 +- user_guide/helpers/array_helper.html | 4 +- user_guide/helpers/cookie_helper.html | 6 +- user_guide/helpers/date_helper.html | 12 +- user_guide/helpers/directory_helper.html | 4 +- user_guide/helpers/download_helper.html | 4 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 14 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 6 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 4 +- user_guide/helpers/string_helper.html | 4 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 8 +- user_guide/helpers/url_helper.html | 10 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/images/appflowchart.gif | Bin 25276 -> 25273 bytes user_guide/images/ci_logo.jpg | Bin 5602 -> 5601 bytes user_guide/images/ci_quick_ref.png | Bin 94476 -> 94906 bytes user_guide/index.html | 12 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 4 +- user_guide/installation/troubleshooting.html | 6 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 10 +- user_guide/installation/upgrade_131.html | 4 +- user_guide/installation/upgrade_132.html | 4 +- user_guide/installation/upgrade_133.html | 6 +- user_guide/installation/upgrade_140.html | 6 +- user_guide/installation/upgrade_141.html | 8 +- user_guide/installation/upgrade_150.html | 10 +- user_guide/installation/upgrade_b11.html | 4 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 12 +- user_guide/libraries/calendar.html | 8 +- user_guide/libraries/config.html | 6 +- user_guide/libraries/email.html | 4 +- user_guide/libraries/encryption.html | 16 +- user_guide/libraries/file_uploading.html | 16 +- user_guide/libraries/image_lib.html | 18 +- user_guide/libraries/input.html | 6 +- user_guide/libraries/language.html | 6 +- user_guide/libraries/loader.html | 22 +- user_guide/libraries/output.html | 6 +- user_guide/libraries/pagination.html | 6 +- user_guide/libraries/parser.html | 8 +- user_guide/libraries/sessions.html | 22 +- user_guide/libraries/table.html | 10 +- user_guide/libraries/trackback.html | 6 +- user_guide/libraries/unit_testing.html | 12 +- user_guide/libraries/uri.html | 6 +- user_guide/libraries/user_agent.html | 4 +- user_guide/libraries/validation.html | 26 +- user_guide/libraries/xmlrpc.html | 42 +- user_guide/libraries/zip.html | 6 +- user_guide/license.html | 4 +- user_guide/nav/moo.fx.pack.js | 6 +- user_guide/nav/prototype.lite.js | 112 +-- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 24 +- user_guide/overview/features.html | 4 +- user_guide/overview/goals.html | 4 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 10 +- user_guide/toc.html | 186 ++-- user_guide/userguide.css | 10 +- 198 files changed, 2871 insertions(+), 2872 deletions(-) diff --git a/index.php b/index.php index 8d7a3025..0386ed6e 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ |--------------------------------------------------------------- | | This variable must contain the name of your "system" folder. -| Include the path if the folder is not in the same directory +| Include the path if the folder is not in the same directory | as this file. | | NO TRAILING SLASH! @@ -31,7 +31,7 @@ | APPLICATION FOLDER NAME |--------------------------------------------------------------- | -| If you want this front controller to use a different "application" +| If you want this front controller to use a different "application" | folder then the default one you can set its name here. | | NO TRAILING SLASH! @@ -59,7 +59,7 @@ $application_folder = 'application'; } -// Some versions of PHP don't support the E_STRICT constant so we'll +// Some versions of PHP don't support the E_STRICT constant so we'll // explicitly define it so that it will be available to the Exception class if ( ! defined('E_STRICT')) { @@ -69,7 +69,7 @@ // Define a few constants that we use througout the framework. // EXT - contains the file extension. Typically ".php" // FCPATH - contains the full server path to THIS file. -// SELF - contains the name of THIS file. +// SELF - contains the name of THIS file. // BASEPATH - contains the full server path to the "system" folder // APPPATH - contains the full server path to the "application" folder diff --git a/license.txt b/license.txt index cd779972..4476208a 100644 --- a/license.txt +++ b/license.txt @@ -18,7 +18,7 @@ the following conditions are met: 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 +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 @@ -26,27 +26,27 @@ the following conditions are met: materials provided with the distribution. 6. Products derived from the Software may not be called "Code Igniter", - nor may "Code Igniter" appear in their name, without prior written + nor may "Code Igniter" appear in their name, without prior written permission from pMachine, 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 +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. +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 +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 +BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. diff --git a/system/application/config/config.php b/system/application/config/config.php index ab4f445f..0ed58d94 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -5,7 +5,7 @@ | Base Site URL |-------------------------------------------------------------------------- | -| URL to your Code Igniter root. Typically this will be your base URL, +| URL to your Code Igniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://www.your-site.com/ @@ -18,8 +18,8 @@ | Index File |-------------------------------------------------------------------------- | -| Typically this will be your index.php file, unless you've renamed it to -| something else. If you are using mod_rewrite to remove the page set this +| Typically this will be your index.php file, unless you've renamed it to +| something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ @@ -30,15 +30,15 @@ | URI PROTOCOL |-------------------------------------------------------------------------- | -| This item determines which server global should be used to retrieve the +| This item determines which server global should be used to retrieve the | URI string. The default setting of "AUTO" works for most servers. | If your links do not seem to work, try one of the other delicious flavors: -| +| | 'AUTO' Default - auto detects -| 'PATH_INFO' Uses the PATH_INFO +| 'PATH_INFO' Uses the PATH_INFO | 'QUERY_STRING' Uses the QUERY_STRING | 'REQUEST_URI' Uses the REQUEST_URI -| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO +| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO | */ $config['uri_protocol'] = "AUTO"; @@ -50,7 +50,7 @@ | | This option allows you to add a suffix to all URLs generated by Code Igniter. | For more information please see the user guide: -| +| | http://www.codeigniter.com/user_guide/general/urls.html */ @@ -61,7 +61,7 @@ | Default Language |-------------------------------------------------------------------------- | -| This determines which set of language files should be used. Make sure +| This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | @@ -88,7 +88,7 @@ | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: -| +| | http://www.codeigniter.com/user_guide/general/core_classes.html | http://www.codeigniter.com/user_guide/general/creating_libraries.html | @@ -109,7 +109,7 @@ | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. -| +| | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ @@ -147,7 +147,7 @@ | Error Logging |-------------------------------------------------------------------------- | -| You can enable error logging by setting a threshold over zero. The +| You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Error logging TURNED OFF @@ -156,7 +156,7 @@ | 3 = Informational Messages | 4 = All Messages | -| For a live site you'll usually only enable Errors (1) to be logged otherwise +| For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ @@ -200,7 +200,7 @@ | Encryption Key |-------------------------------------------------------------------------- | -| If you use the Encryption class or the Sessions class with encryption +| If you use the Encryption class or the Sessions class with encryption | enabled you MUST set an encryption key. See the user guide for info. | */ @@ -229,14 +229,14 @@ |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- -| +| | 'cookie_prefix' = Set a prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | */ $config['cookie_prefix'] = ""; -$config['cookie_domain'] = ""; +$config['cookie_domain'] = ""; $config['cookie_path'] = "/"; /* @@ -244,7 +244,7 @@ | Global XSS Filtering |-------------------------------------------------------------------------- | -| Determines whether the XSS filter is always active when GET, POST or +| Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | */ @@ -256,13 +256,13 @@ |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, -| the output class will test whether your server supports Gzip. +| the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could -| even be a line of whitespace at the end of one of your scripts. For +| even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not "echo" any values with compression enabled. | @@ -274,9 +274,9 @@ | Master Time Reference |-------------------------------------------------------------------------- | -| Options are "local" or "gmt". This pref tells the system whether to use -| your server's local time as the master "now" reference, or convert it to -| GMT. See the "date helper" page of the user guide for information +| Options are "local" or "gmt". This pref tells the system whether to use +| your server's local time as the master "now" reference, or convert it to +| GMT. See the "date helper" page of the user guide for information | regarding date handling. | */ diff --git a/system/application/config/database.php b/system/application/config/database.php index 9d8c7783..b3246b6e 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -13,12 +13,12 @@ | ------------------------------------------------------------------- | | ['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 +| ['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: mysql, mysqli, postgre, odbc, mssql -| ['dbprefix'] You can add an optional prefix, which will be added +| ['dbprefix'] You can add an optional prefix, which will be added | to the table name when using the Active Record class | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. diff --git a/system/application/config/routes.php b/system/application/config/routes.php index 8fa16780..1702e4f4 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -3,9 +3,9 @@ | ------------------------------------------------------------------------- | URI ROUTING | ------------------------------------------------------------------------- -| This file lets you re-map URI requests to specific controller functions. +| This file lets you re-map URI requests to specific controller functions. | -| Typically there is a one-to-one relationship between a URL string +| Typically there is a one-to-one relationship between a URL string | and its corresponding controller class/method. The segments in a | URL normally follow this pattern: | @@ -13,7 +13,7 @@ | | In some instances, however, you may want to remap this relationship | so that a different class/function is called than the one -| corresponding to the URL. +| corresponding to the URL. | | Please see the user guide for complete details: | @@ -33,8 +33,8 @@ | | $route['scaffolding_trigger'] = 'scaffolding'; | -| This route lets you se t a "secret" word that will trigger the -| scaffolding feature for added security. Note: Scaffolding must be +| This route lets you se t a "secret" word that will trigger the +| scaffolding feature for added security. Note: Scaffolding must be | enabled in the controller in which you intend to use it. | */ diff --git a/system/application/config/user_agents.php b/system/application/config/user_agents.php index a799f06b..6fa7b4a7 100644 --- a/system/application/config/user_agents.php +++ b/system/application/config/user_agents.php @@ -4,7 +4,7 @@ | USER AGENT TYPES | ------------------------------------------------------------------- | This file contains four arrays of user agent data. It is used by the -| User Agent Class to help identify browser, platform, robot, and +| User Agent Class to help identify browser, platform, robot, and | mobile device data. The array keys are used to identify the device | and the array values are used to set the actual name of the item. | diff --git a/system/application/errors/error_404.php b/system/application/errors/error_404.php index e5fa8f9d..bfe9444b 100644 --- a/system/application/errors/error_404.php +++ b/system/application/errors/error_404.php @@ -4,9 +4,9 @@ 404 Page Not Found + + + + + + + + + + + + + + + + + + + + +
              + + + + + +

              Code Igniter User Guide Version 1.5.0b3

              +
              + + + + + + + + + +
              + + +
              + + + +
              + + +

              FTP Class

              + +

              Code Igniter's FTP Class permits files to be uploaded via FTP to your server.

              + + + + + + +
              + + + + + + + \ No newline at end of file From d7f88ca118cf1afe0c730e68b35e3693eaf9022e Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 06:34:06 +0000 Subject: [PATCH 0396/2544] --- system/libraries/Ftp.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index d61e0aba..6c1bad8e 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -129,11 +129,17 @@ function _login() // -------------------------------------------------------------------- /** - * Change direcotries + * Change direcotry + * + * The second parameter lets us momentarily turn off debugging so that + * this function can be used to test for the existance of a folder + * without throwing an error. There's no FTP equivalent to is_dir() + * so we do it by trying to change to a particular directory. + * Internally, this paramter is only used by the "mirror" function below. * * @access public * @param string - * @param bool lets us momentarily turn off debugging. + * @param bool * @return array */ function changedir($path = '', $supress_debug = FALSE) @@ -203,7 +209,6 @@ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) if ( ! file_exists($locpath)) { $this->_error('ftp_no_source_file'); - return FALSE; } @@ -248,7 +253,17 @@ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) * @return array */ function chmod($path, $perm) - { + { + // 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) @@ -271,7 +286,7 @@ function chmod($path, $perm) * @access public * @return array */ - function filelist($path = '.') + function list_files($path = '.') { return ftp_nlist($this->conn_id, $path); } @@ -286,8 +301,8 @@ function filelist($path = '.') * is in the original file path will be recreated in the zip file. * * @access public - * @param string path to source - * @param string path to destination + * @param string path to source with trailing slash + * @param string path to destination - include the base folder with trailing slash * @return bool */ function mirror($locpath, $rempath) From 865b4b32ff813156c577e336114ae67b4be1a259 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 07:33:49 +0000 Subject: [PATCH 0397/2544] --- user_guide/libraries/ftp.html | 180 +++++++++++++++++++++++++++++++++- 1 file changed, 179 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index e588e062..ae025f5f 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -63,7 +63,185 @@

              FTP Class

              -

              Code Igniter's FTP Class permits files to be uploaded via FTP to your server.

              +

              Code Igniter's FTP Class permits files to be uploaded via FTP to your server. It also includes a "mirroring" function +that permits an local directory to be recreated remotely via FTP.

              + +

              Initializing the Class

              + +

              Like most other classes in Code Igniter, the FTP class is initialized in your controller using the $this->load->library function:

              + +$this->load->library('ftp'); +

              Once loaded, the FTP object will be available using: $this->ftp

              + + +

              Usage Examples

              + +

              In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The +file permissions are set to 755. Note: Setting permissions requires PHP 5.

              + + +$this->load->library('ftp');
              +
              +$config['hostname'] = 'ftp.your-site.com';
              +$config['username'] = 'your-username';
              +$config['password'] = 'your-password';
              +$config['debug'] = TRUE;
              +
              +$this->ftp->connect($config);
              +
              +$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
              +
              +$this->ftp->close(); + +
              + + +

              In this example a list of files is retrieved from the server.

              + + +$this->load->library('ftp');
              +
              +$config['hostname'] = 'ftp.your-site.com';
              +$config['username'] = 'your-username';
              +$config['password'] = 'your-password';
              +$config['debug'] = TRUE;
              +
              +$this->ftp->connect($config);
              +
              +$list = $this->ftp->list_files('/public_html/');
              +
              +print_r($list);
              +
              +$this->ftp->close(); +
              + +

              In this example a local directory is mirrored on the server.

              + + + +$this->load->library('ftp');
              +
              +$config['hostname'] = 'ftp.your-site.com';
              +$config['username'] = 'your-username';
              +$config['password'] = 'your-password';
              +$config['debug'] = TRUE;
              +
              +$this->ftp->connect($config);
              +
              +$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
              +
              +$this->ftp->close(); +
              + + +

              Function Reference

              + +

              $this->ftp->connect()

              + +

              Connects and logs into to the FTP server. Connection preferences are set by passing an array +to the function, or you can store them in a config file.

              + + +

              Here is an example showing how you set preferences manually:

              + + +$this->load->library('ftp');
              +
              +$config['hostname'] = 'ftp.your-site.com';
              +$config['username'] = 'your-username';
              +$config['password'] = 'your-password';
              +$config['port']     = 21;
              +$config['passive']  = FALSE;
              +$config['debug']    = TRUE;
              +
              +$this->ftp->connect($config);
              +
              + +

              Setting FTP Preferences in a Config File

              + +

              If you prefer you can store your FTP preferences in a config file. +Simply create a new file called the ftp.php, add the $config +array in that file. Then save the file at config/ftp.php and it will be used automatically.

              + +

              Available connection options:

              + + +
                +
              • hostname - the FTP hostname. Usually something like:  ftp.some-site.com
              • +
              • username - the FTP username.
              • +
              • password - the FTP password.
              • +
              • port - The port number. Set to 21 by default.
              • +
              • debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
              • +
              • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
              • +
              + + +

              $this->ftp->sconnect()

              + +

              Secure FTP connect. This function is identical to the function above, except that it initiates a secure connection.

              + + +

              $this->ftp->upload()

              + +

              Uploads a file to your server. You must supply the local path and the remote path (with trailing slash), and you can optionally set the mode and permissions. +Example:

              + + +$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775); + +

              Mode options are:  ascii, binary, and auto (the default). If +auto is used it will base the mode on the file extension of the source file.

              + +

              Permissions are available if you are running PHP 5 and can be passed as an octal value in the fourth parameter.

              + + +

              $this->ftp->mkdir()

              + +

              Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash:

              + + +// Creates a folder named "bar"
              +$this->ftp->mkdir('/public_html/foo/bar/'); +
              + + +

              $this->ftp->chmod()

              + +

              Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

              + + +// Chmod "bar" to 777
              +$this->ftp->chmod('/public_html/foo/bar/', 0777); +
              + + +

              $this->ftp->list_files()

              +

              Permits you to retrieve a list of files on your server returned as an array. You must supply +the path to the desired directory.

              + + +$list = $this->ftp->list_files('/public_html/');
              +
              +print_r($list); +
              + + +

              $this->ftp->mirror()

              + +

              Recursively reads a folder and everything it contains (including sub-folders) and creates a +mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. +You must supply a source path and a destination path:

              + + +$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/'); + + + + +

              $this->ftp->close();

              +

              Closes the connection to your server. It's recommended that you use this when you are finished uploading.

              + + From 631f17b88124619dd27a04509970da155a3fc1b7 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 07:41:28 +0000 Subject: [PATCH 0398/2544] --- system/libraries/Ftp.php | 32 ++++++++++++++++++++++++++------ user_guide/libraries/email.html | 2 +- user_guide/libraries/ftp.html | 2 +- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 6c1bad8e..a0c6895b 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -31,7 +31,6 @@ class CI_FTP { var $password = ''; var $port = 21; var $passive = TRUE; - var $secure = FALSE; var $debug = FALSE; var $conn_id; @@ -80,11 +79,18 @@ function initialize($config = array()) * FTP Connect * * @access public + * @param array the connection values + * @param bool whether to use a secure or standard connection * @return bool */ - function connect() - { - $method = ($this->secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect'; + function connect($config = array(), $secure = FALSE) + { + if (count($config) > 0) + { + $this->initialize($config); + } + + $method = ($secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect'; if (FALSE === ($this->conn_id = @$method($this->hostname, $this->port))) { @@ -112,6 +118,20 @@ function connect() return TRUE; } + + // -------------------------------------------------------------------- + + /** + * Secure FTP Connect + * + * @access public + * @param array the connection values + * @return bool + */ + function sconnect($config = array()) + { + return $this->connect($config, TRUE); + } // -------------------------------------------------------------------- @@ -297,8 +317,8 @@ function list_files($path = '.') * Read a directory and recreate it remotely * * This function recursively reads a folder and everything it contains (including - * sub-folders) and creates a mirror via FTP based on it. Whatever directory structure - * is in the original file path will be recreated in the zip file. + * sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure + * of the original file path will be recreated on the server. * * @access public * @param string path to source with trailing slash diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index b8a68e9d..96150eca 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -119,7 +119,7 @@

              Setting Email Preferences

              Note: Most of the preferences have default values that will be used if you do not set them.

              Setting Email Preferences in your Config File +

              Setting Email Preferences in a Config File

              If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index ae025f5f..4df9c545 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -183,7 +183,7 @@

              $this->ftp->sconnect()

              $this->ftp->upload()

              -

              Uploads a file to your server. You must supply the local path and the remote path (with trailing slash), and you can optionally set the mode and permissions. +

              Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. Example:

              From 667da5e418c97f015a700cf61a70dede321436a9 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 15:54:16 +0000 Subject: [PATCH 0399/2544] --- system/libraries/Upload.php | 76 +++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 1a0b0fc8..ff0fb1cb 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -36,7 +36,7 @@ class CI_Upload { var $file_type = ""; var $file_size = ""; var $file_ext = ""; - var $file_path = ""; + var $upload_path = ""; var $overwrite = FALSE; var $encrypt_name = FALSE; var $is_image = FALSE; @@ -76,17 +76,51 @@ function CI_Upload($props = array()) */ function initialize($config = array()) { - foreach ($config as $key => $val) - { - $method = 'set_'.$key; - if (method_exists($this, $method)) + $defaults = array( + 'max_size' => 0, + 'max_width' => 0, + 'max_height' => 0, + 'allowed_types' => "", + 'file_temp' => "", + 'file_name' => "", + 'orig_name' => "", + 'file_type' => "", + 'file_size' => "", + 'file_ext' => "", + 'upload_path' => "", + 'overwrite' => FALSE, + 'encrypt_name' => FALSE, + 'is_image' => FALSE, + 'image_width' => '', + 'image_height' => '', + 'image_type' => '', + 'image_size_str' => '', + 'error_msg' => array(), + 'mimes' => array(), + 'remove_spaces' => TRUE, + 'xss_clean' => FALSE, + 'temp_prefix' => "temp_file_" + ); + + + foreach ($defaults as $key => $val) + { + if (isset($config[$key])) { - $this->$method($val); + $method = 'set_'.$key; + if (method_exists($this, $method)) + { + $this->$method($config[$key]); + } + else + { + $this->$key = $config[$key]; + } } else { $this->$key = $val; - } + } } } @@ -188,7 +222,7 @@ function do_upload($field = 'userfile') if ($this->overwrite == FALSE) { - $this->file_name = $this->set_filename($this->file_path, $this->file_name); + $this->file_name = $this->set_filename($this->upload_path, $this->file_name); if ($this->file_name === FALSE) { @@ -203,9 +237,9 @@ function do_upload($field = 'userfile') * we'll use move_uploaded_file(). One of the two should * reliably work in most environments */ - if ( ! @copy($this->file_temp, $this->file_path.$this->file_name)) + if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) { - if ( ! @move_uploaded_file($this->file_temp, $this->file_path.$this->file_name)) + if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) { $this->set_error('upload_destination_error'); return FALSE; @@ -229,7 +263,7 @@ function do_upload($field = 'userfile') * file was an image). We use this information * in the "data" function. */ - $this->set_image_properties($this->file_path.$this->file_name); + $this->set_image_properties($this->upload_path.$this->file_name); return TRUE; } @@ -250,8 +284,8 @@ function data() return array ( 'file_name' => $this->file_name, 'file_type' => $this->file_type, - 'file_path' => $this->file_path, - 'full_path' => $this->file_path.$this->file_name, + 'file_path' => $this->upload_path, + 'full_path' => $this->upload_path.$this->file_name, 'raw_name' => str_replace($this->file_ext, '', $this->file_name), 'orig_name' => $this->orig_name, 'file_ext' => $this->file_ext, @@ -275,7 +309,7 @@ function data() */ function set_upload_path($path) { - $this->file_path = $path; + $this->upload_path = $path; } // -------------------------------------------------------------------- @@ -564,30 +598,30 @@ function is_allowed_dimensions() */ function validate_upload_path() { - if ($this->file_path == '') + if ($this->upload_path == '') { $this->set_error('upload_no_filepath'); return FALSE; } - if (function_exists('realpath') AND @realpath($this->file_path) !== FALSE) + if (function_exists('realpath') AND @realpath($this->upload_path) !== FALSE) { - $this->file_path = str_replace("\\", "/", realpath($this->file_path)); + $this->upload_path = str_replace("\\", "/", realpath($this->upload_path)); } - if ( ! @is_dir($this->file_path)) + if ( ! @is_dir($this->upload_path)) { $this->set_error('upload_no_filepath'); return FALSE; } - if ( ! is_writable($this->file_path)) + if ( ! is_writable($this->upload_path)) { $this->set_error('upload_not_writable'); return FALSE; } - $this->file_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->file_path); + $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); return TRUE; } @@ -668,7 +702,7 @@ function clean_file_name($filename) */ function do_xss_clean() { - $file = $this->file_path.$this->file_name; + $file = $this->upload_path.$this->file_name; if (filesize($file) == 0) { From 259ea846018b3c465d3b9c3283a6142a5c342191 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 17:56:58 +0000 Subject: [PATCH 0400/2544] --- system/database/drivers/oci8/oci8_result.php | 104 ++++++++++--------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index efb2f7be..af30457b 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -44,7 +44,7 @@ function num_rows() } else { - return @ocirowcount($this->stmt_id) + return @ocirowcount($this->stmt_id); } } @@ -60,8 +60,7 @@ function num_fields() { $count = @ocinumcols($this->stmt_id); - // if we used a limit, we added a field, - // subtract it out + // if we used a limit we subtract it if ($this->limit_used) { $count = $count - 1; @@ -135,7 +134,7 @@ function free_result() { if (is_resource($this->result_id)) { - OCIFreeStatement($this->result_id); + ocifreestatement($this->result_id); $this->result_id = FALSE; } } @@ -152,32 +151,9 @@ function free_result() */ function _fetch_assoc(&$row) { - // if pulling from a cursor, use curs_id - if ($this->curs_id) - { - return ocifetchinto($this->curs_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - } - else - { - return ocifetchinto($this->stmt_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return FALSE; + $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; + + return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); } // -------------------------------------------------------------------- @@ -191,24 +167,42 @@ function _data_seek($n = 0) * @return object */ function _fetch_object() - { - // the PHP 4 version of the oracle functions do not - // have a fetch method so we call the array version - // and build an object from that + { + $result = array(); - $row = array(); - $res = $this->_fetch_assoc($row); - if ($res != FALSE) + // 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; + + while ($row = oci_fetch_object($id)) + { + $result[] = $row; + } + + return $result; + } + + // If PHP 4 is being used we have to build our own result + foreach ($this->result_array() as $key => $val) { $obj = new stdClass(); - foreach ($row as $key => $value) + if (is_array($val)) + { + foreach ($val as $k => $v) + { + $obj->$k = $v; + } + } + else { - $obj->{$key} = $value; + $obj->$key = $val; } - $res = $obj; + $result[] = $obj; } - return $res; + + return $result; } // -------------------------------------------------------------------- @@ -226,24 +220,34 @@ function result_array() return $this->result_array; } - // oracle's fetch functions do not - // return arrays, the information - // is returned in reference parameters - // + // oracle's fetch functions do not return arrays. + // The information is returned in reference parameters $row = NULL; while ($this->_fetch_assoc($row)) { $this->result_array[] = $row; } - if (count($this->result_array) == 0) - { - return FALSE; - } - return $this->result_array; } + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return FALSE; // Not needed + } + } ?> \ No newline at end of file From 0e5ca047896c92c490d038f54e4623cb4db4ad76 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 17:57:30 +0000 Subject: [PATCH 0401/2544] --- system/libraries/Model.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Model.php b/system/libraries/Model.php index e0335bf4..1c2b7afc 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -36,7 +36,7 @@ class Model { function Model() { // If the magic __get() or __set() methods are used in a Model references can't be used. - $this->_assign_libraries( (method_exists($this, '__get') OR method_exists('__set')) ? FALSE : TRUE ); + $this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE ); // We don't want to assign the model object to itself when using the // assign_libraries function below so we'll grab the name of the model parent diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c4797224..16f830c1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -84,6 +84,7 @@

              Version 1.5.0 Beta 3

            1. Added $query->list_fields() function to database class
            2. Added $this->db->platform() function
            3. Added new File Helper: get_filenames()
            4. +
            5. Added more thorough initialization in the upload class so that all class variables are reset.
            6. Added "is_numeric" to validation, which uses the native PHP is_numeric function.
            7. Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
            8. Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
            9. From 9e774ad7989f7fea33312407a8e25a2724f2ce8b Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 21:58:04 +0000 Subject: [PATCH 0402/2544] --- user_guide/libraries/ftp.html | 71 +++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 4df9c545..1fc82b49 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -63,8 +63,10 @@

              FTP Class

              -

              Code Igniter's FTP Class permits files to be uploaded via FTP to your server. It also includes a "mirroring" function -that permits an local directory to be recreated remotely via FTP.

              +

              Code Igniter's FTP Class permits files to be uploaded, moved, renamed, and deleted on your server. It also includes a "mirroring" function +that permits a local directory to be recreated remotely via FTP.

              + +

              Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

              Initializing the Class

              @@ -176,10 +178,6 @@

              Available connection options:

          -

          $this->ftp->sconnect()

          - -

          Secure FTP connect. This function is identical to the function above, except that it initiates a secure connection.

          -

          $this->ftp->upload()

          @@ -195,26 +193,46 @@

          $this->ftp->upload()

          Permissions are available if you are running PHP 5 and can be passed as an octal value in the fourth parameter.

          -

          $this->ftp->mkdir()

          +

          $this->ftp->rename()

          +

          Permits you to rename a file. Supply the source file name/path and the new file name/path.

          + + +// Renames green.html to blue.html
          +$this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html'); +
          -

          Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash:

          +

          $this->ftp->move()

          +

          Lets you move a file. Supply the source and destination paths:

          -// Creates a folder named "bar"
          -$this->ftp->mkdir('/public_html/foo/bar/'); +// Moves blog.html from "joe" to "fred"
          +$this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');
          +

          Note: if the destination file name is different the file will be renamed.

          -

          $this->ftp->chmod()

          -

          Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

          +

          $this->ftp->delete_file()

          +

          Lets you delete a file. Supply the source path with the file name.

          -// Chmod "bar" to 777
          -$this->ftp->chmod('/public_html/foo/bar/', 0777); +$this->ftp->delete_file('/public_html/joe/blog.html'); +
          + + +

          $this->ftp->delete_dir()

          +

          Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

          + +

          Important  Be VERY careful with this function. It will recursively delete +everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. +Try using the list_files() function first to verify that your path is correct.

          + + +$this->ftp->delete_dir('/public_html/path/to/folder/'); +

          $this->ftp->list_files()

          Permits you to retrieve a list of files on your server returned as an array. You must supply the path to the desired directory.

          @@ -228,7 +246,7 @@

          $this->ftp->list_files()

          $this->ftp->mirror()

          -

          Recursively reads a folder and everything it contains (including sub-folders) and creates a +

          Recursively reads a local folder and everything it contains (including sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. You must supply a source path and a destination path:

          @@ -238,6 +256,29 @@

          $this->ftp->mirror()

          +

          $this->ftp->mkdir()

          + +

          Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. +Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).

          + + +// Creates a folder named "bar"
          +$this->ftp->mkdir('/public_html/foo/bar/', 0777); +
          + + +

          $this->ftp->chmod()

          + +

          Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

          + + +// Chmod "bar" to 777
          +$this->ftp->chmod('/public_html/foo/bar/', 0777); +
          + + + +

          $this->ftp->close();

          Closes the connection to your server. It's recommended that you use this when you are finished uploading.

          From 51e68c06d88a501f02df17d94539ba14e67b009f Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 21:58:13 +0000 Subject: [PATCH 0403/2544] --- system/language/english/ftp_lang.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index f666b4d5..a4320efa 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -7,6 +7,11 @@ $lang['ftp_unable_to_chmod'] = "Unable to set file permissions. Please check your path. Note: This feature is only available in PHP 5 or higher."; $lang['ftp_unable_to_upload'] = "Unable to upload the specified file. Please check your path."; $lang['ftp_no_source_file'] = "Unable to locate the source file. Please check your path."; +$lang['ftp_unable_to_remame'] = "Unable to rename the file."; +$lang['ftp_unable_to_delete'] = "Unable to delete the file."; +$lang['ftp_unable_to_move'] = "Unable to move the file. Please make sure the destination directory exists."; + + ?> \ No newline at end of file From 647e02637f72de3907b0a32139f286404a81f745 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 21:58:22 +0000 Subject: [PATCH 0404/2544] --- system/language/english/ftp_lang.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index a4320efa..99895cc0 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -11,7 +11,4 @@ $lang['ftp_unable_to_delete'] = "Unable to delete the file."; $lang['ftp_unable_to_move'] = "Unable to move the file. Please make sure the destination directory exists."; - - - ?> \ No newline at end of file From 6895a4b6045dd3fef3a2e742932721f6ccc2a569 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 22:06:01 +0000 Subject: [PATCH 0405/2544] --- system/libraries/Ftp.php | 214 ++++++++++++++++++++++++++++++++++----- 1 file changed, 189 insertions(+), 25 deletions(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index a0c6895b..3b2be23d 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -32,7 +32,7 @@ class CI_FTP { var $port = 21; var $passive = TRUE; var $debug = FALSE; - var $conn_id; + var $conn_id = FALSE; /** @@ -80,19 +80,16 @@ function initialize($config = array()) * * @access public * @param array the connection values - * @param bool whether to use a secure or standard connection * @return bool */ - function connect($config = array(), $secure = FALSE) + function connect($config = array()) { if (count($config) > 0) { $this->initialize($config); } - $method = ($secure == FALSE) ? 'ftp_connect' : 'ftp_ssl_connect'; - - if (FALSE === ($this->conn_id = @$method($this->hostname, $this->port))) + if (FALSE === ($this->conn_id = @ftp_connect($this->hostname, $this->port))) { if ($this->debug == TRUE) { @@ -122,32 +119,40 @@ function connect($config = array(), $secure = FALSE) // -------------------------------------------------------------------- /** - * Secure FTP Connect + * FTP Login * - * @access public - * @param array the connection values + * @access private * @return bool - */ - function sconnect($config = array()) + */ + function _login() { - return $this->connect($config, TRUE); + return @ftp_login($this->conn_id, $this->username, $this->password); } - + // -------------------------------------------------------------------- /** - * FTP Login + * Validates the connection ID * * @access private * @return bool */ - function _login() + function _is_conn() { - return @ftp_login($this->conn_id, $this->username, $this->password); + if ( ! is_resource($this->conn_id)) + { + if ($this->debug == TRUE) + { + $this->_error('ftp_no_connection'); + } + return FALSE; + } + return TRUE; } // -------------------------------------------------------------------- + /** * Change direcotry * @@ -160,11 +165,11 @@ function _login() * @access public * @param string * @param bool - * @return array + * @return bool */ function changedir($path = '', $supress_debug = FALSE) { - if ($path == '') + if ($path == '' OR ! $this->_is_conn()) { return FALSE; } @@ -190,11 +195,11 @@ function changedir($path = '', $supress_debug = FALSE) * * @access public * @param string - * @return array + * @return bool */ - function mkdir($path = '') + function mkdir($path = '', $permissions = NULL) { - if ($path == '') + if ($path == '' OR ! $this->_is_conn()) { return FALSE; } @@ -209,6 +214,12 @@ function mkdir($path = '') } return FALSE; } + + // Set file permissions if needed + if ( ! is_null($permissions)) + { + $this->chmod($path, (int)$permissions); + } return TRUE; } @@ -222,10 +233,15 @@ function mkdir($path = '') * @param string * @param string * @param string - * @return array + * @return bool */ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) { + if ( ! $this->_is_conn()) + { + return FALSE; + } + if ( ! file_exists($locpath)) { $this->_error('ftp_no_source_file'); @@ -264,16 +280,149 @@ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) // -------------------------------------------------------------------- + /** + * Rename (or move) a file + * + * @access public + * @param string + * @param string + * @param bool + * @return bool + */ + function rename($old_file, $new_file, $move = FALSE) + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + + $result = @ftp_rename($this->conn_id, $old_file, $new_file); + + if ($result === FALSE) + { + if ($this->debug == TRUE) + { + $msg = ($move = FALSE) ? 'ftp_unable_to_remame' : 'ftp_unable_to_move'; + + $this->_error($msg); + } + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Move a file + * + * @access public + * @param string + * @param string + * @return bool + */ + function move($old_file, $new_file) + { + return $this->rename($old_file, $new_file, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Rename (or move) a file + * + * @access public + * @param string + * @return bool + */ + function delete_file($filepath) + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + + $result = @ftp_delete($this->conn_id, $filepath); + + if ($result === FALSE) + { + if ($this->debug == TRUE) + { + $this->_error('ftp_unable_to_delete'); + } + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Delete a folder and recursively delete everything (including sub-folders) + * containted within it. + * + * @access public + * @param string + * @return bool + */ + function delete_dir($filepath) + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + + // Add a trailing slash to the file path if needed + $filepath = preg_replace("/(.+?)\/*$/", "\\1/", $filepath); + + $list = $this->list_files($filepath); + + if ($list !== FALSE AND count($list) > 0) + { + foreach ($list as $item) + { + // If we can't delete the item it's probaly a folder so + // we'll recursively call delete_dir() + if ( ! @ftp_delete($this->conn_id, $filepath.$item)) + { + $this->delete_dir($filepath.$item); + } + } + } + + $result = @ftp_rmdir($this->conn_id, $filepath); + + if ($result === FALSE) + { + if ($this->debug == TRUE) + { + $this->_error('ftp_unable_to_delete'); + } + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + /** * Set file permissions * * @access public * @param string the file path * @param string the permissions - * @return array + * @return bool */ function chmod($path, $perm) { + if ( ! $this->_is_conn()) + { + return FALSE; + } + // Permissions can only be set when running PHP 5 if ( ! function_exists('ftp_chmod')) { @@ -307,7 +456,12 @@ function chmod($path, $perm) * @return array */ function list_files($path = '.') - { + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + return ftp_nlist($this->conn_id, $path); } @@ -326,7 +480,12 @@ function list_files($path = '.') * @return bool */ function mirror($locpath, $rempath) - { + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + // Open the local file path if ($fp = @opendir($locpath)) { @@ -427,6 +586,11 @@ function _settype($ext) */ function close() { + if ( ! $this->_is_conn()) + { + return FALSE; + } + @ftp_close($this->conn_id); } From 86c60398852a299aa4a485c7e9e3c1d45e8c2184 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 28 Oct 2006 02:50:53 +0000 Subject: [PATCH 0406/2544] --- system/helpers/text_helper.php | 105 +++++++++++++++++--------- system/language/english/ftp_lang.php | 1 + system/libraries/Email.php | 107 +++++++++++++++++---------- user_guide/changelog.html | 1 + 4 files changed, 139 insertions(+), 75 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index fbc63a9b..1b917812 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -325,62 +325,97 @@ function highlight_phrase($str, $phrase, $tag_open = '', $tag_close = '< * Word Wrap * * Wraps text at the specified character. Maintains the integrity of words. + * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor + * will URLs. * * @access public * @param string the text string * @param integer the number of characters to wrap at * @return string */ -function word_wrap($str, $chars = '76') -{ - if ( ! is_numeric($chars)) - $chars = 76; +function word_wrap($str, $charlim = '76') +{ + // Se the character limit + if ( ! is_numeric($charlim)) + $charlim = 76; + + // Reduce multiple spaces + $str = preg_replace("| +|", " ", $str); - $str = preg_replace("/(\r\n|\r|\n)/", "\n", $str); - $lines = split("\n", $str); + // Standardize newlines + $str = preg_replace("/\r\n|\r/", "\n", $str); + // If the current word is surrounded by {unwrap} tags we'll + // strip the entire chunk and replace it with a marker. + $unwrap = array(); + if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $unwrap[] = $matches['1'][$i]; + $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); + } + } + + // Use PHP's native function to do the initial wordwrap. + // We set the cut flag to FALSE so that any individual words that are + // too long get left alone. In the next step we'll deal with them. + $str = wordwrap($str, $charlim, "\n", FALSE); + + // Split the string into individual lines of text and cycle through them $output = ""; - while (list(, $thisline) = each($lines)) + foreach (explode("\n", $str) as $line) { - if (strlen($thisline) > $chars) + // Is the line within the allowed character count? + // If so we'll join it to the output and continue + if (strlen($line) <= $charlim) + { + $output .= $line.$this->newline; + continue; + } + + $temp = ''; + while((strlen($line)) > $charlim) { - $line = ""; - $words = split(" ", $thisline); - while(list(, $thisword) = each($words)) + // If the over-length word is a URL we won't wrap it + if (preg_match("!\[url.+\]|://|wwww.!", $line)) { - while((strlen($thisword)) > $chars) - { - $cur_pos = 0; - for($i=0; $i < $chars - 1; $i++) - { - $output .= $thisword[$i]; - $cur_pos++; - } - - $output .= "\n"; - $thisword = substr($thisword, $cur_pos, (strlen($thisword) - $cur_pos)); - } - - if ((strlen($line) + strlen($thisword)) > $chars) - { - $output .= $line."\n"; - $line = $thisword." "; - } - else - { - $line .= $thisword." "; - } + break; } - $output .= $line."\n"; + // Trim the word down + $temp .= substr($line, 0, $charlim-1); + $line = substr($line, $charlim-1); + } + + // 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 .= $thisline."\n"; + $output .= $line; + } + + $output .= $this->newline; + } + + // Put our markers back + if (count($unwrap) > 0) + { + foreach ($unwrap as $key => $val) + { + $output = str_replace("{{unwrapped".$key."}}", $val, $output); } } + // Remove the unwrap tags + $output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output); + return $output; } + ?> \ No newline at end of file diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index 99895cc0..d6a1a40c 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -1,5 +1,6 @@ wrapchars == "") ? "76" : $this->wrapchars; + $charlim = ($this->wrapchars == "") ? "76" : $this->wrapchars; } + // Reduce multiple spaces $str = preg_replace("| +|", " ", $str); - - $str = preg_replace("|(\[url.+\])|", "{unwrap}\\1{/unwrap}", $str); - + + // Standardize newlines + $str = preg_replace("/\r\n|\r/", "\n", $str); + + // If the current word is surrounded by {unwrap} tags we'll + // strip the entire chunk and replace it with a marker. + $unwrap = array(); + if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $unwrap[] = $matches['1'][$i]; + $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); + } + } + + // Use PHP's native function to do the initial wordwrap. + // We set the cut flag to FALSE so that any individual words that are + // too long get left alone. In the next step we'll deal with them. + $str = wordwrap($str, $charlim, "\n", FALSE); + + // Split the string into individual lines of text and cycle through them $output = ""; - foreach (split("\n", $str) as $current_line) + foreach (explode("\n", $str) as $line) { - if (strlen($current_line) > $chars) + // Is the line within the allowed character count? + // If so we'll join it to the output and continue + if (strlen($line) <= $charlim) { - $line = ""; - - foreach (split(" ", $current_line) as $words) + $output .= $line.$this->newline; + continue; + } + + $temp = ''; + while((strlen($line)) > $charlim) + { + // If the over-length word is a URL we won't wrap it + if (preg_match("!\[url.+\]|://|wwww.!", $line)) { - while((strlen($words)) > $chars) - { - if (stristr($words, '{unwrap}') !== FALSE OR stristr($words, '{/unwrap}') !== FALSE) - { - break; - } - - $output .= substr($words, 0, $chars-1); - $words = substr($words, $chars-1); - - $output .= $this->newline; - } - - if ((strlen($line) + strlen($words)) > $chars) - { - $output .= $line.$this->newline; - - $line = $words." "; - } - else - { - $line .= $words." "; - } + break; } - - $output .= $line.$this->newline; - } - else + + // Trim the word down + $temp .= substr($line, 0, $charlim-1); + $line = substr($line, $charlim-1); + } + + // 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 .= $this->newline; + } + + // Put our markers back + if (count($unwrap) > 0) + { + foreach ($unwrap as $key => $val) { - $output .= $current_line.$this->newline; + $output = str_replace("{{unwrapped".$key."}}", $val, $output); } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 16f830c1..817b49bf 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -92,6 +92,7 @@

          Version 1.5.0 Beta 3

        • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
        • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
        • Fixed a bug in the Email class related to SMTP Helo data.
        • +
        • Fixed a bugin the word wrapping heper and function in the email class.
        • Fixed a bug in the validation class.
        • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
        • Fixed a problem in the form_prep() function that was double encoding entities.
        • From 05186616a0ba51cd7df168ac198b283815c89bf2 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 28 Oct 2006 03:28:01 +0000 Subject: [PATCH 0407/2544] --- system/application/config/config.php | 25 +++++++++++++++++--- system/application/config/database.php | 4 ++-- user_guide/changelog.html | 5 ++-- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/changelog.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/multiple_apps.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 4 ++-- user_guide/helpers/string_helper.html | 4 ++-- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/nav/nav.js | 1 + user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 4 +++- 104 files changed, 132 insertions(+), 109 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 0ed58d94..fc472401 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -147,9 +147,28 @@ | Error Logging |-------------------------------------------------------------------------- | +<<<<<<< .mine +| Options are "local" or "gmt". This pref tells the system whether to use +| your server's local time as the master "now" reference, or convert it to +| GMT. See the "date helper" page of the user guide for information +| regarding date handling. +| +*/ +$config['time_reference'] = 'local'; + +/* +|-------------------------------------------------------------------------- +| Error Logging Threshold +|-------------------------------------------------------------------------- +| +| If you have enabled error logging, you can set an error threshold to +| determine what gets logged. Threshold options are: +======= | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: -| +>>>>>>> .r388 +| +| 0 = Disables logging | 0 = Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages @@ -220,8 +239,8 @@ $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_encrypt_cookie'] = FALSE; -$config['sess_use_database'] = FALSE; -$config['sess_table_name'] = ''; +$config['sess_use_database'] = TRUE; +$config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = TRUE; $config['sess_match_useragent'] = TRUE; diff --git a/system/application/config/database.php b/system/application/config/database.php index b3246b6e..5cfd7634 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -36,13 +36,13 @@ $db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; $db['default']['password'] = ""; -$db['default']['database'] = "tester"; +$db['default']['database'] = "test"; $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; -$db['default']['cache_on'] = TRUE; +$db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = APPPATH.'dbcache/'; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 817b49bf..593a1f2a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -33,7 +33,7 @@
          - +

          Code Igniter User Guide Version 1.5.0b3

          Code Igniter User Guide Version 1.5.0

          @@ -63,7 +63,7 @@

          Change Log

          -

          Version 1.5.0 Beta 3

          +

          Version 1.5.0

          Release Date: October 30, 2006

            @@ -84,6 +84,7 @@

            Version 1.5.0 Beta 3

          • Added $query->list_fields() function to database class
          • Added $this->db->platform() function
          • Added new File Helper: get_filenames()
          • +
          • Added new helper: Smiley Helper
          • Added more thorough initialization in the upload class so that all class variables are reset.
          • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
          • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
          • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index b5c94a2c..e9f9b680 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index ce5535c2..c1062690 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index a437b43a..da3279a6 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 830f8188..1fe0825a 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index ced94794..466af04e 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 79631042..2d38dba0 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 8f206638..31332f70 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 19fe4799..63164169 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/index.html b/user_guide/database/index.html index f83aab22..9d047705 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index e558e3d8..41a28abd 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/results.html b/user_guide/database/results.html index bae8a75c..32662280 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 68119336..954ce668 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 4677ed6f..3f272c56 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index cbc79153..e7685857 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 2e2e562e..7e8de7c0 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 71d88f3b..3634dc32 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index bbb839dd..3a5876f3 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 1e3a6bca..9a8afd59 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 44412b96..81235cae 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index fd6a4bdf..b33c76ef 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index c5d021e6..9318f066 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 12f8f9fc..124fa02e 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 45554904..cbc3641e 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 70ee1021..f4295ec1 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index e9283e9a..4447a887 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 341451aa..05c304d3 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/index.html b/user_guide/general/index.html index b2e89faf..f0905d92 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index de34a7a0..00679c56 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 18e57589..f25b87fe 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html index e7e45850..f9e9ab38 100644 --- a/user_guide/general/multiple_apps.html +++ b/user_guide/general/multiple_apps.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 85190af9..4226b8a6 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 2a933e3f..029dbf02 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 20d3fec9..31a823ff 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 3efb3bba..bd208507 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index a0bb6713..5e633bc7 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index dbe9cb12..08d8a27c 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/security.html b/user_guide/general/security.html index e8f935d5..ef076c66 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index c90e90f7..366e9992 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 602d5825..4fe808ff 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 854d0bab..38b7f57b 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index ec27e548..6e9b5eb8 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 727ce520..b7eb6bc5 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 34450b13..cd9d2928 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 14dba661..7a3f0b01 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index cbbf810a..0d5f2388 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 68d44e66..d983c1da 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index e32cbc93..72743106 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 129e424e..ce62f433 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 65cc795e..02f76ee7 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 3953e8b2..110e45e1 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            @@ -122,7 +122,7 @@

            encode_php_tags()

               ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  String Helper +Next Topic:  Smiley Helper

            Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

            diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index f43dfc48..e2908701 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -33,7 +33,7 @@
            - +

            Code Igniter User Guide Version 1.5.0b3

            Code Igniter User Guide Version 1.5.0

            @@ -131,7 +131,7 @@

            repeater()

          From 49439ff0a4deaac47e078c137216b0c410bd6ec4 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 04:39:12 +0000 Subject: [PATCH 0423/2544] --- system/application/config/config.php | 29 +++++++++++------------- system/codeigniter/Common.php | 6 ++--- system/libraries/Config.php | 2 +- system/libraries/Loader.php | 4 ++-- system/libraries/Log.php | 2 +- user_guide/installation/upgrade_150.html | 14 +++++++++++- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index fc472401..3c3b423d 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -142,20 +142,6 @@ $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; -/* -|-------------------------------------------------------------------------- -| Error Logging -|-------------------------------------------------------------------------- -| -<<<<<<< .mine -| Options are "local" or "gmt". This pref tells the system whether to use -| your server's local time as the master "now" reference, or convert it to -| GMT. See the "date helper" page of the user guide for information -| regarding date handling. -| -*/ -$config['time_reference'] = 'local'; - /* |-------------------------------------------------------------------------- | Error Logging Threshold @@ -163,10 +149,8 @@ | | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: -======= | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: ->>>>>>> .r388 | | 0 = Disables logging | 0 = Error logging TURNED OFF @@ -302,4 +286,17 @@ $config['time_reference'] = 'local'; +/* +|-------------------------------------------------------------------------- +| Rewrite PHP Short Tags +|-------------------------------------------------------------------------- +| +| If your PHP installation does not have short tag support enabled CI +| can rewrite the tags on-the-fly, enabling you to utilize that syntax +| in your view files. Options are TRUE or FALSE (boolean) +| +*/ +$config['rewrite_short_tags'] = FALSE; + + ?> \ No newline at end of file diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 06e92208..41e13bee 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -127,7 +127,7 @@ function &get_config() * @access public * @return mixed */ -function &config_item($item) +function config_item($item) { static $config_item = array(); @@ -197,7 +197,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) { static $LOG; - $config = get_config(); + $config =& get_config(); if ($config['log_threshold'] == 0) { return; @@ -247,7 +247,7 @@ function _exception_handler($severity, $message, $filepath, $line) } // Should we log the error? No? We're done... - $config = get_config(); + $config =& get_config(); if ($config['log_threshold'] == 0) { return; diff --git a/system/libraries/Config.php b/system/libraries/Config.php index c4ea9b4e..28409fbc 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -44,7 +44,7 @@ class CI_Config { */ function CI_Config() { - $this->config = get_config(); + $this->config =& get_config(); log_message('debug', "Config Class Initialized"); } diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 709d9fe3..11762656 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -606,7 +606,7 @@ function _ci_load($data) // do a little string replacement, changing the short tags // to standard PHP echo statements. - if ((bool) @ini_get('short_open_tag') === FALSE) + if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 6ebc331d..06d0c702 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -101,7 +101,7 @@

          Step 2: Update your database.php file

          Step 2: Update your config.php file

          -

          Open your application/config/config.php file and ADD this new item:

          +

          Open your application/config/config.php file and ADD these new items:

           /*
          @@ -117,6 +117,18 @@ 

          Step 2: Update your config.php file

          | */ $config['subclass_prefix'] = 'MY_'; + +/* +|-------------------------------------------------------------------------- +| Rewrite PHP Short Tags +|-------------------------------------------------------------------------- +| +| If your PHP installation does not have short tag support enabled CI +| can rewrite the tags on-the-fly, enabling you to utilize that syntax +| in your view files. Options are TRUE or FALSE (boolean) +| +*/ +$config['rewrite_short_tags'] = FALSE;

          In that same file REMOVE this item:

          From b79b42af353a3070fd19f234ff3ee17502ac57b5 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 17:11:46 +0000 Subject: [PATCH 0424/2544] --- user_guide/general/managing_apps.html | 139 ++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 user_guide/general/managing_apps.html diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html new file mode 100644 index 00000000..9b5c68d7 --- /dev/null +++ b/user_guide/general/managing_apps.html @@ -0,0 +1,139 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
          + + + + + +

          Code Igniter User Guide Version 1.5.0

          +
          + + + + + + + + + +
          + + +
          + + + +
          + +

          Managing your Applications

          + +

          By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your +system/application/ directory. It is possible, however, to have multiple sets of applications that share a single +Code Igniter installation, or even to rename or relocate your application folder.

          + +

          Renaming the Application Folder

          + +

          If you would like to rename your applicaiton folder you may do so as long as you open your main index.php +file and set its name using the $application_folder variable:

          + +$application_folder = "application"; + +

          Relocating your Application Folder

          + +

          It is possible to move your application folder to a different location on your server than your system folder. +To do so open your main index.php and set a full server path in the $application_folder variable.

          + + +$application_folder = "/Path/to/your/application"; + + +

          Running Multiple Applications with one Code Igniter Installation

          + +

          If you would like to share a common Code Igniter installation to manage several different applications simply +put all of the directories located inside your application folder into their +own sub-folder.

          + +

          For example, let's say you want to create two applications, "foo" and "bar". You will structure your +application folder like this: + +system/application/foo/
          +system/application/foo/config/
          +system/application/foo/controllers/
          +system/application/foo/errors/
          +system/application/foo/libraries/
          +system/application/foo/models/
          +system/application/foo/views/
          +system/application/bar/
          +system/application/bar/config/
          +system/application/bar/controllers/
          +system/application/bar/errors/
          +system/application/bar/libraries/
          +system/application/bar/models/
          +system/application/bar/views/
          + + +

          To select a particular application for use requires that you open your main index.php file and set the $application_folder +variable. For example, to select the "foo" application for use you would do this:

          + +$application_folder = "application/foo"; + +

          Note:  Each of your applications will need its own index.php file which +calls the desired application. The index.php file can be named anything you want.

          + + + + + +
          + + + + + + + \ No newline at end of file From a42bf30be502fa46f61ba77575e71fb587b30102 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 17:12:14 +0000 Subject: [PATCH 0425/2544] --- user_guide/general/multiple_apps.html | 33 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html index f9e9ab38..9b5c68d7 100644 --- a/user_guide/general/multiple_apps.html +++ b/user_guide/general/multiple_apps.html @@ -47,7 +47,7 @@ Code Igniter Home  ›  User Guide Home  ›  -Running Multiple Applications +Managing your Applications
          Search User Guide   
          @@ -60,11 +60,32 @@
          -

          Running Multiple Applications with one Code Igniter Installation

          +

          Managing your Applications

          By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your system/application/ directory. It is possible, however, to have multiple sets of applications that share a single -Code Igniter installation. To do this you will put all of the directories located inside your application folder into their +Code Igniter installation, or even to rename or relocate your application folder.

          + +

          Renaming the Application Folder

          + +

          If you would like to rename your applicaiton folder you may do so as long as you open your main index.php +file and set its name using the $application_folder variable:

          + +$application_folder = "application"; + +

          Relocating your Application Folder

          + +

          It is possible to move your application folder to a different location on your server than your system folder. +To do so open your main index.php and set a full server path in the $application_folder variable.

          + + +$application_folder = "/Path/to/your/application"; + + +

          Running Multiple Applications with one Code Igniter Installation

          + +

          If you would like to share a common Code Igniter installation to manage several different applications simply +put all of the directories located inside your application folder into their own sub-folder.

          For example, let's say you want to create two applications, "foo" and "bar". You will structure your @@ -89,9 +110,11 @@

          Running Multiple Applications with one Code Igniter Installation

          To select a particular application for use requires that you open your main index.php file and set the $application_folder variable. For example, to select the "foo" application for use you would do this:

          -$application_folder = "foo"; +$application_folder = "application/foo"; + +

          Note:  Each of your applications will need its own index.php file which +calls the desired application. The index.php file can be named anything you want.

          -

          Note: Each of your applications will need its own index.php file (the index.php file can be named anything you want).

          From cef2106de1c7044072499aa5d4e529a01c3db8a4 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 17:13:13 +0000 Subject: [PATCH 0426/2544] --- index.php | 16 ++- system/codeigniter/CodeIgniter.php | 4 +- system/libraries/Controller.php | 4 +- user_guide/changelog.html | 8 +- user_guide/general/alternative_php.html | 10 +- user_guide/general/caching.html | 2 +- user_guide/general/changelog.html | 2 +- user_guide/general/managing_apps.html | 139 ----------------------- user_guide/general/profiling.html | 2 +- user_guide/installation/upgrade_150.html | 8 +- user_guide/nav/nav.js | 2 +- user_guide/toc.html | 2 +- 12 files changed, 41 insertions(+), 158 deletions(-) delete mode 100644 user_guide/general/managing_apps.html diff --git a/index.php b/index.php index 0386ed6e..6c839ec5 100644 --- a/index.php +++ b/index.php @@ -32,7 +32,11 @@ |--------------------------------------------------------------- | | If you want this front controller to use a different "application" -| folder then the default one you can set its name here. +| folder then the default one you can set its name here. +| The folder can also be relocated anywhere on your server. For +| more info please see the user guide: +| http://www.codeigniter.com/user_guide/general/managing_apps.html +| | | NO TRAILING SLASH! | @@ -77,7 +81,15 @@ define('FCPATH', __FILE__); define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); define('BASEPATH', $system_folder.'/'); -define('APPPATH', BASEPATH.$application_folder.'/'); + +if ( ! is_dir($application_folder)) +{ + define($application_folder.'/'); +} +else +{ + define('APPPATH', BASEPATH.$application_folder.'/'); +} // Load the front controller and away we go!.... require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index fb27191c..5b3f54ae 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -115,11 +115,9 @@ * Note: The Loader class needs to be included first * */ - -load_class('Loader', FALSE); - if (floor(phpversion()) < 5) { + load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); } else diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 922382ab..c8fa646c 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -74,11 +74,11 @@ function _ci_initialize() $this->$var =& load_class($class); } - // In PHP 5 the Controller class is run as a discreet + // In PHP 5 the Loader class is run as a discreet // class. In PHP 4 it extends the Controller if (floor(phpversion()) >= 5) { - $this->load = new CI_Loader(); + $this->load =& load_class('Loader'); $this->load->_ci_autoloader(); } else diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 1d48e125..099614d6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -86,6 +86,8 @@

          Version 1.5.0

        • Added new File Helper: get_filenames()
        • Added new helper: Smiley Helper
        • Added support for <ul> and <ol> lists in the HTML Helper
        • +
        • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
        • +
        • Added the ability to rename or relocate the "application" folder.
        • Added more thorough initialization in the upload class so that all class variables are reset.
        • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
        • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
        • @@ -94,12 +96,12 @@

          Version 1.5.0

        • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
        • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
        • Fixed a bug in the Email class related to SMTP Helo data.
        • -
        • Fixed a bugin the word wrapping heper and function in the email class.
        • +
        • Fixed a bug in the word wrapping helper and function in the email class.
        • Fixed a bug in the validation class.
        • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
        • Fixed a problem in the form_prep() function that was double encoding entities.
        • Fixed a bug that affects some versions of PHP when output buffering is nested.
        • -
        • Fixed a bug that caused CI to stop working when the PHP magic __get() function was used within models or controllers.
        • +
        • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
        • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
        • Deprecated $this->db->field_names() USE $this->db->list_fields()
        • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
        • @@ -315,7 +317,7 @@

          Version Beta 1.1

          • Added a Calendaring class.
          • -
          • Added support for running multiple applications that share a common Code Igniter backend.
          • +
          • Added support for running multiple applications that share a common Code Igniter backend.
          • Moved the "uri protocol" variable from the index.php file into the config.php file
          • Fixed a problem that was preventing certain function calls from working within constructors.
          • Fixed a problem that was preventing the $this->load->library function from working in constructors.
          • diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 7e8de7c0..564dc323 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -67,6 +67,12 @@

            Alternate PHP Syntax for View Files

            syntax for control structures and echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate "echo" statements.

            +

            Note: If you find that the syntax described in this page does not work on your server it might +be that "short tags" are disabled in your PHP ini file. Code Igniter will optionally rewrite short tags on-the-fly, +allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your +config/config.php file.

            + +

            Alternative Echos

            Normally to echo, or print out a variable you would do this:

            @@ -77,8 +83,6 @@

            Alternative Echos

            <?=$variable?> -

            Note: If you find that the syntax described in this page does not work on your server it might -be that "short tags" are disabled in your PHP ini file.

            Alternative Control Structures

            @@ -129,7 +133,7 @@

            Alternative Control Structures

            diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 81235cae..9058f03b 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -304,7 +304,7 @@

            Version Beta 1.1

            • Added a Calendaring class.
            • -
            • Added support for running multiple applications that share a common Code Igniter backend.
            • +
            • Added support for running multiple applications that share a common Code Igniter backend.
            • Moved the "uri protocol" variable from the index.php file into the config.php file
            • Fixed a problem that was preventing certain function calls from working within constructors.
            • Fixed a problem that was preventing the $this->load->library function from working in constructors.
            • diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html deleted file mode 100644 index 9b5c68d7..00000000 --- a/user_guide/general/managing_apps.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -Code Igniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
              - - - - - -

              Code Igniter User Guide Version 1.5.0

              -
              - - - - - - - - - -
              - - -
              - - - -
              - -

              Managing your Applications

              - -

              By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your -system/application/ directory. It is possible, however, to have multiple sets of applications that share a single -Code Igniter installation, or even to rename or relocate your application folder.

              - -

              Renaming the Application Folder

              - -

              If you would like to rename your applicaiton folder you may do so as long as you open your main index.php -file and set its name using the $application_folder variable:

              - -$application_folder = "application"; - -

              Relocating your Application Folder

              - -

              It is possible to move your application folder to a different location on your server than your system folder. -To do so open your main index.php and set a full server path in the $application_folder variable.

              - - -$application_folder = "/Path/to/your/application"; - - -

              Running Multiple Applications with one Code Igniter Installation

              - -

              If you would like to share a common Code Igniter installation to manage several different applications simply -put all of the directories located inside your application folder into their -own sub-folder.

              - -

              For example, let's say you want to create two applications, "foo" and "bar". You will structure your -application folder like this: - -system/application/foo/
              -system/application/foo/config/
              -system/application/foo/controllers/
              -system/application/foo/errors/
              -system/application/foo/libraries/
              -system/application/foo/models/
              -system/application/foo/views/
              -system/application/bar/
              -system/application/bar/config/
              -system/application/bar/controllers/
              -system/application/bar/errors/
              -system/application/bar/libraries/
              -system/application/bar/models/
              -system/application/bar/views/
              - - -

              To select a particular application for use requires that you open your main index.php file and set the $application_folder -variable. For example, to select the "foo" application for use you would do this:

              - -$application_folder = "application/foo"; - -

              Note:  Each of your applications will need its own index.php file which -calls the desired application. The index.php file can be named anything you want.

              - - - - - -
              - - - - - - - \ No newline at end of file diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 029dbf02..0f74f1e2 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -110,7 +110,7 @@

              Setting Benchmark Points

                 ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Running Multiple Applications +Next Topic:  Managing Applications

              Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

          diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 06d0c702..79632ece 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -155,7 +155,13 @@

          Step 2: Update your config.php file

          Step 4: Update your main index.php file

          If you are running a stock index.php file simply replace your version with the new one. If you are running one with -internal modifications, open it and add this line of code near the bottom:

          +internal modifications, open it and make these two changes:

          + +

          Find the $application_folder variable and make sure it contains the name of your "application" directory:

          + +$application_folder = "application"; + +

          Next, at add this line of code near the bottom of the page:

          define('FCPATH', __FILE__); diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index dafe22e8..253700e6 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -54,7 +54,7 @@ function create_menu(basepath) '
        • Error Handling
        • ' + '
        • Caching
        • ' + '
        • Profiling Your Application
        • ' + - '
        • Running Multiple Applications
        • ' + + '
        • Managing Applications
        • ' + '
        • Alternative PHP Syntax
        • ' + '
        • Security
        • ' + '
        ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 7d6178de..95ea19bd 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -109,7 +109,7 @@

        General Topics

      • Error Handling
      • Caching
      • Profiling Your Application
      • -
      • Running Multiple Applications
      • +
      • Managing Applications
      • Alternative PHP Syntax
      • Security
      From c0d5d5201075ff0babbab84e251373cd6b012e4e Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 19:40:35 +0000 Subject: [PATCH 0427/2544] --- system/application/config/config.php | 2 +- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/changelog.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/multiple_apps.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/nav/nav.js | 5 ++++- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 13 +++++++++++++ 104 files changed, 119 insertions(+), 103 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 3c3b423d..2f385a6e 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -78,7 +78,7 @@ | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = TRUE; +$config['enable_hooks'] = FALSE; /* diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 099614d6..53c44224 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index e9f9b680..0db83d2d 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index c1062690..9a16a8f8 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index da3279a6..b19d9d70 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 1fe0825a..f49184d0 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 466af04e..f50f530a 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 2d38dba0..560c6f0e 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 31332f70..dbeb541e 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 63164169..2b552f1c 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 9d047705..812fcaad 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 41a28abd..916ff227 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 32662280..c886f4e3 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 954ce668..109f988a 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 3f272c56..27f1ba9f 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index bccce555..a9227ab2 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 564dc323..888123ed 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 3634dc32..d79de4c1 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 3a5876f3..89768569 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 88f6c8c0..b4b3dab7 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 9058f03b..938d43a7 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index b33c76ef..a388b9f7 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 9318f066..f7e308ac 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 124fa02e..8e17ad3f 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index cbc3641e..3ff4b175 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index f4295ec1..99dba91f 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 4447a887..823a4275 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 05c304d3..a932d743 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/index.html b/user_guide/general/index.html index f0905d92..8d3eb07f 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 00679c56..3d834b8e 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index f25b87fe..b0a10834 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html index 9b5c68d7..387368b6 100644 --- a/user_guide/general/multiple_apps.html +++ b/user_guide/general/multiple_apps.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 4226b8a6..ca8df3cd 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 0f74f1e2..92b77a79 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 31a823ff..13bd1f82 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index bd208507..2a2db5ad 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 5e633bc7..d5377f15 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 08d8a27c..a9c8db28 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/security.html b/user_guide/general/security.html index ef076c66..d7e552e3 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 366e9992..9e65e4f4 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 4fe808ff..147667ce 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 38b7f57b..b3d59c53 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 6e9b5eb8..d6b64160 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index b7eb6bc5..68e30682 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index cd9d2928..822e29af 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 7a3f0b01..9a29abb1 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 0d5f2388..aeba68d2 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index d983c1da..6d1402df 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 303adc34..d246c927 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index ce62f433..4222405b 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 02f76ee7..db203cdd 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 110e45e1..1fcb9115 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index de847957..d818d008 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index e2908701..04310241 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index e35d333f..f84acce9 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 733fbdcb..19550059 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 6dcdef53..33a933d7 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 3ff8d2ad..5d7496f6 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/index.html b/user_guide/index.html index 02399b6b..b2a0dcb9 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index a7fe28be..1f84a405 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index dd85bfc8..f339fe83 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index ea8037fc..168e5977 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index cab53361..93757c87 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index a6b78cc9..da4ad405 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index fae42797..101ac537 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 73e04f45..99571c16 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 3d5bd841..e8220bdc 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 82421167..dbc628a6 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index f5cabf91..929608c2 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 79632ece..f180f8f8 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index d3462fc4..9a78dd55 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 3b77e274..51be6897 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 2daa997e..7ed45586 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 50cbbd36..03035170 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 7dde4451..d22881fa 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 18900867..42d11255 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 03eae7d2..34cacf5c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 6be1db9f..6a2317da 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 2d80a99b..0bec3a82 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 00ce88e6..726f8c92 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 9036d694..292f967b 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 5e8b3b23..3ecadec4 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 53dc60a9..61ed6bff 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 97f1314f..0ebaaedd 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 50519a4d..a2bfc25f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 77657781..e187c49a 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 00e25761..ed6260f4 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 410bd405..fe2f0c29 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 292931a8..4a4d9948 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 2439ce9b..692df003 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index f1006e07..efb0a874 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index fb843818..1426a4a5 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 22ae56ff..0c1288f5 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 82a97fde..9421e0fe 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 9503f16f..67dc039c 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/license.html b/user_guide/license.html index 55bd9f07..a0b68766 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -34,7 +34,7 @@ - +

      Code Igniter User Guide Version 1.5.0

      diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index 253700e6..46272984 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -6,7 +6,10 @@ function create_menu(basepath) '' + ' - +result() as $row): ?> From 1aef55e44d0aff547e4c016796734412fbe710ae Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 02:42:11 +0000 Subject: [PATCH 0434/2544] --- system/language/english/calendar_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php index 4a399af8..02475e1f 100644 --- a/system/language/english/calendar_lang.php +++ b/system/language/english/calendar_lang.php @@ -1,6 +1,6 @@ Date: Tue, 31 Oct 2006 03:26:00 +0000 Subject: [PATCH 0435/2544] --- user_guide/general/managing_apps.html | 139 ++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 user_guide/general/managing_apps.html diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html new file mode 100644 index 00000000..387368b6 --- /dev/null +++ b/user_guide/general/managing_apps.html @@ -0,0 +1,139 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
      +
      ' + - '

      User Guide Home

      ' + + '' + '

      Basic Info

      ' + '
        ' + diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 9cc19a2e..69cc2550 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 2cfeee02..38cb203d 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 5d8ae734..6b570d86 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index a9c42aef..dff233cd 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 3f1e984f..b8e9fd78 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 1be86c6d..21ac6aa4 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -34,7 +34,7 @@ - +

        Code Igniter User Guide Version 1.5.0

        diff --git a/user_guide/toc.html b/user_guide/toc.html index 95ea19bd..7b5bd695 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -63,6 +63,9 @@

        Table of Contents

        + + + + + + + +

        Basic Info

          @@ -90,6 +93,9 @@

          Introduction

        +
        +

        General Topics

        +

        Class Reference

        @@ -144,6 +152,8 @@

        Class Reference

        +

        Helper Reference

          @@ -174,6 +184,9 @@

          Additional Resources

        +
        From 47cf6993fed3d5baefd891d7ec774295bf81bf9b Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 20:24:06 +0000 Subject: [PATCH 0428/2544] --- user_guide/installation/upgrade_150.html | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index f180f8f8..f975f532 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -154,17 +154,9 @@

        Step 2: Update your config.php file

        Step 4: Update your main index.php file

        -

        If you are running a stock index.php file simply replace your version with the new one. If you are running one with -internal modifications, open it and make these two changes:

        - -

        Find the $application_folder variable and make sure it contains the name of your "application" directory:

        - -$application_folder = "application"; - -

        Next, at add this line of code near the bottom of the page:

        - -define('FCPATH', __FILE__); +

        If you are running a stock index.php file simply replace your version with the new one.

        +

        If your index.php file has internal modifications, please add your modifications to the new file and use it.

        From 784add749c806c52327615d47b8c6fabe2bd3438 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 30 Oct 2006 20:24:26 +0000 Subject: [PATCH 0429/2544] --- index.php | 91 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 32 deletions(-) diff --git a/index.php b/index.php index 6c839ec5..315b43c8 100644 --- a/index.php +++ b/index.php @@ -7,9 +7,10 @@ | | By default CI runs with error reporting set to ALL. For security | reasons you are encouraged to change this when your site goes live. +| For more info visit: http://www.php.net/error_reporting | */ -error_reporting(E_ALL); + error_reporting(E_ALL); /* |--------------------------------------------------------------- @@ -23,7 +24,6 @@ | NO TRAILING SLASH! | */ - $system_folder = "system"; /* @@ -32,65 +32,92 @@ |--------------------------------------------------------------- | | If you want this front controller to use a different "application" -| folder then the default one you can set its name here. -| The folder can also be relocated anywhere on your server. For -| more info please see the user guide: +| folder then the default one you can set its name here. The folder +| can also be renamed or relocated anywhere on your server. +| For more info please see the user guide: | http://www.codeigniter.com/user_guide/general/managing_apps.html | | | NO TRAILING SLASH! | */ - $application_folder = "application"; + /* |=============================================================== -| END OF USER CONFIGURABLE SETTINGS +| END OF USER CONFIGURABLE SETTINGS |=============================================================== */ -// Let's attempt to determine the full-server path to the "system" -// folder in order to reduce the possibility of path problems. + +/* +|--------------------------------------------------------------- +| SET THE SERVER PATH +|--------------------------------------------------------------- +| +| Let's attempt to determine the full-server path to the "system" +| folder in order to reduce the possibility of path problems. +| +*/ if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) { $system_folder = str_replace("\\", "/", realpath(dirname(__FILE__))).'/'.$system_folder; } -// Is the $aplication variable blank? If so, we'll assume the folder is called "application" -if ($application_folder == '') -{ - $application_folder = 'application'; -} - -// Some versions of PHP don't support the E_STRICT constant so we'll -// explicitly define it so that it will be available to the Exception class -if ( ! defined('E_STRICT')) -{ - define('E_STRICT', 2048); -} - -// Define a few constants that we use througout the framework. -// EXT - contains the file extension. Typically ".php" -// FCPATH - contains the full server path to THIS file. -// SELF - contains the name of THIS file. -// BASEPATH - contains the full server path to the "system" folder -// APPPATH - contains the full server path to the "application" folder - +/* +|--------------------------------------------------------------- +| DEFINE APPLICATION CONSTANTS +|--------------------------------------------------------------- +| +| EXT - The file extension. Typically ".php" +| FCPATH - The full server path to THIS file +| SELF - The name of THIS file (typically "index.php) +| BASEPATH - The full server path to the "system" folder +| APPPATH - The full server path to the "application" folder +| +*/ define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); define('FCPATH', __FILE__); define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); define('BASEPATH', $system_folder.'/'); -if ( ! is_dir($application_folder)) +if (is_dir($application_folder)) { - define($application_folder.'/'); + define('APPPATH', $application_folder.'/'); } else { + if ($application_folder == '') + { + $application_folder = 'application'; + } + define('APPPATH', BASEPATH.$application_folder.'/'); } -// Load the front controller and away we go!.... +/* +|--------------------------------------------------------------- +| DEFINE E_STRICT +|--------------------------------------------------------------- +| +| Some older versions of PHP don't support the E_STRICT constant +| so we need to explicitly define it otherwise the Exception class +| will generate errors. +| +*/ +if ( ! defined('E_STRICT')) +{ + define('E_STRICT', 2048); +} + +/* +|--------------------------------------------------------------- +| LOAD THE FRONT CONTROLLER +|--------------------------------------------------------------- +| +| And away we go... +| +*/ require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; ?> \ No newline at end of file From b93464db656fe017fe434b0fc917921ded88a12c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 00:36:32 +0000 Subject: [PATCH 0430/2544] --- system/codeigniter/CodeIgniter.php | 9 +++- system/libraries/Calendar.php | 11 +++- system/libraries/Pagination.php | 5 +- user_guide/general/alternative_php.html | 12 +++-- user_guide/libraries/calendar.html | 64 +++++++++++------------- user_guide/libraries/file_uploading.html | 5 +- 6 files changed, 65 insertions(+), 41 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 5b3f54ae..3e2b99de 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -125,9 +125,16 @@ require(BASEPATH.'codeigniter/Base5'.EXT); } +// Load the base controller class load_class('Controller', FALSE); -require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); +// Load the local application controller +// Note: The Router class automatically validates the controller path. If this include fails it +// means that the default controller in the Routes.php file is not resolving to something valid. +if ( ! @include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +{ + show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); +} // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 84b096c8..fdef5dd7 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -45,7 +45,7 @@ class CI_Calendar { * * @access public */ - function CI_Calendar() + function CI_Calendar($config = array()) { $this->CI =& get_instance(); @@ -55,6 +55,12 @@ function CI_Calendar() } $this->local_time = time(); + + if (count($config) > 0) + { + $this->initialize($config); + } + log_message('debug', "Calendar Class Initialized"); } @@ -153,6 +159,9 @@ function generate($year = '', $month = '', $data = array()) // "previous" month link if ($this->show_next_prev == TRUE) { + // Add a trailing slash to the URL if needed + $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"; diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index c66d570c..07ad6a68 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -120,8 +120,11 @@ function create_links() if ($CI->uri->segment($this->uri_segment) != 0) { $this->cur_page = $CI->uri->segment($this->uri_segment); + + // Prep the current page - no funny business! + $this->cur_page = preg_replace("/[a-z\-]/", "", $this->cur_page); } - + if ( ! is_numeric($this->cur_page)) { $this->cur_page = 0; diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 888123ed..2018bf26 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -63,15 +63,21 @@

        Alternate PHP Syntax for View Files

        If you do not utilize Code Igniter's template engine, you'll be using pure PHP -in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use PHPs alternative -syntax for control structures and echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, +in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use +PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate "echo" statements.

        -

        Note: If you find that the syntax described in this page does not work on your server it might +

        Automatic Short Tag Support

        + +

        Note: If you find that the syntax described in this page does not work on your server it might be that "short tags" are disabled in your PHP ini file. Code Igniter will optionally rewrite short tags on-the-fly, allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your config/config.php file.

        +

        Please note that if you do use this feature, if PHP errors are encountered +in your view files, the error message and line number will not be accurately shown. Instead, all errors +will be shown as eval() errors.

        +

        Alternative Echos

        diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 03035170..ff61701a 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -119,19 +119,18 @@

        Passing Data to your Calendar Cells

        Setting Display Preferences

        -

        There are seven preferences you can set to control various aspects of the calendar. Preferences are set using an initialization -function similar to other classes. Here is an example: +

        There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an +array of preferences in the second parameter of the loading function. Here is an example:

        -$this->load->library('calendar');
        -
        + $prefs = array (
                       'start_day'    => 'saturday',
                       'month_type'   => 'long',
                       'day_type'     => 'short'
                     );

        -$this->calendar->initialize($prefs);
        +$this->load->library('calendar', $prefs);

        echo $this->calendar->generate();
        @@ -166,6 +165,30 @@

        Setting Display Preferences

        +

        Showing Next/Previous Month Links

        + +

        To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar +code similar to this example:

        + + +$this->load->library('calendar');
        +
        +$prefs = array (
        +               'show_next_prev'  => TRUE,
        +               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
        +             );
        +
        +echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $prefs);
        + +

        You'll notice a few things about the above example:

        + +
          +
        • You must set the "show_next_prev" to TRUE.
        • +
        • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
        • +
        • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
        • +
        + +

        Creating a Calendar Template

        @@ -173,7 +196,7 @@

        Creating a Calendar Template

        calendar will be placed within a pair of pseudo-variables as shown here:

        -$this->load->library('calendar');

        + $prefs['template'] = '

           {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}

        @@ -206,39 +229,12 @@

        Creating a Calendar Template

           {table_close}</table>{/table_close}
        ';

        -$this->calendar->initialize($prefs);
        +$this->load->library('calendar', $prefs);

        echo $this->calendar->generate();
        -

        Showing Next/Previous Month Links

        - -

        To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar -code similar to this example:

        - - -$this->load->library('calendar');
        -
        -$prefs = array (
        -               'show_next_prev'  => TRUE,
        -               'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
        -             );
        -
        -$this->calendar->initialize($prefs);
        -
        -echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
        - -

        You'll notice a few things about the above example:

        - -
          -
        • You must set the "show_next_prev" to TRUE.
        • -
        • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
        • -
        • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
        • -
        - - - diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 6a2317da..1fa93bf1 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -171,7 +171,7 @@

        The Controller

        $config['max_width'] = '1024'; $config['max_height'] = '768'; - $this->upload->initialize($config); + $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { @@ -230,6 +230,9 @@

        Setting Preferences

        $config['max_width'] = '1024';
        $config['max_height'] = '768';

        +$this->load->library('ftp', $config);

        + +// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
        $this->upload->initialize($config);

        The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

        From 2c9b09f2bb81061fc20610127c7e5b2e54aa4473 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 00:37:48 +0000 Subject: [PATCH 0431/2544] --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 53c44224..c9dc7406 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -102,6 +102,8 @@

        Version 1.5.0

      • Fixed a problem in the form_prep() function that was double encoding entities.
      • Fixed a bug that affects some versions of PHP when output buffering is nested.
      • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
      • +
      • Fixed a pagination bug that was permitting negative values in the URL.
      • +
      • Fixed an oversight in which the Loader class was not allowed to be exteneded.
      • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
      • Deprecated $this->db->field_names() USE $this->db->list_fields()
      • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
      • From bf9ee3f82dda6c738b65f2b558579b6cab7f7774 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 02:35:04 +0000 Subject: [PATCH 0432/2544] --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 77069d1a..03631d69 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -137,7 +137,7 @@ function initialize($params = '') { return TRUE; } - + // Connect to the database $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); From 57cd6e21cd94f5cc278f5f979a2c7071724e73f6 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 02:36:32 +0000 Subject: [PATCH 0433/2544] --- system/scaffolding/views/view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/scaffolding/views/view.php b/system/scaffolding/views/view.php index fd20a174..e7abda6d 100644 --- a/system/scaffolding/views/view.php +++ b/system/scaffolding/views/view.php @@ -7,7 +7,7 @@
      + + + + +

      Code Igniter User Guide Version 1.5.0

      + + + + + + + + + + +
      + + +
      + + + +
      + +

      Managing your Applications

      + +

      By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your +system/application/ directory. It is possible, however, to have multiple sets of applications that share a single +Code Igniter installation, or even to rename or relocate your application folder.

      + +

      Renaming the Application Folder

      + +

      If you would like to rename your applicaiton folder you may do so as long as you open your main index.php +file and set its name using the $application_folder variable:

      + +$application_folder = "application"; + +

      Relocating your Application Folder

      + +

      It is possible to move your application folder to a different location on your server than your system folder. +To do so open your main index.php and set a full server path in the $application_folder variable.

      + + +$application_folder = "/Path/to/your/application"; + + +

      Running Multiple Applications with one Code Igniter Installation

      + +

      If you would like to share a common Code Igniter installation to manage several different applications simply +put all of the directories located inside your application folder into their +own sub-folder.

      + +

      For example, let's say you want to create two applications, "foo" and "bar". You will structure your +application folder like this: + +system/application/foo/
      +system/application/foo/config/
      +system/application/foo/controllers/
      +system/application/foo/errors/
      +system/application/foo/libraries/
      +system/application/foo/models/
      +system/application/foo/views/
      +system/application/bar/
      +system/application/bar/config/
      +system/application/bar/controllers/
      +system/application/bar/errors/
      +system/application/bar/libraries/
      +system/application/bar/models/
      +system/application/bar/views/
      + + +

      To select a particular application for use requires that you open your main index.php file and set the $application_folder +variable. For example, to select the "foo" application for use you would do this:

      + +$application_folder = "application/foo"; + +

      Note:  Each of your applications will need its own index.php file which +calls the desired application. The index.php file can be named anything you want.

      + + + + + +
      + + + + + + + \ No newline at end of file From 57b9e5c5350ffb20048d36c508d1e310603b12f8 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 07:11:36 +0000 Subject: [PATCH 0436/2544] --- system/libraries/Ftp.php | 4 +- system/libraries/Model.php | 9 +- user_guide/general/multiple_apps.html | 139 -------------------------- user_guide/libraries/loader.html | 11 -- 4 files changed, 4 insertions(+), 159 deletions(-) delete mode 100644 user_guide/general/multiple_apps.html diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 3b2be23d..1572a587 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -178,7 +178,7 @@ function changedir($path = '', $supress_debug = FALSE) if ($result === FALSE) { - if ($this->debug == TRUE AND $supress_debug != TRUE) + if ($this->debug == TRUE AND $supress_debug == FALSE) { $this->_error('ftp_unable_to_changedir'); } @@ -251,7 +251,7 @@ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) // Set the mode if not specified if ($mode == 'auto') { - // Get the file extension so we can se the upload type + // Get the file extension so we can set the upload type $ext = $this->_getext($locpath); $mode = $this->_settype($ext); } diff --git a/system/libraries/Model.php b/system/libraries/Model.php index 1c2b7afc..6f4f7e7e 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -40,12 +40,7 @@ function Model() // We don't want to assign the model object to itself when using the // assign_libraries function below so we'll grab the name of the model parent - $methods = get_class_methods($this); - - if (isset($methods[0])) - { - $this->_parent_name = $methods[0]; - } + $this->_parent_name = ucfirst(get_class($this)); log_message('debug', "Model Class Initialized"); } @@ -65,7 +60,7 @@ function _assign_libraries($use_reference = TRUE) foreach (array_keys(get_object_vars($CI)) as $key) { if ( ! isset($this->$key) AND $key != $this->_parent_name) - { + { // In some cases using references can cause // problems so we'll conditionally use them if ($use_reference == TRUE) diff --git a/user_guide/general/multiple_apps.html b/user_guide/general/multiple_apps.html deleted file mode 100644 index 387368b6..00000000 --- a/user_guide/general/multiple_apps.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -Code Igniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
      - - - - - -

      Code Igniter User Guide Version 1.5.0

      -
      - - - - - - - - - -
      - - -
      - - - -
      - -

      Managing your Applications

      - -

      By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your -system/application/ directory. It is possible, however, to have multiple sets of applications that share a single -Code Igniter installation, or even to rename or relocate your application folder.

      - -

      Renaming the Application Folder

      - -

      If you would like to rename your applicaiton folder you may do so as long as you open your main index.php -file and set its name using the $application_folder variable:

      - -$application_folder = "application"; - -

      Relocating your Application Folder

      - -

      It is possible to move your application folder to a different location on your server than your system folder. -To do so open your main index.php and set a full server path in the $application_folder variable.

      - - -$application_folder = "/Path/to/your/application"; - - -

      Running Multiple Applications with one Code Igniter Installation

      - -

      If you would like to share a common Code Igniter installation to manage several different applications simply -put all of the directories located inside your application folder into their -own sub-folder.

      - -

      For example, let's say you want to create two applications, "foo" and "bar". You will structure your -application folder like this: - -system/application/foo/
      -system/application/foo/config/
      -system/application/foo/controllers/
      -system/application/foo/errors/
      -system/application/foo/libraries/
      -system/application/foo/models/
      -system/application/foo/views/
      -system/application/bar/
      -system/application/bar/config/
      -system/application/bar/controllers/
      -system/application/bar/errors/
      -system/application/bar/libraries/
      -system/application/bar/models/
      -system/application/bar/views/
      - - -

      To select a particular application for use requires that you open your main index.php file and set the $application_folder -variable. For example, to select the "foo" application for use you would do this:

      - -$application_folder = "application/foo"; - -

      Note:  Each of your applications will need its own index.php file which -calls the desired application. The index.php file can be named anything you want.

      - - - - - -
      - - - - - - - \ No newline at end of file diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 61ed6bff..c7cf82d4 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -88,17 +88,6 @@

      $this->load->library('class_name')

      Parameters can be passed to the library via an array in the second parameter. - -

      If you would like your libraries assigned to a different variable name then the default you can specify the name in the second parameter:

      - - -$this->load->library('email', 'E'); // Assigns the email object to "E"
      -
      -$this->E->some_function() -
      - - -

      $this->load->view('file_name', $data, true/false)

      This function is used to load your View files. If you haven't read the Views section of the From 9139b0c4d57a6052b54838aedb54e70eb683f34c Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 17:59:16 +0000 Subject: [PATCH 0437/2544] --- system/libraries/Loader.php | 107 ++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 47 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 11762656..aa1ae8cb 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -34,6 +34,7 @@ class CI_Loader { var $_ci_is_php5 = FALSE; var $_ci_is_instance = FALSE; // Whether we should use $this or $CI =& get_instance() var $_ci_cached_vars = array(); + var $_ci_classes = array(); var $_ci_models = array(); var $_ci_helpers = array(); var $_ci_plugins = array(); @@ -305,17 +306,17 @@ function helper($helpers = array()) } foreach ($helpers as $helper) - { + { + $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); + if (isset($this->_ci_helpers[$helper])) { continue; } - - $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); - + if (file_exists(APPPATH.'helpers/'.$helper.EXT)) - { - include(APPPATH.'helpers/'.$helper.EXT); + { + include_once(APPPATH.'helpers/'.$helper.EXT); } else { @@ -330,6 +331,7 @@ function helper($helpers = array()) } $this->_ci_helpers[$helper] = TRUE; + } log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); @@ -371,14 +373,14 @@ function plugin($plugins = array()) } foreach ($plugins as $plugin) - { + { + $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); + if (isset($this->_ci_plugins[$plugin])) { continue; } - - $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); - + if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) { include(APPPATH.'plugins/'.$plugin.EXT); @@ -441,13 +443,13 @@ function script($scripts = array()) } foreach ($scripts as $script) - { + { + $script = strtolower(str_replace(EXT, '', $script)); + if (isset($this->_ci_scripts[$script])) { continue; } - - $script = strtolower(str_replace(EXT, '', $script)); if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) { @@ -455,8 +457,6 @@ function script($scripts = array()) } include(APPPATH.'scripts/'.$script.EXT); - - $this->_ci_scripts[$script] = TRUE; } log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); @@ -534,6 +534,30 @@ function scaffolding($table = '') */ function _ci_load($data) { + // Set the default data variables + foreach (array('view', 'vars', 'path', 'return') as $val) + { + $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; + } + + // Set the path to the requested file + if ($path == '') + { + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.EXT : $view; + $path = $this->_ci_view_path.$file; + } + else + { + $x = explode('/', $path); + $file = end($x); + } + + if ( ! file_exists($path)) + { + show_error('Unable to load the requested file: '.$file); + } + // This allows anything loaded using $this->load (views, files, etc.) // to become accessible from within the Controller and Model functions. // Only needed when running PHP 5 @@ -550,12 +574,6 @@ function _ci_load($data) } } - // Set the default data variables - foreach (array('view', 'vars', 'path', 'return') as $val) - { - $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; - } - /* * Extract and cache variables * @@ -570,19 +588,6 @@ function _ci_load($data) } extract($this->_ci_cached_vars); - // Set the path to the requested file - if ($path == '') - { - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.EXT : $view; - $path = $this->_ci_view_path.$file; - } - else - { - $x = explode('/', $path); - $file = end($x); - } - /* * Buffer the output * @@ -595,11 +600,6 @@ function _ci_load($data) * can intercept the content right before it's sent to * the browser and then stop the timer it won't be accurate. */ - if ( ! file_exists($path)) - { - show_error('Unable to load the requested file: '.$file); - } - ob_start(); // If the PHP installation does not support short tags we'll @@ -682,19 +682,32 @@ function _ci_load_class($class, $params = NULL) } // Lets search for the requested library file and load it. + $is_duplicate = FALSE; for ($i = 1; $i < 3; $i++) { - $path = ($i % 2) ? APPPATH : BASEPATH; - if (file_exists($path.'libraries/'.$class.EXT)) + $path = ($i % 2) ? APPPATH : BASEPATH; + + $fp = $path.'libraries/'.$class.EXT; + + // Safety: Was the class already loaded by a previous call? + if (in_array($fp, $this->_ci_classes) OR ! file_exists($fp)) { - include($path.'libraries/'.$class.EXT); - return $this->_ci_init_class($class, '', $params); + $is_duplicate = TRUE; + continue; } + + include($fp); + $this->_ci_classes[] = $fp; + return $this->_ci_init_class($class, '', $params); + } + + // If we got this far we were unable to find the requested class. + // We do not issue errors if the load call failed due to a duplicate request + if ($is_duplicate == FALSE) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); } - - // If we got this far we were unable to find the requested class - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); } // -------------------------------------------------------------------- From 69d3984b0b2ee417c98573185edfd47c3087539b Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:01:00 +0000 Subject: [PATCH 0438/2544] --- system/libraries/Loader.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index aa1ae8cb..5db9886b 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -686,11 +686,16 @@ function _ci_load_class($class, $params = NULL) for ($i = 1; $i < 3; $i++) { $path = ($i % 2) ? APPPATH : BASEPATH; - $fp = $path.'libraries/'.$class.EXT; + // Does the file exist? No? Bummer... + if ( ! file_exists($fp)) + { + continue; + } + // Safety: Was the class already loaded by a previous call? - if (in_array($fp, $this->_ci_classes) OR ! file_exists($fp)) + if (in_array($fp, $this->_ci_classes)) { $is_duplicate = TRUE; continue; From 41ac09fa04db283003f7eab7adac0c584e0e6a84 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:10:10 +0000 Subject: [PATCH 0439/2544] --- system/application/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/application/index.html diff --git a/system/application/index.html b/system/application/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From 7c807cba83ab368d027a28f4b84ee6a301430e80 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:13:24 +0000 Subject: [PATCH 0440/2544] --- system/helpers/text_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 1b917812..655d6e53 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -370,7 +370,7 @@ function word_wrap($str, $charlim = '76') // If so we'll join it to the output and continue if (strlen($line) <= $charlim) { - $output .= $line.$this->newline; + $output .= $line."\n"; continue; } @@ -399,7 +399,7 @@ function word_wrap($str, $charlim = '76') $output .= $line; } - $output .= $this->newline; + $output .= "\n"; } // Put our markers back From c6317e8747953575d3d4f553de37533889f504d1 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:16:12 +0000 Subject: [PATCH 0441/2544] --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index e03097ab..1d78da8a 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -83,7 +83,7 @@ function _compile_benchmarks() foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "".$key."  ".$val."\n"; + $output .= "".$key."  ".$val."\n"; } $output .= "\n"; @@ -165,7 +165,7 @@ function _compile_post() $key = "'".$key."'"; } - $output .= "$_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."\n"; + $output .= "$_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."\n"; } $output .= "\n"; From 3fc979dd87dbda346c0f8b7da78de15b6d84c64d Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:22:11 +0000 Subject: [PATCH 0442/2544] --- user_guide/general/changelog.html | 347 ------------------------------ 1 file changed, 347 deletions(-) delete mode 100644 user_guide/general/changelog.html diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html deleted file mode 100644 index 938d43a7..00000000 --- a/user_guide/general/changelog.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - -Code Igniter User Guide - - - - - - - - - - - - - - - - - - - - -

      - -
      - - - - - -

      Code Igniter User Guide Version 1.5.0

      -
      - - - - - - - - - -
      - - -
      - - - -
      - -

      Change Log

      - - -

      Version 1.5.0 Beta

      -

      Release Date: October 11, 2006

      - -
        -
      • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
      • -
      • Added Database Caching Class.
      • -
      • Added transaction support to the database classes.
      • -
      • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
      • -
      • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
      • -
      • Added HTML Table Class , enabling tables to be generated from arrays or database results.
      • -
      • Added Zip Encoding Library.
      • -
      • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
      • -
      • Added support for storing models within sub-folders.
      • -
      • Added Download Helper.
      • -
      • Added simple_query() function to the database classes
      • -
      • Added standard_date() function to the Date Helper.
      • -
      • Added $query->free_result() to database class.
      • -
      • Added $query->list_fields() function to database class
      • -
      • Added $this->db->platform() function
      • -
      • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
      • -
      • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
      • -
      • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
      • -
      • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
      • -
      • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
      • -
      • Fixed a bug in the Email class related to SMTP Helo data.
      • -
      • Fixed a bug in the validation class.
      • -
      • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
      • -
      • Deprecated $this->db->field_names() USE $this->db->list_fields()
      • - -
      - - - - -

      Version 1.4.1

      -

      Release Date: September 21, 2006

      - -
        -
      • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
      • -
      • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
      • -
      • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
      • -
      • Added $this->output->set_header() function, which allows you to set server headers.
      • -
      • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
      • -
      • Added Inflector helper.
      • -
      • Added element() function in the array helper.
      • -
      • Added RAND() to active record orderby() function.
      • -
      • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
      • -
      • Added Oracle database driver (still undergoing testing so it might have some bugs).
      • -
      • Added the ability to combine pseudo-variables and php variables in the template parser class.
      • -
      • Added output compression option to the config file.
      • -
      • Removed the is_numeric test from the db->escape() function.
      • -
      • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
      • -
      • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
      • -
      • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
      • -
      • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
      • -
      • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
      • -
      • Added some code to allow email attachments to be reset when sending batches of email.
      • -
      • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
      • -
      • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
      • -
      • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
      • -
      - - - -

      Version 1.4.0

      -

      Release Date: September 17, 2006

      - -
        -
      • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
      • -
      • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
      • -
      • Added regular expressions support for routing rules.
      • -
      • Added the ability to remap function calls within your controllers.
      • -
      • Added the ability to replace core system classes with your own classes.
      • -
      • Added support for % character in URL.
      • -
      • Added the ability to supply full URLs using the anchor() helper function.
      • -
      • Added mode parameter to file_write() helper.
      • -
      • Added support for changing the port number in the Postgre driver.
      • -
      • Moved the list of "allowed URI characters" out of the Router class and into the config file.
      • -
      • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
      • -
      • Updated the Upload class to allow the upload field name to be set when calling do_upload().
      • -
      • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
      • -
      • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
      • -
      • Updated the form_open() helper to allow the GET method to be used.
      • -
      • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
      • -
      • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
      • -
      • Updated the Models loader function to allow multiple loads of the same model.
      • -
      • Updated the MS SQL driver so that single quotes are escaped.
      • -
      • Updated the Postgre and ODBC drivers for better compatibility.
      • -
      • Removed a strtolower() call that was changing URL segments to lower case.
      • -
      • Removed some references that were interfering with PHP 4.4.1 compatibility.
      • -
      • Removed backticks from Postgre class since these are not needed.
      • -
      • Renamed display() to _display() in the Output class to make it clear that it's a private function.
      • -
      • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
      • -
      • Fixed an bug that was preventing the input class from unsetting GET variables.
      • -
      • Fixed a router bug that was making it too greedy when matching end segments.
      • -
      • Fixed a bug that was preventing multiple discreet database calls.
      • -
      • Fixed a bug in which loading a language file was producing a "file contains no data" message.
      • -
      • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
      • -
      • Fixed some missing prefixes when using the database prefix feature.
      • -
      • Fixed a typo in the Calendar class (cal_november).
      • -
      • Fixed a bug in the form_checkbox() helper.
      • -
      • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
      • -
      • Fixed an evaluation bug in the database initialization function.
      • -
      • Fixed a minor bug in one of the error messages in the language class.
      • -
      • Fixed a bug in the date helper timespan function.
      • -
      • Fixed an undefined variable in the DB Driver class.
      • -
      • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
      • -
      • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
      • -
      • Fixed a couple bugs in the Unit Testing class.
      • -
      • Fixed an incorrectly named variable in the Validation class.
      • -
      • Fixed an incorrectly named variable in the URI class.
      • -
      • Fixed a bug in the config class that was preventing the base URL from being called properly.
      • -
      • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
      • -
      • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
      • -
      • Fixed some MS SQL bugs.
      • -
      • Fixed some doc typos.
      • -
      - - - -

      Version 1.3.3

      -

      Release Date: June 1, 2006

      - -
        - -
      • Models do not connect automatically to the database as of this version. More info here. -
      • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
      • -
      • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
      • -
      • Fixed a bug in the active record "having" function.
      • -
      • Fixed a problem in the validation class which was making checkboxes be ignored when required.
      • -
      • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
      • -
      • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
      • -
      • Fixed a validation bug that was preventing rules from being set twice in one controller.
      • -
      • Fixed a calendar bug that was not letting it use dynamically loaded languages.
      • -
      • Fixed a bug in the active record class when using WHERE clauses with LIKE
      • -
      • Fixed a bug in the hash() security helper.
      • -
      • Fixed some typos.
      • -
      - - - - -

      Version 1.3.2

      -

      Release Date: April 17, 2006

      - -
        -
      • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
      • -
      • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
      • -
      • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
      • -
      • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
      • -
      • Fixed a couple bugs in the Model class.
      • -
      • Fixed some documentation typos and errata.
      • -
      - - - -

      Version 1.3.1

      -

      Release Date: April 11, 2006

      - -
        -
      • Added a Unit Testing Library.
      • -
      • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
      • -
      • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
      • -
      • Added getwhere function to Active Record class.
      • -
      • Added count_all function to Active Record class.
      • -
      • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
      • -
      • Added $this->db->last_query(), which allows you to view your last query that was run.
      • -
      • Added a new mime type to the upload class for better compatibility.
      • -
      • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
      • -
      • Fixed a bug in a couple of the active record functions (where and orderby).
      • -
      • Fixed a bug in the image library when realpath() returns false.
      • -
      • Fixed a bug in the Models that was preventing libraries from being used within them.
      • -
      • Fixed a bug in the "exact_length" function of the validation class.
      • -
      • Fixed some typos in the user guide
      • -
      - - -

      Version 1.3

      -

      Release Date: April 3, 2006

      - -
        -
      • Added support for Models.
      • -
      • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
      • -
      • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
      • -
      • Added a feature to the database class that lets you run custom function calls.
      • -
      • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
      • -
      • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
      • -
      • Added support for running standard query string URLs. These can be optionally enabled in your config file.
      • -
      • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
      • -
      • Added a new error template for use with native PHP errors.
      • -
      • Added "alternator" function in the string helpers.

        -
      • Removed slashing from the input class. After much debate we decided to kill this feature.
      • -
      • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
      • -
      • Added better class and function name-spacing to avoid collisions with user developed classes. All Code Igniter classes are now prefixed with CI_ and -all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
      • -
      • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
      • -
      • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
      • -
      • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
      • -
      • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
      • -
      • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
      • -
      • Fixed some typos in the default calendar template
      • -
      • Fixed some typos in the user guide
      • -
      - - - - - - - - -

      Version 1.2

      -

      Release Date: March 21, 2006

      - -
        -
      • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
      • -
      • Added a global function named get_instance() allowing the main Code Igniter object to be accessible throughout your own classes.
      • -
      • Added new File Helper: delete_files()
      • -
      • Added new URL Helpers: base_url(), index_page()
      • -
      • Added the ability to create your own core libraries and store them in your local application directory.
      • -
      • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
      • -
      • Added Javascript Calendar plugin.
      • -
      • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
      • -
      • Updated the parser class so that it allows tag pars within other tag pairs.
      • -
      • Fixed a bug in the DB "where" function.
      • -
      • Fixed a bug that was preventing custom config files to be auto-loaded.
      • -
      • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
      • -
      • Fixed some bugs in the xss_clean function
      • -
      - - - - - -

      Version Beta 1.1

      -

      Release Date: March 10, 2006

      - -
        -
      • Added a Calendaring class.
      • -
      • Added support for running multiple applications that share a common Code Igniter backend.
      • -
      • Moved the "uri protocol" variable from the index.php file into the config.php file
      • -
      • Fixed a problem that was preventing certain function calls from working within constructors.
      • -
      • Fixed a problem that was preventing the $this->load->library function from working in constructors.
      • -
      • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
      • -
      • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
      • -
      • Fixed a data type error in the form_radio function (form helper)
      • -
      • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
      • -
      • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
      • -
      • Fixed a pagination problem in the scaffolding.
      • -
      • Fixed a bug in the mysql class "where" function.
      • -
      • Fixed a regex problem in some code that trimmed duplicate slashes.
      • -
      • Fixed a bug in the br() function in the HTML helper
      • -
      • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
      • -
      • Removed the "style" attributes form the form helpers.
      • -
      • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
      • -
      - -

      Version Beta 1.0

      -

      Release Date: February 28, 2006

      -

      First publicly released version.

      - -
      - - - - - - - \ No newline at end of file From 1b90c27c46dde1b5cc79a295c5e36f402a144063 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 31 Oct 2006 18:22:29 +0000 Subject: [PATCH 0443/2544] --- system/codeigniter/CodeIgniter.php | 3 ++- user_guide/changelog.html | 11 +++++++++++ user_guide/images/appflowchart.gif | Bin 25273 -> 25276 bytes user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/license.html | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 3e2b99de..367d5eaa 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -27,7 +27,8 @@ * @link http://www.codeigniter.com/user_guide/ */ -define('APPVER', '1.5.0'); +// CI Version +define('APPVER', '1.5.0.1'); /* * ------------------------------------------------------ diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c9dc7406..26d340b9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,6 +62,16 @@

      Change Log

      +

      Version 1.5.0.1

      +

      Release Date: October 31, 2006

      +
        +
      • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
      • +
      • Fixed a bug in the word_wrap() helper function.
      • +
      • Fixed an invalid color Hex number in the Profiler class.
      • +
      • Fixed a corrupted image in the user guide.
      • +
      + +

      Version 1.5.0

      Release Date: October 30, 2006

      @@ -104,6 +114,7 @@

      Version 1.5.0

    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • +
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • diff --git a/user_guide/images/appflowchart.gif b/user_guide/images/appflowchart.gif index 5ca1ade4cdf77b99b919007ad91b3418ccc2ae94..422332c9e21ceb09a535d098407f52effc392baa 100644 GIT binary patch delta 816 zcmW-fe=O8-7{`6@{5pJe%K33|KRC_}7k8Z>Idw4#T9ka`&jCsa~X>mUy`hbXSVsNQj)vN$H7ne!Rg!8IR5l1|;dy7_TiD^2}U zSuQ;vQRTcse9a>N6Zkyy8NtCNK?DT7f_=r&A8w=K{hwfEQz!=d20Q?c2Y3P(0zQD; zFS-aa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s-s4+OB8{>%$&$#jC`NW4ZVD*1ST}yp4=r#K^Bp(5b@#YR#2?2uOzmuo*StvogdX&L1J@l?bo`^ z#lh?Q2S5)gwlRcJT2j`Kesgx4mzC%u8ZmqwjR`XProcessing an Image $config['width'] = 75;
      $config['height'] = 50;

      -$this->image_lib->initialize($config); +$this->load->library('image_lib', $config);

      $this->image_lib->resize();
      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index c7cf82d4..448ba4c4 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -93,7 +93,7 @@

      $this->load->view('file_name', $data, true/fals

      This function is used to load your View files. If you haven't read the Views section of the user guide it is recommended that you do since it shows you how this function is typically used.

      -

      The first parameter is required. It is the name of the view file you would like to load.

      +

      The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other then .php.

      The second optional parameter can take an associative array or an object as input, which it runs through the PHP extract function to diff --git a/user_guide/license.html b/user_guide/license.html index a0b68766..3c07c79c 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -103,7 +103,7 @@

      Limitations of Liability

         ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Change Log +Next Topic:  Change Log

      Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

      From afde68a64095e6408f5f28962405c4586d9eb4c6 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 03:44:36 +0000 Subject: [PATCH 0444/2544] --- system/libraries/Input.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 8408b16f..b630bf6b 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -436,7 +436,6 @@ function xss_clean($str, $charset = 'ISO-8859-1') * these are the ones that will pose security problems. * */ - if (preg_match_all("/<(.+?)>/si", $str, $matches)) { for ($i = 0; $i < count($matches['0']); $i++) From fc84bd259cb4ce5143148a840c96d638945985f8 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:25:41 +0000 Subject: [PATCH 0445/2544] --- system/database/drivers/mssql/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/mssql/index.html diff --git a/system/database/drivers/mssql/index.html b/system/database/drivers/mssql/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/mssql/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From 06f3be8ac351235d6e6db4cd9f61c281f3a43cc2 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:25:54 +0000 Subject: [PATCH 0446/2544] --- system/database/drivers/mysql/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/mysql/index.html diff --git a/system/database/drivers/mysql/index.html b/system/database/drivers/mysql/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/mysql/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From 8508cae2ca1b98799f8fad55ca2e5c4c863b4c18 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:26:06 +0000 Subject: [PATCH 0447/2544] --- system/database/drivers/mysqli/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/mysqli/index.html diff --git a/system/database/drivers/mysqli/index.html b/system/database/drivers/mysqli/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/mysqli/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From a176f26c4a0e26443c073fe9ecc121df23e94502 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:26:40 +0000 Subject: [PATCH 0448/2544] --- system/database/drivers/oci8/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/oci8/index.html diff --git a/system/database/drivers/oci8/index.html b/system/database/drivers/oci8/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/oci8/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From b95b6d2dc7ffc3bcc18bfffdea3d43c0915590ce Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:26:58 +0000 Subject: [PATCH 0449/2544] --- system/database/drivers/odbc/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/odbc/index.html diff --git a/system/database/drivers/odbc/index.html b/system/database/drivers/odbc/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/odbc/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From 1a726a6a21d2ef2b6402d9027aab29544655760d Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:27:15 +0000 Subject: [PATCH 0450/2544] --- system/database/drivers/postgre/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/postgre/index.html diff --git a/system/database/drivers/postgre/index.html b/system/database/drivers/postgre/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/postgre/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From 2f0dc10e48e3f766ff558fd8856a45205881512f Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Nov 2006 05:27:25 +0000 Subject: [PATCH 0451/2544] --- system/database/drivers/sqlite/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/database/drivers/sqlite/index.html diff --git a/system/database/drivers/sqlite/index.html b/system/database/drivers/sqlite/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/database/drivers/sqlite/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

      Directory access is forbidden.

      + + + + \ No newline at end of file From c50747cfe50a4c6b7e8bde81d0f56c3bd26bd29a Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 3 Nov 2006 17:17:02 +0000 Subject: [PATCH 0452/2544] --- system/database/DB_active_rec.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index b41b929d..90f58ae0 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -486,8 +486,9 @@ function get($table = '', $limit = null, $offset = null) $sql = $this->_compile_select(); + $result = $this->query($sql); $this->_reset_select(); - return $this->query($sql); + return $result; } // -------------------------------------------------------------------- @@ -522,8 +523,9 @@ function getwhere($table = '', $where = null, $limit = null, $offset = null) $sql = $this->_compile_select(); + $result = $this->query($sql); $this->_reset_select(); - return $this->query($sql); + return $result; } // -------------------------------------------------------------------- From be013b3270f751e248efcbe82d5ea28e9386ce05 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 4 Nov 2006 05:07:03 +0000 Subject: [PATCH 0453/2544] --- system/libraries/Loader.php | 106 +++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 5db9886b..41c0a9b9 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -71,12 +71,25 @@ function CI_Loader() * @param mixed the optional parameters * @return void */ - function library($class, $params = NULL) + function library($library = '', $params = NULL) { - if ($class == '') - return; - - $this->_ci_load_class($class, $params); + if ($library == '') + { + return FALSE; + } + + if (is_array($library)) + { + foreach ($library as $class) + { + $this->_ci_load_class($class, $params); + } + } + else + { + $this->_ci_load_class($library, $params); + } + $this->_ci_assign_to_models(); } @@ -621,8 +634,7 @@ function _ci_load($data) if ($return === TRUE) { $buffer = ob_get_contents(); - ob_end_clean(); - + @ob_end_clean(); return $buffer; } @@ -645,7 +657,7 @@ function _ci_load($data) // PHP 4 requires that we use a global global $OUT; $OUT->set_output(ob_get_contents()); - ob_end_clean(); + @ob_end_clean(); } } @@ -663,49 +675,53 @@ function _ci_load($data) */ function _ci_load_class($class, $params = NULL) { - // Prep the class name - $class = ucfirst(strtolower(str_replace(EXT, '', $class))); - - // Is this a class extension request? - if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) - { - if ( ! file_exists(BASEPATH.'libraries/'.$class.EXT)) - { - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); - } - - include(BASEPATH.'libraries/'.ucfirst($class).EXT); - include(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); - - return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); - } + // Get the class name + $class = str_replace(EXT, '', $class); - // Lets search for the requested library file and load it. - $is_duplicate = FALSE; - for ($i = 1; $i < 3; $i++) + // We'll test for both lowercase and capitalized versions of the file name + foreach (array(ucfirst($class), strtolower($class)) as $class) { - $path = ($i % 2) ? APPPATH : BASEPATH; - $fp = $path.'libraries/'.$class.EXT; - - // Does the file exist? No? Bummer... - if ( ! file_exists($fp)) + // Is this a class extension request? + if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) { - continue; + if ( ! file_exists(BASEPATH.'libraries/'.ucfirst($class).EXT)) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + + include(BASEPATH.'libraries/'.ucfirst($class).EXT); + include(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); } - - // Safety: Was the class already loaded by a previous call? - if (in_array($fp, $this->_ci_classes)) + + // Lets search for the requested library file and load it. + $is_duplicate = FALSE; + for ($i = 1; $i < 3; $i++) { - $is_duplicate = TRUE; - continue; + $path = ($i % 2) ? APPPATH : BASEPATH; + $fp = $path.'libraries/'.$class.EXT; + + // Does the file exist? No? Bummer... + if ( ! file_exists($fp)) + { + continue; + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($fp, $this->_ci_classes)) + { + $is_duplicate = TRUE; + continue; + } + + include($fp); + $this->_ci_classes[] = $fp; + return $this->_ci_init_class($class, '', $params); } - - include($fp); - $this->_ci_classes[] = $fp; - return $this->_ci_init_class($class, '', $params); - } - + } // END FOREACH + // If we got this far we were unable to find the requested class. // We do not issue errors if the load call failed due to a duplicate request if ($is_duplicate == FALSE) From 40d299e8221ba5d641e07c18ef19f4ac13ff9b85 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 4 Nov 2006 05:07:59 +0000 Subject: [PATCH 0454/2544] --- system/codeigniter/CodeIgniter.php | 2 +- system/helpers/html_helper.php | 21 +++++++++++++++++++++ system/helpers/url_helper.php | 4 ++-- system/scaffolding/views/header.php | 2 -- user_guide/changelog.html | 8 ++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 367d5eaa..88659a74 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -132,7 +132,7 @@ // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! @include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index e32abfbf..90a77638 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -178,6 +178,27 @@ function nbs($num = 1) return str_repeat(" ", $num); } +// ------------------------------------------------------------------------ + +/** + * Generates meta tags from an array of key/values + * + * @access public + * @param array + * @return string + */ +function meta($meta = array(), $newline = "\n") +{ + $str = ''; + foreach ($meta as $key => $val) + { + $str .= ''.$newline; + } + + return $str; +} + + ?> \ No newline at end of file diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 9010a06a..3ca59746 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -442,9 +442,9 @@ function redirect($uri = '', $method = 'location') { switch($method) { - case 'refresh' : header("Refresh:0;url=".site_url($uri)); + case 'refresh' : header("Refresh:0;url=".site_url($uri)); break; - default : header("location:".site_url($uri)); + default : header("location:".site_url($uri)); break; } exit; diff --git a/system/scaffolding/views/header.php b/system/scaffolding/views/header.php index 7ab60fd8..50f234a4 100644 --- a/system/scaffolding/views/header.php +++ b/system/scaffolding/views/header.php @@ -8,8 +8,6 @@ file(BASEPATH.'scaffolding/views/stylesheet.css'); ?> - - diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 26d340b9..644f24fe 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,6 +62,14 @@

      Change Log

      +

      Version 1.5.0.2

      +

      Release Date: November 4, 2006

      +
        +
      • Fixed a bug in the active record class that was not resetting query data after a completed query.
      • +
      • Fixed a bug that was supressing errors in controllers.
      • +
      + +

      Version 1.5.0.1

      Release Date: October 31, 2006

        From ebfa686046bb98c757d1b41c81eb867478036e68 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 5 Nov 2006 21:31:00 +0000 Subject: [PATCH 0455/2544] --- system/libraries/Ftp.php | 2 +- system/libraries/Profiler.php | 2 +- system/libraries/User_agent.php | 2 +- system/libraries/Zip.php | 2 +- user_guide/changelog.html | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 1572a587..f213736f 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Libraries * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/libraries/encryption.html + * @link http://www.codeigniter.com/user_guide/libraries/ftp.html */ class CI_FTP { diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 1d78da8a..5b0f6e2b 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -28,7 +28,7 @@ * @subpackage Libraries * @category Libraries * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/libraries/benchmark.html + * @link http://www.codeigniter.com/user_guide/general/profiling.html */ class CI_Profiler { diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index b217367f..8d160672 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -24,7 +24,7 @@ * @subpackage Libraries * @category User Agent * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/libraries/uri.html + * @link http://www.codeigniter.com/user_guide/libraries/user_agent.html */ class CI_User_agent { diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 828ef0c2..1ff175fe 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -28,7 +28,7 @@ * @subpackage Libraries * @category Encryption * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/general/encryption.html + * @link http://www.codeigniter.com/user_guide/libraries/zip.html */ class CI_Zip { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 644f24fe..477814d7 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,6 +65,8 @@

        Change Log

        Version 1.5.0.2

        Release Date: November 4, 2006

          +
        • Added support for submitting arrays of libraries in the $this->load->library function.
        • +
        • Added support for naming custom library files in lower or uppercase.
        • Fixed a bug in the active record class that was not resetting query data after a completed query.
        • Fixed a bug that was supressing errors in controllers.
        From 325197e700564f8e4e0ba7c9fc82abfd85f451b0 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 20 Nov 2006 17:29:05 +0000 Subject: [PATCH 0456/2544] --- system/application/config/config.php | 4 ++-- system/codeigniter/Common.php | 8 +++---- system/database/drivers/oci8/oci8_result.php | 24 +++++++++----------- system/libraries/Exceptions.php | 6 +++-- system/libraries/Input.php | 6 +++-- system/libraries/User_agent.php | 1 + user_guide/changelog.html | 3 +++ user_guide/database/caching.html | 2 +- user_guide/database/helpers.html | 4 +++- user_guide/database/utilities.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/core_classes.html | 8 +++++++ user_guide/general/views.html | 8 +++++++ user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/text_helper.html | 8 +++---- user_guide/installation/downloads.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 4 ++-- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- 23 files changed, 65 insertions(+), 41 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 2f385a6e..b1598b34 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -223,9 +223,9 @@ $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_encrypt_cookie'] = FALSE; -$config['sess_use_database'] = TRUE; +$config['sess_use_database'] = FALSE; $config['sess_table_name'] = 'ci_sessions'; -$config['sess_match_ip'] = TRUE; +$config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = TRUE; /* diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 41e13bee..4576cd96 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -106,14 +106,14 @@ function &get_config() { if ( ! file_exists(APPPATH.'config/config'.EXT)) { - show_error('The configuration file config'.EXT.' does not exist.'); + exit('The configuration file config'.EXT.' does not exist.'); } require(APPPATH.'config/config'.EXT); if ( ! isset($config) OR ! is_array($config)) { - show_error('Your config file does not appear to be formatted correctly.'); + exit('Your config file does not appear to be formatted correctly.'); } $main_conf[0] =& $config; @@ -210,8 +210,8 @@ function log_message($level = 'error', $message, $php_error = FALSE) /** * Exception Handler * -* This is the custom exception handler we defined at the -* top of this file. The main reason we use this is permit +* This is the custom exception handler that is declaired at the top +* of Codeigniter.php. The main reason we use this is permit * PHP errors to be logged in our own log files since we may * not have access to server logs. Since this function * effectively intercepts PHP errors, however, we also need diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index af30457b..fb4ed1f0 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -31,21 +31,24 @@ class CI_DB_oci8_result extends CI_DB_result { var $limit_used; /** - * Number of rows in the result set + * Number of rows in the result set. + * + * Oracle doesn't have a graceful way to retun the number of rows + * so we have to use what amounts to a hack. + * * * @access public * @return integer */ function num_rows() { - if (function_exists('oci_num_rows')) - { - return @oci_num_rows($this->stmt_id); - } - else + $rowcount = count($this->result_array()); + @ociexecute($this->stmt_id); + if ($this->curs_id) { - return @ocirowcount($this->stmt_id); + @ociexecute($this->curs_id); } + return $rowcount; } // -------------------------------------------------------------------- @@ -175,12 +178,7 @@ function _fetch_object() { $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; - while ($row = oci_fetch_object($id)) - { - $result[] = $row; - } - - return $result; + return @oci_fetch_object($id); } // If PHP 4 is being used we have to build our own result diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 8f90ff8f..83909391 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -30,6 +30,7 @@ class CI_Exceptions { var $message; var $filename; var $line; + var $ob_level; var $levels = array( E_ERROR => 'Error', @@ -53,6 +54,7 @@ class CI_Exceptions { */ function CI_Exceptions() { + $this->ob_level = ob_get_level(); // Note: Do not log messages from this constructor. } @@ -115,7 +117,7 @@ function show_error($heading, $message, $template = 'error_general') { $message = '

        '.implode('

        ', ( ! is_array($message)) ? array($message) : $message).'

        '; - if (ob_get_level() > 1) + if (ob_get_level() > $this->ob_level + 1) { ob_end_flush(); } @@ -151,7 +153,7 @@ function show_php_error($severity, $message, $filepath, $line) $filepath = $x[count($x)-2].'/'.end($x); } - if (ob_get_level() > 1) + if (ob_get_level() > $this->ob_level + 1) { ob_end_flush(); } diff --git a/system/libraries/Input.php b/system/libraries/Input.php index b630bf6b..80176207 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -73,13 +73,15 @@ function _sanitize_globals() { if ( ! is_array($global)) { - unset($$global); + global $global; + $$global = NULL; } else { foreach ($global as $key => $val) { - unset($$key); + global $$key; + $$key = NULL; } } } diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 8d160672..95eccd12 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -186,6 +186,7 @@ function _set_browser() $this->is_browser = TRUE; $this->version = $match[1]; $this->browser = $val; + $this->_set_mobile(); return TRUE; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 477814d7..461142fd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,9 @@

        Version 1.5.0.2

      • Added support for naming custom library files in lower or uppercase.
      • Fixed a bug in the active record class that was not resetting query data after a completed query.
      • Fixed a bug that was supressing errors in controllers.
      • +
      • Fixed a problem that can cause a loop to occur when the config file is missing.
      • +
      • Fixed some bugs in the Oracle DB driver.
      • +
      • Fixed some doc typos.
      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 9a16a8f8..615f74c9 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -216,7 +216,7 @@

      $this->db->cache_delete_all()

         ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Database Export Class +Next Topic:  Database Utilities Class

      Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 2b552f1c..5ffe0c85 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -117,6 +117,8 @@

      $this->db->insert_string();

      The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

      INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@your-site.com', 'www.your-site.com') +

      Note: Values are automatically escaped, producing safer queries.

      +

      $this->db->update_string();

      @@ -132,7 +134,7 @@

      $this->db->update_string();

      The first parameter is the table name, the second is an associative array with the data to be inserted, and the third parameter is the "where" clause. The above example produces:

      UPDATE exp_weblog SET name = 'Rick', email = 'rick@your-site.com', url = 'www.your-site.com' WHERE author_id = 1 AND status = 'active' - +

      Note: Values are automatically escaped, producing safer queries.

      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index a9227ab2..3027b68e 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -325,7 +325,7 @@

      Description of Backup Preferences

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 1fa93bf1..25054c7e 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -230,7 +230,7 @@

      Setting Preferences

      $config['max_width'] = '1024';
      $config['max_height'] = '768';

      -$this->load->library('ftp', $config);

      +$this->load->library('upload', $config);

      // Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
      $this->upload->initialize($config);
      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 0bec3a82..014b94d2 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -63,8 +63,8 @@

      FTP Class

      -

      Code Igniter's FTP Class permits files to be uploaded, moved, renamed, and deleted on your server. It also includes a "mirroring" function -that permits a local directory to be recreated remotely via FTP.

      +

      Code Igniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, +and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

      Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index ed6260f4..01796528 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -238,7 +238,7 @@

      Session Preferences

      sess_encrypt_cookie -TRUE +FALSE TRUE/FALSE (boolean) Whether to encrypt the session data. diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 692df003..0ebb4011 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -155,7 +155,7 @@

      Strict Mode

      To enable strict mode use this:

      -$this->unit->strict(TRUE); +$this->unit->use_strict(TRUE);

      Enabling/Disabling Unit Testing

      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 9421e0fe..01a88d78 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -485,7 +485,7 @@

      Data Types

         ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Array Helper +Next Topic:  Zip Encoding Class

      Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

      From 205971012e9cd8e2cebf2ea798f45629f9849723 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 20 Nov 2006 17:33:06 +0000 Subject: [PATCH 0457/2544] --- user_guide/changelog.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 461142fd..45bafce1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,13 +63,15 @@

      Change Log

      Version 1.5.0.2

      -

      Release Date: November 4, 2006

      +

      Release Date: November 20, 2006

      • Added support for submitting arrays of libraries in the $this->load->library function.
      • Added support for naming custom library files in lower or uppercase.
      • +
      • Fixed a bug related to output buffering.
      • Fixed a bug in the active record class that was not resetting query data after a completed query.
      • -
      • Fixed a bug that was supressing errors in controllers.
      • +
      • Fixed a bug that was suppressing errors in controllers.
      • Fixed a problem that can cause a loop to occur when the config file is missing.
      • +
      • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
      • Fixed some bugs in the Oracle DB driver.
      • Fixed some doc typos.
      From 6b151050a80aa62808a5afc5a4c934f8bfb47512 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 23 Nov 2006 18:08:26 +0000 Subject: [PATCH 0458/2544] --- system/database/drivers/mysqli/mysqli_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index be7ec356..57c89ea8 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -63,7 +63,7 @@ function num_fields() function list_fields() { $field_names = array(); - while ($field = mysql_fetch_field($this->result_id)) + while ($field = mysqli_fetch_field($this->result_id)) { $field_names[] = $field->name; } From 9241af3229855ace0b74f1929feec971ec61591d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 23 Nov 2006 18:18:30 +0000 Subject: [PATCH 0459/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 45bafce1..06534af4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,6 +73,7 @@

      Version 1.5.0.2

    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • +
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.
    From 257651d498cbd8c998520b12a1001524cfb88d69 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 23 Nov 2006 18:40:13 +0000 Subject: [PATCH 0460/2544] --- system/application/config/database.php | 2 +- system/codeigniter/CodeIgniter.php | 2 +- user_guide/changelog.html | 4 ++-- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 4 ++-- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 103 files changed, 105 insertions(+), 105 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index 5cfd7634..5293a5a6 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -43,7 +43,7 @@ $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; -$db['default']['cachedir'] = APPPATH.'dbcache/'; +$db['default']['cachedir'] = ""; ?> \ No newline at end of file diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 88659a74..3008b2ff 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -28,7 +28,7 @@ */ // CI Version -define('APPVER', '1.5.0.1'); +define('APPVER', '1.5.0.2'); /* * ------------------------------------------------------ diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 06534af4..f9f53b1d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -33,7 +33,7 @@
    - +

    Code Igniter User Guide Version 1.5.0

    Code Igniter User Guide Version 1.5.1

    @@ -63,7 +63,7 @@

    Change Log

    Version 1.5.0.2

    -

    Release Date: November 20, 2006

    +

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 0db83d2d..6f842f47 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 615f74c9..6eb654ab 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index b19d9d70..831d6e8a 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index f49184d0..2e539597 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index f50f530a..cd09e07f 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 560c6f0e..80c0f233 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index dbeb541e..d6f273ed 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 5ffe0c85..ccd30696 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 812fcaad..d17e7052 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 916ff227..ca618f17 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index c886f4e3..846504fd 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 109f988a..b105b00c 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 27f1ba9f..9330faf4 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 3027b68e..dfe979c1 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 2018bf26..89e53fd0 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index d79de4c1..b40905c3 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 89768569..c16ad4cd 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index f62c53db..8352fcd0 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index a388b9f7..ef2d3fac 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 92c35c70..aa64bb43 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 8e17ad3f..11a62c97 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 3ff4b175..a3bfaa34 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 99dba91f..af7ae4b9 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 823a4275..e346bd67 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index a932d743..86082d2e 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 8d3eb07f..daef0008 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 3d834b8e..74782269 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 387368b6..58712c70 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index b0a10834..5ca1ae8b 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index ca8df3cd..61f4574a 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 92b77a79..77bb9eb1 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 13bd1f82..b3154f40 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 2a2db5ad..1163e6d5 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index d5377f15..e8d074e7 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index a9c8db28..ea511373 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/security.html b/user_guide/general/security.html index d7e552e3..083be367 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 9e65e4f4..f493c69b 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index fa7f5eb7..a8d0fec2 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index b3d59c53..a3f66fb5 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index d6b64160..4592a2ff 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 0cf78848..c6df300b 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 822e29af..bc1e9050 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 9a29abb1..c89257af 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index aeba68d2..68ce66eb 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 6d1402df..3dcb147b 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index d246c927..8a81dde5 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 4222405b..67016035 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index db203cdd..3ac47a04 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 1fcb9115..0fc96628 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 36ea2621..dd04451a 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 04310241..9a6fc358 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 9cdada2d..bafc6ac0 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 19550059..b1d08412 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 33a933d7..4f4ac95e 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 5d7496f6..119e8d20 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/index.html b/user_guide/index.html index b2a0dcb9..8c8ca265 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index ca0e5829..88ef4748 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -33,7 +33,7 @@
      - +

      Code Igniter User Guide Version 1.5.0

      Code Igniter User Guide Version 1.5.1

      @@ -63,7 +63,7 @@

      Downloading Code Igniter

        -
      • Code Igniter V 1.5.0 (Current version)
      • +
      • Code Igniter V 1.5.2 (Current version)
      • Code Igniter V 1.4.1
      • Code Igniter V 1.3.3
      • Code Igniter V 1.3.2
      • diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index f339fe83..4e4aa41d 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 168e5977..733012fa 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 93757c87..b3817668 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index da4ad405..ee26595e 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 101ac537..a494a092 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 99571c16..df1a0719 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index e8220bdc..e6570404 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index dbc628a6..bed67597 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 929608c2..850c8ea4 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index f975f532..5657595a 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 9a78dd55..79bf31d6 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 51be6897..04afb929 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 7ed45586..35ba9cec 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index ff61701a..a21812e0 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index c88b5d67..5c62f8a6 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 42d11255..0ce1813c 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 34cacf5c..3cb42dca 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 25054c7e..69fa2dfc 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 014b94d2..4e97f18c 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 5b4575b0..22c71c44 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 292f967b..7c3cc640 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 3ecadec4..139c2d52 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 448ba4c4..d1784c5e 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 0ebaaedd..ec76947b 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index a2bfc25f..c83f71ae 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index e187c49a..880d2d4e 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 01796528..184eaec1 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index fe2f0c29..1214d0e9 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 4a4d9948..247347d9 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 0ebb4011..d97fa6d4 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index efb0a874..546d936c 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 1426a4a5..9649b013 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 0c1288f5..dc74439b 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 01a88d78..5a6bebcf 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 67dc039c..fabe8a4f 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/license.html b/user_guide/license.html index 3c07c79c..e4801817 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 69cc2550..21d788d5 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 38cb203d..d3d5e805 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 6b570d86..ed3a670f 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index dff233cd..aea64f23 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index b8e9fd78..8796934b 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 21ac6aa4..d081161e 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -33,7 +33,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        diff --git a/user_guide/toc.html b/user_guide/toc.html index 7b5bd695..8632ac9f 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -34,7 +34,7 @@
        - +

        Code Igniter User Guide Version 1.5.0

        Code Igniter User Guide Version 1.5.1

        From d1c638f0e9d1d838d80ff3641f1dc889f488cbf6 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 23 Nov 2006 18:56:39 +0000 Subject: [PATCH 0461/2544] --- system/database/DB_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 03631d69..2a8510e1 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -372,8 +372,8 @@ function load_rdriver() if ( ! class_exists($driver)) { - include(BASEPATH.'database/DB_result'.EXT); - include(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + include_once(BASEPATH.'database/DB_result'.EXT); + include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); } return $driver; From 6f62816ef1212a501d5f6c27110e2e5d81a6ebe2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 24 Nov 2006 01:17:45 +0000 Subject: [PATCH 0462/2544] --- system/libraries/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 41c0a9b9..0947046e 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -146,7 +146,7 @@ function model($model, $name = '', $db_conn = FALSE) show_error('Unable to locate the model you have specified: '.$model); } - if ($db_conn !== FALSE) + if ($db_conn !== FALSE AND ! class_exists('CI_DB')) { if ($db_conn === TRUE) $db_conn = ''; From 30c536dcd4e54613e3daa6af02ba6701b6d42832 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 24 Nov 2006 01:20:11 +0000 Subject: [PATCH 0463/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f9f53b1d..c5e369f3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

        Version 1.5.0.2

      • Fixed a bug in the active record class that was not resetting query data after a completed query.
      • Fixed a bug that was suppressing errors in controllers.
      • Fixed a problem that can cause a loop to occur when the config file is missing.
      • +
      • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
      • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
      • Fixed some bugs in the Oracle DB driver.
      • Fixed an incorrectly named variable in the MySQLi result driver.
      • From fc38deab8b258cafb3fe7fefb26c70e38f7db6bc Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Jan 2007 19:47:05 +0000 Subject: [PATCH 0464/2544] --- user_guide/libraries/input.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 7c3cc640..4fef7091 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -183,7 +183,7 @@

        $this->input->valid_ip($ip)

        Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

        -if ( ! valid_id($ip))
        +if ( ! valid_ip($ip))
        {
             echo 'Not Valid';
        }
        From 40a7c6805f4a65605963f10dc2db0fc748710779 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Sat, 13 Jan 2007 00:03:37 +0000 Subject: [PATCH 0465/2544] --- system/libraries/Input.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 80176207..4fd2061c 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -366,14 +366,14 @@ function user_agent() * XSS Clean * * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented.Ê This function does a fair amount of work but + * prevented.  This function does a fair amount of work but * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts.Ê Nothing is ever 100% foolproof, + * most obscure XSS attempts.  Nothing is ever 100% foolproof, * of course, but I haven't been able to get anything passed * the filter. * * Note: This function should only be used to deal with data - * upon submission.Ê It's not something that should + * upon submission.  It's not something that should * be used for general runtime processing. * * This function was based in part on some code and ideas I @@ -447,6 +447,24 @@ function xss_clean($str, $charset = 'ISO-8859-1') $str); } } + + /* + * Not Allowed Under Any Conditions + */ + $bad = array( + 'document.cookie' => '[removed]', + 'document.write' => '[removed]', + 'window.location' => '[removed]', + "javascript\s*:" => '[removed]', + "Redirect\s+302" => '[removed]', + '' => '-->' + ); + + foreach ($bad as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } /* * Convert all tabs to spaces @@ -542,11 +560,11 @@ function xss_clean($str, $charset = 'ISO-8859-1') * */ $bad = array( - 'document.cookie' => '', - 'document.write' => '', - 'window.location' => '', - "javascript\s*:" => '', - "Redirect\s+302" => '', + 'document.cookie' => '[removed]', + 'document.write' => '[removed]', + 'window.location' => '[removed]', + "javascript\s*:" => '[removed]', + "Redirect\s+302" => '[removed]', '' => '-->' ); From 986cad50868e0762a861a936f66f99acbdddc972 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Jan 2007 20:44:14 +0000 Subject: [PATCH 0466/2544] test commit --- license.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/license.txt b/license.txt index 4476208a..01ee741c 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2006, pMachine, Inc. +Copyright (c) 2006-2007, pMachine, Inc. All rights reserved. This license is a legal agreement between you and pMachine Inc. for the use From db0c780b5111702aba3a48087bacdbdfc746037c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Jan 2007 20:44:31 +0000 Subject: [PATCH 0467/2544] --- license.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/license.txt b/license.txt index 01ee741c..4476208a 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2006-2007, pMachine, Inc. +Copyright (c) 2006, pMachine, Inc. All rights reserved. This license is a legal agreement between you and pMachine Inc. for the use From c64099442e381a284b5b7cd1a86ef3dafe8a65c3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 14:23:27 +0000 Subject: [PATCH 0468/2544] assoc_to_uri() incorrectly said assoc_to_str() --- user_guide/libraries/uri.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 546d936c..7e8f2d7d 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -183,7 +183,7 @@

        $this->uri->assoc_to_uri()

        $array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');

        -$str = $this->uri->assoc_to_str($array);
        +$str = $this->uri->assoc_to_uri($array);

        // Produces: product/shoes/size/large/color/red
        From 17f4d73ff388dbcb4d9fbd4f79a0f9150ddc8c7e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 17:23:13 +0000 Subject: [PATCH 0469/2544] unset the value attribute in textarea --- system/helpers/form_helper.php | 806 +++++++++++++++++---------------- 1 file changed, 404 insertions(+), 402 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 7d594d72..8186d4cc 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1,403 +1,405 @@ -config->site_url($action).'"'; - - if ( ! isset($attributes['method'])) - { - $form .= ' method="post"'; - } - - if (is_array($attributes) AND count($attributes) > 0) - { - foreach ($attributes as $key => $val) - { - $form .= ' '.$key.'="'.$val.'"'; - } - } - - $form .= '>'; - - if (is_array($hidden) AND count($hidden > 0)) - { - $form .= form_hidden($hidden); - } - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Form Declaration - Multipart type - * - * Creates the opening portion of the form, but with "multipart/form-data". - * - * @access public - * @param string the URI segments of the form destination - * @param array a key/value pair of attributes - * @param array a key/value pair hidden data - * @return string - */ -function form_open_multipart($action, $attributes = array(), $hidden = array()) -{ - $attributes['enctype'] = 'multipart/form-data'; - return form_open($action, $attributes, $hidden); -} - -// ------------------------------------------------------------------------ - -/** - * Hidden Input Field - * - * Generates hidden fields. You can pass a simple key/value string or an associative - * array with multiple values. - * - * @access public - * @param mixed - * @param string - * @return string - */ -function form_hidden($name, $value = '') -{ - if ( ! is_array($name)) - { - return ''; - } - - $form = ''; - foreach ($name as $name => $value) - { - $form .= ''; - } - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Text Input Field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_input($data = '', $value = '', $extra = '') -{ - $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Password Field - * - * Identical to the input function but adds the "password" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_password($data = '', $value = '', $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'password'; - return form_input($data, $value, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Upload Field - * - * Identical to the input function but adds the "file" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_upload($data = '', $value = '', $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'file'; - return form_input($data, $value, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Textarea field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_textarea($data = '', $value = '', $extra = '') -{ - $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - - $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Drop-down Menu - * - * @access public - * @param string - * @param array - * @param string - * @param string - * @return string - */ -function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') -{ - if ($extra != '') $extra = ' '.$extra; - - $form = ''; - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Checkbox Field - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') -{ - $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - if (is_array($data) AND array_key_exists('checked', $data)) - { - $checked = $data['checked']; - - if ($checked == FALSE) - unset($data['checked']); - } - - if ($checked == TRUE) - $defaults['checked'] = 'checked'; - else - unset($defaults['checked']); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Radio Button - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'radio'; - return form_checkbox($data, $value, $checked, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Submit Button - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_submit($data = '', $value = '', $extra = '') -{ - $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Form Close Tag - * - * @access public - * @param string - * @return string - */ -function form_close($extra = '') -{ - return "\n".$extra; -} - -// ------------------------------------------------------------------------ - -/** - * Form Prep - * - * Formats text so that it can be safely placed in a form field in the event it has HTML tags. - * - * @access public - * @param string - * @return string - */ -function form_prep($str = '') -{ - if ($str === '') - { - return ''; - } - - $temp = '__TEMP_AMPERSANDS__'; - - // Replace entities to temporary markers so that - // htmlspecialchars won't mess them up - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - - $str = htmlspecialchars($str); - - // In case htmlspecialchars misses these. - $str = str_replace(array("'", '"'), array("'", """), $str); - - // Decode the temp markers back to entities - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;",$str); - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Parse the form attributes - * - * Helper function used by some of the form helpers - * - * @access private - * @param array - * @param array - * @return string - */ -function parse_form_attributes($attributes, $default) -{ - if (is_array($attributes)) - { - foreach ($default as $key => $val) - { - if (isset($attributes[$key])) - { - $default[$key] = $attributes[$key]; - unset($attributes[$key]); - } - } - - if (count($attributes) > 0) - { - $default = array_merge($default, $attributes); - } - } - - $att = ''; - foreach ($default as $key => $val) - { - if ($key == 'value') - { - $val = form_prep($val); - } - - $att .= $key . '="' . $val . '" '; - } - - return $att; -} - +config->site_url($action).'"'; + + if ( ! isset($attributes['method'])) + { + $form .= ' method="post"'; + } + + if (is_array($attributes) AND count($attributes) > 0) + { + foreach ($attributes as $key => $val) + { + $form .= ' '.$key.'="'.$val.'"'; + } + } + + $form .= '>'; + + if (is_array($hidden) AND count($hidden > 0)) + { + $form .= form_hidden($hidden); + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Form Declaration - Multipart type + * + * Creates the opening portion of the form, but with "multipart/form-data". + * + * @access public + * @param string the URI segments of the form destination + * @param array a key/value pair of attributes + * @param array a key/value pair hidden data + * @return string + */ +function form_open_multipart($action, $attributes = array(), $hidden = array()) +{ + $attributes['enctype'] = 'multipart/form-data'; + return form_open($action, $attributes, $hidden); +} + +// ------------------------------------------------------------------------ + +/** + * Hidden Input Field + * + * Generates hidden fields. You can pass a simple key/value string or an associative + * array with multiple values. + * + * @access public + * @param mixed + * @param string + * @return string + */ +function form_hidden($name, $value = '') +{ + if ( ! is_array($name)) + { + return ''; + } + + $form = ''; + foreach ($name as $name => $value) + { + $form .= ''; + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Text Input Field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_input($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Password Field + * + * Identical to the input function but adds the "password" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_password($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'password'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Upload Field + * + * Identical to the input function but adds the "file" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_upload($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'file'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Textarea field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_textarea($data = '', $value = '', $extra = '') +{ + $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); + + $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']); + + unset ($data['value']); // textareas don't use the value attribute + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Drop-down Menu + * + * @access public + * @param string + * @param array + * @param string + * @param string + * @return string + */ +function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') +{ + if ($extra != '') $extra = ' '.$extra; + + $form = ''; + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Checkbox Field + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') +{ + $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + if (is_array($data) AND array_key_exists('checked', $data)) + { + $checked = $data['checked']; + + if ($checked == FALSE) + unset($data['checked']); + } + + if ($checked == TRUE) + $defaults['checked'] = 'checked'; + else + unset($defaults['checked']); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Radio Button + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'radio'; + return form_checkbox($data, $value, $checked, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Submit Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_submit($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Form Close Tag + * + * @access public + * @param string + * @return string + */ +function form_close($extra = '') +{ + return "\n".$extra; +} + +// ------------------------------------------------------------------------ + +/** + * Form Prep + * + * Formats text so that it can be safely placed in a form field in the event it has HTML tags. + * + * @access public + * @param string + * @return string + */ +function form_prep($str = '') +{ + if ($str === '') + { + return ''; + } + + $temp = '__TEMP_AMPERSANDS__'; + + // Replace entities to temporary markers so that + // htmlspecialchars won't mess them up + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + $str = htmlspecialchars($str); + + // In case htmlspecialchars misses these. + $str = str_replace(array("'", '"'), array("'", """), $str); + + // Decode the temp markers back to entities + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;",$str); + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Parse the form attributes + * + * Helper function used by some of the form helpers + * + * @access private + * @param array + * @param array + * @return string + */ +function parse_form_attributes($attributes, $default) +{ + if (is_array($attributes)) + { + foreach ($default as $key => $val) + { + if (isset($attributes[$key])) + { + $default[$key] = $attributes[$key]; + unset($attributes[$key]); + } + } + + if (count($attributes) > 0) + { + $default = array_merge($default, $attributes); + } + } + + $att = ''; + foreach ($default as $key => $val) + { + if ($key == 'value') + { + $val = form_prep($val); + } + + $att .= $key . '="' . $val . '" '; + } + + return $att; +} + ?> \ No newline at end of file From d66ba05d2968e68ff96c53ce96a243d965fb9bb9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 17:44:16 +0000 Subject: [PATCH 0470/2544] added set_caption() --- user_guide/libraries/table.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 1214d0e9..30968e25 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -184,6 +184,12 @@

        Function Reference

        $this->table->generate()

        Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

        +

        $this->table->set_caption()

        + +

        Permits you to add a caption to the table.

        + +$this->table->set_caption('Colours'); +

        $this->table->set_heading()

        Permits you to set the table heading. You can submit an array or discreet params:

        From 5932c867a10ed38d58a51b40a3898ea70605f3cd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 17:44:54 +0000 Subject: [PATCH 0471/2544] added set_caption() --- system/libraries/Table.php | 853 +++++++++++++++++++------------------ 1 file changed, 438 insertions(+), 415 deletions(-) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 1b25a441..b8ce9491 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -1,416 +1,439 @@ -template = $template; - } - - // -------------------------------------------------------------------- - - /** - * Set the table heading - * - * Can be passed as an array or discreet params - * - * @access public - * @param mixed - * @return void - */ - function set_heading() - { - $args = func_get_args(); - $this->heading = (is_array($args[0])) ? $args[0] : $args; - } - - // -------------------------------------------------------------------- - - /** - * Set columns. Takes a one-dimensional array as input and creates - * a multi-dimensional array with a depth equal to the number of - * columns. This allows a single array with many elements to be - * displayed in a table that has a fixed column count. - * - * @access public - * @param array - * @param int - * @return void - */ - function make_columns($array = array(), $col_limit = 0) - { - if ( ! is_array($array) OR count($array) == 0) - { - return FALSE; - } - - // Turn off the auto-heading feature since it's doubtful we - // will want headings from a one-dimensional array - $this->auto_heading = FALSE; - - if ($col_limit == 0) - { - return $array; - } - - $new = array(); - while(count($array) > 0) - { - $temp = array_slice($array, 0, $col_limit); - $array = array_diff($array, $temp); - - if (count($temp) < $col_limit) - { - for ($i = count($temp); $i < $col_limit; $i++) - { - $temp[] = ' '; - } - } - - $new[] = $temp; - } - - return $new; - } - - // -------------------------------------------------------------------- - - /** - * Set "empty" cells - * - * Can be passed as an array or discreet params - * - * @access public - * @param mixed - * @return void - */ - function set_empty($value) - { - $this->empty_cells = $value; - } - - // -------------------------------------------------------------------- - - /** - * Add a table row - * - * Can be passed as an array or discreet params - * - * @access public - * @param mixed - * @return void - */ - function add_row() - { - $args = func_get_args(); - $this->rows[] = (is_array($args[0])) ? $args[0] : $args; - } - - // -------------------------------------------------------------------- - - /** - * Generate the table - * - * @access public - * @param mixed - * @return string - */ - function generate($table_data = NULL) - { - // The table data can optionally be passed to this function - // either as a database result object or an array - if ( ! is_null($table_data)) - { - if (is_object($table_data)) - { - $this->_set_from_object($table_data); - } - elseif (is_array($table_data)) - { - $set_heading = (count($this->heading) == 0 AND $this->auto_heading == FALSE) ? FALSE : TRUE; - $this->_set_from_array($table_data, $set_heading); - } - } - - // Is there anything to display? No? Smite them! - if (count($this->heading) == 0 AND count($this->rows) == 0) - { - return 'Undefined table data'; - } - - // Compile and validate the template date - $this->_compile_template(); - - - // Build the table! - - $out = $this->template['table_open']; - $out .= $this->newline; - - // Is there a table heading to display? - if (count($this->heading) > 0) - { - $out .= $this->template['heading_row_start']; - $out .= $this->newline; - - foreach($this->heading as $heading) - { - $out .= $this->template['heading_cell_start']; - $out .= $heading; - $out .= $this->template['heading_cell_end']; - } - - $out .= $this->template['heading_row_end']; - $out .= $this->newline; - } - - // Build the table rows - if (count($this->rows) > 0) - { - $i = 1; - foreach($this->rows as $row) - { - if ( ! is_array($row)) - { - break; - } - - // We use modulus to alternate the row colors - $name = (fmod($i++, 2)) ? '' : 'alt_'; - - $out .= $this->template['row_'.$name.'start']; - $out .= $this->newline; - - foreach($row as $cell) - { - $out .= $this->template['cell_'.$name.'start']; - - if ($cell == "") - { - $out .= $this->empty_cells; - } - else - { - $out .= $cell; - } - - $out .= $this->template['cell_'.$name.'end']; - } - - $out .= $this->template['row_'.$name.'end']; - $out .= $this->newline; - } - } - - $out .= $this->template['table_close']; - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Clears the table arrays. Useful if multiple tables are beting generated - * - * @access public - * @return void - */ - function clear() - { - $this->rows = array(); - $this->heading = array(); - $this->auto_heading = TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set table data from a database result object - * - * @access public - * @param object - * @return void - */ - function _set_from_object($query) - { - if ( ! is_object($query)) - { - return FALSE; - } - - // First generate the headings from the table column names - if (count($this->heading) == 0) - { - if ( ! method_exists($query, 'list_fields')) - { - return FALSE; - } - - $this->heading = $query->list_fields(); - } - - // Next blast through the result array and build out the rows - - if ($query->num_rows() > 0) - { - foreach ($query->result_array() as $row) - { - $this->rows[] = $row; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Set table data from an array - * - * @access public - * @param array - * @return void - */ - function _set_from_array($data, $set_heading = TRUE) - { - if ( ! is_array($data) OR count($data) == 0) - { - return FALSE; - } - - $i = 0; - foreach ($data as $row) - { - if ( ! is_array($row)) - { - $this->rows[] = $data; - break; - } - - // If a heading hasn't already been set we'll use the first row of the array as the heading - if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE) - { - $this->heading = $row; - } - else - { - $this->rows[] = $row; - } - - $i++; - } - } - - // -------------------------------------------------------------------- - - /** - * Compile Template - * - * @access private - * @return void - */ - function _compile_template() - { - if ($this->template == NULL) - { - $this->template = $this->_default_template(); - return; - } - - $this->temp = $this->_default_template(); - foreach (array('table_open','heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val) - { - if ( ! isset($this->template[$val])) - { - $this->template[$val] = $this->temp[$val]; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Default Template - * - * @access private - * @return void - */ - function _default_template() - { - return array ( - 'table_open' => '', - - 'heading_row_start' => '', - 'heading_row_end' => '', - 'heading_cell_start' => '', - - 'row_start' => '', - 'row_end' => '', - 'cell_start' => '', - - 'row_alt_start' => '', - 'row_alt_end' => '', - 'cell_alt_start' => '', - - 'table_close' => '
        ', - 'heading_cell_end' => '
        ', - 'cell_end' => '
        ', - 'cell_alt_end' => '
        ' - ); - } - - -} - +template = $template; + } + + // -------------------------------------------------------------------- + + /** + * Set the table heading + * + * Can be passed as an array or discreet params + * + * @access public + * @param mixed + * @return void + */ + function set_heading() + { + $args = func_get_args(); + $this->heading = (is_array($args[0])) ? $args[0] : $args; + } + + // -------------------------------------------------------------------- + + /** + * Set columns. Takes a one-dimensional array as input and creates + * a multi-dimensional array with a depth equal to the number of + * columns. This allows a single array with many elements to be + * displayed in a table that has a fixed column count. + * + * @access public + * @param array + * @param int + * @return void + */ + function make_columns($array = array(), $col_limit = 0) + { + if ( ! is_array($array) OR count($array) == 0) + { + return FALSE; + } + + // Turn off the auto-heading feature since it's doubtful we + // will want headings from a one-dimensional array + $this->auto_heading = FALSE; + + if ($col_limit == 0) + { + return $array; + } + + $new = array(); + while(count($array) > 0) + { + $temp = array_slice($array, 0, $col_limit); + $array = array_diff($array, $temp); + + if (count($temp) < $col_limit) + { + for ($i = count($temp); $i < $col_limit; $i++) + { + $temp[] = ' '; + } + } + + $new[] = $temp; + } + + return $new; + } + + // -------------------------------------------------------------------- + + /** + * Set "empty" cells + * + * Can be passed as an array or discreet params + * + * @access public + * @param mixed + * @return void + */ + function set_empty($value) + { + $this->empty_cells = $value; + } + + // -------------------------------------------------------------------- + + /** + * Add a table row + * + * Can be passed as an array or discreet params + * + * @access public + * @param mixed + * @return void + */ + function add_row() + { + $args = func_get_args(); + $this->rows[] = (is_array($args[0])) ? $args[0] : $args; + } + + // -------------------------------------------------------------------- + + /** + * Add a table caption + * + * @access public + * @param string + * @return void + */ + function set_caption($caption) + { + $this->caption = $caption; + } + + // -------------------------------------------------------------------- + + /** + * Generate the table + * + * @access public + * @param mixed + * @return string + */ + function generate($table_data = NULL) + { + // The table data can optionally be passed to this function + // either as a database result object or an array + if ( ! is_null($table_data)) + { + if (is_object($table_data)) + { + $this->_set_from_object($table_data); + } + elseif (is_array($table_data)) + { + $set_heading = (count($this->heading) == 0 AND $this->auto_heading == FALSE) ? FALSE : TRUE; + $this->_set_from_array($table_data, $set_heading); + } + } + + // Is there anything to display? No? Smite them! + if (count($this->heading) == 0 AND count($this->rows) == 0) + { + return 'Undefined table data'; + } + + // Compile and validate the template date + $this->_compile_template(); + + + // Build the table! + + $out = $this->template['table_open']; + $out .= $this->newline; + + // Add any caption here + if ($this->caption) + { + $out .= $this->newline; + $out .= '' . $this->caption . ''; + $out .= $this->newline; + } + + // Is there a table heading to display? + if (count($this->heading) > 0) + { + $out .= $this->template['heading_row_start']; + $out .= $this->newline; + + foreach($this->heading as $heading) + { + $out .= $this->template['heading_cell_start']; + $out .= $heading; + $out .= $this->template['heading_cell_end']; + } + + $out .= $this->template['heading_row_end']; + $out .= $this->newline; + } + + // Build the table rows + if (count($this->rows) > 0) + { + $i = 1; + foreach($this->rows as $row) + { + if ( ! is_array($row)) + { + break; + } + + // We use modulus to alternate the row colors + $name = (fmod($i++, 2)) ? '' : 'alt_'; + + $out .= $this->template['row_'.$name.'start']; + $out .= $this->newline; + + foreach($row as $cell) + { + $out .= $this->template['cell_'.$name.'start']; + + if ($cell == "") + { + $out .= $this->empty_cells; + } + else + { + $out .= $cell; + } + + $out .= $this->template['cell_'.$name.'end']; + } + + $out .= $this->template['row_'.$name.'end']; + $out .= $this->newline; + } + } + + $out .= $this->template['table_close']; + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Clears the table arrays. Useful if multiple tables are beting generated + * + * @access public + * @return void + */ + function clear() + { + $this->rows = array(); + $this->heading = array(); + $this->auto_heading = TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set table data from a database result object + * + * @access public + * @param object + * @return void + */ + function _set_from_object($query) + { + if ( ! is_object($query)) + { + return FALSE; + } + + // First generate the headings from the table column names + if (count($this->heading) == 0) + { + if ( ! method_exists($query, 'list_fields')) + { + return FALSE; + } + + $this->heading = $query->list_fields(); + } + + // Next blast through the result array and build out the rows + + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $this->rows[] = $row; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set table data from an array + * + * @access public + * @param array + * @return void + */ + function _set_from_array($data, $set_heading = TRUE) + { + if ( ! is_array($data) OR count($data) == 0) + { + return FALSE; + } + + $i = 0; + foreach ($data as $row) + { + if ( ! is_array($row)) + { + $this->rows[] = $data; + break; + } + + // If a heading hasn't already been set we'll use the first row of the array as the heading + if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE) + { + $this->heading = $row; + } + else + { + $this->rows[] = $row; + } + + $i++; + } + } + + // -------------------------------------------------------------------- + + /** + * Compile Template + * + * @access private + * @return void + */ + function _compile_template() + { + if ($this->template == NULL) + { + $this->template = $this->_default_template(); + return; + } + + $this->temp = $this->_default_template(); + foreach (array('table_open','heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val) + { + if ( ! isset($this->template[$val])) + { + $this->template[$val] = $this->temp[$val]; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Default Template + * + * @access private + * @return void + */ + function _default_template() + { + return array ( + 'table_open' => '', + + 'heading_row_start' => '', + 'heading_row_end' => '', + 'heading_cell_start' => '', + + 'row_start' => '', + 'row_end' => '', + 'cell_start' => '', + + 'row_alt_start' => '', + 'row_alt_end' => '', + 'cell_alt_start' => '', + + 'table_close' => '
        ', + 'heading_cell_end' => '
        ', + 'cell_end' => '
        ', + 'cell_alt_end' => '
        ' + ); + } + + +} + ?> \ No newline at end of file From 7e26e6980ed547470a538c8c0f7a1af01377bf49 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 17:47:59 +0000 Subject: [PATCH 0472/2544] detailed recent changes --- user_guide/changelog.html | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c5e369f3..f0acc71f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,23 +62,28 @@

        Change Log

        +

        Version 1.5.0.3

        +

        Release Date: January 27, 2007

        +
          +
        • Added support for captions in the Table Library
        • +
        • Fixed a bug in the form helper that gave textarea a value attribute
        • +
        • Fixed some doc typos.
        • +

        Version 1.5.0.2

        Release Date: November 23, 2006

          -
        • Added support for submitting arrays of libraries in the $this->load->library function.
        • -
        • Added support for naming custom library files in lower or uppercase.
        • -
        • Fixed a bug related to output buffering.
        • -
        • Fixed a bug in the active record class that was not resetting query data after a completed query.
        • -
        • Fixed a bug that was suppressing errors in controllers.
        • -
        • Fixed a problem that can cause a loop to occur when the config file is missing.
        • -
        • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
        • -
        • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
        • -
        • Fixed some bugs in the Oracle DB driver.
        • -
        • Fixed an incorrectly named variable in the MySQLi result driver.
        • -
        • Fixed some doc typos.
        • +
        • Added support for submitting arrays of libraries in the $this->load->library function.
        • +
        • Added support for naming custom library files in lower or uppercase.
        • +
        • Fixed a bug related to output buffering.
        • +
        • Fixed a bug in the active record class that was not resetting query data after a completed query.
        • +
        • Fixed a bug that was suppressing errors in controllers.
        • +
        • Fixed a problem that can cause a loop to occur when the config file is missing.
        • +
        • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
        • +
        • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
        • +
        • Fixed some bugs in the Oracle DB driver.
        • +
        • Fixed an incorrectly named variable in the MySQLi result driver.
        • +
        • Fixed some doc typos.
        - -

        Version 1.5.0.1

        Release Date: October 31, 2006

          From c250b144dcfab2c2667b6eec3fcb1b396cdf3c28 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 17:56:40 +0000 Subject: [PATCH 0473/2544] fixed $moble to $mobile --- system/libraries/User_agent.php | 998 ++++++++++++++++---------------- 1 file changed, 499 insertions(+), 499 deletions(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 95eccd12..afd012e3 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -1,500 +1,500 @@ -agent = trim($_SERVER['HTTP_USER_AGENT']); - } - - if ( ! is_null($this->agent)) - { - if ($this->_load_agent_file()) - { - $this->_compile_data(); - } - } - - log_message('debug', "Table Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Compile the User Agent Data - * - * @access private - * @return bool - */ - function _load_agent_file() - { - if ( ! @include(APPPATH.'config/user_agents'.EXT)) - { - return FALSE; - } - - $return = FALSE; - - if (isset($platforms)) - { - $this->platforms = $platforms; - unset($platforms); - $return = TRUE; - } - - if (isset($browsers)) - { - $this->browsers = $browsers; - unset($browsers); - $return = TRUE; - } - - if (isset($mobiles)) - { - $this->mobiles = $mobiles; - unset($mobiles); - $return = TRUE; - } - - if (isset($robots)) - { - $this->robots = $robots; - unset($robots); - $return = TRUE; - } - - return $return; - } - - // -------------------------------------------------------------------- - - /** - * Compile the User Agent Data - * - * @access private - * @return bool - */ - function _compile_data() - { - $this->_set_platform(); - - foreach (array('_set_browser', '_set_robot', '_set_mobile') as $function) - { - if ($this->$function() === TRUE) - { - break; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Set the Platform - * - * @access private - * @return mixed - */ - function _set_platform() - { - if (is_array($this->platforms) AND count($this->platforms) > 0) - { - foreach ($this->platforms as $key => $val) - { - if (preg_match("|".preg_quote($key)."|i", $this->agent)) - { - $this->platform = $val; - return TRUE; - } - } - } - $this->platform = 'Unknown Platform'; - } - - // -------------------------------------------------------------------- - - /** - * Set the Browser - * - * @access private - * @return bool - */ - function _set_browser() - { - if (is_array($this->browsers) AND count($this->browsers) > 0) - { - foreach ($this->browsers as $key => $val) - { - if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match)) - { - $this->is_browser = TRUE; - $this->version = $match[1]; - $this->browser = $val; - $this->_set_mobile(); - return TRUE; - } - } - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Set the Robot - * - * @access private - * @return bool - */ - function _set_robot() - { - if (is_array($this->robots) AND count($this->robots) > 0) - { - foreach ($this->robots as $key => $val) - { - if (preg_match("|".preg_quote($key)."|i", $this->agent)) - { - $this->is_robot = TRUE; - $this->robot = $val; - return TRUE; - } - } - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Set the Mobile Device - * - * @access private - * @return bool - */ - function _set_mobile() - { - if (is_array($this->mobiles) AND count($this->mobiles) > 0) - { - foreach ($this->mobiles as $key => $val) - { - if (FALSE !== (strpos(strtolower($this->agent), $key))) - { - $this->is_mobile = TRUE; - $this->mobile = $val; - return TRUE; - } - } - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Set the accepted languages - * - * @access private - * @return void - */ - function _set_languages() - { - if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') - { - $languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])); - - $this->languages = explode(',', $languages); - } - - if (count($this->languages) == 0) - { - $this->languages = array('Undefined'); - } - } - - // -------------------------------------------------------------------- - - /** - * Set the accepted character sets - * - * @access private - * @return void - */ - function _set_charsets() - { - if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') - { - $charsets = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_CHARSET'])); - - $this->charsets = explode(',', $charsets); - } - - if (count($this->charsets) == 0) - { - $this->charsets = array('Undefined'); - } - } - - // -------------------------------------------------------------------- - - /** - * Is Browser - * - * @access public - * @return bool - */ - function is_browser() - { - return $this->is_browser; - } - - // -------------------------------------------------------------------- - - /** - * Is Robot - * - * @access public - * @return bool - */ - function is_robot() - { - return $this->is_robot; - } - - // -------------------------------------------------------------------- - - /** - * Is Mobile - * - * @access public - * @return bool - */ - function is_mobile() - { - return $this->is_mobile; - } - - // -------------------------------------------------------------------- - - /** - * Is this a referral from another site? - * - * @access public - * @return bool - */ - function is_referral() - { - return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Agent String - * - * @access public - * @return string - */ - function agent_string() - { - return $this->agent; - } - - // -------------------------------------------------------------------- - - /** - * Get Platform - * - * @access public - * @return string - */ - function platform() - { - return $this->platform; - } - - // -------------------------------------------------------------------- - - /** - * Get Browser Name - * - * @access public - * @return string - */ - function browser() - { - return $this->browser; - } - - // -------------------------------------------------------------------- - - /** - * Get the Browser Version - * - * @access public - * @return string - */ - function version() - { - return $this->version; - } - - // -------------------------------------------------------------------- - - /** - * Get The Robot Name - * - * @access public - * @return string - */ - function robot() - { - return $this->robot; - } - // -------------------------------------------------------------------- - - /** - * Get the Mobile Device - * - * @access public - * @return string - */ - function mobile() - { - return $this->mobile; - } - - // -------------------------------------------------------------------- - - /** - * Get the referrer - * - * @access public - * @return bool - */ - function referrer() - { - return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']); - } - - // -------------------------------------------------------------------- - - /** - * Get the accepted languages - * - * @access public - * @return array - */ - function languages() - { - if (count($this->languages) == 0) - { - $this->_set_languages(); - } - - return $this->languages; - } - - // -------------------------------------------------------------------- - - /** - * Get the accepted Character Sets - * - * @access public - * @return array - */ - function charsets() - { - if (count($this->charsets) == 0) - { - $this->_set_charsets(); - } - - return $this->charsets; - } - - // -------------------------------------------------------------------- - - /** - * Test for a particular language - * - * @access public - * @return bool - */ - function accept_lang($lang = 'en') - { - return (in_array(strtolower($lang), $this->languages(), TRUE)) ? TRUE : FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Test for a particular character set - * - * @access public - * @return bool - */ - function accept_charset($charset = 'utf-8') - { - return (in_array(strtolower($charset), $this->charsets(), TRUE)) ? TRUE : FALSE; - } - - -} - +agent = trim($_SERVER['HTTP_USER_AGENT']); + } + + if ( ! is_null($this->agent)) + { + if ($this->_load_agent_file()) + { + $this->_compile_data(); + } + } + + log_message('debug', "Table Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Compile the User Agent Data + * + * @access private + * @return bool + */ + function _load_agent_file() + { + if ( ! @include(APPPATH.'config/user_agents'.EXT)) + { + return FALSE; + } + + $return = FALSE; + + if (isset($platforms)) + { + $this->platforms = $platforms; + unset($platforms); + $return = TRUE; + } + + if (isset($browsers)) + { + $this->browsers = $browsers; + unset($browsers); + $return = TRUE; + } + + if (isset($mobiles)) + { + $this->mobiles = $mobiles; + unset($mobiles); + $return = TRUE; + } + + if (isset($robots)) + { + $this->robots = $robots; + unset($robots); + $return = TRUE; + } + + return $return; + } + + // -------------------------------------------------------------------- + + /** + * Compile the User Agent Data + * + * @access private + * @return bool + */ + function _compile_data() + { + $this->_set_platform(); + + foreach (array('_set_browser', '_set_robot', '_set_mobile') as $function) + { + if ($this->$function() === TRUE) + { + break; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set the Platform + * + * @access private + * @return mixed + */ + function _set_platform() + { + if (is_array($this->platforms) AND count($this->platforms) > 0) + { + foreach ($this->platforms as $key => $val) + { + if (preg_match("|".preg_quote($key)."|i", $this->agent)) + { + $this->platform = $val; + return TRUE; + } + } + } + $this->platform = 'Unknown Platform'; + } + + // -------------------------------------------------------------------- + + /** + * Set the Browser + * + * @access private + * @return bool + */ + function _set_browser() + { + if (is_array($this->browsers) AND count($this->browsers) > 0) + { + foreach ($this->browsers as $key => $val) + { + if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match)) + { + $this->is_browser = TRUE; + $this->version = $match[1]; + $this->browser = $val; + $this->_set_mobile(); + return TRUE; + } + } + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Set the Robot + * + * @access private + * @return bool + */ + function _set_robot() + { + if (is_array($this->robots) AND count($this->robots) > 0) + { + foreach ($this->robots as $key => $val) + { + if (preg_match("|".preg_quote($key)."|i", $this->agent)) + { + $this->is_robot = TRUE; + $this->robot = $val; + return TRUE; + } + } + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Set the Mobile Device + * + * @access private + * @return bool + */ + function _set_mobile() + { + if (is_array($this->mobiles) AND count($this->mobiles) > 0) + { + foreach ($this->mobiles as $key => $val) + { + if (FALSE !== (strpos(strtolower($this->agent), $key))) + { + $this->is_mobile = TRUE; + $this->mobile = $val; + return TRUE; + } + } + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Set the accepted languages + * + * @access private + * @return void + */ + function _set_languages() + { + if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') + { + $languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])); + + $this->languages = explode(',', $languages); + } + + if (count($this->languages) == 0) + { + $this->languages = array('Undefined'); + } + } + + // -------------------------------------------------------------------- + + /** + * Set the accepted character sets + * + * @access private + * @return void + */ + function _set_charsets() + { + if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') + { + $charsets = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_CHARSET'])); + + $this->charsets = explode(',', $charsets); + } + + if (count($this->charsets) == 0) + { + $this->charsets = array('Undefined'); + } + } + + // -------------------------------------------------------------------- + + /** + * Is Browser + * + * @access public + * @return bool + */ + function is_browser() + { + return $this->is_browser; + } + + // -------------------------------------------------------------------- + + /** + * Is Robot + * + * @access public + * @return bool + */ + function is_robot() + { + return $this->is_robot; + } + + // -------------------------------------------------------------------- + + /** + * Is Mobile + * + * @access public + * @return bool + */ + function is_mobile() + { + return $this->is_mobile; + } + + // -------------------------------------------------------------------- + + /** + * Is this a referral from another site? + * + * @access public + * @return bool + */ + function is_referral() + { + return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Agent String + * + * @access public + * @return string + */ + function agent_string() + { + return $this->agent; + } + + // -------------------------------------------------------------------- + + /** + * Get Platform + * + * @access public + * @return string + */ + function platform() + { + return $this->platform; + } + + // -------------------------------------------------------------------- + + /** + * Get Browser Name + * + * @access public + * @return string + */ + function browser() + { + return $this->browser; + } + + // -------------------------------------------------------------------- + + /** + * Get the Browser Version + * + * @access public + * @return string + */ + function version() + { + return $this->version; + } + + // -------------------------------------------------------------------- + + /** + * Get The Robot Name + * + * @access public + * @return string + */ + function robot() + { + return $this->robot; + } + // -------------------------------------------------------------------- + + /** + * Get the Mobile Device + * + * @access public + * @return string + */ + function mobile() + { + return $this->mobile; + } + + // -------------------------------------------------------------------- + + /** + * Get the referrer + * + * @access public + * @return bool + */ + function referrer() + { + return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']); + } + + // -------------------------------------------------------------------- + + /** + * Get the accepted languages + * + * @access public + * @return array + */ + function languages() + { + if (count($this->languages) == 0) + { + $this->_set_languages(); + } + + return $this->languages; + } + + // -------------------------------------------------------------------- + + /** + * Get the accepted Character Sets + * + * @access public + * @return array + */ + function charsets() + { + if (count($this->charsets) == 0) + { + $this->_set_charsets(); + } + + return $this->charsets; + } + + // -------------------------------------------------------------------- + + /** + * Test for a particular language + * + * @access public + * @return bool + */ + function accept_lang($lang = 'en') + { + return (in_array(strtolower($lang), $this->languages(), TRUE)) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Test for a particular character set + * + * @access public + * @return bool + */ + function accept_charset($charset = 'utf-8') + { + return (in_array(strtolower($charset), $this->charsets(), TRUE)) ? TRUE : FALSE; + } + + +} + ?> \ No newline at end of file From 7a1f5162029b8bc7d62171bd487a6954f1cf0bfc Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 27 Jan 2007 18:02:09 +0000 Subject: [PATCH 0474/2544] typo fix: thih to this --- user_guide/general/creating_libraries.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 11a62c97..86cd1528 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -220,7 +220,7 @@

          Replacing Native Libraries with Your Versions

          $this->load->library('email'); -

          Note: At thit time the Database classes can not be replaced with your own versions.

          +

          Note: At this time the Database classes can not be replaced with your own versions.

          Extending Native Libraries

          From b29d37c1d070b1e3790c7ce7429c59d789a5ed4b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 28 Jan 2007 16:05:51 +0000 Subject: [PATCH 0475/2544] log_exception() printed severity twice... fixed. --- system/libraries/Exceptions.php | 338 ++++++++++++++++---------------- 1 file changed, 169 insertions(+), 169 deletions(-) diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 83909391..03588acb 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -1,170 +1,170 @@ - 'Error', - E_WARNING => 'Warning', - E_PARSE => 'Parsing Error', - E_NOTICE => 'Notice', - E_CORE_ERROR => 'Core Error', - E_CORE_WARNING => 'Core Warning', - E_COMPILE_ERROR => 'Compile Error', - E_COMPILE_WARNING => 'Compile Warning', - E_USER_ERROR => 'User Error', - E_USER_WARNING => 'User Warning', - E_USER_NOTICE => 'User Notice', - E_STRICT => 'Runtime Notice' - ); - - - /** - * Constructor - * - */ - function CI_Exceptions() - { - $this->ob_level = ob_get_level(); - // Note: Do not log messages from this constructor. - } - - // -------------------------------------------------------------------- - - /** - * Exception Logger - * - * This function logs PHP generated error messages - * - * @access private - * @param string the error severity - * @param string the error string - * @param string the error filepath - * @param string the error line number - * @return string - */ - function log_exception($severity, $message, $filepath, $line) - { - $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; - - log_message('error', 'Severity: '.$severity.' '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * 404 Page Not Found Handler - * - * @access private - * @param string - * @return string - */ - function show_404($page = '') - { - $heading = "404 Page Not Found"; - $message = "The page you requested was not found."; - - log_message('error', '404 Page Not Found --> '.$page); - echo $this->show_error($heading, $message, 'error_404'); - exit; - } - - // -------------------------------------------------------------------- - - /** - * General Error Page - * - * This function takes an error message as input - * (either as a string or an array) and displays - * it using the specified template. - * - * @access private - * @param string the heading - * @param string the message - * @param string the template name - * @return string - */ - function show_error($heading, $message, $template = 'error_general') - { - $message = '

          '.implode('

          ', ( ! is_array($message)) ? array($message) : $message).'

          '; - - if (ob_get_level() > $this->ob_level + 1) - { - ob_end_flush(); - } - ob_start(); - include(APPPATH.'errors/'.$template.EXT); - $buffer = ob_get_contents(); - ob_end_clean(); - return $buffer; - } - - // -------------------------------------------------------------------- - - /** - * Native PHP error handler - * - * @access private - * @param string the error severity - * @param string the error string - * @param string the error filepath - * @param string the error line number - * @return string - */ - function show_php_error($severity, $message, $filepath, $line) - { - $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; - - $filepath = str_replace("\\", "/", $filepath); - - // For safety reasons we do not show the full file path - if (FALSE !== strpos($filepath, '/')) - { - $x = explode('/', $filepath); - $filepath = $x[count($x)-2].'/'.end($x); - } - - if (ob_get_level() > $this->ob_level + 1) - { - ob_end_flush(); - } - ob_start(); - include(APPPATH.'errors/error_php'.EXT); - $buffer = ob_get_contents(); - ob_end_clean(); - echo $buffer; - } - - -} -// END Exceptions Class + 'Error', + E_WARNING => 'Warning', + E_PARSE => 'Parsing Error', + E_NOTICE => 'Notice', + E_CORE_ERROR => 'Core Error', + E_CORE_WARNING => 'Core Warning', + E_COMPILE_ERROR => 'Compile Error', + E_COMPILE_WARNING => 'Compile Warning', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', + E_STRICT => 'Runtime Notice' + ); + + + /** + * Constructor + * + */ + function CI_Exceptions() + { + $this->ob_level = ob_get_level(); + // Note: Do not log messages from this constructor. + } + + // -------------------------------------------------------------------- + + /** + * Exception Logger + * + * This function logs PHP generated error messages + * + * @access private + * @param string the error severity + * @param string the error string + * @param string the error filepath + * @param string the error line number + * @return string + */ + function log_exception($severity, $message, $filepath, $line) + { + $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; + + log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * 404 Page Not Found Handler + * + * @access private + * @param string + * @return string + */ + function show_404($page = '') + { + $heading = "404 Page Not Found"; + $message = "The page you requested was not found."; + + log_message('error', '404 Page Not Found --> '.$page); + echo $this->show_error($heading, $message, 'error_404'); + exit; + } + + // -------------------------------------------------------------------- + + /** + * General Error Page + * + * This function takes an error message as input + * (either as a string or an array) and displays + * it using the specified template. + * + * @access private + * @param string the heading + * @param string the message + * @param string the template name + * @return string + */ + function show_error($heading, $message, $template = 'error_general') + { + $message = '

          '.implode('

          ', ( ! is_array($message)) ? array($message) : $message).'

          '; + + if (ob_get_level() > $this->ob_level + 1) + { + ob_end_flush(); + } + ob_start(); + include(APPPATH.'errors/'.$template.EXT); + $buffer = ob_get_contents(); + ob_end_clean(); + return $buffer; + } + + // -------------------------------------------------------------------- + + /** + * Native PHP error handler + * + * @access private + * @param string the error severity + * @param string the error string + * @param string the error filepath + * @param string the error line number + * @return string + */ + function show_php_error($severity, $message, $filepath, $line) + { + $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; + + $filepath = str_replace("\\", "/", $filepath); + + // For safety reasons we do not show the full file path + if (FALSE !== strpos($filepath, '/')) + { + $x = explode('/', $filepath); + $filepath = $x[count($x)-2].'/'.end($x); + } + + if (ob_get_level() > $this->ob_level + 1) + { + ob_end_flush(); + } + ob_start(); + include(APPPATH.'errors/error_php'.EXT); + $buffer = ob_get_contents(); + ob_end_clean(); + echo $buffer; + } + + +} +// END Exceptions Class ?> \ No newline at end of file From b0712d04eee3c2c85c8f10579c31cbc83961b3d6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 28 Jan 2007 17:08:03 +0000 Subject: [PATCH 0476/2544] updated version number --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f0acc71f..013c0e57 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,7 +62,7 @@

          Change Log

          -

          Version 1.5.0.3

          +

          Version 1.5.1.1

          Release Date: January 27, 2007

          • Added support for captions in the Table Library
          • From 394d0b2d1b5e1633566a3ea56b9dd63118ac7dbf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 29 Jan 2007 16:00:28 +0000 Subject: [PATCH 0477/2544] changed to('$array') into to($array) --- user_guide/libraries/email.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 0ce1813c..d794d140 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -119,7 +119,7 @@

            Setting Email Preferences

            Note: Most of the preferences have default values that will be used if you do not set them.

            Setting Email Preferences in a Config File +>

            Setting Email Preferences in a Config File

            If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config @@ -196,7 +196,7 @@

            $this->email->to()

            $this->email->to('one@some-site.com, two@some-site.com, three@some-site.com'); $list = array('one@some-site.com, two@some-site.com, three@some-site.com');

            -$this->email->to('$list');
            +$this->email->to($list);

            $this->email->cc()

            Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

            From a72b60d96cbdbfc10fbe20d2c4a3c4a62358b4d3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 31 Jan 2007 23:56:11 +0000 Subject: [PATCH 0478/2544] removed unescaped variable that could be used in XSS --- system/libraries/Input.php | 1278 +++++++++++++++++------------------ system/libraries/Router.php | 1120 +++++++++++++++--------------- 2 files changed, 1199 insertions(+), 1199 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 4fd2061c..f346caba 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -1,640 +1,640 @@ -use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; - $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; - $this->_sanitize_globals(); - } - - // -------------------------------------------------------------------- - - /** - * Sanitize Globals - * - * This function does the following: - * - * Unsets $_GET data (if query strings are not enabled) - * - * Unsets all globals if register_globals is enabled - * - * Standardizes newline characters to \n - * - * @access private - * @return void - */ - function _sanitize_globals() - { - // Unset globals. This is effectively the same as register_globals = off - foreach (array($_GET, $_POST, $_COOKIE) as $global) - { - if ( ! is_array($global)) - { - global $global; - $$global = NULL; - } - else - { - foreach ($global as $key => $val) - { - global $$key; - $$key = NULL; - } - } - } - - // Is $_GET data allowed? If not we'll set the $_GET to an empty array - if ($this->allow_get_array == FALSE) - { - $_GET = array(); - } - - // Clean $_POST Data - if (is_array($_POST) AND count($_POST) > 0) - { - foreach($_POST as $key => $val) - { - $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - } - - // Clean $_COOKIE Data - if (is_array($_COOKIE) AND count($_COOKIE) > 0) - { - foreach($_COOKIE as $key => $val) - { - $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - } - - log_message('debug', "Global POST and COOKIE data sanitized"); - } - - // -------------------------------------------------------------------- - - /** - * Clean Input Data - * - * This is a helper function. It escapes data and - * standardizes newline characters to \n - * - * @access private - * @param string - * @return string - */ - function _clean_input_data($str) - { - if (is_array($str)) - { - $new_array = array(); - foreach ($str as $key => $val) - { - $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - return $new_array; - } - - if ($this->use_xss_clean === TRUE) - { - $str = $this->xss_clean($str); - } - - // Standardize newlines - return preg_replace("/\015\012|\015|\012/", "\n", $str); - } - - // -------------------------------------------------------------------- - - /** - * Clean Keys - * - * This is a helper function. To prevent malicious users - * from trying to exploit keys we make sure that keys are - * only named with alpha-numeric text and a few other items. - * - * @access private - * @param string - * @return string - */ - function _clean_input_keys($str) - { - if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) - { - exit('Disallowed Key Characters: '.$str); - } - - if ( ! get_magic_quotes_gpc()) - { - return addslashes($str); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the POST array - * - * @access public - * @param string - * @param bool - * @return string - */ - function post($index = '', $xss_clean = FALSE) - { - if ( ! isset($_POST[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - if (is_array($_POST[$index])) - { - foreach($_POST[$index] as $key => $val) - { - $_POST[$index][$key] = $this->xss_clean($val); - } - } - else - { - return $this->xss_clean($_POST[$index]); - } - } - - return $_POST[$index]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the COOKIE array - * - * @access public - * @param string - * @param bool - * @return string - */ - function cookie($index = '', $xss_clean = FALSE) - { - if ( ! isset($_COOKIE[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - if (is_array($_COOKIE[$index])) - { - $cookie = array(); - foreach($_COOKIE[$index] as $key => $val) - { - $cookie[$key] = $this->xss_clean($val); - } - - return $cookie; - } - else - { - return $this->xss_clean($_COOKIE[$index]); - } - } - else - { - return $_COOKIE[$index]; - } - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the SERVER array - * - * @access public - * @param string - * @param bool - * @return string - */ - function server($index = '', $xss_clean = FALSE) - { - if ( ! isset($_SERVER[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - return $this->xss_clean($_SERVER[$index]); - } - - return $_SERVER[$index]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch the IP Address - * - * @access public - * @return string - */ - function ip_address() - { - if ($this->ip_address !== FALSE) - { - return $this->ip_address; - } - - if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('REMOTE_ADDR')) - { - $this->ip_address = $_SERVER['REMOTE_ADDR']; - } - elseif ($this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('HTTP_X_FORWARDED_FOR')) - { - $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; - } - - if ($this->ip_address === FALSE) - { - $this->ip_address = '0.0.0.0'; - return $this->ip_address; - } - - if (strstr($this->ip_address, ',')) - { - $x = explode(',', $this->ip_address); - $this->ip_address = end($x); - } - - if ( ! $this->valid_ip($this->ip_address)) - { - $this->ip_address = '0.0.0.0'; - } - - return $this->ip_address; - } - - // -------------------------------------------------------------------- - - /** - * Validate IP Address - * - * @access public - * @param string - * @return string - */ - function valid_ip($ip) - { - return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * User Agent - * - * @access public - * @return string - */ - function user_agent() - { - if ($this->user_agent !== FALSE) - { - return $this->user_agent; - } - - $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; - - return $this->user_agent; - } - - // -------------------------------------------------------------------- - - /** - * XSS Clean - * - * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented.  This function does a fair amount of work but - * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts.  Nothing is ever 100% foolproof, - * of course, but I haven't been able to get anything passed - * the filter. - * - * Note: This function should only be used to deal with data - * upon submission.  It's not something that should - * be used for general runtime processing. - * - * This function was based in part on some code and ideas I - * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention - * - * To help develop this script I used this great list of - * vulnerabilities along with a few other hacks I've - * harvested from examining vulnerabilities in other programs: - * http://ha.ckers.org/xss.html - * - * @access public - * @param string - * @return string - */ - function xss_clean($str, $charset = 'ISO-8859-1') - { - /* - * Remove Null Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - */ - $str = preg_replace('/\0+/', '', $str); - $str = preg_replace('/(\\\\0)+/', '', $str); - - /* - * Validate standard character entities - * - * Add a semicolon if missing. We do this to enable - * the conversion of entities to ASCII later. - * - */ - $str = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$str); - - /* - * Validate UTF16 two byte encoding (x00) - * - * Just as above, adds a semicolon if missing. - * - */ - $str = preg_replace('#(&\#x*)([0-9A-F]+);*#iu',"\\1\\2;",$str); - - /* - * URL Decode - * - * Just in case stuff like this is submitted: - * - * Google - * - * Note: Normally urldecode() would be easier but it removes plus signs - * - */ - $str = preg_replace("/%u0([a-z0-9]{3})/i", "&#x\\1;", $str); - $str = preg_replace("/%([a-z0-9]{2})/i", "&#x\\1;", $str); - - /* - * Convert character entities to ASCII - * - * This permits our tests below to work reliably. - * We only convert entities that are within tags since - * these are the ones that will pose security problems. - * - */ - if (preg_match_all("/<(.+?)>/si", $str, $matches)) - { - for ($i = 0; $i < count($matches['0']); $i++) - { - $str = str_replace($matches['1'][$i], - $this->_html_entity_decode($matches['1'][$i], $charset), - $str); - } - } - - /* - * Not Allowed Under Any Conditions - */ - $bad = array( - 'document.cookie' => '[removed]', - 'document.write' => '[removed]', - 'window.location' => '[removed]', - "javascript\s*:" => '[removed]', - "Redirect\s+302" => '[removed]', - '' => '-->' - ); - - foreach ($bad as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - /* - * Convert all tabs to spaces - * - * This prevents strings like this: ja vascript - * Note: we deal with spaces between characters later. - * - */ - $str = preg_replace("#\t+#", " ", $str); - - /* - * Makes PHP tags safe - * - * Note: XML tags are inadvertently replaced too: - * - * '), array('<?php', '<?PHP', '<?', '?>'), $str); - - /* - * Compact any exploded words - * - * This corrects words like: j a v a s c r i p t - * These words are compacted back to their correct state. - * - */ - $words = array('javascript', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); - foreach ($words as $word) - { - $temp = ''; - for ($i = 0; $i < strlen($word); $i++) - { - $temp .= substr($word, $i, 1)."\s*"; - } - - $temp = substr($temp, 0, -3); - $str = preg_replace('#'.$temp.'#s', $word, $str); - $str = preg_replace('#'.ucfirst($temp).'#s', ucfirst($word), $str); - } - - /* - * Remove disallowed Javascript in links or img tags - */ - $str = preg_replace("#.*?#si", "", $str); - $str = preg_replace("##si", "", $str); - $str = preg_replace("#<(script|xss).*?\>#si", "", $str); - - /* - * Remove JavaScript Event Handlers - * - * Note: This code is a little blunt. It removes - * the event handler and anything up to the closing >, - * but it's unlikely to be a problem. - * - */ - $str = preg_replace('#(<[^>]+.*?)(onblur|onchange|onclick|onfocus|onload|onmouseover|onmouseup|onmousedown|onselect|onsubmit|onunload|onkeypress|onkeydown|onkeyup|onresize)[^>]*>#iU',"\\1>",$str); - - /* - * Sanitize naughty HTML elements - * - * If a tag containing any of the words in the list - * below is found, the tag gets converted to entities. - * - * So this: - * Becomes: <blink> - * - */ - $str = preg_replace('#<(/*\s*)(alert|applet|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|xml|xss)([^>]*)>#is', "<\\1\\2\\3>", $str); - - /* - * Sanitize naughty scripting elements - * - * Similar to above, only instead of looking for - * tags it looks for PHP and JavaScript commands - * that are disallowed. Rather than removing the - * code, it simply converts the parenthesis to entities - * rendering the code un-executable. - * - * For example: eval('some code') - * Becomes: eval('some code') - * - */ - $str = preg_replace('#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); - - /* - * Final clean up - * - * This adds a bit of extra precaution in case - * something got through the above filters - * - */ - $bad = array( - 'document.cookie' => '[removed]', - 'document.write' => '[removed]', - 'window.location' => '[removed]', - "javascript\s*:" => '[removed]', - "Redirect\s+302" => '[removed]', - '' => '-->' - ); - - foreach ($bad as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - - log_message('debug', "XSS Filtering completed"); - return $str; - } - - // -------------------------------------------------------------------- - - /** - * HTML Entities Decode - * - * This function is a replacement for html_entity_decode() - * - * In some versions of PHP the native function does not work - * when UTF-8 is the specified character set, so this gives us - * a work-around. More info here: - * http://bugs.php.net/bug.php?id=25670 - * - * @access private - * @param string - * @param string - * @return string - */ - /* ------------------------------------------------- - /* Replacement for html_entity_decode() - /* -------------------------------------------------*/ - - /* - NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the - character set, and the PHP developers said they were not back porting the - fix to versions other than PHP 5.x. - */ - function _html_entity_decode($str, $charset='ISO-8859-1') - { - if (stristr($str, '&') === FALSE) return $str; - - // 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. - - if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) - { - $str = html_entity_decode($str, ENT_COMPAT, $charset); - $str = preg_replace('~&#x([0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); - return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); - } - - // Numeric Entities - $str = preg_replace('~&#x([0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); - - // Literal Entities - Slightly slow so we do another check - if (stristr($str, '&') === FALSE) - { - $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); - } - - return $str; - } - -} -// END Input class +use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; + $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; + $this->_sanitize_globals(); + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Globals + * + * This function does the following: + * + * Unsets $_GET data (if query strings are not enabled) + * + * Unsets all globals if register_globals is enabled + * + * Standardizes newline characters to \n + * + * @access private + * @return void + */ + function _sanitize_globals() + { + // Unset globals. This is effectively the same as register_globals = off + foreach (array($_GET, $_POST, $_COOKIE) as $global) + { + if ( ! is_array($global)) + { + global $global; + $$global = NULL; + } + else + { + foreach ($global as $key => $val) + { + global $$key; + $$key = NULL; + } + } + } + + // Is $_GET data allowed? If not we'll set the $_GET to an empty array + if ($this->allow_get_array == FALSE) + { + $_GET = array(); + } + + // Clean $_POST Data + if (is_array($_POST) AND count($_POST) > 0) + { + foreach($_POST as $key => $val) + { + $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + + // Clean $_COOKIE Data + if (is_array($_COOKIE) AND count($_COOKIE) > 0) + { + foreach($_COOKIE as $key => $val) + { + $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + + log_message('debug', "Global POST and COOKIE data sanitized"); + } + + // -------------------------------------------------------------------- + + /** + * Clean Input Data + * + * This is a helper function. It escapes data and + * standardizes newline characters to \n + * + * @access private + * @param string + * @return string + */ + function _clean_input_data($str) + { + if (is_array($str)) + { + $new_array = array(); + foreach ($str as $key => $val) + { + $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + return $new_array; + } + + if ($this->use_xss_clean === TRUE) + { + $str = $this->xss_clean($str); + } + + // Standardize newlines + return preg_replace("/\015\012|\015|\012/", "\n", $str); + } + + // -------------------------------------------------------------------- + + /** + * Clean Keys + * + * This is a helper function. To prevent malicious users + * from trying to exploit keys we make sure that keys are + * only named with alpha-numeric text and a few other items. + * + * @access private + * @param string + * @return string + */ + function _clean_input_keys($str) + { + if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) + { + exit('Disallowed Key Characters.'); + } + + if ( ! get_magic_quotes_gpc()) + { + return addslashes($str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the POST array + * + * @access public + * @param string + * @param bool + * @return string + */ + function post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_POST[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + if (is_array($_POST[$index])) + { + foreach($_POST[$index] as $key => $val) + { + $_POST[$index][$key] = $this->xss_clean($val); + } + } + else + { + return $this->xss_clean($_POST[$index]); + } + } + + return $_POST[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return string + */ + function cookie($index = '', $xss_clean = FALSE) + { + if ( ! isset($_COOKIE[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + if (is_array($_COOKIE[$index])) + { + $cookie = array(); + foreach($_COOKIE[$index] as $key => $val) + { + $cookie[$key] = $this->xss_clean($val); + } + + return $cookie; + } + else + { + return $this->xss_clean($_COOKIE[$index]); + } + } + else + { + return $_COOKIE[$index]; + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the SERVER array + * + * @access public + * @param string + * @param bool + * @return string + */ + function server($index = '', $xss_clean = FALSE) + { + if ( ! isset($_SERVER[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + return $this->xss_clean($_SERVER[$index]); + } + + return $_SERVER[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the IP Address + * + * @access public + * @return string + */ + function ip_address() + { + if ($this->ip_address !== FALSE) + { + return $this->ip_address; + } + + if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('REMOTE_ADDR')) + { + $this->ip_address = $_SERVER['REMOTE_ADDR']; + } + elseif ($this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('HTTP_X_FORWARDED_FOR')) + { + $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + + if ($this->ip_address === FALSE) + { + $this->ip_address = '0.0.0.0'; + return $this->ip_address; + } + + if (strstr($this->ip_address, ',')) + { + $x = explode(',', $this->ip_address); + $this->ip_address = end($x); + } + + if ( ! $this->valid_ip($this->ip_address)) + { + $this->ip_address = '0.0.0.0'; + } + + return $this->ip_address; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * User Agent + * + * @access public + * @return string + */ + function user_agent() + { + if ($this->user_agent !== FALSE) + { + return $this->user_agent; + } + + $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; + + return $this->user_agent; + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented.  This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts.  Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission.  It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @access public + * @param string + * @return string + */ + function xss_clean($str, $charset = 'ISO-8859-1') + { + /* + * Remove Null Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + */ + $str = preg_replace('/\0+/', '', $str); + $str = preg_replace('/(\\\\0)+/', '', $str); + + /* + * Validate standard character entities + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$str); + + /* + * Validate UTF16 two byte encoding (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x*)([0-9A-F]+);*#iu',"\\1\\2;",$str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * Google + * + * Note: Normally urldecode() would be easier but it removes plus signs + * + */ + $str = preg_replace("/%u0([a-z0-9]{3})/i", "&#x\\1;", $str); + $str = preg_replace("/%([a-z0-9]{2})/i", "&#x\\1;", $str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + if (preg_match_all("/<(.+?)>/si", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $str = str_replace($matches['1'][$i], + $this->_html_entity_decode($matches['1'][$i], $charset), + $str); + } + } + + /* + * Not Allowed Under Any Conditions + */ + $bad = array( + 'document.cookie' => '[removed]', + 'document.write' => '[removed]', + 'window.location' => '[removed]', + "javascript\s*:" => '[removed]', + "Redirect\s+302" => '[removed]', + '' => '-->' + ); + + foreach ($bad as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * Note: we deal with spaces between characters later. + * + */ + $str = preg_replace("#\t+#", " ", $str); + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * '), array('<?php', '<?PHP', '<?', '?>'), $str); + + /* + * Compact any exploded words + * + * This corrects words like: j a v a s c r i p t + * These words are compacted back to their correct state. + * + */ + $words = array('javascript', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); + foreach ($words as $word) + { + $temp = ''; + for ($i = 0; $i < strlen($word); $i++) + { + $temp .= substr($word, $i, 1)."\s*"; + } + + $temp = substr($temp, 0, -3); + $str = preg_replace('#'.$temp.'#s', $word, $str); + $str = preg_replace('#'.ucfirst($temp).'#s', ucfirst($word), $str); + } + + /* + * Remove disallowed Javascript in links or img tags + */ + $str = preg_replace("#.*?#si", "", $str); + $str = preg_replace("##si", "", $str); + $str = preg_replace("#<(script|xss).*?\>#si", "", $str); + + /* + * Remove JavaScript Event Handlers + * + * Note: This code is a little blunt. It removes + * the event handler and anything up to the closing >, + * but it's unlikely to be a problem. + * + */ + $str = preg_replace('#(<[^>]+.*?)(onblur|onchange|onclick|onfocus|onload|onmouseover|onmouseup|onmousedown|onselect|onsubmit|onunload|onkeypress|onkeydown|onkeyup|onresize)[^>]*>#iU',"\\1>",$str); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: + * Becomes: <blink> + * + */ + $str = preg_replace('#<(/*\s*)(alert|applet|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|xml|xss)([^>]*)>#is', "<\\1\\2\\3>", $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code un-executable. + * + * For example: eval('some code') + * Becomes: eval('some code') + * + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + /* + * Final clean up + * + * This adds a bit of extra precaution in case + * something got through the above filters + * + */ + $bad = array( + 'document.cookie' => '[removed]', + 'document.write' => '[removed]', + 'window.location' => '[removed]', + "javascript\s*:" => '[removed]', + "Redirect\s+302" => '[removed]', + '' => '-->' + ); + + foreach ($bad as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + + log_message('debug', "XSS Filtering completed"); + return $str; + } + + // -------------------------------------------------------------------- + + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * @access private + * @param string + * @param string + * @return string + */ + /* ------------------------------------------------- + /* Replacement for html_entity_decode() + /* -------------------------------------------------*/ + + /* + NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + character set, and the PHP developers said they were not back porting the + fix to versions other than PHP 5.x. + */ + function _html_entity_decode($str, $charset='ISO-8859-1') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) + { + $str = html_entity_decode($str, ENT_COMPAT, $charset); + $str = preg_replace('~&#x([0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); + return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); + } + + // Numeric Entities + $str = preg_replace('~&#x([0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; + } + +} +// END Input class ?> \ No newline at end of file diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 6d925a1c..8dfc8258 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -1,561 +1,561 @@ -config =& load_class('Config'); - $this->_set_route_mapping(); - log_message('debug', "Router Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Set the route mapping - * - * This function determines what should be served based on the URI request, - * as well as any "routes" that have been set in the routing config file. - * - * @access private - * @return void - */ - function _set_route_mapping() - { - // Are query strings enabled in the config file? - // If so, we're done since segment based URIs are not used with query strings. - if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) - { - $this->set_class($_GET[$this->config->item('controller_trigger')]); - - if (isset($_GET[$this->config->item('function_trigger')])) - { - $this->set_method($_GET[$this->config->item('function_trigger')]); - } - - return; - } - - // Load the routes.php file. - @include(APPPATH.'config/routes'.EXT); - $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; - unset($route); - - // Set the default controller so we can display it in the event - // the URI doesn't correlated to a valid controller. - $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); - - // Fetch the complete URI string - $this->uri_string = $this->_get_uri_string(); - - // If the URI contains only a slash we'll kill it - if ($this->uri_string == '/') - { - $this->uri_string = ''; - } - - // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. - if ($this->uri_string == '') - { - if ($this->default_controller === FALSE) - { - show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); - } - - $this->set_class($this->default_controller); - $this->set_method('index'); - - log_message('debug', "No URI present. Default controller set."); - return; - } - unset($this->routes['default_controller']); - - // Do we need to remove the suffix specified in the config file? - if ($this->config->item('url_suffix') != "") - { - $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); - } - - // Explode the URI Segments. The individual segments will - // be stored in the $this->segments array. - foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) - { - // Filter segments for security - $val = trim($this->_filter_uri($val)); - - if ($val != '') - $this->segments[] = $val; - } - - // Parse any custom routing that may exist - $this->_parse_routes(); - - // Re-index the segment array so that it starts with 1 rather than 0 - $this->_reindex_segments(); - } - - // -------------------------------------------------------------------- - - /** - * Compile Segments - * - * This function takes an array of URI segments as - * input, and puts it into the $this->segments array. - * It also sets the current class/method - * - * @access private - * @param array - * @param bool - * @return void - */ - function _compile_segments($segments = array()) - { - $segments = $this->_validate_segments($segments); - - if (count($segments) == 0) - { - return; - } - - $this->set_class($segments[0]); - - if (isset($segments[1])) - { - // A scaffolding request. No funny business with the URL - if ($this->routes['scaffolding_trigger'] == $segments[1] AND $segments[1] != '_ci_scaffolding') - { - $this->scaffolding_request = TRUE; - unset($this->routes['scaffolding_trigger']); - } - else - { - // A standard method request - $this->set_method($segments[1]); - } - } - - // Update our "routed" segment array to contain the segments. - // Note: If there is no custom routing, this array will be - // identical to $this->segments - $this->rsegments = $segments; - } - - // -------------------------------------------------------------------- - - /** - * Validates the supplied segments. Attempts to determine the path to - * the controller. - * - * @access private - * @param array - * @return array - */ - function _validate_segments($segments) - { - // Does the requested controller exist in the root folder? - if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) - { - return $segments; - } - - // Is the controller in a sub-folder? - if (is_dir(APPPATH.'controllers/'.$segments[0])) - { - // Set the directory and remove it from the segment array - $this->set_directory($segments[0]); - $segments = array_slice($segments, 1); - - if (count($segments) > 0) - { - // Does the requested controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT)) - { - show_404(); - } - } - else - { - $this->set_class($this->default_controller); - $this->set_method('index'); - - // Does the default controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT)) - { - $this->directory = ''; - return array(); - } - - } - - return $segments; - } - - // Can't find the requested controller... - show_404(); - } - - // -------------------------------------------------------------------- - /** - * Re-index Segments - * - * This function re-indexes the $this->segment array so that it - * starts at 1 rather then 0. Doing so makes it simpler to - * use functions like $this->uri->segment(n) since there is - * a 1:1 relationship between the segment array and the actual segments. - * - * @access private - * @return void - */ - function _reindex_segments() - { - // Is the routed segment array different then the main segment array? - $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; - - $i = 1; - foreach ($this->segments as $val) - { - $this->segments[$i++] = $val; - } - unset($this->segments[0]); - - if ($diff == FALSE) - { - $this->rsegments = $this->segments; - } - else - { - $i = 1; - foreach ($this->rsegments as $val) - { - $this->rsegments[$i++] = $val; - } - unset($this->rsegments[0]); - } - } - - // -------------------------------------------------------------------- - - /** - * Get the URI String - * - * @access private - * @return string - */ - function _get_uri_string() - { - if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') - { - // If the URL has a question mark then it's simplest to just - // build the URI string from the zero index of the $_GET array. - // This avoids having to deal with $_SERVER variables, which - // can be unreliable in some environments - if (is_array($_GET) AND count($_GET) == 1) - { - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $keys = array_keys($_GET); - return current($keys); - } - - // Is there a PATH_INFO variable? - // Note: some servers seem to have trouble with getenv() so we'll test it two ways - $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - if ($path != '' AND $path != "/".SELF) - { - return $path; - } - - // No PATH_INFO?... What about QUERY_STRING? - $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - if ($path != '') - { - return $path; - } - - // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if ($path != '' AND $path != "/".SELF) - { - return $path; - } - - // We've exhausted all our options... - return ''; - } - else - { - $uri = strtoupper($this->config->item('uri_protocol')); - - if ($uri == 'REQUEST_URI') - { - return $this->_parse_request_uri(); - } - - return (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); - } - } - - // -------------------------------------------------------------------- - - /** - * Parse the REQUEST_URI - * - * Due to the way REQUEST_URI works it usually contains path info - * that makes it unusable as URI data. We'll trim off the unnecessary - * data, hopefully arriving at a valid URI that we can use. - * - * @access private - * @return string - */ - function _parse_request_uri() - { - if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') - { - return ''; - } - - $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - - if ($request_uri == '' OR $request_uri == SELF) - { - return ''; - } - - $fc_path = FCPATH; - if (strpos($request_uri, '?') !== FALSE) - { - $fc_path .= '?'; - } - - $parsed_uri = explode("/", $request_uri); - - $i = 0; - foreach(explode("/", $fc_path) as $segment) - { - if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) - { - $i++; - } - } - - $parsed_uri = implode("/", array_slice($parsed_uri, $i)); - - if ($parsed_uri != '') - { - $parsed_uri = '/'.$parsed_uri; - } - - return $parsed_uri; - } - - // -------------------------------------------------------------------- - - /** - * Filter segments for malicious characters - * - * @access private - * @param string - * @return string - */ - function _filter_uri($str) - { - if ($this->config->item('permitted_uri_chars') != '') - { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) - { - exit('The URI you submitted has disallowed characters: '.$str); - } - } - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Parse Routes - * - * This function matches any routes that may exist in - * the config/routes.php file against the URI to - * determine if the class/method need to be remapped. - * - * @access private - * @return void - */ - function _parse_routes() - { - // Do we even have any custom routing to deal with? - if (count($this->routes) == 0) - { - $this->_compile_segments($this->segments); - return; - } - - // Turn the segment array into a URI string - $uri = implode('/', $this->segments); - $num = count($this->segments); - - // Is there a literal match? If so we're done - if (isset($this->routes[$uri])) - { - $this->_compile_segments(explode('/', $this->routes[$uri])); - return; - } - - // Loop through the route array looking for wild-cards - foreach (array_slice($this->routes, 1) as $key => $val) - { - // Convert wild-cards to RegEx - $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); - - // Does the RegEx match? - if (preg_match('#^'.$key.'$#', $uri)) - { - // Do we have a back-reference? - if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) - { - $val = preg_replace('#^'.$key.'$#', $val, $uri); - } - - $this->_compile_segments(explode('/', $val)); - return; - } - } - - // If we got this far it means we didn't encounter a - // matching route so we'll set the site default route - $this->_compile_segments($this->segments); - } - - // -------------------------------------------------------------------- - - /** - * Set the class name - * - * @access public - * @param string - * @return void - */ - function set_class($class) - { - $this->class = $class; - } - - // -------------------------------------------------------------------- - - /** - * Fetch the current class - * - * @access public - * @return string - */ - function fetch_class() - { - return $this->class; - } - - // -------------------------------------------------------------------- - - /** - * Set the method name - * - * @access public - * @param string - * @return void - */ - function set_method($method) - { - $this->method = $method; - } - - // -------------------------------------------------------------------- - - /** - * Fetch the current method - * - * @access public - * @return string - */ - function fetch_method() - { - if ($this->method == $this->fetch_class()) - { - return 'index'; - } - - return $this->method; - } - - // -------------------------------------------------------------------- - - /** - * Set the directory name - * - * @access public - * @param string - * @return void - */ - function set_directory($dir) - { - $this->directory = $dir.'/'; - } - - // -------------------------------------------------------------------- - - /** - * Fetch the sub-directory (if any) that contains the requested controller class - * - * @access public - * @return string - */ - function fetch_directory() - { - return $this->directory; - } - -} -// END Router Class +config =& load_class('Config'); + $this->_set_route_mapping(); + log_message('debug', "Router Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set the route mapping + * + * This function determines what should be served based on the URI request, + * as well as any "routes" that have been set in the routing config file. + * + * @access private + * @return void + */ + function _set_route_mapping() + { + // Are query strings enabled in the config file? + // If so, we're done since segment based URIs are not used with query strings. + if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) + { + $this->set_class($_GET[$this->config->item('controller_trigger')]); + + if (isset($_GET[$this->config->item('function_trigger')])) + { + $this->set_method($_GET[$this->config->item('function_trigger')]); + } + + return; + } + + // Load the routes.php file. + @include(APPPATH.'config/routes'.EXT); + $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; + unset($route); + + // Set the default controller so we can display it in the event + // the URI doesn't correlated to a valid controller. + $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); + + // Fetch the complete URI string + $this->uri_string = $this->_get_uri_string(); + + // If the URI contains only a slash we'll kill it + if ($this->uri_string == '/') + { + $this->uri_string = ''; + } + + // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. + if ($this->uri_string == '') + { + if ($this->default_controller === FALSE) + { + show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); + } + + $this->set_class($this->default_controller); + $this->set_method('index'); + + log_message('debug', "No URI present. Default controller set."); + return; + } + unset($this->routes['default_controller']); + + // Do we need to remove the suffix specified in the config file? + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + + // Explode the URI Segments. The individual segments will + // be stored in the $this->segments array. + foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + $this->segments[] = $val; + } + + // Parse any custom routing that may exist + $this->_parse_routes(); + + // Re-index the segment array so that it starts with 1 rather than 0 + $this->_reindex_segments(); + } + + // -------------------------------------------------------------------- + + /** + * Compile Segments + * + * This function takes an array of URI segments as + * input, and puts it into the $this->segments array. + * It also sets the current class/method + * + * @access private + * @param array + * @param bool + * @return void + */ + function _compile_segments($segments = array()) + { + $segments = $this->_validate_segments($segments); + + if (count($segments) == 0) + { + return; + } + + $this->set_class($segments[0]); + + if (isset($segments[1])) + { + // A scaffolding request. No funny business with the URL + if ($this->routes['scaffolding_trigger'] == $segments[1] AND $segments[1] != '_ci_scaffolding') + { + $this->scaffolding_request = TRUE; + unset($this->routes['scaffolding_trigger']); + } + else + { + // A standard method request + $this->set_method($segments[1]); + } + } + + // Update our "routed" segment array to contain the segments. + // Note: If there is no custom routing, this array will be + // identical to $this->segments + $this->rsegments = $segments; + } + + // -------------------------------------------------------------------- + + /** + * Validates the supplied segments. Attempts to determine the path to + * the controller. + * + * @access private + * @param array + * @return array + */ + function _validate_segments($segments) + { + // Does the requested controller exist in the root folder? + if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) + { + return $segments; + } + + // Is the controller in a sub-folder? + if (is_dir(APPPATH.'controllers/'.$segments[0])) + { + // Set the directory and remove it from the segment array + $this->set_directory($segments[0]); + $segments = array_slice($segments, 1); + + if (count($segments) > 0) + { + // Does the requested controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT)) + { + show_404(); + } + } + else + { + $this->set_class($this->default_controller); + $this->set_method('index'); + + // Does the default controller exist in the sub-folder? + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT)) + { + $this->directory = ''; + return array(); + } + + } + + return $segments; + } + + // Can't find the requested controller... + show_404(); + } + + // -------------------------------------------------------------------- + /** + * Re-index Segments + * + * This function re-indexes the $this->segment array so that it + * starts at 1 rather then 0. Doing so makes it simpler to + * use functions like $this->uri->segment(n) since there is + * a 1:1 relationship between the segment array and the actual segments. + * + * @access private + * @return void + */ + function _reindex_segments() + { + // Is the routed segment array different then the main segment array? + $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; + + $i = 1; + foreach ($this->segments as $val) + { + $this->segments[$i++] = $val; + } + unset($this->segments[0]); + + if ($diff == FALSE) + { + $this->rsegments = $this->segments; + } + else + { + $i = 1; + foreach ($this->rsegments as $val) + { + $this->rsegments[$i++] = $val; + } + unset($this->rsegments[0]); + } + } + + // -------------------------------------------------------------------- + + /** + * Get the URI String + * + * @access private + * @return string + */ + function _get_uri_string() + { + if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') + { + // If the URL has a question mark then it's simplest to just + // build the URI string from the zero index of the $_GET array. + // This avoids having to deal with $_SERVER variables, which + // can be unreliable in some environments + if (is_array($_GET) AND count($_GET) == 1) + { + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $keys = array_keys($_GET); + return current($keys); + } + + // Is there a PATH_INFO variable? + // Note: some servers seem to have trouble with getenv() so we'll test it two ways + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if ($path != '' AND $path != "/".SELF) + { + return $path; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if ($path != '') + { + return $path; + } + + // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? + $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + if ($path != '' AND $path != "/".SELF) + { + return $path; + } + + // We've exhausted all our options... + return ''; + } + else + { + $uri = strtoupper($this->config->item('uri_protocol')); + + if ($uri == 'REQUEST_URI') + { + return $this->_parse_request_uri(); + } + + return (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); + } + } + + // -------------------------------------------------------------------- + + /** + * Parse the REQUEST_URI + * + * Due to the way REQUEST_URI works it usually contains path info + * that makes it unusable as URI data. We'll trim off the unnecessary + * data, hopefully arriving at a valid URI that we can use. + * + * @access private + * @return string + */ + function _parse_request_uri() + { + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') + { + return ''; + } + + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '' OR $request_uri == SELF) + { + return ''; + } + + $fc_path = FCPATH; + if (strpos($request_uri, '?') !== FALSE) + { + $fc_path .= '?'; + } + + $parsed_uri = explode("/", $request_uri); + + $i = 0; + foreach(explode("/", $fc_path) as $segment) + { + if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) + { + $i++; + } + } + + $parsed_uri = implode("/", array_slice($parsed_uri, $i)); + + if ($parsed_uri != '') + { + $parsed_uri = '/'.$parsed_uri; + } + + return $parsed_uri; + } + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ($this->config->item('permitted_uri_chars') != '') + { + if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + { + exit('The URI you submitted has disallowed characters.'); + } + } + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Parse Routes + * + * This function matches any routes that may exist in + * the config/routes.php file against the URI to + * determine if the class/method need to be remapped. + * + * @access private + * @return void + */ + function _parse_routes() + { + // Do we even have any custom routing to deal with? + if (count($this->routes) == 0) + { + $this->_compile_segments($this->segments); + return; + } + + // Turn the segment array into a URI string + $uri = implode('/', $this->segments); + $num = count($this->segments); + + // Is there a literal match? If so we're done + if (isset($this->routes[$uri])) + { + $this->_compile_segments(explode('/', $this->routes[$uri])); + return; + } + + // Loop through the route array looking for wild-cards + foreach (array_slice($this->routes, 1) as $key => $val) + { + // Convert wild-cards to RegEx + $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); + + // Does the RegEx match? + if (preg_match('#^'.$key.'$#', $uri)) + { + // Do we have a back-reference? + if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE) + { + $val = preg_replace('#^'.$key.'$#', $val, $uri); + } + + $this->_compile_segments(explode('/', $val)); + return; + } + } + + // If we got this far it means we didn't encounter a + // matching route so we'll set the site default route + $this->_compile_segments($this->segments); + } + + // -------------------------------------------------------------------- + + /** + * Set the class name + * + * @access public + * @param string + * @return void + */ + function set_class($class) + { + $this->class = $class; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current class + * + * @access public + * @return string + */ + function fetch_class() + { + return $this->class; + } + + // -------------------------------------------------------------------- + + /** + * Set the method name + * + * @access public + * @param string + * @return void + */ + function set_method($method) + { + $this->method = $method; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current method + * + * @access public + * @return string + */ + function fetch_method() + { + if ($this->method == $this->fetch_class()) + { + return 'index'; + } + + return $this->method; + } + + // -------------------------------------------------------------------- + + /** + * Set the directory name + * + * @access public + * @param string + * @return void + */ + function set_directory($dir) + { + $this->directory = $dir.'/'; + } + + // -------------------------------------------------------------------- + + /** + * Fetch the sub-directory (if any) that contains the requested controller class + * + * @access public + * @return string + */ + function fetch_directory() + { + return $this->directory; + } + +} +// END Router Class ?> \ No newline at end of file From eec852be74d523db209c7c3b0edbd21105463059 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Feb 2007 03:11:11 +0000 Subject: [PATCH 0479/2544] fixed incorrect version number --- user_guide/installation/downloads.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 88ef4748..5acf04e5 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -63,7 +63,7 @@

            Downloading Code Igniter

              -
            • Code Igniter V 1.5.2 (Current version)
            • +
            • Code Igniter V 1.5.1 (Current version)
            • Code Igniter V 1.4.1
            • Code Igniter V 1.3.3
            • Code Igniter V 1.3.2
            • From c47f6e7a490f623e2cf83e8c70a35eb7c7f3abee Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Feb 2007 03:11:25 +0000 Subject: [PATCH 0480/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 013c0e57..21935898 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

              Version 1.5.1.1

              • Added support for captions in the Table Library
              • Fixed a bug in the form helper that gave textarea a value attribute
              • +
              • Fixed a bug in the Image Library that was ignoring resizing the same size image
              • Fixed some doc typos.

              Version 1.5.0.2

              From c5d887941fac6754972e87979e180cc043c4d0fe Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Feb 2007 03:12:32 +0000 Subject: [PATCH 0481/2544] fixed resize bug that was comparing height to width instead of height to original height --- system/libraries/Image_lib.php | 3052 ++++++++++++++++---------------- 1 file changed, 1526 insertions(+), 1526 deletions(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 561c5c03..28e1bfbb 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1,1527 +1,1527 @@ - 0) - { - $this->initialize($props); - } - - log_message('debug', "Image Lib Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize image properties - * - * Resets values in case this class is used in a loop - * - * @access public - * @return void - */ - 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'); - - foreach ($props as $val) - { - $this->$val = ''; - } - } - - // -------------------------------------------------------------------- - - /** - * initialize image preferences - * - * @access public - * @param array - * @return void - */ - function initialize($props = array()) - { - /* - * Convert array elements into class variables - */ - if (count($props) > 0) - { - foreach ($props as $key => $val) - { - $this->$key = $val; - } - } - - /* - * Is there a source image? - * - * If not, there's no reason to continue - * - */ - if ($this->source_image == '') - { - $this->set_error('imglib_source_image_required'); - return FALSE; - } - - /* - * Is getimagesize() Available? - * - * We use it to determine the image properties (width/height). - * Note: We need to figure out how to determine image - * properties using ImageMagick and NetPBM - * - */ - if ( ! function_exists('getimagesize')) - { - $this->set_error('imglib_gd_required_for_props'); - return FALSE; - } - - $this->image_library = strtolower($this->image_library); - - /* - * Set the full server path - * - * The source image may or may not contain a path. - * Either way, we'll try use realpath to generate the - * full server path in order to more reliably read it. - * - */ - if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) - { - $full_source_path = str_replace("\\", "/", realpath($this->source_image)); - } - else - { - $full_source_path = $this->source_image; - } - - $x = explode('/', $full_source_path); - $this->source_image = end($x); - $this->source_folder = str_replace($this->source_image, '', $full_source_path); - - // Set the Image Properties - if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) - { - return FALSE; - } - - /* - * Assign the "new" image name/path - * - * If the user has set a "new_image" name it means - * we are making a copy of the source image. If not - * it means we are altering the original. We'll - * set the destination filename and path accordingly. - * - */ - if ($this->new_image == '') - { - $this->dest_image = $this->source_image; - $this->dest_folder = $this->source_folder; - } - else - { - if (strpos($this->new_image, '/') === FALSE) - { - $this->dest_folder = $this->source_folder; - $this->dest_image = $this->new_image; - } - else - { - if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) - { - $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); - } - else - { - $full_dest_path = $this->new_image; - } - - // Is there a file name? - if ( ! preg_match("#[\.jpg|\.jpeg|\.gif|\.png]$#i", $full_dest_path)) - { - $this->dest_folder = $full_dest_path.'/'; - $this->dest_image = $this->source_image; - } - else - { - $x = explode('/', $full_dest_path); - $this->dest_image = end($x); - $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path); - } - } - } - - /* - * Compile the finalized filenames/paths - * - * We'll create two master strings containing the - * full server path to the source image and the - * full server path to the destination image. - * We'll also split the destination image name - * so we can insert the thumbnail marker if needed. - * - */ - if ($this->create_thumb === FALSE OR $this->thumb_marker == '') - { - $this->thumb_marker = ''; - } - - $xp = $this->explode_name($this->dest_image); - - $filename = $xp['name']; - $file_ext = $xp['ext']; - - $this->full_src_path = $this->source_folder.$this->source_image; - $this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext; - - /* - * Should we maintain image proportions? - * - * When creating thumbs or copies, the target width/height - * might not be in correct proportion with the source - * image's width/height. We'll recalculate it here. - * - */ - if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) - { - $this->image_reproportion(); - } - - /* - * Was a width and height specified? - * - * If the destination width/height was - * not submitted we will use the values - * from the actual file - * - */ - if ($this->width == '') - $this->width = $this->orig_width; - - if ($this->height == '') - $this->height = $this->orig_height; - - // Set the quality - $this->quality = trim(str_replace("%", "", $this->quality)); - - if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) - $this->quality = 90; - - // Set the x/y coordinates - $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; - $this->y_axis = ($this->y_axis == '' OR ! is_numeric($this->y_axis)) ? 0 : $this->y_axis; - - // Watermark-related Stuff... - if ($this->wm_font_color != '') - { - if (strlen($this->wm_font_color) == 6) - { - $this->wm_font_color = '#'.$this->wm_font_color; - } - } - - if ($this->wm_shadow_color != '') - { - if (strlen($this->wm_shadow_color) == 6) - { - $this->wm_shadow_color = '#'.$this->wm_shadow_color; - } - } - - if ($this->wm_overlay_path != '') - { - $this->wm_overlay_path = str_replace("\\", "/", realpath($this->wm_overlay_path)); - } - - if ($this->wm_shadow_color != '') - { - $this->wm_use_drop_shadow = TRUE; - } - - if ($this->wm_font_path != '') - { - $this->wm_use_truetype = TRUE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Image Resize - * - * This is a wrapper function that chooses the proper - * resize function based on the protocol specified - * - * @access public - * @return bool - */ - function resize() - { - $protocol = 'image_process_'.$this->image_library; - - if (eregi("gd2$", $protocol)) - { - $protocol = 'image_process_gd'; - } - - return $this->$protocol('resize'); - } - - // -------------------------------------------------------------------- - - /** - * Image Crop - * - * This is a wrapper function that chooses the proper - * cropping function based on the protocol specified - * - * @access public - * @return bool - */ - function crop() - { - $protocol = 'image_process_'.$this->image_library; - - if (eregi("gd2$", $protocol)) - { - $protocol = 'image_process_gd'; - } - - return $this->$protocol('crop'); - } - - // -------------------------------------------------------------------- - - /** - * Image Rotate - * - * This is a wrapper function that chooses the proper - * rotation function based on the protocol specified - * - * @access public - * @return bool - */ - function rotate() - { - // Allowed rotation values - $degs = array(90, 180, 270, 'vrt', 'hor'); - - if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs, TRUE)) - { - $this->set_error('imglib_rotation_angle_required'); - return FALSE; - } - - // Reassign the width and height - if ($this->rotation_angle == 90 OR $this->rotation_angle == 270) - { - $this->width = $this->orig_height; - $this->height = $this->orig_width; - } - else - { - $this->width = $this->orig_width; - $this->height = $this->orig_height; - } - - - // Choose resizing function - if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm') - { - $protocol = 'image_process_'.$this->image_library; - - return $this->$protocol('rotate'); - } - - if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') - { - return $this->image_mirror_gd(); - } - else - { - return $this->image_rotate_gd(); - } - } - - // -------------------------------------------------------------------- - - /** - * Image Process Using GD/GD2 - * - * This function will resize or crop - * - * @access public - * @param string - * @return bool - */ - function image_process_gd($action = 'resize') - { - $v2_override = FALSE; - - if ($action == 'crop') - { - // If the target width/height match the source then it's pointless to crop, right? - if ($this->width >= $this->orig_width AND $this->height >= $this->orig_width) - { - // We'll return true so the user thinks the process succeeded. - // It'll be our little secret... - - return TRUE; - } - - // Reassign the source width/height if cropping - $this->orig_width = $this->width; - $this->orig_height = $this->height; - - // GD 2.0 has a cropping bug so we'll test for it - if ($this->gd_version() !== FALSE) - { - $gd_version = str_replace('0', '', $this->gd_version()); - $v2_override = ($gd_version == 2) ? TRUE : FALSE; - } - } - else - { - // If the target width/height match the source, AND if - // the new file name is not equal to the old file name - // we'll simply make a copy of the original with the new name - if (($this->orig_width == $this->width AND $this->orig_height == $this->height) AND ($this->source_image != $this->dest_image)) - { - if ( ! @copy($this->full_src_path, $this->full_dst_path)) - { - $this->set_error('imglib_copy_failed'); - return FALSE; - } - - @chmod($this->full_dst_path, 0777); - return TRUE; - } - - // If resizing the x/y axis must be zero - $this->x_axis = 0; - $this->y_axis = 0; - } - - // Create the image handle - if ( ! ($src_img = $this->image_create_gd())) - { - return FALSE; - } - - // Create The Image - if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) - { - $create = 'imagecreatetruecolor'; - $copy = 'imagecopyresampled'; - } - else - { - $create = 'imagecreate'; - $copy = 'imagecopyresized'; - } - - $dst_img = $create($this->width, $this->height); - $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); - - // Show the image - if ($this->dynamic_output == TRUE) - { - $this->image_display_gd($dst_img); - } - else - { - // Or save it - if ( ! $this->image_save_gd($dst_img)) - { - return FALSE; - } - } - - // Kill the file handles - imagedestroy($dst_img); - imagedestroy($src_img); - - // Set the file to 777 - @chmod($this->full_dst_path, 0777); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Image Process Using ImageMagick - * - * This function will resize, crop or rotate - * - * @access public - * @param string - * @return bool - */ - function image_process_imagemagick($action = 'resize') - { - // Do we have a vaild library path? - if ($this->library_path == '') - { - $this->set_error('imglib_libpath_invalid'); - return FALSE; - } - - if ( ! eregi("convert$", $this->library_path)) - { - if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; - - $this->library_path .= 'convert'; - } - - // Execute the command - $cmd = $this->library_path." -quality ".$this->quality; - - if ($action == 'crop') - { - $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; - } - elseif ($action == 'rotate') - { - switch ($this->rotation_angle) - { - case 'hor' : $angle = '-flop'; - break; - case 'vrt' : $angle = '-flip'; - break; - default : $angle = '-rotate '.$this->rotation_angle; - break; - } - - $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; - } - else // Resize - { - $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; - } - - $retval = 1; - - @exec($cmd, $output, $retval); - - // Did it work? - if ($retval > 0) - { - $this->set_error('imglib_image_process_failed'); - return FALSE; - } - - // Set the file to 777 - @chmod($this->full_dst_path, 0777); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Image Process Using NetPBM - * - * This function will resize, crop or rotate - * - * @access public - * @param string - * @return bool - */ - function image_process_netpbm($action = 'resize') - { - if ($this->library_path == '') - { - $this->set_error('imglib_libpath_invalid'); - return FALSE; - } - - // Build the resizing command - switch ($this->image_type) - { - case 1 : - $cmd_in = 'giftopnm'; - $cmd_out = 'ppmtogif'; - break; - case 2 : - $cmd_in = 'jpegtopnm'; - $cmd_out = 'ppmtojpeg'; - break; - case 3 : - $cmd_in = 'pngtopnm'; - $cmd_out = 'ppmtopng'; - break; - } - - if ($action == 'crop') - { - $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; - } - elseif ($action == 'rotate') - { - switch ($this->rotation_angle) - { - case 90 : $angle = 'r270'; - break; - case 180 : $angle = 'r180'; - break; - case 270 : $angle = 'r90'; - break; - case 'vrt' : $angle = 'tb'; - break; - case 'hor' : $angle = 'lr'; - break; - } - - $cmd_inner = 'pnmflip -'.$angle.' '; - } - else // Resize - { - $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; - } - - $cmd = $this->library_path.$cmd_in.' '.$this->full_src_path.' | '.$cmd_inner.' | '.$cmd_out.' > '.$this->dest_folder.'netpbm.tmp'; - - $retval = 1; - - @exec($cmd, $output, $retval); - - // Did it work? - if ($retval > 0) - { - $this->set_error('imglib_image_process_failed'); - return FALSE; - } - - // With NetPBM we have to create a temporary image. - // If you try manipulating the original it fails so - // we have to rename the temp file. - copy ($this->dest_folder.'netpbm.tmp', $this->full_dst_path); - unlink ($this->dest_folder.'netpbm.tmp'); - @chmod($dst_image, 0777); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Image Rotate Using GD - * - * @access public - * @return bool - */ - function image_rotate_gd() - { - // Is Image Rotation Supported? - // this function is only supported as of PHP 4.3 - if ( ! function_exists('imagerotate')) - { - $this->set_error('imglib_rotate_unsupported'); - return FALSE; - } - - // Create the image handle - if ( ! ($src_img = $this->image_create_gd())) - { - return FALSE; - } - - // Set the background color - // This won't work with transparent PNG files so we are - // going to have to figure out how to determine the color - // of the alpha channel in a future release. - - $white = imagecolorallocate($src_img, 255, 255, 255); - - // Rotate it! - $dst_img = imagerotate($src_img, $this->rotation_angle, $white); - - // Save the Image - if ($this->dynamic_output == TRUE) - { - $this->image_display_gd($dst_img); - } - else - { - // Or save it - if ( ! $this->image_save_gd($dst_img)) - { - return FALSE; - } - } - - // Kill the file handles - imagedestroy($dst_img); - imagedestroy($src_img); - - // Set the file to 777 - - @chmod($this->full_dst_path, 0777); - - return true; - } - - // -------------------------------------------------------------------- - - /** - * Create Mirror Image using GD - * - * This function will flip horizontal or vertical - * - * @access public - * @return bool - */ - function image_mirror_gd() - { - if ( ! $src_img = $this->image_create_gd()) - { - return FALSE; - } - - $width = $this->orig_width; - $height = $this->orig_height; - - if ($this->rotation_angle == 'hor') - { - for ($i = 0; $i < $height; $i++) - { - $left = 0; - $right = $width-1; - - while ($left < $right) - { - $cl = imagecolorat($src_img, $left, $i); - $cr = imagecolorat($src_img, $right, $i); - - imagesetpixel($src_img, $left, $i, $cr); - imagesetpixel($src_img, $right, $i, $cl); - - $left++; - $right--; - } - } - } - else - { - for ($i = 0; $i < $width; $i++) - { - $top = 0; - $bot = $height-1; - - while ($top < $bot) - { - $ct = imagecolorat($src_img, $i, $top); - $cb = imagecolorat($src_img, $i, $bot); - - imagesetpixel($src_img, $i, $top, $cb); - imagesetpixel($src_img, $i, $bot, $ct); - - $top++; - $bot--; - } - } - } - - // Show the image - if ($this->dynamic_output == TRUE) - { - $this->image_display_gd($src_img); - } - else - { - // Or save it - if ( ! $this->image_save_gd($src_img)) - { - return FALSE; - } - } - - // Kill the file handles - imagedestroy($src_img); - - // Set the file to 777 - @chmod($this->full_dst_path, 0777); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Image Watermark - * - * This is a wrapper function that chooses the type - * of watermarking based on the specified preference. - * - * @access public - * @param string - * @return bool - */ - function watermark() - { - if ($this->wm_type == 'overlay') - { - return $this->overlay_watermark(); - } - else - { - return $this->text_watermark(); - } - } - - // -------------------------------------------------------------------- - - /** - * Watermark - Graphic Version - * - * @access public - * @return bool - */ - function overlay_watermark() - { - if ( ! function_exists('imagecolortransparent')) - { - $this->set_error('imglib_gd_required'); - return FALSE; - } - - // Fetch source image properties - $this->get_image_properties(); - - // Fetch watermark image properties - $props = $this->get_image_properties($this->wm_overlay_path, TRUE); - $wm_img_type = $props['image_type']; - $wm_width = $props['width']; - $wm_height = $props['height']; - - // Create two image resources - $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); - $src_img = $this->image_create_gd($this->full_src_path); - - // Reverse the offset if necessary - // When the image is positioned at the bottom - // we don't want the vertical offset to push it - // further down. We want the reverse, so we'll - // invert the offset. Same with the horizontal - // offset when the image is at the right - - $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); - $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); - - if ($this->wm_vrt_alignment == 'B') - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; - - if ($this->wm_hor_alignment == 'R') - $this->wm_hor_offset = $this->wm_hor_offset * -1; - - // Set the base x and y axis values - $x_axis = $this->wm_hor_offset + $this->wm_padding; - $y_axis = $this->wm_vrt_offset + $this->wm_padding; - - // Set the vertical position - switch ($this->wm_vrt_alignment) - { - case 'T': - break; - case 'M': $y_axis += ($this->orig_height / 2) - ($wm_height / 2); - break; - case 'B': $y_axis += $this->orig_height - $wm_height; - break; - } - - // Set the horizontal position - switch ($this->wm_hor_alignment) - { - case 'L': - break; - case 'C': $x_axis += ($this->orig_width / 2) - ($wm_width / 2); - break; - case 'R': $x_axis += $this->orig_width - $wm_width; - break; - } - - // Build the finalized image - if ($wm_img_type == 3 AND function_exists('imagealphablending')) - { - @imagealphablending($src_img, TRUE); - } - - // Set RGB values for text and shadow - imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); - imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); - - // Output the image - if ($this->dynamic_output == TRUE) - { - $this->image_display_gd($src_img); - } - else - { - if ( ! $this->image_save_gd($src_img)) - { - return FALSE; - } - } - - imagedestroy($src_img); - imagedestroy($wm_img); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Watermark - Text Version - * - * @access public - * @return bool - */ - function text_watermark() - { - if ( ! ($src_img = $this->image_create_gd())) - { - return FALSE; - } - - if ($this->wm_use_truetype == TRUE AND ! file_exists($this->wm_font_path)) - { - $this->set_error('imglib_missing_font'); - return FALSE; - } - - // Fetch source image properties - $this->get_image_properties(); - - // Set RGB values for text and shadow - $this->wm_font_color = str_replace('#', '', $this->wm_font_color); - $this->wm_shadow_color = str_replace('#', '', $this->wm_shadow_color); - - $R1 = hexdec(substr($this->wm_font_color, 0, 2)); - $G1 = hexdec(substr($this->wm_font_color, 2, 2)); - $B1 = hexdec(substr($this->wm_font_color, 4, 2)); - - $R2 = hexdec(substr($this->wm_shadow_color, 0, 2)); - $G2 = hexdec(substr($this->wm_shadow_color, 2, 2)); - $B2 = hexdec(substr($this->wm_shadow_color, 4, 2)); - - $txt_color = imagecolorclosest($src_img, $R1, $G1, $B1); - $drp_color = imagecolorclosest($src_img, $R2, $G2, $B2); - - // Reverse the vertical offset - // When the image is positioned at the bottom - // we don't want the vertical offset to push it - // further down. We want the reverse, so we'll - // invert the offset. Note: The horizontal - // offset flips itself automatically - - if ($this->wm_vrt_alignment == 'B') - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; - - if ($this->wm_hor_alignment == 'R') - $this->wm_hor_offset = $this->wm_hor_offset * -1; - - // Set font width and height - // These are calculated differently depending on - // whether we are using the true type font or not - if ($this->wm_use_truetype == TRUE) - { - if ($this->wm_font_size == '') - $this->wm_font_size = '17'; - - $fontwidth = $this->wm_font_size-($this->wm_font_size/4); - $fontheight = $this->wm_font_size; - $this->wm_vrt_offset += $this->wm_font_size; - } - else - { - $fontwidth = imagefontwidth($this->wm_font_size); - $fontheight = imagefontheight($this->wm_font_size); - } - - // Set base X and Y axis values - $x_axis = $this->wm_hor_offset + $this->wm_padding; - $y_axis = $this->wm_vrt_offset + $this->wm_padding; - - // Set verticle alignment - if ($this->wm_use_drop_shadow == FALSE) - $this->wm_shadow_distance = 0; - - $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); - $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); - - switch ($this->wm_vrt_alignment) - { - case "T" : - break; - case "M": $y_axis += ($this->orig_height/2)+($fontheight/2); - break; - case "B": $y_axis += ($this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight/2)); - break; - } - - $x_shad = $x_axis + $this->wm_shadow_distance; - $y_shad = $y_axis + $this->wm_shadow_distance; - - // Set horizontal alignment - switch ($this->wm_hor_alignment) - { - case "L": - break; - case "R": - if ($this->wm_use_drop_shadow) - $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); - $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); - break; - case "C": - if ($this->wm_use_drop_shadow) - $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); - $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); - break; - } - - // Add the text to the source image - if ($this->wm_use_truetype) - { - if ($this->wm_use_drop_shadow) - imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); - imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); - } - else - { - if ($this->wm_use_drop_shadow) - imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); - imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); - } - - // Output the final image - if ($this->dynamic_output == TRUE) - { - $this->image_display_gd($src_img); - } - else - { - $this->image_save_gd($src_img); - } - - imagedestroy($src_img); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Create Image - GD - * - * This simply creates an image resource handle - * based on the type of image being processed - * - * @access public - * @param string - * @return resource - */ - function image_create_gd($path = '', $image_type = '') - { - if ($path == '') - $path = $this->full_src_path; - - if ($image_type == '') - $image_type = $this->image_type; - - - switch ($image_type) - { - case 1 : - if ( ! function_exists('imagecreatefromgif')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); - return FALSE; - } - - return imagecreatefromgif($path); - break; - case 2 : - if ( ! function_exists('imagecreatefromjpeg')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); - return FALSE; - } - - return imagecreatefromjpeg($path); - break; - case 3 : - if ( ! function_exists('imagecreatefrompng')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); - return FALSE; - } - - return imagecreatefrompng($path); - break; - - } - - $this->set_error(array('imglib_unsupported_imagecreate')); - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Write image file to disk - GD - * - * Takes an image resource as input and writes the file - * to the specified destination - * - * @access public - * @param resource - * @return bool - */ - function image_save_gd($resource) - { - switch ($this->image_type) - { - case 1 : - if ( ! function_exists('imagegif')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); - return FALSE; - } - - @imagegif($resource, $this->full_dst_path); - break; - case 2 : - if ( ! function_exists('imagejpeg')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); - return FALSE; - } - - if (phpversion() == '4.4.1') - { - @touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround - } - - @imagejpeg($resource, $this->full_dst_path, $this->quality); - break; - case 3 : - if ( ! function_exists('imagepng')) - { - $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); - return FALSE; - } - - @imagepng($resource, $this->full_dst_path); - break; - default : - $this->set_error(array('imglib_unsupported_imagecreate')); - return FALSE; - break; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Dynamically outputs an image - * - * @access public - * @param resource - * @return void - */ - function image_display_gd($resource) - { - header("Content-Disposition: filename={$this->source_image};"); - header("Content-Type: {$this->mime_type}"); - header('Content-Transfer-Encoding: binary'); - header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); - - switch ($this->image_type) - { - case 1 : imagegif($resource); - break; - case 2 : imagejpeg($resource, '', $this->quality); - break; - case 3 : imagepng($resource); - break; - default : echo 'Unable to display the image'; - break; - } - } - - // -------------------------------------------------------------------- - - /** - * Re-proportion Image Width/Height - * - * When creating thumbs, the desired width/height - * can end up warping the image due to an incorrect - * ratio between the full-sized image and the thumb. - * - * This function lets us re-proportion the width/height - * if users choose to maintain the aspect ratio when resizing. - * - * @access public - * @return void - */ - function image_reproportion() - { - if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) - return; - - if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) - return; - - $new_width = ceil($this->orig_width*$this->height/$this->orig_height); - $new_height = ceil($this->width*$this->orig_height/$this->orig_width); - - $ratio = (($this->orig_height/$this->orig_width) - ($this->height/$this->width)); - - if ($this->master_dim != 'width' AND $this->master_dim != 'height') - { - $this->master_dim = ($ratio < 0) ? 'width' : 'height'; - } - - if (($this->width != $new_width) AND ($this->height != $new_height)) - { - if ($this->master_dim == 'height') - { - $this->width = $new_width; - } - else - { - $this->height = $new_height; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Get image properties - * - * A helper function that gets info about the file - * - * @access public - * @param string - * @return mixed - */ - 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 - - if ($path == '') - $path = $this->full_src_path; - - if ( ! file_exists($path)) - { - $this->set_error('imglib_invalid_path'); - return FALSE; - } - - $vals = @getimagesize($path); - - $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); - - $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg'; - - if ($return == TRUE) - { - $v['width'] = $vals['0']; - $v['height'] = $vals['1']; - $v['image_type'] = $vals['2']; - $v['size_str'] = $vals['3']; - $v['mime_type'] = $mime; - - return $v; - } - - $this->orig_width = $vals['0']; - $this->orig_height = $vals['1']; - $this->image_type = $vals['2']; - $this->size_str = $vals['3']; - $this->mime_type = $mime; - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Size calculator - * - * This function takes a known width x height and - * recalculates it to a new size. Only one - * new variable needs to be known - * - * $props = array( - * 'width' => $width, - * 'height' => $height, - * 'new_width' => 40, - * 'new_height' => '' - * ); - * - * @access public - * @param array - * @return array - */ - function size_calculator($vals) - { - if ( ! is_array($vals)) - return; - - $allowed = array('new_width', 'new_height', 'width', 'height'); - - foreach ($allowed as $item) - { - if ( ! isset($vals[$item]) OR $vals[$item] == '') - $vals[$item] = 0; - } - - if ($vals['width'] == 0 OR $vals['height'] == 0) - { - return $vals; - } - - if ($vals['new_width'] == 0) - { - $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); - } - elseif ($vals['new_height'] == 0) - { - $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); - } - - return $vals; - } - - // -------------------------------------------------------------------- - - /** - * Explode source_image - * - * This is a helper function that extracts the extension - * from the source_image. This function lets us deal with - * source_images with multiple periods, like: my.cool.jpg - * It returns an associative array with two elements: - * $array['ext'] = '.jpg'; - * $array['name'] = 'my.cool'; - * - * @access public - * @param array - * @return array - */ - function explode_name($source_image) - { - $x = explode('.', $source_image); - $ret['ext'] = '.'.end($x); - - $name = ''; - - $ct = count($x)-1; - - for ($i = 0; $i < $ct; $i++) - { - $name .= $x[$i]; - - if ($i < ($ct - 1)) - { - $name .= '.'; - } - } - - $ret['name'] = $name; - - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Is GD Installed? - * - * @access public - * @return bool - */ - function gd_loaded() - { - if ( ! extension_loaded('gd')) - { - if ( ! dl('gd.so')) - { - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Get GD version - * - * @access public - * @return mixed - */ - function gd_version() - { - if (function_exists('gd_info')) - { - $gd_version = @gd_info(); - $gd_version = preg_replace("/\D/", "", $gd_version['GD Version']); - - return $gd_version; - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Set error message - * - * @access public - * @param string - * @return void - */ - function set_error($msg) - { - $CI =& get_instance(); - $CI->lang->load('imglib'); - - if (is_array($msg)) - { - foreach ($msg as $val) - { - - $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); - $this->error_msg[] = $msg; - log_message('error', $msg); - } - } - else - { - $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); - $this->error_msg[] = $msg; - log_message('error', $msg); - } - } - - // -------------------------------------------------------------------- - - /** - * Show error messages - * - * @access public - * @param string - * @return string - */ - function display_errors($open = '

              ', $close = '

              ') - { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; - } - -} -// END Image_lib Class + 0) + { + $this->initialize($props); + } + + log_message('debug', "Image Lib Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize image properties + * + * Resets values in case this class is used in a loop + * + * @access public + * @return void + */ + 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'); + + foreach ($props as $val) + { + $this->$val = ''; + } + } + + // -------------------------------------------------------------------- + + /** + * initialize image preferences + * + * @access public + * @param array + * @return void + */ + function initialize($props = array()) + { + /* + * Convert array elements into class variables + */ + if (count($props) > 0) + { + foreach ($props as $key => $val) + { + $this->$key = $val; + } + } + + /* + * Is there a source image? + * + * If not, there's no reason to continue + * + */ + if ($this->source_image == '') + { + $this->set_error('imglib_source_image_required'); + return FALSE; + } + + /* + * Is getimagesize() Available? + * + * We use it to determine the image properties (width/height). + * Note: We need to figure out how to determine image + * properties using ImageMagick and NetPBM + * + */ + if ( ! function_exists('getimagesize')) + { + $this->set_error('imglib_gd_required_for_props'); + return FALSE; + } + + $this->image_library = strtolower($this->image_library); + + /* + * Set the full server path + * + * The source image may or may not contain a path. + * Either way, we'll try use realpath to generate the + * full server path in order to more reliably read it. + * + */ + if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) + { + $full_source_path = str_replace("\\", "/", realpath($this->source_image)); + } + else + { + $full_source_path = $this->source_image; + } + + $x = explode('/', $full_source_path); + $this->source_image = end($x); + $this->source_folder = str_replace($this->source_image, '', $full_source_path); + + // Set the Image Properties + if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) + { + return FALSE; + } + + /* + * Assign the "new" image name/path + * + * If the user has set a "new_image" name it means + * we are making a copy of the source image. If not + * it means we are altering the original. We'll + * set the destination filename and path accordingly. + * + */ + if ($this->new_image == '') + { + $this->dest_image = $this->source_image; + $this->dest_folder = $this->source_folder; + } + else + { + if (strpos($this->new_image, '/') === FALSE) + { + $this->dest_folder = $this->source_folder; + $this->dest_image = $this->new_image; + } + else + { + if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) + { + $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); + } + else + { + $full_dest_path = $this->new_image; + } + + // Is there a file name? + if ( ! preg_match("#[\.jpg|\.jpeg|\.gif|\.png]$#i", $full_dest_path)) + { + $this->dest_folder = $full_dest_path.'/'; + $this->dest_image = $this->source_image; + } + else + { + $x = explode('/', $full_dest_path); + $this->dest_image = end($x); + $this->dest_folder = str_replace($this->dest_image, '', $full_dest_path); + } + } + } + + /* + * Compile the finalized filenames/paths + * + * We'll create two master strings containing the + * full server path to the source image and the + * full server path to the destination image. + * We'll also split the destination image name + * so we can insert the thumbnail marker if needed. + * + */ + if ($this->create_thumb === FALSE OR $this->thumb_marker == '') + { + $this->thumb_marker = ''; + } + + $xp = $this->explode_name($this->dest_image); + + $filename = $xp['name']; + $file_ext = $xp['ext']; + + $this->full_src_path = $this->source_folder.$this->source_image; + $this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext; + + /* + * Should we maintain image proportions? + * + * When creating thumbs or copies, the target width/height + * might not be in correct proportion with the source + * image's width/height. We'll recalculate it here. + * + */ + if ($this->maintain_ratio === TRUE && ($this->width != '' AND $this->height != '')) + { + $this->image_reproportion(); + } + + /* + * Was a width and height specified? + * + * If the destination width/height was + * not submitted we will use the values + * from the actual file + * + */ + if ($this->width == '') + $this->width = $this->orig_width; + + if ($this->height == '') + $this->height = $this->orig_height; + + // Set the quality + $this->quality = trim(str_replace("%", "", $this->quality)); + + if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) + $this->quality = 90; + + // Set the x/y coordinates + $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; + $this->y_axis = ($this->y_axis == '' OR ! is_numeric($this->y_axis)) ? 0 : $this->y_axis; + + // Watermark-related Stuff... + if ($this->wm_font_color != '') + { + if (strlen($this->wm_font_color) == 6) + { + $this->wm_font_color = '#'.$this->wm_font_color; + } + } + + if ($this->wm_shadow_color != '') + { + if (strlen($this->wm_shadow_color) == 6) + { + $this->wm_shadow_color = '#'.$this->wm_shadow_color; + } + } + + if ($this->wm_overlay_path != '') + { + $this->wm_overlay_path = str_replace("\\", "/", realpath($this->wm_overlay_path)); + } + + if ($this->wm_shadow_color != '') + { + $this->wm_use_drop_shadow = TRUE; + } + + if ($this->wm_font_path != '') + { + $this->wm_use_truetype = TRUE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Resize + * + * This is a wrapper function that chooses the proper + * resize function based on the protocol specified + * + * @access public + * @return bool + */ + function resize() + { + $protocol = 'image_process_'.$this->image_library; + + if (eregi("gd2$", $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('resize'); + } + + // -------------------------------------------------------------------- + + /** + * Image Crop + * + * This is a wrapper function that chooses the proper + * cropping function based on the protocol specified + * + * @access public + * @return bool + */ + function crop() + { + $protocol = 'image_process_'.$this->image_library; + + if (eregi("gd2$", $protocol)) + { + $protocol = 'image_process_gd'; + } + + return $this->$protocol('crop'); + } + + // -------------------------------------------------------------------- + + /** + * Image Rotate + * + * This is a wrapper function that chooses the proper + * rotation function based on the protocol specified + * + * @access public + * @return bool + */ + function rotate() + { + // Allowed rotation values + $degs = array(90, 180, 270, 'vrt', 'hor'); + + if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs, TRUE)) + { + $this->set_error('imglib_rotation_angle_required'); + return FALSE; + } + + // Reassign the width and height + if ($this->rotation_angle == 90 OR $this->rotation_angle == 270) + { + $this->width = $this->orig_height; + $this->height = $this->orig_width; + } + else + { + $this->width = $this->orig_width; + $this->height = $this->orig_height; + } + + + // Choose resizing function + if ($this->image_library == 'imagemagick' OR $this->image_library == 'netpbm') + { + $protocol = 'image_process_'.$this->image_library; + + return $this->$protocol('rotate'); + } + + if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') + { + return $this->image_mirror_gd(); + } + else + { + return $this->image_rotate_gd(); + } + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using GD/GD2 + * + * This function will resize or crop + * + * @access public + * @param string + * @return bool + */ + function image_process_gd($action = 'resize') + { + $v2_override = FALSE; + + if ($action == 'crop') + { + // If the target width/height match the source then it's pointless to crop, right? + if ($this->width >= $this->orig_width AND $this->height >= $this->orig_height) + { + // We'll return true so the user thinks the process succeeded. + // It'll be our little secret... + + return TRUE; + } + + // Reassign the source width/height if cropping + $this->orig_width = $this->width; + $this->orig_height = $this->height; + + // GD 2.0 has a cropping bug so we'll test for it + if ($this->gd_version() !== FALSE) + { + $gd_version = str_replace('0', '', $this->gd_version()); + $v2_override = ($gd_version == 2) ? TRUE : FALSE; + } + } + else + { + // If the target width/height match the source, AND if + // the new file name is not equal to the old file name + // we'll simply make a copy of the original with the new name + if (($this->orig_width == $this->width AND $this->orig_height == $this->height) AND ($this->source_image != $this->dest_image)) + { + if ( ! @copy($this->full_src_path, $this->full_dst_path)) + { + $this->set_error('imglib_copy_failed'); + return FALSE; + } + + @chmod($this->full_dst_path, 0777); + return TRUE; + } + + // If resizing the x/y axis must be zero + $this->x_axis = 0; + $this->y_axis = 0; + } + + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Create The Image + if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) + { + $create = 'imagecreatetruecolor'; + $copy = 'imagecopyresampled'; + } + else + { + $create = 'imagecreate'; + $copy = 'imagecopyresized'; + } + + $dst_img = $create($this->width, $this->height); + $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using ImageMagick + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_imagemagick($action = 'resize') + { + // Do we have a vaild library path? + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + if ( ! eregi("convert$", $this->library_path)) + { + if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; + + $this->library_path .= 'convert'; + } + + // Execute the command + $cmd = $this->library_path." -quality ".$this->quality; + + if ($action == 'crop') + { + $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 'hor' : $angle = '-flop'; + break; + case 'vrt' : $angle = '-flip'; + break; + default : $angle = '-rotate '.$this->rotation_angle; + break; + } + + $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + else // Resize + { + $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; + } + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Process Using NetPBM + * + * This function will resize, crop or rotate + * + * @access public + * @param string + * @return bool + */ + function image_process_netpbm($action = 'resize') + { + if ($this->library_path == '') + { + $this->set_error('imglib_libpath_invalid'); + return FALSE; + } + + // Build the resizing command + switch ($this->image_type) + { + case 1 : + $cmd_in = 'giftopnm'; + $cmd_out = 'ppmtogif'; + break; + case 2 : + $cmd_in = 'jpegtopnm'; + $cmd_out = 'ppmtojpeg'; + break; + case 3 : + $cmd_in = 'pngtopnm'; + $cmd_out = 'ppmtopng'; + break; + } + + if ($action == 'crop') + { + $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; + } + elseif ($action == 'rotate') + { + switch ($this->rotation_angle) + { + case 90 : $angle = 'r270'; + break; + case 180 : $angle = 'r180'; + break; + case 270 : $angle = 'r90'; + break; + case 'vrt' : $angle = 'tb'; + break; + case 'hor' : $angle = 'lr'; + break; + } + + $cmd_inner = 'pnmflip -'.$angle.' '; + } + else // Resize + { + $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; + } + + $cmd = $this->library_path.$cmd_in.' '.$this->full_src_path.' | '.$cmd_inner.' | '.$cmd_out.' > '.$this->dest_folder.'netpbm.tmp'; + + $retval = 1; + + @exec($cmd, $output, $retval); + + // Did it work? + if ($retval > 0) + { + $this->set_error('imglib_image_process_failed'); + return FALSE; + } + + // With NetPBM we have to create a temporary image. + // If you try manipulating the original it fails so + // we have to rename the temp file. + copy ($this->dest_folder.'netpbm.tmp', $this->full_dst_path); + unlink ($this->dest_folder.'netpbm.tmp'); + @chmod($dst_image, 0777); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Rotate Using GD + * + * @access public + * @return bool + */ + function image_rotate_gd() + { + // Is Image Rotation Supported? + // this function is only supported as of PHP 4.3 + if ( ! function_exists('imagerotate')) + { + $this->set_error('imglib_rotate_unsupported'); + return FALSE; + } + + // Create the image handle + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + // Set the background color + // This won't work with transparent PNG files so we are + // going to have to figure out how to determine the color + // of the alpha channel in a future release. + + $white = imagecolorallocate($src_img, 255, 255, 255); + + // Rotate it! + $dst_img = imagerotate($src_img, $this->rotation_angle, $white); + + // Save the Image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($dst_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($dst_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($dst_img); + imagedestroy($src_img); + + // Set the file to 777 + + @chmod($this->full_dst_path, 0777); + + return true; + } + + // -------------------------------------------------------------------- + + /** + * Create Mirror Image using GD + * + * This function will flip horizontal or vertical + * + * @access public + * @return bool + */ + function image_mirror_gd() + { + if ( ! $src_img = $this->image_create_gd()) + { + return FALSE; + } + + $width = $this->orig_width; + $height = $this->orig_height; + + if ($this->rotation_angle == 'hor') + { + for ($i = 0; $i < $height; $i++) + { + $left = 0; + $right = $width-1; + + while ($left < $right) + { + $cl = imagecolorat($src_img, $left, $i); + $cr = imagecolorat($src_img, $right, $i); + + imagesetpixel($src_img, $left, $i, $cr); + imagesetpixel($src_img, $right, $i, $cl); + + $left++; + $right--; + } + } + } + else + { + for ($i = 0; $i < $width; $i++) + { + $top = 0; + $bot = $height-1; + + while ($top < $bot) + { + $ct = imagecolorat($src_img, $i, $top); + $cb = imagecolorat($src_img, $i, $bot); + + imagesetpixel($src_img, $i, $top, $cb); + imagesetpixel($src_img, $i, $bot, $ct); + + $top++; + $bot--; + } + } + } + + // Show the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + // Or save it + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + // Kill the file handles + imagedestroy($src_img); + + // Set the file to 777 + @chmod($this->full_dst_path, 0777); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Image Watermark + * + * This is a wrapper function that chooses the type + * of watermarking based on the specified preference. + * + * @access public + * @param string + * @return bool + */ + function watermark() + { + if ($this->wm_type == 'overlay') + { + return $this->overlay_watermark(); + } + else + { + return $this->text_watermark(); + } + } + + // -------------------------------------------------------------------- + + /** + * Watermark - Graphic Version + * + * @access public + * @return bool + */ + function overlay_watermark() + { + if ( ! function_exists('imagecolortransparent')) + { + $this->set_error('imglib_gd_required'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Fetch watermark image properties + $props = $this->get_image_properties($this->wm_overlay_path, TRUE); + $wm_img_type = $props['image_type']; + $wm_width = $props['width']; + $wm_height = $props['height']; + + // Create two image resources + $wm_img = $this->image_create_gd($this->wm_overlay_path, $wm_img_type); + $src_img = $this->image_create_gd($this->full_src_path); + + // Reverse the offset if necessary + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Same with the horizontal + // offset when the image is at the right + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set the base x and y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set the vertical position + switch ($this->wm_vrt_alignment) + { + case 'T': + break; + case 'M': $y_axis += ($this->orig_height / 2) - ($wm_height / 2); + break; + case 'B': $y_axis += $this->orig_height - $wm_height; + break; + } + + // Set the horizontal position + switch ($this->wm_hor_alignment) + { + case 'L': + break; + case 'C': $x_axis += ($this->orig_width / 2) - ($wm_width / 2); + break; + case 'R': $x_axis += $this->orig_width - $wm_width; + break; + } + + // Build the finalized image + if ($wm_img_type == 3 AND function_exists('imagealphablending')) + { + @imagealphablending($src_img, TRUE); + } + + // Set RGB values for text and shadow + imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); + imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity); + + // Output the image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + if ( ! $this->image_save_gd($src_img)) + { + return FALSE; + } + } + + imagedestroy($src_img); + imagedestroy($wm_img); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Watermark - Text Version + * + * @access public + * @return bool + */ + function text_watermark() + { + if ( ! ($src_img = $this->image_create_gd())) + { + return FALSE; + } + + if ($this->wm_use_truetype == TRUE AND ! file_exists($this->wm_font_path)) + { + $this->set_error('imglib_missing_font'); + return FALSE; + } + + // Fetch source image properties + $this->get_image_properties(); + + // Set RGB values for text and shadow + $this->wm_font_color = str_replace('#', '', $this->wm_font_color); + $this->wm_shadow_color = str_replace('#', '', $this->wm_shadow_color); + + $R1 = hexdec(substr($this->wm_font_color, 0, 2)); + $G1 = hexdec(substr($this->wm_font_color, 2, 2)); + $B1 = hexdec(substr($this->wm_font_color, 4, 2)); + + $R2 = hexdec(substr($this->wm_shadow_color, 0, 2)); + $G2 = hexdec(substr($this->wm_shadow_color, 2, 2)); + $B2 = hexdec(substr($this->wm_shadow_color, 4, 2)); + + $txt_color = imagecolorclosest($src_img, $R1, $G1, $B1); + $drp_color = imagecolorclosest($src_img, $R2, $G2, $B2); + + // Reverse the vertical offset + // When the image is positioned at the bottom + // we don't want the vertical offset to push it + // further down. We want the reverse, so we'll + // invert the offset. Note: The horizontal + // offset flips itself automatically + + if ($this->wm_vrt_alignment == 'B') + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; + + if ($this->wm_hor_alignment == 'R') + $this->wm_hor_offset = $this->wm_hor_offset * -1; + + // Set font width and height + // These are calculated differently depending on + // whether we are using the true type font or not + if ($this->wm_use_truetype == TRUE) + { + if ($this->wm_font_size == '') + $this->wm_font_size = '17'; + + $fontwidth = $this->wm_font_size-($this->wm_font_size/4); + $fontheight = $this->wm_font_size; + $this->wm_vrt_offset += $this->wm_font_size; + } + else + { + $fontwidth = imagefontwidth($this->wm_font_size); + $fontheight = imagefontheight($this->wm_font_size); + } + + // Set base X and Y axis values + $x_axis = $this->wm_hor_offset + $this->wm_padding; + $y_axis = $this->wm_vrt_offset + $this->wm_padding; + + // Set verticle alignment + if ($this->wm_use_drop_shadow == FALSE) + $this->wm_shadow_distance = 0; + + $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); + $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); + + switch ($this->wm_vrt_alignment) + { + case "T" : + break; + case "M": $y_axis += ($this->orig_height/2)+($fontheight/2); + break; + case "B": $y_axis += ($this->orig_height - $fontheight - $this->wm_shadow_distance - ($fontheight/2)); + break; + } + + $x_shad = $x_axis + $this->wm_shadow_distance; + $y_shad = $y_axis + $this->wm_shadow_distance; + + // Set horizontal alignment + switch ($this->wm_hor_alignment) + { + case "L": + break; + case "R": + if ($this->wm_use_drop_shadow) + $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); + break; + case "C": + if ($this->wm_use_drop_shadow) + $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); + $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); + break; + } + + // Add the text to the source image + if ($this->wm_use_truetype) + { + if ($this->wm_use_drop_shadow) + imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); + imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); + } + else + { + if ($this->wm_use_drop_shadow) + imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); + imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); + } + + // Output the final image + if ($this->dynamic_output == TRUE) + { + $this->image_display_gd($src_img); + } + else + { + $this->image_save_gd($src_img); + } + + imagedestroy($src_img); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Create Image - GD + * + * This simply creates an image resource handle + * based on the type of image being processed + * + * @access public + * @param string + * @return resource + */ + function image_create_gd($path = '', $image_type = '') + { + if ($path == '') + $path = $this->full_src_path; + + if ($image_type == '') + $image_type = $this->image_type; + + + switch ($image_type) + { + case 1 : + if ( ! function_exists('imagecreatefromgif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + return imagecreatefromgif($path); + break; + case 2 : + if ( ! function_exists('imagecreatefromjpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + return imagecreatefromjpeg($path); + break; + case 3 : + if ( ! function_exists('imagecreatefrompng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + return imagecreatefrompng($path); + break; + + } + + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Write image file to disk - GD + * + * Takes an image resource as input and writes the file + * to the specified destination + * + * @access public + * @param resource + * @return bool + */ + function image_save_gd($resource) + { + switch ($this->image_type) + { + case 1 : + if ( ! function_exists('imagegif')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported')); + return FALSE; + } + + @imagegif($resource, $this->full_dst_path); + break; + case 2 : + if ( ! function_exists('imagejpeg')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported')); + return FALSE; + } + + if (phpversion() == '4.4.1') + { + @touch($this->full_dst_path); // PHP 4.4.1 bug #35060 - workaround + } + + @imagejpeg($resource, $this->full_dst_path, $this->quality); + break; + case 3 : + if ( ! function_exists('imagepng')) + { + $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported')); + return FALSE; + } + + @imagepng($resource, $this->full_dst_path); + break; + default : + $this->set_error(array('imglib_unsupported_imagecreate')); + return FALSE; + break; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Dynamically outputs an image + * + * @access public + * @param resource + * @return void + */ + function image_display_gd($resource) + { + header("Content-Disposition: filename={$this->source_image};"); + header("Content-Type: {$this->mime_type}"); + header('Content-Transfer-Encoding: binary'); + header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); + + switch ($this->image_type) + { + case 1 : imagegif($resource); + break; + case 2 : imagejpeg($resource, '', $this->quality); + break; + case 3 : imagepng($resource); + break; + default : echo 'Unable to display the image'; + break; + } + } + + // -------------------------------------------------------------------- + + /** + * Re-proportion Image Width/Height + * + * When creating thumbs, the desired width/height + * can end up warping the image due to an incorrect + * ratio between the full-sized image and the thumb. + * + * This function lets us re-proportion the width/height + * if users choose to maintain the aspect ratio when resizing. + * + * @access public + * @return void + */ + function image_reproportion() + { + if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) + return; + + if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) + return; + + $new_width = ceil($this->orig_width*$this->height/$this->orig_height); + $new_height = ceil($this->width*$this->orig_height/$this->orig_width); + + $ratio = (($this->orig_height/$this->orig_width) - ($this->height/$this->width)); + + if ($this->master_dim != 'width' AND $this->master_dim != 'height') + { + $this->master_dim = ($ratio < 0) ? 'width' : 'height'; + } + + if (($this->width != $new_width) AND ($this->height != $new_height)) + { + if ($this->master_dim == 'height') + { + $this->width = $new_width; + } + else + { + $this->height = $new_height; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Get image properties + * + * A helper function that gets info about the file + * + * @access public + * @param string + * @return mixed + */ + 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 + + if ($path == '') + $path = $this->full_src_path; + + if ( ! file_exists($path)) + { + $this->set_error('imglib_invalid_path'); + return FALSE; + } + + $vals = @getimagesize($path); + + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $mime = (isset($types[$vals['2']])) ? 'image/'.$types[$vals['2']] : 'image/jpg'; + + if ($return == TRUE) + { + $v['width'] = $vals['0']; + $v['height'] = $vals['1']; + $v['image_type'] = $vals['2']; + $v['size_str'] = $vals['3']; + $v['mime_type'] = $mime; + + return $v; + } + + $this->orig_width = $vals['0']; + $this->orig_height = $vals['1']; + $this->image_type = $vals['2']; + $this->size_str = $vals['3']; + $this->mime_type = $mime; + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Size calculator + * + * This function takes a known width x height and + * recalculates it to a new size. Only one + * new variable needs to be known + * + * $props = array( + * 'width' => $width, + * 'height' => $height, + * 'new_width' => 40, + * 'new_height' => '' + * ); + * + * @access public + * @param array + * @return array + */ + function size_calculator($vals) + { + if ( ! is_array($vals)) + return; + + $allowed = array('new_width', 'new_height', 'width', 'height'); + + foreach ($allowed as $item) + { + if ( ! isset($vals[$item]) OR $vals[$item] == '') + $vals[$item] = 0; + } + + if ($vals['width'] == 0 OR $vals['height'] == 0) + { + return $vals; + } + + if ($vals['new_width'] == 0) + { + $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); + } + elseif ($vals['new_height'] == 0) + { + $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); + } + + return $vals; + } + + // -------------------------------------------------------------------- + + /** + * Explode source_image + * + * This is a helper function that extracts the extension + * from the source_image. This function lets us deal with + * source_images with multiple periods, like: my.cool.jpg + * It returns an associative array with two elements: + * $array['ext'] = '.jpg'; + * $array['name'] = 'my.cool'; + * + * @access public + * @param array + * @return array + */ + function explode_name($source_image) + { + $x = explode('.', $source_image); + $ret['ext'] = '.'.end($x); + + $name = ''; + + $ct = count($x)-1; + + for ($i = 0; $i < $ct; $i++) + { + $name .= $x[$i]; + + if ($i < ($ct - 1)) + { + $name .= '.'; + } + } + + $ret['name'] = $name; + + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Is GD Installed? + * + * @access public + * @return bool + */ + function gd_loaded() + { + if ( ! extension_loaded('gd')) + { + if ( ! dl('gd.so')) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Get GD version + * + * @access public + * @return mixed + */ + function gd_version() + { + if (function_exists('gd_info')) + { + $gd_version = @gd_info(); + $gd_version = preg_replace("/\D/", "", $gd_version['GD Version']); + + return $gd_version; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Set error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + $CI =& get_instance(); + $CI->lang->load('imglib'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + + $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + + // -------------------------------------------------------------------- + + /** + * Show error messages + * + * @access public + * @param string + * @return string + */ + function display_errors($open = '

              ', $close = '

              ') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + +} +// END Image_lib Class ?> \ No newline at end of file From 13a0d736b6678c589afec1864edb0ad0d05a84d3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Feb 2007 19:35:54 +0000 Subject: [PATCH 0482/2544] error in update example fixed --- user_guide/database/active_record.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 6f842f47..087d3e1f 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -525,8 +525,9 @@

              $this->db->update();

              $object = new Myclass;

              $this->db->where('id', $id);
              -$this->db->update('mytable', $object, $where); -

              +$this->db->update('mytable', $object); +
              +
              // Produces:
              // UPDATE mytable
              // SET title = '{$title}', name = '{$name}', date = '{$date}'
              From ace387ac78117d7053d77ee1fe07d6c50a3fc6bc Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Feb 2007 20:15:32 +0000 Subject: [PATCH 0483/2544] changed example to crazy US way of spelling "colour" for consistency --- user_guide/libraries/table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 30968e25..8cd4a1e9 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -188,7 +188,7 @@

              $this->table->set_caption()

              Permits you to add a caption to the table.

              -$this->table->set_caption('Colours'); +$this->table->set_caption('Colors');

              $this->table->set_heading()

              From 11b76a37d20348c153ba77c39f6158f443de2ba0 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 2 Feb 2007 03:46:31 +0000 Subject: [PATCH 0484/2544] result() now returns an empty array when no results are found --- user_guide/database/results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 846504fd..53f4713e 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -71,7 +71,7 @@

              Generating Query Results

              result()

              -

              This function returns the query result as an array of objects, or FALSE on failure. +

              This function returns the query result as an array of objects, or an empty array on failure. Typically you'll use this in a foreach loop, like this:

              From f553b113416c3631cf2fd6120c8c273023ea545f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 2 Feb 2007 03:47:13 +0000 Subject: [PATCH 0485/2544] typo in example --- user_guide/database/active_record.html | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 087d3e1f..d0657cda 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -405,14 +405,14 @@

              $this->db->insert();

              $data = array(
              -               'title' => $title,
              -               'name' => $name,
              -               'date' => $date
              +               'title' => 'My title' ,
              +               'name' => 'My Name' ,
              +               'date' => 'My date'
                          );

              $this->db->insert('mytable', $data);

              -// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
              +// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')

              The first parameter will contain the table name, the second is an associative array of values.

              @@ -421,9 +421,9 @@

              $this->db->insert();

              /*
                  class Myclass {
              -        var = $title = 'My Title';
              -        var = $content = 'My Content';
              -        var = $date = 'My Date';
              +        var $title = 'My Title';
              +        var $content = 'My Content';
              +        var $date = 'My Date';
                  }
              */

              @@ -431,7 +431,7 @@

              $this->db->insert();


              $this->db->insert('mytable', $object);

              -// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
              +// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')

              The first parameter will contain the table name, the second is an associative array of values.

              @@ -474,9 +474,9 @@

              $this->db->set();

              /*
                  class Myclass {
              -        var = $title = 'My Title';
              -        var = $content = 'My Content';
              -        var = $date = 'My Date';
              +        var $title = 'My Title';
              +        var $content = 'My Content';
              +        var $date = 'My Date';
                  }
              */

              @@ -516,9 +516,9 @@

              $this->db->update();

              /*
                  class Myclass {
              -        var = $title = 'My Title';
              -        var = $content = 'My Content';
              -        var = $date = 'My Date';
              +        var $title = 'My Title';
              +        var $content = 'My Content';
              +        var $date = 'My Date';
                  }
              */

              From e0135cfe9c23f2cb9312bcd2fbcfa3dbf024f8d6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 2 Feb 2007 03:47:40 +0000 Subject: [PATCH 0486/2544] added sess_destroy() into docs --- user_guide/libraries/sessions.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 184eaec1..b1ce8472 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -210,8 +210,10 @@

              Saving Session Data to a Database

              do not need to write your own routine to do it.

              +

              Destroying a Session

              +

              To clear the current session:

              +$this->session->sess_destroy();

              Session Preferences

              -

              You'll find the following Session related preferences in your application/config/config.php file:

              From 715935ed8ba8b39e5dd8b0e47190867d479815ff Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 2 Feb 2007 03:48:30 +0000 Subject: [PATCH 0487/2544] broken link to creating_libraries fixed --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 21935898..035e5d60 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -138,7 +138,7 @@

              Version 1.5.0

            • Fixed a pagination bug that was permitting negative values in the URL.
            • Fixed an oversight in which the Loader class was not allowed to be exteneded.
            • Changed _get_config() to get_config() since the function is not a private one.
            • -
            • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
            • +
            • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
            • Deprecated $this->db->field_names() USE $this->db->list_fields()
            • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
            From 356da23d8cc237674228f2383b72e878d661d41e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 4 Feb 2007 15:05:26 +0000 Subject: [PATCH 0488/2544] $lang['ut_test_datatype'] = 'Test Datatype '; became (removed space) $lang['ut_test_datatype'] = 'Test Datatype'; --- system/language/english/unit_test_lang.php | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/system/language/english/unit_test_lang.php b/system/language/english/unit_test_lang.php index 33b20c56..a33cad5f 100644 --- a/system/language/english/unit_test_lang.php +++ b/system/language/english/unit_test_lang.php @@ -1,22 +1,22 @@ - \ No newline at end of file From c1ee65ba12164141b18aac49b0f210ed161f88b9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 4 Feb 2007 16:18:03 +0000 Subject: [PATCH 0489/2544] added note: set_userdata() also supports setting one value at a time --- user_guide/libraries/sessions.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index b1ce8472..087d2d1f 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -161,14 +161,15 @@

            Adding Custom Session Data

            Where $array is an associative array containing your new data. Here's an example:

            -$newdata = array(
            -                   'username'  => 'johndoe',
            -                   'email'     => 'johndoe@some-site.com',
            -                   'logged_in' => TRUE
            -               );
            -
            -$this->session->set_userdata($newdata);
            - +

            $newdata = array(
            +                    'username'  => 'johndoe',
            +                    'email'     => 'johndoe@some-site.com',
            +                    'logged_in' => TRUE
            +                );
            +
            + $this->session->set_userdata($newdata);

            +

            If you want to add userdata one value at a time, set_userdata() also supports this syntax.

            +

            $this->session->set_userdata('some_name', 'some_value');

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

            From bb433723c84e174ed87a1daf46017866c32c83c8 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 5 Feb 2007 22:32:49 +0000 Subject: [PATCH 0490/2544] --- system/database/DB_active_rec.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 90f58ae0..d27d3dc1 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -134,7 +134,17 @@ function join($table, $cond, $type = '') $type .= ' '; } } - + + // If a DB prefix is used we might need to add it to the column names + if ($this->dbprefix) + { + // First we remove any existing prefixes in the condition to avoid duplicates + $cond = preg_replace('|('.$this->dbprefix.')([\w\.]+)([\W\s]+)|', "$2$3", $cond); + + // Next we add the prefixes to the condition + $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); + } + $this->ar_join[] = $type.'JOIN '.$this->dbprefix.$table.' ON '.$cond; return $this; } From 6fdadfa1593623cafaecad06f5bbb533b44c9a02 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 5 Feb 2007 22:34:03 +0000 Subject: [PATCH 0491/2544] --- user_guide/changelog.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 035e5d60..24a1d26c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,10 +66,13 @@

            Version 1.5.1.1

            Release Date: January 27, 2007

            • Added support for captions in the Table Library
            • +
            • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
            • Fixed a bug in the form helper that gave textarea a value attribute
            • Fixed a bug in the Image Library that was ignoring resizing the same size image
            • Fixed some doc typos.
            + +

            Version 1.5.0.2

            Release Date: November 23, 2006

              From 085c00ff6948bd21e72d24c53457f3bbf2274985 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 5 Feb 2007 22:36:56 +0000 Subject: [PATCH 0492/2544] --- system/libraries/Loader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 0947046e..f76146ff 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -499,10 +499,10 @@ function language($file = '', $lang = '', $return = FALSE) * @param string * @return void */ - function config($file = '') - { + function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { $CI =& get_instance(); - $CI->config->load($file); + $CI->config->load($file, $use_sections, $fail_gracefully); } // -------------------------------------------------------------------- From 7fcf8ca599f21732a124b8d2610f32a9e4b01c7d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 5 Feb 2007 22:46:56 +0000 Subject: [PATCH 0493/2544] --- system/libraries/Loader.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f76146ff..38d7c35a 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -697,7 +697,6 @@ function _ci_load_class($class, $params = NULL) } // Lets search for the requested library file and load it. - $is_duplicate = FALSE; for ($i = 1; $i < 3; $i++) { $path = ($i % 2) ? APPPATH : BASEPATH; @@ -712,8 +711,8 @@ function _ci_load_class($class, $params = NULL) // Safety: Was the class already loaded by a previous call? if (in_array($fp, $this->_ci_classes)) { - $is_duplicate = TRUE; - continue; + log_message('debug', $class." class already loaded.Ê Second attempt ignored."); + return; } include($fp); From 29eff53d35fd2fb1ba8867eab20794ef0a53d5bb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Feb 2007 23:55:06 +0000 Subject: [PATCH 0494/2544] Fixed a typo in error message --- system/libraries/Loader.php | 1860 +++++++++++++++++------------------ 1 file changed, 930 insertions(+), 930 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 38d7c35a..d1163071 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -1,931 +1,931 @@ - 'unit', 'user_agent' => 'agent'); - - - /** - * Constructor - * - * Sets the path to the view files and gets the initial output buffering level - * - * @access public - */ - function CI_Loader() - { - $this->_ci_is_php5 = (floor(phpversion()) >= 5) ? TRUE : FALSE; - $this->_ci_view_path = APPPATH.'views/'; - $this->_ci_ob_level = ob_get_level(); - - log_message('debug', "Loader Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Class Loader - * - * This function lets users load and instantiate classes. - * It is designed to be called from a user's app controllers. - * - * @access public - * @param string the name of the class - * @param mixed the optional parameters - * @return void - */ - function library($library = '', $params = NULL) - { - if ($library == '') - { - return FALSE; - } - - if (is_array($library)) - { - foreach ($library as $class) - { - $this->_ci_load_class($class, $params); - } - } - else - { - $this->_ci_load_class($library, $params); - } - - $this->_ci_assign_to_models(); - } - - // -------------------------------------------------------------------- - - /** - * Model Loader - * - * This function lets users load and instantiate models. - * - * @access public - * @param string the name of the class - * @param mixed any initialization parameters - * @return void - */ - function model($model, $name = '', $db_conn = FALSE) - { - if ($model == '') - return; - - // Is the model in a sub-folder? If so, parse out the filename and path. - if (strpos($model, '/') === FALSE) - { - $path = ''; - } - else - { - $x = explode('/', $model); - $model = end($x); - unset($x[count($x)-1]); - $path = implode('/', $x).'/'; - } - - if ($name == '') - { - $name = $model; - } - - if (in_array($name, $this->_ci_models, TRUE)) - { - return; - } - - $CI =& get_instance(); - if (isset($CI->$name)) - { - show_error('The model name you are loading is the name of a resource that is already being used: '.$name); - } - - $model = strtolower($model); - - if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT)) - { - show_error('Unable to locate the model you have specified: '.$model); - } - - if ($db_conn !== FALSE AND ! class_exists('CI_DB')) - { - if ($db_conn === TRUE) - $db_conn = ''; - - $CI->load->database($db_conn, FALSE, TRUE); - } - - if ( ! class_exists('Model')) - { - require_once(BASEPATH.'libraries/Model'.EXT); - } - - require_once(APPPATH.'models/'.$path.$model.EXT); - - $model = ucfirst($model); - - $CI->$name = new $model(); - $CI->$name->_assign_libraries(); - - $this->_ci_models[] = $name; - } - - // -------------------------------------------------------------------- - - /** - * Database Loader - * - * @access public - * @param string the DB credentials - * @param bool whether to return the DB object - * @param bool whether to enable active record (this allows us to override the config setting) - * @return object - */ - function database($params = '', $return = FALSE, $active_record = FALSE) - { - // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) - { - return FALSE; - } - - require_once(BASEPATH.'database/DB'.EXT); - - if ($return === TRUE) - { - return DB($params, $active_record); - } - - // Grab the super object - $CI =& get_instance(); - - // Initialize the db variable. Needed to prevent - // reference errors with some configurations - $CI->db = ''; - - // Load the DB class - $CI->db =& DB($params, $active_record); - - // Assign the DB object to any existing models - $this->_ci_assign_to_models(); - } - - // -------------------------------------------------------------------- - - /** - * Load the Utilities Class - * - * @access public - * @return string - */ - function dbutil() - { - if ( ! class_exists('CI_DB')) - { - $this->database(); - } - - $CI =& get_instance(); - - require_once(BASEPATH.'database/DB_utility'.EXT); - require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); - $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; - - $CI->dbutil = new $class(); - $CI->load->_ci_assign_to_models(); - } - - // -------------------------------------------------------------------- - - /** - * Load View - * - * This function is used to load a "view" file. It has three parameters: - * - * 1. The name of the "view" file to be included. - * 2. An associative array of data to be extracted for use in the view. - * 3. TRUE/FALSE - whether to return the data or load it. In - * some cases it's advantageous to be able to return data so that - * a developer can process it in some way. - * - * @access public - * @param string - * @param array - * @param bool - * @return void - */ - function view($view, $vars = array(), $return = FALSE) - { - return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); - } - - // -------------------------------------------------------------------- - - /** - * Load File - * - * This is a generic file loader - * - * @access public - * @param string - * @param bool - * @return string - */ - function file($path, $return = FALSE) - { - return $this->_ci_load(array('path' => $path, 'return' => $return)); - } - - // -------------------------------------------------------------------- - - /** - * Set Variables - * - * Once variables are set they become available within - * the controller class and its "view" files. - * - * @access public - * @param array - * @return void - */ - function vars($vars = array()) - { - $vars = $this->_ci_object_to_array($vars); - - if (is_array($vars) AND count($vars) > 0) - { - foreach ($vars as $key => $val) - { - $this->_ci_cached_vars[$key] = $val; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Load Helper - * - * This function loads the specified helper file. - * - * @access public - * @param mixed - * @return void - */ - function helper($helpers = array()) - { - if ( ! is_array($helpers)) - { - $helpers = array($helpers); - } - - foreach ($helpers as $helper) - { - $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); - - if (isset($this->_ci_helpers[$helper])) - { - continue; - } - - if (file_exists(APPPATH.'helpers/'.$helper.EXT)) - { - include_once(APPPATH.'helpers/'.$helper.EXT); - } - else - { - if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) - { - include(BASEPATH.'helpers/'.$helper.EXT); - } - else - { - show_error('Unable to load the requested file: helpers/'.$helper.EXT); - } - } - - $this->_ci_helpers[$helper] = TRUE; - - } - - log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); - } - - // -------------------------------------------------------------------- - - /** - * Load Helpers - * - * This is simply an alias to the above function in case the - * user has written the plural form of this function. - * - * @access public - * @param array - * @return void - */ - function helpers($helpers = array()) - { - $this->helper($helpers); - } - - // -------------------------------------------------------------------- - - /** - * Load Plugin - * - * This function loads the specified plugin. - * - * @access public - * @param array - * @return void - */ - function plugin($plugins = array()) - { - if ( ! is_array($plugins)) - { - $plugins = array($plugins); - } - - foreach ($plugins as $plugin) - { - $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); - - if (isset($this->_ci_plugins[$plugin])) - { - continue; - } - - if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) - { - include(APPPATH.'plugins/'.$plugin.EXT); - } - else - { - if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) - { - include(BASEPATH.'plugins/'.$plugin.EXT); - } - else - { - show_error('Unable to load the requested file: plugins/'.$plugin.EXT); - } - } - - $this->_ci_plugins[$plugin] = TRUE; - } - - log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); - } - - // -------------------------------------------------------------------- - - /** - * Load Plugins - * - * This is simply an alias to the above function in case the - * user has written the plural form of this function. - * - * @access public - * @param array - * @return void - */ - function plugins($plugins = array()) - { - $this->plugin($plugins); - } - - // -------------------------------------------------------------------- - - /** - * Load Script - * - * This function loads the specified include file from the - * application/scripts/ folder. - * - * NOTE: This feature has been deprecated but it will remain available - * for legacy users. - * - * @access public - * @param array - * @return void - */ - function script($scripts = array()) - { - if ( ! is_array($scripts)) - { - $scripts = array($scripts); - } - - foreach ($scripts as $script) - { - $script = strtolower(str_replace(EXT, '', $script)); - - if (isset($this->_ci_scripts[$script])) - { - continue; - } - - if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) - { - show_error('Unable to load the requested script: scripts/'.$script.EXT); - } - - include(APPPATH.'scripts/'.$script.EXT); - } - - log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); - } - - // -------------------------------------------------------------------- - - /** - * Loads a language file - * - * @access public - * @param string - * @return void - */ - function language($file = '', $lang = '', $return = FALSE) - { - $CI =& get_instance(); - return $CI->lang->load($file, $lang, $return); - } - - // -------------------------------------------------------------------- - - /** - * Loads a config file - * - * @access public - * @param string - * @return void - */ - function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) - { - $CI =& get_instance(); - $CI->config->load($file, $use_sections, $fail_gracefully); - } - - // -------------------------------------------------------------------- - - /** - * Scaffolding Loader - * - * This initializing function works a bit different than the - * others. It doesn't load the class. Instead, it simply - * sets a flag indicating that scaffolding is allowed to be - * used. The actual scaffolding function below is - * called by the front controller based on whether the - * second segment of the URL matches the "secret" scaffolding - * word stored in the application/config/routes.php - * - * @access public - * @param string - * @return void - */ - function scaffolding($table = '') - { - if ($table === FALSE) - { - show_error('You must include the name of the table you would like access when you initialize scaffolding'); - } - - $CI =& get_instance(); - $CI->_ci_scaffolding = TRUE; - $CI->_ci_scaff_table = $table; - } - - // -------------------------------------------------------------------- - - /** - * Loader - * - * This function is used to load views and files. - * - * @access private - * @param array - * @return void - */ - function _ci_load($data) - { - // Set the default data variables - foreach (array('view', 'vars', 'path', 'return') as $val) - { - $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; - } - - // Set the path to the requested file - if ($path == '') - { - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.EXT : $view; - $path = $this->_ci_view_path.$file; - } - else - { - $x = explode('/', $path); - $file = end($x); - } - - if ( ! file_exists($path)) - { - show_error('Unable to load the requested file: '.$file); - } - - // This allows anything loaded using $this->load (views, files, etc.) - // to become accessible from within the Controller and Model functions. - // Only needed when running PHP 5 - - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - foreach (get_object_vars($CI) as $key => $var) - { - if ( ! isset($this->$key)) - { - $this->$key =& $CI->$key; - } - } - } - - /* - * Extract and cache variables - * - * You can either set variables using the dedicated $this->load_vars() - * function or via the second parameter of this function. We'll merge - * the two types and cache them so that views that are embedded within - * other views can have access to these variables. - */ - if (is_array($vars)) - { - $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); - } - extract($this->_ci_cached_vars); - - /* - * Buffer the output - * - * We buffer the output for two reasons: - * 1. Speed. You get a significant speed boost. - * 2. So that the final rendered template can be - * post-processed by the output class. Why do we - * need post processing? For one thing, in order to - * show the elapsed page load time. Unless we - * can intercept the content right before it's sent to - * the browser and then stop the timer it won't be accurate. - */ - ob_start(); - - // If the PHP installation does not support short tags we'll - // do a little string replacement, changing the short tags - // to standard PHP echo statements. - - if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) - { - echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(' $this->_ci_ob_level + 1) - { - ob_end_flush(); - } - else - { - // PHP 4 requires that we use a global - global $OUT; - $OUT->set_output(ob_get_contents()); - @ob_end_clean(); - } - } - - // -------------------------------------------------------------------- - - /** - * Load class - * - * This function loads the requested class. - * - * @access private - * @param string the item that is being loaded - * @param mixed any additional parameters - * @return void - */ - function _ci_load_class($class, $params = NULL) - { - // Get the class name - $class = str_replace(EXT, '', $class); - - // We'll test for both lowercase and capitalized versions of the file name - foreach (array(ucfirst($class), strtolower($class)) as $class) - { - // Is this a class extension request? - if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) - { - if ( ! file_exists(BASEPATH.'libraries/'.ucfirst($class).EXT)) - { - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); - } - - include(BASEPATH.'libraries/'.ucfirst($class).EXT); - include(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); - - return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); - } - - // Lets search for the requested library file and load it. - for ($i = 1; $i < 3; $i++) - { - $path = ($i % 2) ? APPPATH : BASEPATH; - $fp = $path.'libraries/'.$class.EXT; - - // Does the file exist? No? Bummer... - if ( ! file_exists($fp)) - { - continue; - } - - // Safety: Was the class already loaded by a previous call? - if (in_array($fp, $this->_ci_classes)) - { - log_message('debug', $class." class already loaded.Ê Second attempt ignored."); - return; - } - - include($fp); - $this->_ci_classes[] = $fp; - return $this->_ci_init_class($class, '', $params); - } - } // END FOREACH - - // If we got this far we were unable to find the requested class. - // We do not issue errors if the load call failed due to a duplicate request - if ($is_duplicate == FALSE) - { - log_message('error', "Unable to load the requested class: ".$class); - show_error("Unable to load the requested class: ".$class); - } - } - - // -------------------------------------------------------------------- - - /** - * Instantiates a class - * - * @access private - * @param string - * @param string - * @return null - */ - function _ci_init_class($class, $prefix = '', $config = FALSE) - { - // Is there an associated config file for this class? - if ($config === NULL) - { - $config = NULL; - if (file_exists(APPPATH.'config/'.$class.EXT)) - { - include(APPPATH.'config/'.$class.EXT); - } - } - - if ($prefix == '') - { - $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; - } - else - { - $name = $prefix.$class; - } - - // Set the variable name we will assign the class to - $class = strtolower($class); - $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; - - // Instantiate the class - $CI =& get_instance(); - if ($config !== NULL) - { - $CI->$classvar = new $name($config); - } - else - { - $CI->$classvar = new $name; - } - } - - // -------------------------------------------------------------------- - - /** - * Autoloader - * - * The config/autoload.php file contains an array that permits sub-systems, - * libraries, plugins, and helpers to be loaded automatically. - * - * @access private - * @param array - * @return void - */ - function _ci_autoloader() - { - include(APPPATH.'config/autoload'.EXT); - - if ( ! isset($autoload)) - { - return FALSE; - } - - // Load any custome config file - if (count($autoload['config']) > 0) - { - $CI =& get_instance(); - foreach ($autoload['config'] as $key => $val) - { - $CI->config->load($val); - } - } - - // Load plugins, helpers, and scripts - foreach (array('helper', 'plugin', 'script') as $type) - { - if (isset($autoload[$type]) AND count($autoload[$type]) > 0) - { - $this->$type($autoload[$type]); - } - } - - // A little tweak to remain backward compatible - // The $autoload['core'] item was deprecated - if ( ! isset($autoload['libraries'])) - { - $autoload['libraries'] = $autoload['core']; - } - - // Load libraries - if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) - { - // Load the database driver. - if (in_array('database', $autoload['libraries'])) - { - $this->database(); - $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); - } - - // Load the model class. - if (in_array('model', $autoload['libraries'])) - { - $this->model(); - $autoload['libraries'] = array_diff($autoload['libraries'], array('model')); - } - - // Load scaffolding - if (in_array('scaffolding', $autoload['libraries'])) - { - $this->scaffolding(); - $autoload['libraries'] = array_diff($autoload['libraries'], array('scaffolding')); - } - - // Load all other libraries - foreach ($autoload['libraries'] as $item) - { - $this->library($item); - } - } - } - - // -------------------------------------------------------------------- - - /** - * Assign to Models - * - * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) - * will be available to models, if any exist. - * - * @access private - * @param object - * @return array - */ - function _ci_assign_to_models() - { - if (count($this->_ci_models) == 0) - { - return; - } - - if ($this->_ci_is_instance()) - { - $CI =& get_instance(); - foreach ($this->_ci_models as $model) - { - $CI->$model->_assign_libraries(); - } - } - else - { - foreach ($this->_ci_models as $model) - { - $this->$model->_assign_libraries(); - } - } - } - - // -------------------------------------------------------------------- - - /** - * Object to Array - * - * Takes an object as input and converts the class variables to array key/vals - * - * @access private - * @param object - * @return array - */ - function _ci_object_to_array($object) - { - return (is_object($object)) ? get_object_vars($object) : $object; - } - - // -------------------------------------------------------------------- - - /** - * Determines whether we should use the CI instance or $this - * - * @access private - * @return bool - */ - function _ci_is_instance() - { - if ($this->_ci_is_php5 == TRUE) - { - return TRUE; - } - - global $CI; - return (is_object($CI)) ? TRUE : FALSE; - } - -} + 'unit', 'user_agent' => 'agent'); + + + /** + * Constructor + * + * Sets the path to the view files and gets the initial output buffering level + * + * @access public + */ + function CI_Loader() + { + $this->_ci_is_php5 = (floor(phpversion()) >= 5) ? TRUE : FALSE; + $this->_ci_view_path = APPPATH.'views/'; + $this->_ci_ob_level = ob_get_level(); + + log_message('debug', "Loader Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Class Loader + * + * This function lets users load and instantiate classes. + * It is designed to be called from a user's app controllers. + * + * @access public + * @param string the name of the class + * @param mixed the optional parameters + * @return void + */ + function library($library = '', $params = NULL) + { + if ($library == '') + { + return FALSE; + } + + if (is_array($library)) + { + foreach ($library as $class) + { + $this->_ci_load_class($class, $params); + } + } + else + { + $this->_ci_load_class($library, $params); + } + + $this->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Model Loader + * + * This function lets users load and instantiate models. + * + * @access public + * @param string the name of the class + * @param mixed any initialization parameters + * @return void + */ + function model($model, $name = '', $db_conn = FALSE) + { + if ($model == '') + return; + + // Is the model in a sub-folder? If so, parse out the filename and path. + if (strpos($model, '/') === FALSE) + { + $path = ''; + } + else + { + $x = explode('/', $model); + $model = end($x); + unset($x[count($x)-1]); + $path = implode('/', $x).'/'; + } + + if ($name == '') + { + $name = $model; + } + + if (in_array($name, $this->_ci_models, TRUE)) + { + return; + } + + $CI =& get_instance(); + if (isset($CI->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } + + $model = strtolower($model); + + if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT)) + { + show_error('Unable to locate the model you have specified: '.$model); + } + + if ($db_conn !== FALSE AND ! class_exists('CI_DB')) + { + if ($db_conn === TRUE) + $db_conn = ''; + + $CI->load->database($db_conn, FALSE, TRUE); + } + + if ( ! class_exists('Model')) + { + require_once(BASEPATH.'libraries/Model'.EXT); + } + + require_once(APPPATH.'models/'.$path.$model.EXT); + + $model = ucfirst($model); + + $CI->$name = new $model(); + $CI->$name->_assign_libraries(); + + $this->_ci_models[] = $name; + } + + // -------------------------------------------------------------------- + + /** + * Database Loader + * + * @access public + * @param string the DB credentials + * @param bool whether to return the DB object + * @param bool whether to enable active record (this allows us to override the config setting) + * @return object + */ + function database($params = '', $return = FALSE, $active_record = FALSE) + { + // Do we even need to load the database class? + if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) + { + return FALSE; + } + + require_once(BASEPATH.'database/DB'.EXT); + + if ($return === TRUE) + { + return DB($params, $active_record); + } + + // Grab the super object + $CI =& get_instance(); + + // Initialize the db variable. Needed to prevent + // reference errors with some configurations + $CI->db = ''; + + // Load the DB class + $CI->db =& DB($params, $active_record); + + // Assign the DB object to any existing models + $this->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Load the Utilities Class + * + * @access public + * @return string + */ + function dbutil() + { + if ( ! class_exists('CI_DB')) + { + $this->database(); + } + + $CI =& get_instance(); + + require_once(BASEPATH.'database/DB_utility'.EXT); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); + $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; + + $CI->dbutil = new $class(); + $CI->load->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Load View + * + * This function is used to load a "view" file. It has three parameters: + * + * 1. The name of the "view" file to be included. + * 2. An associative array of data to be extracted for use in the view. + * 3. TRUE/FALSE - whether to return the data or load it. In + * some cases it's advantageous to be able to return data so that + * a developer can process it in some way. + * + * @access public + * @param string + * @param array + * @param bool + * @return void + */ + function view($view, $vars = array(), $return = FALSE) + { + return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Load File + * + * This is a generic file loader + * + * @access public + * @param string + * @param bool + * @return string + */ + function file($path, $return = FALSE) + { + return $this->_ci_load(array('path' => $path, 'return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Set Variables + * + * Once variables are set they become available within + * the controller class and its "view" files. + * + * @access public + * @param array + * @return void + */ + function vars($vars = array()) + { + $vars = $this->_ci_object_to_array($vars); + + if (is_array($vars) AND count($vars) > 0) + { + foreach ($vars as $key => $val) + { + $this->_ci_cached_vars[$key] = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Load Helper + * + * This function loads the specified helper file. + * + * @access public + * @param mixed + * @return void + */ + function helper($helpers = array()) + { + if ( ! is_array($helpers)) + { + $helpers = array($helpers); + } + + foreach ($helpers as $helper) + { + $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); + + if (isset($this->_ci_helpers[$helper])) + { + continue; + } + + if (file_exists(APPPATH.'helpers/'.$helper.EXT)) + { + include_once(APPPATH.'helpers/'.$helper.EXT); + } + else + { + if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) + { + include(BASEPATH.'helpers/'.$helper.EXT); + } + else + { + show_error('Unable to load the requested file: helpers/'.$helper.EXT); + } + } + + $this->_ci_helpers[$helper] = TRUE; + + } + + log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); + } + + // -------------------------------------------------------------------- + + /** + * Load Helpers + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function helpers($helpers = array()) + { + $this->helper($helpers); + } + + // -------------------------------------------------------------------- + + /** + * Load Plugin + * + * This function loads the specified plugin. + * + * @access public + * @param array + * @return void + */ + function plugin($plugins = array()) + { + if ( ! is_array($plugins)) + { + $plugins = array($plugins); + } + + foreach ($plugins as $plugin) + { + $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); + + if (isset($this->_ci_plugins[$plugin])) + { + continue; + } + + if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) + { + include(APPPATH.'plugins/'.$plugin.EXT); + } + else + { + if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) + { + include(BASEPATH.'plugins/'.$plugin.EXT); + } + else + { + show_error('Unable to load the requested file: plugins/'.$plugin.EXT); + } + } + + $this->_ci_plugins[$plugin] = TRUE; + } + + log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); + } + + // -------------------------------------------------------------------- + + /** + * Load Plugins + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function plugins($plugins = array()) + { + $this->plugin($plugins); + } + + // -------------------------------------------------------------------- + + /** + * Load Script + * + * This function loads the specified include file from the + * application/scripts/ folder. + * + * NOTE: This feature has been deprecated but it will remain available + * for legacy users. + * + * @access public + * @param array + * @return void + */ + function script($scripts = array()) + { + if ( ! is_array($scripts)) + { + $scripts = array($scripts); + } + + foreach ($scripts as $script) + { + $script = strtolower(str_replace(EXT, '', $script)); + + if (isset($this->_ci_scripts[$script])) + { + continue; + } + + if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) + { + show_error('Unable to load the requested script: scripts/'.$script.EXT); + } + + include(APPPATH.'scripts/'.$script.EXT); + } + + log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); + } + + // -------------------------------------------------------------------- + + /** + * Loads a language file + * + * @access public + * @param string + * @return void + */ + function language($file = '', $lang = '', $return = FALSE) + { + $CI =& get_instance(); + return $CI->lang->load($file, $lang, $return); + } + + // -------------------------------------------------------------------- + + /** + * Loads a config file + * + * @access public + * @param string + * @return void + */ + function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { + $CI =& get_instance(); + $CI->config->load($file, $use_sections, $fail_gracefully); + } + + // -------------------------------------------------------------------- + + /** + * Scaffolding Loader + * + * This initializing function works a bit different than the + * others. It doesn't load the class. Instead, it simply + * sets a flag indicating that scaffolding is allowed to be + * used. The actual scaffolding function below is + * called by the front controller based on whether the + * second segment of the URL matches the "secret" scaffolding + * word stored in the application/config/routes.php + * + * @access public + * @param string + * @return void + */ + function scaffolding($table = '') + { + if ($table === FALSE) + { + show_error('You must include the name of the table you would like access when you initialize scaffolding'); + } + + $CI =& get_instance(); + $CI->_ci_scaffolding = TRUE; + $CI->_ci_scaff_table = $table; + } + + // -------------------------------------------------------------------- + + /** + * Loader + * + * This function is used to load views and files. + * + * @access private + * @param array + * @return void + */ + function _ci_load($data) + { + // Set the default data variables + foreach (array('view', 'vars', 'path', 'return') as $val) + { + $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; + } + + // Set the path to the requested file + if ($path == '') + { + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.EXT : $view; + $path = $this->_ci_view_path.$file; + } + else + { + $x = explode('/', $path); + $file = end($x); + } + + if ( ! file_exists($path)) + { + show_error('Unable to load the requested file: '.$file); + } + + // This allows anything loaded using $this->load (views, files, etc.) + // to become accessible from within the Controller and Model functions. + // Only needed when running PHP 5 + + if ($this->_ci_is_instance()) + { + $CI =& get_instance(); + foreach (get_object_vars($CI) as $key => $var) + { + if ( ! isset($this->$key)) + { + $this->$key =& $CI->$key; + } + } + } + + /* + * Extract and cache variables + * + * You can either set variables using the dedicated $this->load_vars() + * function or via the second parameter of this function. We'll merge + * the two types and cache them so that views that are embedded within + * other views can have access to these variables. + */ + if (is_array($vars)) + { + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); + } + extract($this->_ci_cached_vars); + + /* + * Buffer the output + * + * We buffer the output for two reasons: + * 1. Speed. You get a significant speed boost. + * 2. So that the final rendered template can be + * post-processed by the output class. Why do we + * need post processing? For one thing, in order to + * show the elapsed page load time. Unless we + * can intercept the content right before it's sent to + * the browser and then stop the timer it won't be accurate. + */ + ob_start(); + + // If the PHP installation does not support short tags we'll + // do a little string replacement, changing the short tags + // to standard PHP echo statements. + + if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) + { + echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(' $this->_ci_ob_level + 1) + { + ob_end_flush(); + } + else + { + // PHP 4 requires that we use a global + global $OUT; + $OUT->set_output(ob_get_contents()); + @ob_end_clean(); + } + } + + // -------------------------------------------------------------------- + + /** + * Load class + * + * This function loads the requested class. + * + * @access private + * @param string the item that is being loaded + * @param mixed any additional parameters + * @return void + */ + function _ci_load_class($class, $params = NULL) + { + // Get the class name + $class = str_replace(EXT, '', $class); + + // We'll test for both lowercase and capitalized versions of the file name + foreach (array(ucfirst($class), strtolower($class)) as $class) + { + // Is this a class extension request? + if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) + { + if ( ! file_exists(BASEPATH.'libraries/'.ucfirst($class).EXT)) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + + include(BASEPATH.'libraries/'.ucfirst($class).EXT); + include(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); + } + + // Lets search for the requested library file and load it. + for ($i = 1; $i < 3; $i++) + { + $path = ($i % 2) ? APPPATH : BASEPATH; + $fp = $path.'libraries/'.$class.EXT; + + // Does the file exist? No? Bummer... + if ( ! file_exists($fp)) + { + continue; + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($fp, $this->_ci_classes)) + { + log_message('debug', $class." class already loaded. Second attempt ignored."); + return; + } + + include($fp); + $this->_ci_classes[] = $fp; + return $this->_ci_init_class($class, '', $params); + } + } // END FOREACH + + // If we got this far we were unable to find the requested class. + // We do not issue errors if the load call failed due to a duplicate request + if ($is_duplicate == FALSE) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + } + + // -------------------------------------------------------------------- + + /** + * Instantiates a class + * + * @access private + * @param string + * @param string + * @return null + */ + function _ci_init_class($class, $prefix = '', $config = FALSE) + { + // Is there an associated config file for this class? + if ($config === NULL) + { + $config = NULL; + if (file_exists(APPPATH.'config/'.$class.EXT)) + { + include(APPPATH.'config/'.$class.EXT); + } + } + + if ($prefix == '') + { + $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; + } + else + { + $name = $prefix.$class; + } + + // Set the variable name we will assign the class to + $class = strtolower($class); + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + + // Instantiate the class + $CI =& get_instance(); + if ($config !== NULL) + { + $CI->$classvar = new $name($config); + } + else + { + $CI->$classvar = new $name; + } + } + + // -------------------------------------------------------------------- + + /** + * Autoloader + * + * The config/autoload.php file contains an array that permits sub-systems, + * libraries, plugins, and helpers to be loaded automatically. + * + * @access private + * @param array + * @return void + */ + function _ci_autoloader() + { + include(APPPATH.'config/autoload'.EXT); + + if ( ! isset($autoload)) + { + return FALSE; + } + + // Load any custome config file + if (count($autoload['config']) > 0) + { + $CI =& get_instance(); + foreach ($autoload['config'] as $key => $val) + { + $CI->config->load($val); + } + } + + // Load plugins, helpers, and scripts + foreach (array('helper', 'plugin', 'script') as $type) + { + if (isset($autoload[$type]) AND count($autoload[$type]) > 0) + { + $this->$type($autoload[$type]); + } + } + + // A little tweak to remain backward compatible + // The $autoload['core'] item was deprecated + if ( ! isset($autoload['libraries'])) + { + $autoload['libraries'] = $autoload['core']; + } + + // Load libraries + if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) + { + // Load the database driver. + if (in_array('database', $autoload['libraries'])) + { + $this->database(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); + } + + // Load the model class. + if (in_array('model', $autoload['libraries'])) + { + $this->model(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('model')); + } + + // Load scaffolding + if (in_array('scaffolding', $autoload['libraries'])) + { + $this->scaffolding(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('scaffolding')); + } + + // Load all other libraries + foreach ($autoload['libraries'] as $item) + { + $this->library($item); + } + } + } + + // -------------------------------------------------------------------- + + /** + * Assign to Models + * + * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) + * will be available to models, if any exist. + * + * @access private + * @param object + * @return array + */ + function _ci_assign_to_models() + { + if (count($this->_ci_models) == 0) + { + return; + } + + if ($this->_ci_is_instance()) + { + $CI =& get_instance(); + foreach ($this->_ci_models as $model) + { + $CI->$model->_assign_libraries(); + } + } + else + { + foreach ($this->_ci_models as $model) + { + $this->$model->_assign_libraries(); + } + } + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @access private + * @param object + * @return array + */ + function _ci_object_to_array($object) + { + return (is_object($object)) ? get_object_vars($object) : $object; + } + + // -------------------------------------------------------------------- + + /** + * Determines whether we should use the CI instance or $this + * + * @access private + * @return bool + */ + function _ci_is_instance() + { + if ($this->_ci_is_php5 == TRUE) + { + return TRUE; + } + + global $CI; + return (is_object($CI)) ? TRUE : FALSE; + } + +} ?> \ No newline at end of file From 320f3dfd8f6ea948d08660b57b29ed9c0de8d712 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 6 Feb 2007 04:06:08 +0000 Subject: [PATCH 0495/2544] changed app_ver to 1.5.1.1 --- system/codeigniter/CodeIgniter.php | 516 ++++++++++++++--------------- 1 file changed, 258 insertions(+), 258 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 3008b2ff..1caf7c96 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -1,259 +1,259 @@ -mark('total_execution_time_start'); -$BM->mark('loading_time_base_classes_start'); - -/* - * ------------------------------------------------------ - * Instantiate the hooks class - * ------------------------------------------------------ - */ - -$EXT =& load_class('Hooks'); - -/* - * ------------------------------------------------------ - * Is there a "pre_system" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('pre_system'); - -/* - * ------------------------------------------------------ - * Instantiate the base classes - * ------------------------------------------------------ - */ - -$CFG =& load_class('Config'); -$RTR =& load_class('Router'); -$OUT =& load_class('Output'); - -/* - * ------------------------------------------------------ - * Is there a valid cache file? If so, we're done... - * ------------------------------------------------------ - */ - -if ($EXT->_call_hook('cache_override') === FALSE) -{ - if ($OUT->_display_cache($CFG, $RTR) == TRUE) - { - exit; - } -} - -/* - * ------------------------------------------------------ - * Load the remaining base classes - * ------------------------------------------------------ - */ - -$IN =& load_class('Input'); -$URI =& load_class('URI'); -$LANG =& load_class('Language'); - -/* - * ------------------------------------------------------ - * Load the app controller and local controller - * ------------------------------------------------------ - * - * Note: Due to the poor object handling in PHP 4 we'll - * conditionally load different versions of the base - * class. Retaining PHP 4 compatibility requires a bit of a hack. - * - * Note: The Loader class needs to be included first - * - */ -if (floor(phpversion()) < 5) -{ - load_class('Loader', FALSE); - require(BASEPATH.'codeigniter/Base4'.EXT); -} -else -{ - require(BASEPATH.'codeigniter/Base5'.EXT); -} - -// Load the base controller class -load_class('Controller', FALSE); - -// Load the local application controller -// Note: The Router class automatically validates the controller path. If this include fails it -// means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) -{ - show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); -} - -// Set a mark point for benchmarking -$BM->mark('loading_time_base_classes_end'); - - -/* - * ------------------------------------------------------ - * Security check - * ------------------------------------------------------ - * - * None of the functions in the app controller or the - * loader class can be called via the URI, nor can - * controller functions that begin with an underscore - */ -$class = $RTR->fetch_class(); -$method = $RTR->fetch_method(); - - -if ( ! class_exists($class) - OR $method == 'controller' - OR substr($method, 0, 1) == '_' - OR in_array($method, get_class_methods('Controller'), TRUE) - ) -{ - show_404(); -} - -/* - * ------------------------------------------------------ - * Is there a "pre_controller" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('pre_controller'); - -/* - * ------------------------------------------------------ - * Instantiate the controller and call requested method - * ------------------------------------------------------ - */ - -// Mark a start point so we can benchmark the controller -$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); - -// Instantiate the Controller -$CI = new $class(); - -// Is this a scaffolding request? -if ($RTR->scaffolding_request === TRUE) -{ - if ($EXT->_call_hook('scaffolding_override') === FALSE) - { - $CI->_ci_scaffolding(); - } -} -else -{ - /* - * ------------------------------------------------------ - * Is there a "post_controller_constructor" hook? - * ------------------------------------------------------ - */ - $EXT->_call_hook('post_controller_constructor'); - - // Is there a "remap" function? - if (method_exists($CI, '_remap')) - { - $CI->_remap($method); - } - else - { - if ( ! method_exists($CI, $method)) - { - show_404(); - } - - // Call the requested method. - // Any URI segments present (besides the class/function) will be passed to the method for convenience - call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); - } -} - -// Mark a benchmark end point -$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); - -/* - * ------------------------------------------------------ - * Is there a "post_controller" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('post_controller'); - -/* - * ------------------------------------------------------ - * Send the final rendered output to the browser - * ------------------------------------------------------ - */ - -if ($EXT->_call_hook('display_override') === FALSE) -{ - $OUT->_display(); -} - -/* - * ------------------------------------------------------ - * Is there a "post_system" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('post_system'); - -/* - * ------------------------------------------------------ - * Close the DB connection if one exists - * ------------------------------------------------------ - */ -if (class_exists('CI_DB') AND isset($CI->db)) -{ - $CI->db->close(); -} - - +mark('total_execution_time_start'); +$BM->mark('loading_time_base_classes_start'); + +/* + * ------------------------------------------------------ + * Instantiate the hooks class + * ------------------------------------------------------ + */ + +$EXT =& load_class('Hooks'); + +/* + * ------------------------------------------------------ + * Is there a "pre_system" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('pre_system'); + +/* + * ------------------------------------------------------ + * Instantiate the base classes + * ------------------------------------------------------ + */ + +$CFG =& load_class('Config'); +$RTR =& load_class('Router'); +$OUT =& load_class('Output'); + +/* + * ------------------------------------------------------ + * Is there a valid cache file? If so, we're done... + * ------------------------------------------------------ + */ + +if ($EXT->_call_hook('cache_override') === FALSE) +{ + if ($OUT->_display_cache($CFG, $RTR) == TRUE) + { + exit; + } +} + +/* + * ------------------------------------------------------ + * Load the remaining base classes + * ------------------------------------------------------ + */ + +$IN =& load_class('Input'); +$URI =& load_class('URI'); +$LANG =& load_class('Language'); + +/* + * ------------------------------------------------------ + * Load the app controller and local controller + * ------------------------------------------------------ + * + * Note: Due to the poor object handling in PHP 4 we'll + * conditionally load different versions of the base + * class. Retaining PHP 4 compatibility requires a bit of a hack. + * + * Note: The Loader class needs to be included first + * + */ +if (floor(phpversion()) < 5) +{ + load_class('Loader', FALSE); + require(BASEPATH.'codeigniter/Base4'.EXT); +} +else +{ + require(BASEPATH.'codeigniter/Base5'.EXT); +} + +// Load the base controller class +load_class('Controller', FALSE); + +// Load the local application controller +// Note: The Router class automatically validates the controller path. If this include fails it +// means that the default controller in the Routes.php file is not resolving to something valid. +if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +{ + show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); +} + +// Set a mark point for benchmarking +$BM->mark('loading_time_base_classes_end'); + + +/* + * ------------------------------------------------------ + * Security check + * ------------------------------------------------------ + * + * None of the functions in the app controller or the + * loader class can be called via the URI, nor can + * controller functions that begin with an underscore + */ +$class = $RTR->fetch_class(); +$method = $RTR->fetch_method(); + + +if ( ! class_exists($class) + OR $method == 'controller' + OR substr($method, 0, 1) == '_' + OR in_array($method, get_class_methods('Controller'), TRUE) + ) +{ + show_404(); +} + +/* + * ------------------------------------------------------ + * Is there a "pre_controller" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('pre_controller'); + +/* + * ------------------------------------------------------ + * Instantiate the controller and call requested method + * ------------------------------------------------------ + */ + +// Mark a start point so we can benchmark the controller +$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); + +// Instantiate the Controller +$CI = new $class(); + +// Is this a scaffolding request? +if ($RTR->scaffolding_request === TRUE) +{ + if ($EXT->_call_hook('scaffolding_override') === FALSE) + { + $CI->_ci_scaffolding(); + } +} +else +{ + /* + * ------------------------------------------------------ + * Is there a "post_controller_constructor" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('post_controller_constructor'); + + // Is there a "remap" function? + if (method_exists($CI, '_remap')) + { + $CI->_remap($method); + } + else + { + if ( ! method_exists($CI, $method)) + { + show_404(); + } + + // Call the requested method. + // Any URI segments present (besides the class/function) will be passed to the method for convenience + call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); + } +} + +// Mark a benchmark end point +$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); + +/* + * ------------------------------------------------------ + * Is there a "post_controller" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('post_controller'); + +/* + * ------------------------------------------------------ + * Send the final rendered output to the browser + * ------------------------------------------------------ + */ + +if ($EXT->_call_hook('display_override') === FALSE) +{ + $OUT->_display(); +} + +/* + * ------------------------------------------------------ + * Is there a "post_system" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('post_system'); + +/* + * ------------------------------------------------------ + * Close the DB connection if one exists + * ------------------------------------------------------ + */ +if (class_exists('CI_DB') AND isset($CI->db)) +{ + $CI->db->close(); +} + + ?> \ No newline at end of file From abd98ca5d86487008e61175ebfb384604f1a07c7 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 6 Feb 2007 18:30:04 +0000 Subject: [PATCH 0496/2544] removed a duplicate call to load the library --- user_guide/libraries/file_uploading.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 69fa2dfc..71b330f1 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -163,8 +163,6 @@

              The Controller

              function do_upload() { - $this->load->library('upload'); - $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; From c4e9dc961c67084294d1050545c451ba0319fbb5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 6 Feb 2007 19:52:30 +0000 Subject: [PATCH 0497/2544] added missing 'quotes' in a few examples --- user_guide/helpers/url_helper.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 4f4ac95e..ad8ada3e 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -128,11 +128,11 @@

              anchor()

              Here are some examples:

              -echo anchor(news/local/123, My News); +echo anchor('news/local/123', 'My News');

              Would produce: <a href="http://www.your-site.com/index.php/news/local/123" title="My News">My News</a>

              -echo anchor(news/local/123, My News, array('title' => 'The best news!')); +echo anchor('news/local/123', 'My News', array('title' => 'The best news!'));

              Would produce: <a href="http://www.your-site.com/index.php/news/local/123" title="The best news!">My News</a>

              @@ -162,7 +162,7 @@

              anchor_popup()

              Note: The above attributes are the function defaults so you only need to set the ones that are different from what you need. If you want the function to use all of its defaults simply pass an empty array in the third parameter:

              -echo anchor_popup(news/local/123, 'Click Me!', array()); +echo anchor_popup('news/local/123', 'Click Me!', array());

              mailto()

              From 655bc02b4992d0ed764363f8181459d6390be24b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 6 Feb 2007 23:45:33 +0000 Subject: [PATCH 0498/2544] fixed grammer error in show_error message --- system/libraries/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index d1163071..aede38d7 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -526,7 +526,7 @@ function scaffolding($table = '') { if ($table === FALSE) { - show_error('You must include the name of the table you would like access when you initialize scaffolding'); + show_error('You must include the name of the table you would like to access when you initialize scaffolding'); } $CI =& get_instance(); From dbbe40862c895296a9e3d9e184ff2da3788800d4 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 13 Feb 2007 23:46:23 +0000 Subject: [PATCH 0499/2544] changed Content-Disposition: from "inline" to "attachment" for MSIE in force_download() --- system/helpers/download_helper.php | 190 ++++++++++++++--------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index dbedd872..34cc152c 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,96 +1,96 @@ - \ No newline at end of file From d62052a5333079984ee2e15602ef9adf4234e348 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 13 Feb 2007 23:48:54 +0000 Subject: [PATCH 0500/2544] download helper change note --- user_guide/changelog.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 24a1d26c..3e81cf0e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,8 +66,9 @@

              Version 1.5.1.1

              Release Date: January 27, 2007

              • Added support for captions in the Table Library
              • -
              • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
              • -
              • Fixed a bug in the form helper that gave textarea a value attribute
              • +
              • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
              • +
              • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
              • +
              • Fixed a bug in the form helper that gave textarea a value attribute
              • Fixed a bug in the Image Library that was ignoring resizing the same size image
              • Fixed some doc typos.
              From 6aa124847aae699f76c013343283a11bbb474f84 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 00:00:07 +0000 Subject: [PATCH 0501/2544] added a few more changes to changelog --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3e81cf0e..ff7a8c22 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,8 @@

              Version 1.5.1.1

            • Added support for captions in the Table Library
            • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
            • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
            • +
            • Removed unescaped variables in error messages of Input and Router classes
            • +
            • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
            • Fixed a bug in the form helper that gave textarea a value attribute
            • Fixed a bug in the Image Library that was ignoring resizing the same size image
            • Fixed some doc typos.
            • From 561b6bb7ca046f2e047560a7c8b0db5a6a9b2a51 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 01:34:52 +0000 Subject: [PATCH 0502/2544] updated app_version --- system/codeigniter/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 1caf7c96..12f1a0d5 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -28,7 +28,7 @@ */ // CI Version -define('APPVER', '1.5.1.1'); +define('APPVER', '1.5.2'); /* * ------------------------------------------------------ From 09de1854b1ac78f81264ca7a6b9d849ddcd1d159 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 01:35:56 +0000 Subject: [PATCH 0503/2544] updated AR join() to accommodate database prefixes --- system/database/DB_active_rec.php | 1777 +++++++++++++++-------------- 1 file changed, 891 insertions(+), 886 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index d27d3dc1..1c72528e 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1,887 +1,892 @@ -ar_select[] = $val; - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * DISTINCT - * - * Sets a flag which tells the query string compiler to add DISTINCT - * - * @access public - * @param bool - * @return object - */ - function distinct($val = TRUE) - { - $this->ar_distinct = (is_bool($val)) ? $val : TRUE; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * From - * - * Generates the FROM portion of the query - * - * @access public - * @param mixed can be a string or array - * @return object - */ - function from($from) - { - foreach ((array)$from as $val) - { - $this->ar_from[] = $this->dbprefix.$val; - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Join - * - * Generates the JOIN portion of the query - * - * @access public - * @param string - * @param string the join condition - * @param string the type of join - * @return object - */ - function join($table, $cond, $type = '') - { - if ($type != '') - { - $type = strtoupper(trim($type)); - - if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE)) - { - $type = ''; - } - else - { - $type .= ' '; - } - } - - // If a DB prefix is used we might need to add it to the column names - if ($this->dbprefix) - { - // First we remove any existing prefixes in the condition to avoid duplicates - $cond = preg_replace('|('.$this->dbprefix.')([\w\.]+)([\W\s]+)|', "$2$3", $cond); - - // Next we add the prefixes to the condition - $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); - } - - $this->ar_join[] = $type.'JOIN '.$this->dbprefix.$table.' ON '.$cond; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Where - * - * Generates the WHERE portion of the query. Separates - * multiple calls with AND - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function where($key, $value = NULL) - { - return $this->_where($key, $value, 'AND '); - } - - // -------------------------------------------------------------------- - - /** - * OR Where - * - * Generates the WHERE portion of the query. Separates - * multiple calls with OR - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function orwhere($key, $value = NULL) - { - return $this->_where($key, $value, 'OR '); - } - - // -------------------------------------------------------------------- - - /** - * Where - * - * Called by where() or orwhere() - * - * @access private - * @param mixed - * @param mixed - * @param string - * @return object - */ - function _where($key, $value = NULL, $type = 'AND ') - { - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - foreach ($key as $k => $v) - { - $prefix = (count($this->ar_where) == 0) ? '' : $type; - - if ( ! is_null($v)) - { - if ( ! $this->_has_operator($k)) - { - $k .= ' ='; - } - - $v = ' '.$this->escape($v); - } - - $this->ar_where[] = $prefix.$k.$v; - } - return $this; - } - - - - // -------------------------------------------------------------------- - - /** - * Like - * - * Generates a %LIKE% portion of the query. Separates - * multiple calls with AND - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function like($field, $match = '') - { - return $this->_like($field, $match, 'AND '); - } - - // -------------------------------------------------------------------- - - /** - * OR Like - * - * Generates a %LIKE% portion of the query. Separates - * multiple calls with OR - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function orlike($field, $match = '') - { - return $this->_like($field, $match, 'OR '); - } - - // -------------------------------------------------------------------- - - /** - * Like - * - * Called by like() or orlike() - * - * @access private - * @param mixed - * @param mixed - * @param string - * @return object - */ - function _like($field, $match = '', $type = 'AND ') - { - if ( ! is_array($field)) - { - $field = array($field => $match); - } - - foreach ($field as $k => $v) - { - $prefix = (count($this->ar_like) == 0) ? '' : $type; - - $v = $this->escape_str($v); - - $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * GROUP BY - * - * @access public - * @param string - * @return object - */ - function groupby($by) - { - if (is_string($by)) - { - $by = explode(',', $by); - } - - foreach ($by as $val) - { - $val = trim($val); - - if ($val != '') - $this->ar_groupby[] = $val; - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the HAVING value - * - * Separates multiple calls with AND - * - * @access public - * @param string - * @param string - * @return object - */ - function having($key, $value = '') - { - return $this->_having($key, $value, 'AND '); - } - - // -------------------------------------------------------------------- - - /** - * Sets the OR HAVING value - * - * Separates multiple calls with OR - * - * @access public - * @param string - * @param string - * @return object - */ - function orhaving($key, $value = '') - { - return $this->_having($key, $value, 'OR '); - } - - // -------------------------------------------------------------------- - - /** - * Sets the HAVING values - * - * Called by having() or orhaving() - * - * @access private - * @param string - * @param string - * @return object - */ - function _having($key, $value = '', $type = 'AND ') - { - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - foreach ($key as $k => $v) - { - $prefix = (count($this->ar_having) == 0) ? '' : $type; - - if ($v != '') - { - $v = ' '.$this->escape($v); - } - - $this->ar_having[] = $prefix.$k.$v; - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the ORDER BY value - * - * @access public - * @param string - * @param string direction: asc or desc - * @return object - */ - function orderby($orderby, $direction = '') - { - if (trim($direction) != '') - { - $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC', 'RAND()'), TRUE)) ? ' '.$direction : ' ASC'; - } - - $this->ar_orderby[] = $orderby.$direction; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the LIMIT value - * - * @access public - * @param integer the limit value - * @param integer the offset value - * @return object - */ - function limit($value, $offset = '') - { - $this->ar_limit = $value; - - if ($offset != '') - $this->ar_offset = $offset; - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the OFFSET value - * - * @access public - * @param integer the offset value - * @return object - */ - function offset($value) - { - $this->ar_offset = $value; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * The "set" function. Allows key/value pairs to be set for inserting or updating - * - * @access public - * @param mixed - * @param string - * @return object - */ - function set($key, $value = '') - { - $key = $this->_object_to_array($key); - - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - foreach ($key as $k => $v) - { - $this->ar_set[$k] = $this->escape($v); - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Get - * - * Compiles the select statement based on the other functions called - * and runs the query - * - * @access public - * @param string the limit clause - * @param string the offset clause - * @return object - */ - function get($table = '', $limit = null, $offset = null) - { - if ($table != '') - { - $this->from($table); - } - - if ( ! is_null($limit)) - { - $this->limit($limit, $offset); - } - - $sql = $this->_compile_select(); - - $result = $this->query($sql); - $this->_reset_select(); - return $result; - } - - // -------------------------------------------------------------------- - - /** - * GetWhere - * - * Allows the where clause, limit and offset to be added directly - * - * @access public - * @param string the where clause - * @param string the limit clause - * @param string the offset clause - * @return object - */ - function getwhere($table = '', $where = null, $limit = null, $offset = null) - { - if ($table != '') - { - $this->from($table); - } - - if ( ! is_null($where)) - { - $this->where($where); - } - - if ( ! is_null($limit)) - { - $this->limit($limit, $offset); - } - - $sql = $this->_compile_select(); - - $result = $this->query($sql); - $this->_reset_select(); - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Insert - * - * Compiles an insert string and runs the query - * - * @access public - * @param string the table to retrieve the results from - * @param array an associative array of insert values - * @return object - */ - function insert($table = '', $set = NULL) - { - if ( ! is_null($set)) - { - $this->set($set); - } - - if (count($this->ar_set) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_must_use_set'); - } - return FALSE; - } - - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - - $sql = $this->_insert($this->dbprefix.$table, array_keys($this->ar_set), array_values($this->ar_set)); - - $this->_reset_write(); - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Update - * - * Compiles an update string and runs the query - * - * @access public - * @param string the table to retrieve the results from - * @param array an associative array of update values - * @param mixed the where clause - * @return object - */ - function update($table = '', $set = NULL, $where = null) - { - if ( ! is_null($set)) - { - $this->set($set); - } - - if (count($this->ar_set) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_must_use_set'); - } - return FALSE; - } - - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - - if ($where != null) - { - $this->where($where); - } - - $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where); - - $this->_reset_write(); - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Delete - * - * Compiles a delete string and runs the query - * - * @access public - * @param string the table to retrieve the results from - * @param mixed the where clause - * @return object - */ - function delete($table = '', $where = '') - { - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - - if ($where != '') - { - $this->where($where); - } - - if (count($this->ar_where) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_del_must_use_where'); - } - return FALSE; - } - - $sql = $this->_delete($this->dbprefix.$table, $this->ar_where); - - $this->_reset_write(); - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Use Table - DEPRECATED - * - * @deprecated use $this->db->from instead - */ - function use_table($table) - { - return $this->from($table); - return $this; - } - - // -------------------------------------------------------------------- - - /** - * ORDER BY - DEPRECATED - * - * @deprecated use $this->db->orderby() instead - */ - function order_by($orderby, $direction = '') - { - return $this->orderby($orderby, $direction); - } - - // -------------------------------------------------------------------- - - /** - * Tests whether the string has an SQL operator - * - * @access private - * @param string - * @return bool - */ - function _has_operator($str) - { - $str = trim($str); - if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str)) - { - return FALSE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Compile the SELECT statement - * - * Generates a query string based on which functions were used. - * Should not be called directly. The get() function calls it. - * - * @access private - * @return string - */ - function _compile_select() - { - $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; - - $sql .= (count($this->ar_select) == 0) ? '*' : implode(', ', $this->ar_select); - - if (count($this->ar_from) > 0) - { - $sql .= "\nFROM "; - $sql .= implode(', ', $this->ar_from); - } - - if (count($this->ar_join) > 0) - { - $sql .= "\n"; - $sql .= implode("\n", $this->ar_join); - } - - if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) - { - $sql .= "\nWHERE "; - } - - $sql .= implode("\n", $this->ar_where); - - if (count($this->ar_like) > 0) - { - if (count($this->ar_where) > 0) - { - $sql .= " AND "; - } - - $sql .= implode("\n", $this->ar_like); - } - - if (count($this->ar_groupby) > 0) - { - $sql .= "\nGROUP BY "; - $sql .= implode(', ', $this->ar_groupby); - } - - if (count($this->ar_having) > 0) - { - $sql .= "\nHAVING "; - $sql .= implode("\n", $this->ar_having); - } - - if (count($this->ar_orderby) > 0) - { - $sql .= "\nORDER BY "; - $sql .= implode(', ', $this->ar_orderby); - - if ($this->ar_order !== FALSE) - { - $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; - } - } - - if (is_numeric($this->ar_limit)) - { - $sql .= "\n"; - $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Object to Array - * - * Takes an object as input and converts the class variables to array key/vals - * - * @access public - * @param object - * @return array - */ - function _object_to_array($object) - { - if ( ! is_object($object)) - { - return $object; - } - - $array = array(); - foreach (get_object_vars($object) as $key => $val) - { - if ( ! is_object($val) AND ! is_array($val)) - { - $array[$key] = $val; - } - } - - return $array; - } - - // -------------------------------------------------------------------- - - /** - * Resets the active record values. Called by the get() function - * - * @access private - * @return void - */ - function _reset_select() - { - $this->ar_select = array(); - $this->ar_distinct = FALSE; - $this->ar_from = array(); - $this->ar_join = array(); - $this->ar_where = array(); - $this->ar_like = array(); - $this->ar_groupby = array(); - $this->ar_having = array(); - $this->ar_limit = FALSE; - $this->ar_offset = FALSE; - $this->ar_order = FALSE; - $this->ar_orderby = array(); - } - - // -------------------------------------------------------------------- - - /** - * Resets the active record "write" values. - * - * Called by the insert() or update() functions - * - * @access private - * @return void - */ - function _reset_write() - { - $this->ar_set = array(); - $this->ar_from = array(); - $this->ar_where = array(); - } - -} - +ar_select[] = $val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * DISTINCT + * + * Sets a flag which tells the query string compiler to add DISTINCT + * + * @access public + * @param bool + * @return object + */ + function distinct($val = TRUE) + { + $this->ar_distinct = (is_bool($val)) ? $val : TRUE; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * From + * + * Generates the FROM portion of the query + * + * @access public + * @param mixed can be a string or array + * @return object + */ + function from($from) + { + foreach ((array)$from as $val) + { + $this->ar_from[] = $this->dbprefix.$val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Join + * + * Generates the JOIN portion of the query + * + * @access public + * @param string + * @param string the join condition + * @param string the type of join + * @return object + */ + function join($table, $cond, $type = '') + { + if ($type != '') + { + $type = strtoupper(trim($type)); + + if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE)) + { + $type = ''; + } + else + { + $type .= ' '; + } + } + + if ($this->dbprefix) + { + $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); + } + + // If a DB prefix is used we might need to add it to the column names + if ($this->dbprefix) + { + // First we remove any existing prefixes in the condition to avoid duplicates + $cond = preg_replace('|('.$this->dbprefix.')([\w\.]+)([\W\s]+)|', "$2$3", $cond); + + // Next we add the prefixes to the condition + $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); + } + + $this->ar_join[] = $type.'JOIN '.$this->dbprefix.$table.' ON '.$cond; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function where($key, $value = NULL) + { + return $this->_where($key, $value, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * OR Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function orwhere($key, $value = NULL) + { + return $this->_where($key, $value, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Called by where() or orwhere() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _where($key, $value = NULL, $type = 'AND ') + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_where) == 0) ? '' : $type; + + if ( ! is_null($v)) + { + if ( ! $this->_has_operator($k)) + { + $k .= ' ='; + } + + $v = ' '.$this->escape($v); + } + + $this->ar_where[] = $prefix.$k.$v; + } + return $this; + } + + + + // -------------------------------------------------------------------- + + /** + * Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function like($field, $match = '') + { + return $this->_like($field, $match, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * OR Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function orlike($field, $match = '') + { + return $this->_like($field, $match, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Like + * + * Called by like() or orlike() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _like($field, $match = '', $type = 'AND ') + { + if ( ! is_array($field)) + { + $field = array($field => $match); + } + + foreach ($field as $k => $v) + { + $prefix = (count($this->ar_like) == 0) ? '' : $type; + + $v = $this->escape_str($v); + + $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * GROUP BY + * + * @access public + * @param string + * @return object + */ + function groupby($by) + { + if (is_string($by)) + { + $by = explode(',', $by); + } + + foreach ($by as $val) + { + $val = trim($val); + + if ($val != '') + $this->ar_groupby[] = $val; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the HAVING value + * + * Separates multiple calls with AND + * + * @access public + * @param string + * @param string + * @return object + */ + function having($key, $value = '') + { + return $this->_having($key, $value, 'AND '); + } + + // -------------------------------------------------------------------- + + /** + * Sets the OR HAVING value + * + * Separates multiple calls with OR + * + * @access public + * @param string + * @param string + * @return object + */ + function orhaving($key, $value = '') + { + return $this->_having($key, $value, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Sets the HAVING values + * + * Called by having() or orhaving() + * + * @access private + * @param string + * @param string + * @return object + */ + function _having($key, $value = '', $type = 'AND ') + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_having) == 0) ? '' : $type; + + if ($v != '') + { + $v = ' '.$this->escape($v); + } + + $this->ar_having[] = $prefix.$k.$v; + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the ORDER BY value + * + * @access public + * @param string + * @param string direction: asc or desc + * @return object + */ + function orderby($orderby, $direction = '') + { + if (trim($direction) != '') + { + $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC', 'RAND()'), TRUE)) ? ' '.$direction : ' ASC'; + } + + $this->ar_orderby[] = $orderby.$direction; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the LIMIT value + * + * @access public + * @param integer the limit value + * @param integer the offset value + * @return object + */ + function limit($value, $offset = '') + { + $this->ar_limit = $value; + + if ($offset != '') + $this->ar_offset = $offset; + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the OFFSET value + * + * @access public + * @param integer the offset value + * @return object + */ + function offset($value) + { + $this->ar_offset = $value; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * The "set" function. Allows key/value pairs to be set for inserting or updating + * + * @access public + * @param mixed + * @param string + * @return object + */ + function set($key, $value = '') + { + $key = $this->_object_to_array($key); + + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $this->ar_set[$k] = $this->escape($v); + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Get + * + * Compiles the select statement based on the other functions called + * and runs the query + * + * @access public + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function get($table = '', $limit = null, $offset = null) + { + if ($table != '') + { + $this->from($table); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $result = $this->query($sql); + $this->_reset_select(); + return $result; + } + + // -------------------------------------------------------------------- + + /** + * GetWhere + * + * Allows the where clause, limit and offset to be added directly + * + * @access public + * @param string the where clause + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function getwhere($table = '', $where = null, $limit = null, $offset = null) + { + if ($table != '') + { + $this->from($table); + } + + if ( ! is_null($where)) + { + $this->where($where); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $result = $this->query($sql); + $this->_reset_select(); + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Insert + * + * Compiles an insert string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of insert values + * @return object + */ + function insert($table = '', $set = NULL) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + $sql = $this->_insert($this->dbprefix.$table, array_keys($this->ar_set), array_values($this->ar_set)); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * Compiles an update string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of update values + * @param mixed the where clause + * @return object + */ + function update($table = '', $set = NULL, $where = null) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + if ($where != null) + { + $this->where($where); + } + + $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * Compiles a delete string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param mixed the where clause + * @return object + */ + function delete($table = '', $where = '') + { + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + if ($where != '') + { + $this->where($where); + } + + if (count($this->ar_where) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_del_must_use_where'); + } + return FALSE; + } + + $sql = $this->_delete($this->dbprefix.$table, $this->ar_where); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Use Table - DEPRECATED + * + * @deprecated use $this->db->from instead + */ + function use_table($table) + { + return $this->from($table); + return $this; + } + + // -------------------------------------------------------------------- + + /** + * ORDER BY - DEPRECATED + * + * @deprecated use $this->db->orderby() instead + */ + function order_by($orderby, $direction = '') + { + return $this->orderby($orderby, $direction); + } + + // -------------------------------------------------------------------- + + /** + * Tests whether the string has an SQL operator + * + * @access private + * @param string + * @return bool + */ + function _has_operator($str) + { + $str = trim($str); + if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str)) + { + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Compile the SELECT statement + * + * Generates a query string based on which functions were used. + * Should not be called directly. The get() function calls it. + * + * @access private + * @return string + */ + function _compile_select() + { + $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; + + $sql .= (count($this->ar_select) == 0) ? '*' : implode(', ', $this->ar_select); + + if (count($this->ar_from) > 0) + { + $sql .= "\nFROM "; + $sql .= implode(', ', $this->ar_from); + } + + if (count($this->ar_join) > 0) + { + $sql .= "\n"; + $sql .= implode("\n", $this->ar_join); + } + + if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) + { + $sql .= "\nWHERE "; + } + + $sql .= implode("\n", $this->ar_where); + + if (count($this->ar_like) > 0) + { + if (count($this->ar_where) > 0) + { + $sql .= " AND "; + } + + $sql .= implode("\n", $this->ar_like); + } + + if (count($this->ar_groupby) > 0) + { + $sql .= "\nGROUP BY "; + $sql .= implode(', ', $this->ar_groupby); + } + + if (count($this->ar_having) > 0) + { + $sql .= "\nHAVING "; + $sql .= implode("\n", $this->ar_having); + } + + if (count($this->ar_orderby) > 0) + { + $sql .= "\nORDER BY "; + $sql .= implode(', ', $this->ar_orderby); + + if ($this->ar_order !== FALSE) + { + $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; + } + } + + if (is_numeric($this->ar_limit)) + { + $sql .= "\n"; + $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @access public + * @param object + * @return array + */ + function _object_to_array($object) + { + if ( ! is_object($object)) + { + return $object; + } + + $array = array(); + foreach (get_object_vars($object) as $key => $val) + { + if ( ! is_object($val) AND ! is_array($val)) + { + $array[$key] = $val; + } + } + + return $array; + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record values. Called by the get() function + * + * @access private + * @return void + */ + function _reset_select() + { + $this->ar_select = array(); + $this->ar_distinct = FALSE; + $this->ar_from = array(); + $this->ar_join = array(); + $this->ar_where = array(); + $this->ar_like = array(); + $this->ar_groupby = array(); + $this->ar_having = array(); + $this->ar_limit = FALSE; + $this->ar_offset = FALSE; + $this->ar_order = FALSE; + $this->ar_orderby = array(); + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record "write" values. + * + * Called by the insert() or update() functions + * + * @access private + * @return void + */ + function _reset_write() + { + $this->ar_set = array(); + $this->ar_from = array(); + $this->ar_where = array(); + } + +} + ?> \ No newline at end of file From f743c737d13025336672c99c7c9b8a0dff447d08 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 01:36:46 +0000 Subject: [PATCH 0504/2544] Changed version number, added upgrade instructions --- user_guide/changelog.html | 9 +++++---- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 10 ++++++---- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 4 ++-- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 4 ++-- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 101 files changed, 112 insertions(+), 109 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ff7a8c22..dfde9185 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -33,7 +33,7 @@
              - +

              Code Igniter User Guide Version 1.5.1

              Code Igniter User Guide Version 1.5.2

              @@ -62,10 +62,11 @@

              Change Log

              -

              Version 1.5.1.1

              -

              Release Date: January 27, 2007

              +

              Version 1.5.2

              +

              Release Date: February 13, 2007

                -
              • Added support for captions in the Table Library
              • +
              • Added subversion information to the downloads page.
              • +
              • Added support for captions in the Table Library
              • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
              • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
              • Removed unescaped variables in error messages of Input and Router classes
              • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d0657cda..7e0c14c8 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 6eb654ab..fa00e4ad 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 831d6e8a..9522c5d9 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 2e539597..e6d9a89d 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index cd09e07f..aa60af5d 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 80c0f233..6b1a2a1e 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index d6f273ed..091faaf6 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index ccd30696..b3bd3f68 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/index.html b/user_guide/database/index.html index d17e7052..d9c62169 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index ca618f17..cefcf234 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 53f4713e..c941d5b9 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index b105b00c..621f6fe0 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 9330faf4..5c59d786 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index dfe979c1..e9012740 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 89e53fd0..c97f4ba5 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index b40905c3..78c3620d 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index c16ad4cd..c63ed72c 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 8352fcd0..b5d5c80a 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index ef2d3fac..945791a4 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index aa64bb43..5121b7d8 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 86cd1528..7ab97d60 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index a3bfaa34..77c080cb 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index af7ae4b9..60456d33 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index e346bd67..2bae2639 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 86082d2e..1b9ad7a8 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/index.html b/user_guide/general/index.html index daef0008..2d3ad90a 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 74782269..d293920d 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 58712c70..13bd6b76 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 5ca1ae8b..d7e0e60a 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 61f4574a..0e83c5ca 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 77bb9eb1..688531e0 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index b3154f40..2a7fee2f 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 1163e6d5..e1d32417 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index e8d074e7..a4ca8dca 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index ea511373..ba1a804f 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 083be367..48c8ce81 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index f493c69b..e2ebbf23 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/general/views.html b/user_guide/general/views.html index a8d0fec2..21f8b5c0 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index a3f66fb5..328ca79a 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 4592a2ff..53418c8b 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index c6df300b..436ac88b 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index bc1e9050..497ac99b 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index c89257af..06b56ed7 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 68ce66eb..4d759a72 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 3dcb147b..8eea9610 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 8a81dde5..b89fc1c3 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 67016035..66a0feec 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 3ac47a04..c52cf030 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 0fc96628..91392ad0 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index dd04451a..b0bbf8af 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 9a6fc358..2c39bb36 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index bafc6ac0..c5c413d2 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index b1d08412..b1137e8d 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index ad8ada3e..53cad703 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 119e8d20..af95ae55 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/index.html b/user_guide/index.html index 8c8ca265..10fee4bd 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 5acf04e5..1f5922a8 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                @@ -63,7 +63,8 @@

                Downloading Code Igniter

                +

                Subversion Server

                +

                Public subversion access is now available via http://dev.ellislab.com/svn/CodeIgniter/trunk please note that while every effort is made to keep this codebase functional, we cannot guarantee the functionality of code taken from the repository.

                +

                Subversion is a version control system.

                diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 4e4aa41d..60fa2acf 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 733012fa..ac131c46 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index b3817668..45f30eb2 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index ee26595e..ce0359d8 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index a494a092..085e6f14 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index df1a0719..1999ac08 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index e6570404..4e6916b3 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index bed67597..24676304 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 850c8ea4..ae1a2f99 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 5657595a..2114dfd0 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                @@ -99,7 +99,7 @@

                Step 2: Update your database.php file

                -

                Step 2: Update your config.php file

                +

                Step 3: Update your config.php file

                Open your application/config/config.php file and ADD these new items:

                diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 79bf31d6..3a24e9ee 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 04afb929..b6ac6338 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 35ba9cec..9d286aa5 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index a21812e0..499a4328 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 5c62f8a6..9196ea4c 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index d794d140..c38eafbf 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 3cb42dca..a69577c8 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 71b330f1..01f9b685 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 4e97f18c..898f769b 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 22c71c44..87b68d2e 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 4fef7091..9efa3017 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 139c2d52..e84773cc 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index d1784c5e..4bc5d634 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index ec76947b..82c2187b 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index c83f71ae..35c43504 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 880d2d4e..2907b786 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 087d2d1f..b212b697 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 8cd4a1e9..f62d2780 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 247347d9..be6779fd 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index d97fa6d4..401876ba 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7e8f2d7d..b6d51bef 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 9649b013..7772ade7 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index dc74439b..0f8b141d 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5a6bebcf..5f556388 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index fabe8a4f..3df99bf4 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/license.html b/user_guide/license.html index e4801817..f8806271 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 21d788d5..f9dcd30c 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.1

                Code Igniter User Guide Version 1.5.2

                @@ -65,7 +65,7 @@

                Application Flow Chart

                The following graphic illustrates how data flows throughout the system:

                -
                +
                  diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index d3d5e805..35f20540 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -33,7 +33,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index ed3a670f..af7c2d4a 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -33,7 +33,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index aea64f23..3c325069 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -33,7 +33,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 8796934b..1166dee2 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -33,7 +33,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index d081161e..ba863dd6 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -33,7 +33,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  diff --git a/user_guide/toc.html b/user_guide/toc.html index 8632ac9f..59eb9e60 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -34,7 +34,7 @@
                  - +

                  Code Igniter User Guide Version 1.5.1

                  Code Igniter User Guide Version 1.5.2

                  From b3e1c6a0d53cd0a09e0f2f674c9095acf8a5c41e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 01:43:31 +0000 Subject: [PATCH 0505/2544] added link to upgrade instructions --- user_guide/installation/upgrading.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index b6ac6338..32907cda 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -65,6 +65,7 @@

                  Upgrading From a Previous Version

                  Please read the upgrade notes corresponding to the version you are upgrading from.

                    +
                  • Upgrading from 1.5.0 or 1.5.1 to 1.5.2
                  • Upgrading from 1.4.1 to 1.5.0
                  • Upgrading from 1.4.0 to 1.4.1
                  • Upgrading from 1.3.3 to 1.4.0
                  • From 4dde0de7576872c075171c75363dfad7e5528952 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 14 Feb 2007 22:44:36 +0000 Subject: [PATCH 0506/2544] fixed an undefined var --- system/libraries/Loader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index aede38d7..e634c388 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -697,6 +697,7 @@ function _ci_load_class($class, $params = NULL) } // Lets search for the requested library file and load it. + $is_duplicate = FALSE; for ($i = 1; $i < 3; $i++) { $path = ($i % 2) ? APPPATH : BASEPATH; @@ -711,6 +712,7 @@ function _ci_load_class($class, $params = NULL) // Safety: Was the class already loaded by a previous call? if (in_array($fp, $this->_ci_classes)) { + $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; } From b4bca8e7344ad1d1c3e9d165a3a5b6a7650e2a28 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 15 Feb 2007 02:31:23 +0000 Subject: [PATCH 0507/2544] incorrect directory fixed --- user_guide/installation/upgrade_152.html | 116 +++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 user_guide/installation/upgrade_152.html diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html new file mode 100644 index 00000000..730b6f38 --- /dev/null +++ b/user_guide/installation/upgrade_152.html @@ -0,0 +1,116 @@ + + + + +Code Igniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
                    + + + + + +

                    Code Igniter User Guide Version 1.5.2

                    +
                    + + + + + + + + + +
                    + + +
                    + + + +
                    + +

                    Upgrading from 1.5.0 to 1.5.2

                    + +

                    Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you +have not upgraded to that version please do so first.

                    + +

                    Before performing an update you should take your site offline by replacing the index.php file with a static one.

                    + + + +

                    Step 1: Update your Code Igniter files

                    + +

                    Replace these files and directories in your "system" folder with the new versions: + +

                      + +
                    • system/helpers/download_helper.php
                    • +
                    • system/helpers/form_helper.php
                    • +
                    • system/libraries/Table.php
                    • +
                    • system/libraries/User_agent.php
                    • +
                    • system/libraries/Exceptions.php
                    • +
                    • system/libraries/Input.php
                    • +
                    • system/libraries/Router.php
                    • +
                    • system/libraries/Loader.php
                    • +
                    • system/libraries/Image_lib.php
                    • +
                    • system/language/english/unit_test_lang.php
                    • +
                    • system/database/DB_active_rec.php
                    • +
                    • codeigniter/
                    • +
                    + +

                    Note: If you have any custom developed files in these folders please make copies of them first.

                    + + +

                    Step 2: Update your user guide

                    + +

                    Please also replace your local copy of the user guide with the new version.

                    + +
                    + + + + + + + \ No newline at end of file From c4ac15f47a73a2db99406d901d53803b87f255bb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 15 Feb 2007 17:22:31 +0000 Subject: [PATCH 0508/2544] fixed a a value bug introduced when clearing value from textarea --- system/helpers/form_helper.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8186d4cc..a166198f 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -196,9 +196,15 @@ function form_textarea($data = '', $value = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']); - - unset ($data['value']); // textareas don't use the value attribute + if ( ! is_array($data) OR ! isset($data['value'])) + { + $val = $value; + } + else + { + $val = $data['value']; + unset($data['value']); // textareas don't use the value attribute + } return "\n"; } From a8b10bed6b1064548b8af605e5b16113b457de02 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 15 Feb 2007 18:20:05 +0000 Subject: [PATCH 0509/2544] allow for extending models --- system/libraries/Loader.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index e634c388..8438cc0b 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -154,10 +154,7 @@ function model($model, $name = '', $db_conn = FALSE) $CI->load->database($db_conn, FALSE, TRUE); } - if ( ! class_exists('Model')) - { - require_once(BASEPATH.'libraries/Model'.EXT); - } + load_class('Model', false); require_once(APPPATH.'models/'.$path.$model.EXT); From ac0eb4543ce713d0d25125614489de3b8b2fd296 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 15 Feb 2007 18:42:22 +0000 Subject: [PATCH 0510/2544] reverted a change user testing revealed a flaw. --- system/libraries/Loader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 8438cc0b..e634c388 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -154,7 +154,10 @@ function model($model, $name = '', $db_conn = FALSE) $CI->load->database($db_conn, FALSE, TRUE); } - load_class('Model', false); + if ( ! class_exists('Model')) + { + require_once(BASEPATH.'libraries/Model'.EXT); + } require_once(APPPATH.'models/'.$path.$model.EXT); From 9e772fc9ab36f77c83f28dd1f19796f64cd2925a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 15 Feb 2007 21:03:15 +0000 Subject: [PATCH 0511/2544] fixed another version number --- user_guide/changelog.html | 2 +- user_guide/installation/upgrade_152.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index dfde9185..bbc205a6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,7 +77,7 @@

                    Version 1.5.2

                  -

                  Version 1.5.0.2

                  +

                  Version 1.5.1

                  Release Date: November 23, 2006

                  • Added support for submitting arrays of libraries in the $this->load->library function.
                  • diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 730b6f38..947cd71d 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -86,6 +86,7 @@

                    Step 1: Update your Code Igniter files

                  • system/libraries/Image_lib.php
                  • system/language/english/unit_test_lang.php
                  • system/database/DB_active_rec.php
                  • +
                  • system/database/drivers/mysqli/mysqli_driver.php
                  • codeigniter/
                  From 5811bf1da422839d8dd6cfc7e6bac65649fceacd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 20 Feb 2007 01:26:08 +0000 Subject: [PATCH 0512/2544] added a space to redirect Location to conform to w3c http spec --- system/helpers/url_helper.php | 984 +++++++++++++++++----------------- 1 file changed, 492 insertions(+), 492 deletions(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 3ca59746..baac0e5d 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -1,493 +1,493 @@ -config->site_url($uri); -} - -// ------------------------------------------------------------------------ - -/** - * Base URL - * - * Returns the "base_url" item from your config file - * - * @access public - * @return string - */ -function base_url() -{ - $CI =& get_instance(); - return $CI->config->slash_item('base_url'); -} - -// ------------------------------------------------------------------------ - -/** - * Index page - * - * Returns the "index_page" from your config file - * - * @access public - * @return string - */ -function index_page() -{ - $CI =& get_instance(); - return $CI->config->item('index_page'); -} - -// ------------------------------------------------------------------------ - -/** - * Anchor Link - * - * Creates an anchor based on the local URL. - * - * @access public - * @param string the URL - * @param string the link title - * @param mixed any attributes - * @return string - */ -function anchor($uri = '', $title = '', $attributes = '') -{ - if ( ! is_array($uri)) - { - $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; - } - else - { - $site_url = site_url($uri); - } - - if ($title == '') - { - $title = $site_url; - } - - if ($attributes == '') - { - $attributes = ' title="'.$title.'"'; - } - else - { - $attributes = _parse_attributes($attributes); - } - - return ''.$title.''; -} - -// ------------------------------------------------------------------------ - -/** - * Anchor Link - Pop-up version - * - * Creates an anchor based on the local URL. The link - * opens a new window based on the attributes specified. - * - * @access public - * @param string the URL - * @param string the link title - * @param mixed any attributes - * @return string - */ -function anchor_popup($uri = '', $title = '', $attributes = FALSE) -{ - $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; - - if ($title == '') - { - $title = $site_url; - } - - if ($attributes === FALSE) - { - return "".$title.""; - } - - if ( ! is_array($attributes)) - { - $attributes = array(); - } - - foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val) - { - $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key]; - } - - return "".$title.""; -} - -// ------------------------------------------------------------------------ - -/** - * Mailto Link - * - * @access public - * @param string the email address - * @param string the link title - * @param mixed any attributes - * @return string - */ -function mailto($email, $title = '', $attributes = '') -{ - if ($title == "") - { - $title = $email; - } - - $attributes = _parse_attributes($attributes); - - return ''.$title.''; -} - -// ------------------------------------------------------------------------ - -/** - * Encoded Mailto Link - * - * Create a spam-protected mailto link written in Javascript - * - * @access public - * @param string the email address - * @param string the link title - * @param mixed any attributes - * @return string - */ -function safe_mailto($email, $title = '', $attributes = '') -{ - if ($title == "") - { - $title = $email; - } - - for ($i = 0; $i < 16; $i++) - { - $x[] = substr(' $val) - { - $x[] = ' '.$key.'="'; - for ($i = 0; $i < strlen($val); $i++) - { - $x[] = "|".ord(substr($val, $i, 1)); - } - $x[] = '"'; - } - } - else - { - for ($i = 0; $i < strlen($attributes); $i++) - { - $x[] = substr($attributes, $i, 1); - } - } - } - - $x[] = '>'; - - $temp = array(); - for ($i = 0; $i < strlen($title); $i++) - { - $ordinal = ord($title[$i]); - - if ($ordinal < 128) - { - $x[] = "|".$ordinal; - } - else - { - if (count($temp) == 0) - { - $count = ($ordinal < 224) ? 2 : 3; - } - - $temp[] = $ordinal; - if (count($temp) == $count) - { - $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); - $x[] = "|".$number; - $count = 1; - $temp = array(); - } - } - } - - $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>'; - - $x = array_reverse($x); - ob_start(); - -?>http'. - $matches['4'][$i].'://'. - $matches['5'][$i]. - $matches['6'][$i].''. - $period, $str); - } - } - } - - if ($type != 'url') - { - if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) - { - for ($i = 0; $i < sizeof($matches['0']); $i++) - { - $period = ''; - if (preg_match("|\.$|", $matches['3'][$i])) - { - $period = '.'; - $matches['3'][$i] = substr($matches['3'][$i], 0, -1); - } - - $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); - } - - } - } - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Prep URL - * - * Simply adds the http:// part if missing - * - * @access public - * @param string the URL - * @return string - */ -function prep_url($str = '') -{ - if ($str == 'http://' OR $str == '') - { - return ''; - } - - if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') - { - $str = 'http://'.$str; - } - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Create URL Title - * - * Takes a "title" string as input and creates a - * human-friendly URL string with either a dash - * or an underscore as the word separator. - * - * @access public - * @param string the string - * @param string the separator: dash, or underscore - * @return string - */ -function url_title($str, $separator = 'dash') -{ - if ($separator == 'dash') - { - $search = '_'; - $replace = '-'; - } - else - { - $search = '-'; - $replace = '_'; - } - - $trans = array( - $search => $replace, - "\s+" => $replace, - "[^a-z0-9".$replace."]" => '', - $replace."+" => $replace, - $replace."$" => '', - "^".$replace => '' - ); - - $str = strip_tags(strtolower($str)); - - foreach ($trans as $key => $val) - { - $str = preg_replace("#".$key."#", $val, $str); - } - - return trim(stripslashes($str)); -} - -// ------------------------------------------------------------------------ - -/** - * Header Redirect - * - * Header redirect in two flavors - * - * @access public - * @param string the URL - * @param string the method: location or redirect - * @return string - */ -function redirect($uri = '', $method = 'location') -{ - switch($method) - { - case 'refresh' : header("Refresh:0;url=".site_url($uri)); - break; - default : header("location:".site_url($uri)); - break; - } - exit; -} - -// ------------------------------------------------------------------------ - -/** - * Parse out the attributes - * - * Some of the functions use this - * - * @access private - * @param array - * @param bool - * @return string - */ -function _parse_attributes($attributes, $javascript = FALSE) -{ - if (is_string($attributes)) - { - return ($attributes != '') ? ' '.$attributes : ''; - } - - $att = ''; - foreach ($attributes as $key => $val) - { - if ($javascript == TRUE) - { - $att .= $key . '=' . $val . ','; - } - else - { - $att .= ' ' . $key . '="' . $val . '"'; - } - } - - if ($javascript == TRUE AND $att != '') - { - $att = substr($att, 0, -1); - } - - return $att; -} - +config->site_url($uri); +} + +// ------------------------------------------------------------------------ + +/** + * Base URL + * + * Returns the "base_url" item from your config file + * + * @access public + * @return string + */ +function base_url() +{ + $CI =& get_instance(); + return $CI->config->slash_item('base_url'); +} + +// ------------------------------------------------------------------------ + +/** + * Index page + * + * Returns the "index_page" from your config file + * + * @access public + * @return string + */ +function index_page() +{ + $CI =& get_instance(); + return $CI->config->item('index_page'); +} + +// ------------------------------------------------------------------------ + +/** + * Anchor Link + * + * Creates an anchor based on the local URL. + * + * @access public + * @param string the URL + * @param string the link title + * @param mixed any attributes + * @return string + */ +function anchor($uri = '', $title = '', $attributes = '') +{ + if ( ! is_array($uri)) + { + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; + } + else + { + $site_url = site_url($uri); + } + + if ($title == '') + { + $title = $site_url; + } + + if ($attributes == '') + { + $attributes = ' title="'.$title.'"'; + } + else + { + $attributes = _parse_attributes($attributes); + } + + return ''.$title.''; +} + +// ------------------------------------------------------------------------ + +/** + * Anchor Link - Pop-up version + * + * Creates an anchor based on the local URL. The link + * opens a new window based on the attributes specified. + * + * @access public + * @param string the URL + * @param string the link title + * @param mixed any attributes + * @return string + */ +function anchor_popup($uri = '', $title = '', $attributes = FALSE) +{ + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; + + if ($title == '') + { + $title = $site_url; + } + + if ($attributes === FALSE) + { + return "".$title.""; + } + + if ( ! is_array($attributes)) + { + $attributes = array(); + } + + foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val) + { + $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key]; + } + + return "".$title.""; +} + +// ------------------------------------------------------------------------ + +/** + * Mailto Link + * + * @access public + * @param string the email address + * @param string the link title + * @param mixed any attributes + * @return string + */ +function mailto($email, $title = '', $attributes = '') +{ + if ($title == "") + { + $title = $email; + } + + $attributes = _parse_attributes($attributes); + + return ''.$title.''; +} + +// ------------------------------------------------------------------------ + +/** + * Encoded Mailto Link + * + * Create a spam-protected mailto link written in Javascript + * + * @access public + * @param string the email address + * @param string the link title + * @param mixed any attributes + * @return string + */ +function safe_mailto($email, $title = '', $attributes = '') +{ + if ($title == "") + { + $title = $email; + } + + for ($i = 0; $i < 16; $i++) + { + $x[] = substr(' $val) + { + $x[] = ' '.$key.'="'; + for ($i = 0; $i < strlen($val); $i++) + { + $x[] = "|".ord(substr($val, $i, 1)); + } + $x[] = '"'; + } + } + else + { + for ($i = 0; $i < strlen($attributes); $i++) + { + $x[] = substr($attributes, $i, 1); + } + } + } + + $x[] = '>'; + + $temp = array(); + for ($i = 0; $i < strlen($title); $i++) + { + $ordinal = ord($title[$i]); + + if ($ordinal < 128) + { + $x[] = "|".$ordinal; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + $x[] = "|".$number; + $count = 1; + $temp = array(); + } + } + } + + $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>'; + + $x = array_reverse($x); + ob_start(); + +?>http'. + $matches['4'][$i].'://'. + $matches['5'][$i]. + $matches['6'][$i].''. + $period, $str); + } + } + } + + if ($type != 'url') + { + if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) + { + for ($i = 0; $i < sizeof($matches['0']); $i++) + { + $period = ''; + if (preg_match("|\.$|", $matches['3'][$i])) + { + $period = '.'; + $matches['3'][$i] = substr($matches['3'][$i], 0, -1); + } + + $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); + } + + } + } + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Prep URL + * + * Simply adds the http:// part if missing + * + * @access public + * @param string the URL + * @return string + */ +function prep_url($str = '') +{ + if ($str == 'http://' OR $str == '') + { + return ''; + } + + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + { + $str = 'http://'.$str; + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Create URL Title + * + * Takes a "title" string as input and creates a + * human-friendly URL string with either a dash + * or an underscore as the word separator. + * + * @access public + * @param string the string + * @param string the separator: dash, or underscore + * @return string + */ +function url_title($str, $separator = 'dash') +{ + if ($separator == 'dash') + { + $search = '_'; + $replace = '-'; + } + else + { + $search = '-'; + $replace = '_'; + } + + $trans = array( + $search => $replace, + "\s+" => $replace, + "[^a-z0-9".$replace."]" => '', + $replace."+" => $replace, + $replace."$" => '', + "^".$replace => '' + ); + + $str = strip_tags(strtolower($str)); + + foreach ($trans as $key => $val) + { + $str = preg_replace("#".$key."#", $val, $str); + } + + return trim(stripslashes($str)); +} + +// ------------------------------------------------------------------------ + +/** + * Header Redirect + * + * Header redirect in two flavors + * + * @access public + * @param string the URL + * @param string the method: location or redirect + * @return string + */ +function redirect($uri = '', $method = 'location') +{ + switch($method) + { + case 'refresh' : header("Refresh:0;url=".site_url($uri)); + break; + default : header("Location: ".site_url($uri)); + break; + } + exit; +} + +// ------------------------------------------------------------------------ + +/** + * Parse out the attributes + * + * Some of the functions use this + * + * @access private + * @param array + * @param bool + * @return string + */ +function _parse_attributes($attributes, $javascript = FALSE) +{ + if (is_string($attributes)) + { + return ($attributes != '') ? ' '.$attributes : ''; + } + + $att = ''; + foreach ($attributes as $key => $val) + { + if ($javascript == TRUE) + { + $att .= $key . '=' . $val . ','; + } + else + { + $att .= ' ' . $key . '="' . $val . '"'; + } + } + + if ($javascript == TRUE AND $att != '') + { + $att = substr($att, 0, -1); + } + + return $att; +} + ?> \ No newline at end of file From 7184e31bf641e181045dcfa95128e5a06b916130 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 20 Feb 2007 12:34:28 +0000 Subject: [PATCH 0513/2544] fixed a capitalize error --- user_guide/libraries/email.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index c38eafbf..c8d1c6e8 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -122,8 +122,8 @@

                  Setting Email Preferences

                  >

                  Setting Email Preferences in a Config File

                  If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the email.php, add the $config -array in that file. Then save the file at config/email.php and it will be used automatically. You +Simply create a new file called the Email.php, add the $config +array in that file. Then save the file at config/Email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

                  From 67e1053780a45dbeedc3ed98361aa1fc3d4931b8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 24 Feb 2007 15:13:17 +0000 Subject: [PATCH 0514/2544] result_array() returns an empty array when no result is produced. --- user_guide/database/results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/results.html b/user_guide/database/results.html index c941d5b9..7b46d21b 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -105,7 +105,7 @@

                  result()

                  result_array()

                  -

                  This function returns the query result as a pure array, or FALSE on failure. Typically you'll use this in a foreach loop, like this:

                  +

                  This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

                  $query = $this->db->query("YOUR QUERY");

                  From 4d8c7bb4697aabe173fdd8e08ae182e1d5ba488e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 24 Feb 2007 17:26:33 +0000 Subject: [PATCH 0515/2544] image was corrupted. --- user_guide/images/ci_quick_ref.png | Bin 94906 -> 94476 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/user_guide/images/ci_quick_ref.png b/user_guide/images/ci_quick_ref.png index 1e74a4290eacd449a46769a33f9c856f4007842c..c07d6b46970bfde2affac0e50644db91414e41c0 100644 GIT binary patch delta 2361 zcmWmCdtA-;9|!PW-&4xbw^RAKbXAL_(q(BSs&f>&mugB&PP$AcF>*_~s3~bK@9N_c z)^eGaDW9V+u?QoVQ8Cht+%0oiVw>!8e*bqo7 z9UZYz3=$ync;N?-wXPF|=&s|Py72;c($4@@8cd-sgGCfPxPvU@7UU)Or{(gyJZ?xo zc$kQLZ`hmbL zhuMP%49^5_9I+H+Z+4bHGn)bOwaDTJEg}T|-fB81aMUaEv>70G+f}^YwjA8YZXS5; z=uUwz8~a3{B*(Gzg=04*J6TblQyC3$o~jq&)?6i0oO3H{^DR;fMQY9j(mYI_z>v{#KD5xTR8%`*MEDeG-gLM_G3*sN4Iuy6PK) zry>pUaOIOc&dRoUd6Bo59VL2oa2Ic9fj;rc;+K5fz~4^_2Zi{$(`w&ny6QWNkMkP~ zKEwYPa95Qd_`)eRpp5~$xJ#f7c;wVn8P^15$jCZO&GW*dK<(kRv^1iW{)srt&qQh! zN@twoQPCp=J}-6?Ok)3NZiehar@_*6^PtXHdNXa(C6v1sXhHLU;C++qHf*} z(6sq}ym-C<`I`BCD>H-)eNm)}&pzR=J{u0w&-CWX%y1cfx#$ulEIv%)=Vmna^T*t1 ziPlZM^dK2!ALkddwMy~JKhoA+5lGipbn^Wx6F@@FdMeNPo#(Ai1izhYC)-kRinkV6 zgL(=JDP`?4>R!8^(uy+aTG0kl7pwT!#k)YNb-`4&E`?sMv!kIUrL?nT0(F*DQ&#Cp z{%dIfXnfgrYAcH(vkjII$$LXO-@U;A^i8=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&O12{l``oCASY@E_w8wbv$L=-Ei>n z-Jiggd(MNzrs90H@a970TldV^<=K7IqkZ(ieyGrNukCD#czyMco-nUM#g;ARNt$jS zOltoy2`+gLSAc&#COwtF?x&ByAD-cU))qfc0Ixsa4rae_1j}C(fu=7zz{@XFt;9R-{Z-v<$4xhT z)%)apiENtw6hooIvgDfnR<3yNKXnj0-kiYi6K@Q85p8d)!K8N;;KO&EGwZzzsC|#$ zyQ~SHO!I2uPL?`}0u*YYBLx{j*BL8``%;QGAQY`@Fd%-fb?*m~lBL3gve>*>5dKT( zjtH89$3dk^|xKmfkwhOAE38aADs8Wnj)!LzmK~5>)?w1RYQs ziU++&U*k;k5vUkNzwkP)jV5nSVB$g_K=p7TLu|Ls+l^-N@OpRJ3f1}}60DB!AY9G5 zQV+V#!3(_fMM;(3bQ#tK;|LutP4Lmjobw@f#OV5cX(-34#?x>+(c6@>)&G)J@{~XO z2R1&bE=X~A62tCaMaN1(<7o)|62{|*gsyHpea2yS{!|80>(6ydu@lJ^;){udrj$OK zL?sXnlc-E3lrL=D*DV+r^bZOS2_Q8GM+Z^>a#aM<3aBj_;yYX#9YjkYb_P)>#P30b zhfYchrnL~af(h@9^e&jPAr^)3S|nWv;Zo5lr{E|c=Y~=m%9q;0sC2k+7_+J?r?9Iz zYsC6pVQUR9KWe^>BKF@ZTaR9>P76driuU zB!7syNJ_L4$DJO|>L>`BnpvelxsxP0o<}9C+4v-cGG}@H zOQ%ZSZi@_@Iff@Lpcshq1+*Jt0@$5p96)Let6W41tp?P>Fsw&B%00Ve*Nv6?^gf- From 112569db87d01a04b98eb6c37d9c9ced03b52f3f Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 26 Feb 2007 19:19:08 +0000 Subject: [PATCH 0516/2544] --- system/libraries/Input.php | 74 +++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index f346caba..0d41b0a9 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -91,6 +91,16 @@ function _sanitize_globals() { $_GET = array(); } + else + { + if (is_array($_GET) AND count($_GET) > 0) + { + foreach($_GET as $key => $val) + { + $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + } + } // Clean $_POST Data if (is_array($_POST) AND count($_POST) > 0) @@ -173,6 +183,41 @@ function _clean_input_keys($str) return $str; } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the GET array + * + * @access public + * @param string + * @param bool + * @return string + */ + function post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_GET[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + if (is_array($_GET[$index])) + { + foreach($_GET[$index] as $key => $val) + { + $_GET[$index][$key] = $this->xss_clean($val); + } + } + else + { + return $this->xss_clean($_GET[$index]); + } + } + + return $_GET[$index]; + } // -------------------------------------------------------------------- @@ -337,7 +382,34 @@ function ip_address() */ function valid_ip($ip) { - return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; + if ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) + { + return FALSE; + } + + $octets = explode('.', $ip); + + for ($i = 1; $i <= 4; $i++) + { + $octet = intval($octets[($i-1)]); + if ($i === 1) + { + if ($octet > 223 OR $octet < 1) + return FALSE; + } + elseif ($i === 4) + { + if ($octet < 1) + return FALSE; + } + else + { + if ($octet > 254) + return FALSE; + } + } + + return TRUE; } // -------------------------------------------------------------------- From 090b2f7f2e9109b8cf03a3f64d520b50da4fc57a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Mar 2007 12:57:52 +0000 Subject: [PATCH 0517/2544] fixed a note in the xmlrpc server section --- user_guide/libraries/xmlrpc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5f556388..5afbae98 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -183,7 +183,7 @@

                  Creating an XML-RPC Server

                  Here is an example to illustrate:

                  -$this->load->library('xmlrpcs');
                  +$this->load->library('xmlrpc');
                  $this->load->library('xmlrpcs');

                  $config['functions']['new_post'];  = array('function' => 'My_blog.new_entry');
                  From 87d1eeb9e1f5678c78e06c3a685fb3aa1a88ece3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 Mar 2007 13:20:43 +0000 Subject: [PATCH 0518/2544] function post() duplicated, changed the second to function get() --- system/libraries/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 0d41b0a9..3a35f498 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -194,7 +194,7 @@ function _clean_input_keys($str) * @param bool * @return string */ - function post($index = '', $xss_clean = FALSE) + function get($index = '', $xss_clean = FALSE) { if ( ! isset($_GET[$index])) { From ba0dd638336d2617066b67cf4f59667aaff8c531 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 7 Mar 2007 12:10:58 +0000 Subject: [PATCH 0519/2544] pg_version() doesn't exist. Changed reference to version() which does. --- .../drivers/postgre/postgre_driver.php | 968 +++++++++--------- 1 file changed, 484 insertions(+), 484 deletions(-) diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index a66fddbd..58cc69a9 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -1,485 +1,485 @@ -port == '') ? '' : " port=".$this->port; - - return @pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - $port = ($this->port == '') ? '' : " port=".$this->port; - - return @pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - // Not needed for Postgre so we'll return TRUE - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @pg_query($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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; - - return @pg_exec($this->conn_id, "begin"); - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - return @pg_exec($this->conn_id, "commit"); - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - return @pg_exec($this->conn_id, "rollback"); - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return pg_escape_string($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @pg_affected_rows($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - $v = pg_version($this->conn_id); - $v = $v['server']; - - $table = func_num_args() > 0 ? func_get_arg(0) : null; - $column = func_num_args() > 1 ? func_get_arg(1) : null; - - if ($table == null && $v >= '8.1') - { - $sql='SELECT LASTVAL() as ins_id'; - } - elseif ($table != null && $column != null && $v >= '8.0') - { - $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); - $query = $this->query($sql); - $row = $query->row(); - $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); - } - elseif ($table != null) - { - // seq_name passed in table parameter - $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); - } - else - { - return pg_last_oid($this->result_id); - } - $query = $this->query($sql); - $row = $query->row(); - return $row->ins_id; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$this->_escape_table($table)."'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return pg_last_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return ''; - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped. - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = '"'.preg_replace("/\./", '"."', $table).'"'; - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $sql .= "LIMIT ".$limit; - - if ($offset > 0) - { - $sql .= " OFFSET ".$offset; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @pg_close($conn_id); - } - - -} - +port == '') ? '' : " port=".$this->port; + + return @pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + $port = ($this->port == '') ? '' : " port=".$this->port; + + return @pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for Postgre so we'll return TRUE + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @pg_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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; + + return @pg_exec($this->conn_id, "begin"); + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + return @pg_exec($this->conn_id, "commit"); + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + return @pg_exec($this->conn_id, "rollback"); + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return pg_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @pg_affected_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + $v = version($this->conn_id); + $v = $v['server']; + + $table = func_num_args() > 0 ? func_get_arg(0) : null; + $column = func_num_args() > 1 ? func_get_arg(1) : null; + + if ($table == null && $v >= '8.1') + { + $sql='SELECT LASTVAL() as ins_id'; + } + elseif ($table != null && $column != null && $v >= '8.0') + { + $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); + $query = $this->query($sql); + $row = $query->row(); + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); + } + elseif ($table != null) + { + // seq_name passed in table parameter + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); + } + else + { + return pg_last_oid($this->result_id); + } + $query = $this->query($sql); + $row = $query->row(); + return $row->ins_id; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$this->_escape_table($table)."'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return pg_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped. + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = '"'.preg_replace("/\./", '"."', $table).'"'; + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @pg_close($conn_id); + } + + +} + ?> \ No newline at end of file From 0ae7f300e65c0035bcf7c96c8728549eb23564b9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 7 Mar 2007 12:12:46 +0000 Subject: [PATCH 0520/2544] --- user_guide/changelog.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bbc205a6..b848b086 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,6 +62,11 @@

                  Change Log

                  +

                  Version 1.5.3

                  +

                  Release Date:

                  +
                    +
                  • Fixed a version but in the Postgre driver
                  • +

                  Version 1.5.2

                  Release Date: February 13, 2007

                    From 8389487656f0f8c027b0cfe38014b7035be10888 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 13 Mar 2007 20:51:52 +0000 Subject: [PATCH 0521/2544] removed duplicate 'DATE_RFC822' --- system/helpers/date_helper.php | 1129 ++++++++++++++++---------------- 1 file changed, 564 insertions(+), 565 deletions(-) diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index b8df03ed..504a962c 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -1,566 +1,565 @@ -config->item('time_reference')) == 'gmt') - { - $now = time(); - $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); - - if (strlen($system_time) < 10) - { - $system_time = time(); - log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); - } - - return $system_time; - } - else - { - return time(); - } -} - -// ------------------------------------------------------------------------ - -/** - * Convert MySQL Style Datecodes - * - * This function is identical to PHPs date() function, - * except that it allows date codes to be formatted using - * the MySQL style, where each code letter is preceded - * with a percent sign: %Y %m %d etc... - * - * The benefit of doing dates this way is that you don't - * have to worry about escaping your text letters that - * match the date codes. - * - * @access public - * @param string - * @param integer - * @return integer - */ -function mdate($datestr = '', $time = '') -{ - if ($datestr == '') - return ''; - - if ($time == '') - $time = now(); - - $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); - return date($datestr, $time); -} - -// ------------------------------------------------------------------------ - -/** - * Standard Date - * - * Returns a date formatted according to the submitted standard. - * - * @access public - * @param string the chosen format - * @param integer Unix timestamp - * @return string - */ -function standard_date($fmt = 'DATE_RFC822', $time = '') -{ - $formats = array( - 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%Q', - 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', - 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%O', - 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', - 'DATE_RFC850' => '%l, %d-%M-%y %H:%m:%i UTC', - 'DATE_RFC1036' => '%D, %d %M %y %H:%i:%s %O', - 'DATE_RFC1123' => '%D, %d %M %Y %H:%i:%s %O', - 'DATE_RFC2822' => '%D, %d %M %Y %H:%i:%s %O', - 'DATE_RSS' => '%D, %d %M %Y %H:%i:%s %O', - 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%Q' - ); - - if ( ! isset($formats[$fmt])) - { - return FALSE; - } - - return mdate($formats[$fmt], $time); -} - - -// ------------------------------------------------------------------------ - -/** - * Timespan - * - * Returns a span of seconds in this format: - * 10 days 14 hours 36 minutes 47 seconds - * - * @access public - * @param integer a number of seconds - * @param integer Unix timestamp - * @return integer - */ -function timespan($seconds = 1, $time = '') -{ - $CI =& get_instance(); - $CI->lang->load('date'); - - if ( ! is_numeric($seconds)) - { - $seconds = 1; - } - - if ( ! is_numeric($time)) - { - $time = time(); - } - - if ($time <= $seconds) - { - $seconds = 1; - } - else - { - $seconds = $time - $seconds; - } - - $str = ''; - $years = floor($seconds / 31536000); - - if ($years > 0) - { - $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; - } - - $seconds -= $years * 31536000; - $months = floor($seconds / 2628000); - - if ($years > 0 OR $months > 0) - { - if ($months > 0) - { - $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; - } - - $seconds -= $months * 2628000; - } - - $weeks = floor($seconds / 604800); - - if ($years > 0 OR $months > 0 OR $weeks > 0) - { - if ($weeks > 0) - { - $str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; - } - - $seconds -= $weeks * 604800; - } - - $days = floor($seconds / 86400); - - if ($months > 0 OR $weeks > 0 OR $days > 0) - { - if ($days > 0) - { - $str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; - } - - $seconds -= $days * 86400; - } - - $hours = floor($seconds / 3600); - - if ($days > 0 OR $hours > 0) - { - if ($hours > 0) - { - $str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; - } - - $seconds -= $hours * 3600; - } - - $minutes = floor($seconds / 60); - - if ($days > 0 OR $hours > 0 OR $minutes > 0) - { - if ($minutes > 0) - { - $str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; - } - - $seconds -= $minutes * 60; - } - - if ($str == '') - { - $str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; - } - - return substr(trim($str), 0, -1); -} - -// ------------------------------------------------------------------------ - -/** - * Number of days in a month - * - * Takes a month/year as input and returns the number of days - * for the given month/year. Takes leap years into consideration. - * - * @access public - * @param integer a numeric month - * @param integer a numeric year - * @return integer - */ -function days_in_month($month = 0, $year = '') -{ - if ($month < 1 OR $month > 12) - { - return 0; - } - - if ( ! is_numeric($year) OR strlen($year) != 4) - { - $year = date('Y'); - } - - if ($month == 2) - { - if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) - { - return 29; - } - } - - $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); - return $days_in_month[$month - 1]; -} - -// ------------------------------------------------------------------------ - -/** - * Converts a local Unix timestamp to GMT - * - * @access public - * @param integer Unix timestamp - * @return integer - */ -function local_to_gmt($time = '') -{ - if ($time == '') - $time = time(); - - return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); -} - -// ------------------------------------------------------------------------ - -/** - * Converts GMT time to a localized value - * - * Takes a Unix timestamp (in GMT) as input, and returns - * at the local value based on the timezone and DST setting - * submitted - * - * @access public - * @param integer Unix timestamp - * @param string timezone - * @param bool whether DST is active - * @return integer - */ -function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) -{ - if ($time == '') - { - return now(); - } - - $time += timezones($timezone) * 3600; - - if ($dst == TRUE) - { - $time += 3600; - } - - return $time; -} - -// ------------------------------------------------------------------------ - -/** - * Converts a MySQL Timestamp to Unix - * - * @access public - * @param integer Unix timestamp - * @return integer - */ -function mysql_to_unix($time = '') -{ - // We'll remove certain characters for backward compatibility - // since the formatting changed with MySQL 4.1 - // YYYY-MM-DD HH:MM:SS - - $time = str_replace('-', '', $time); - $time = str_replace(':', '', $time); - $time = str_replace(' ', '', $time); - - // YYYYMMDDHHMMSS - return mktime( - substr($time, 8, 2), - substr($time, 10, 2), - substr($time, 12, 2), - substr($time, 4, 2), - substr($time, 6, 2), - substr($time, 0, 4) - ); -} - -// ------------------------------------------------------------------------ - -/** - * Unix to "Human" - * - * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM - * - * @access public - * @param integer Unix timestamp - * @param bool whether to show seconds - * @param string format: us or euro - * @return string - */ -function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') -{ - $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; - - if ($fmt == 'us') - { - $r .= date('h', $time).':'.date('i', $time); - } - else - { - $r .= date('H', $time).':'.date('i', $time); - } - - if ($seconds) - { - $r .= ':'.date('s', $time); - } - - if ($fmt == 'us') - { - $r .= ' '.date('A', $time); - } - - return $r; -} - -// ------------------------------------------------------------------------ - -/** - * Convert "human" date to GMT - * - * Reverses the above process - * - * @access public - * @param string format: us or euro - * @return integer - */ -function human_to_unix($datestr = '') -{ - if ($datestr == '') - { - return FALSE; - } - - $datestr = trim($datestr); - $datestr = preg_replace("/\040+/", "\040", $datestr); - - if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr)) - { - return FALSE; - } - - $split = preg_split("/\040/", $datestr); - - $ex = explode("-", $split['0']); - - $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; - $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; - - $ex = explode(":", $split['1']); - - $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; - $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - - if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) - { - $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; - } - else - { - // Unless specified, seconds get set to zero. - $sec = '00'; - } - - if (isset($split['2'])) - { - $ampm = strtolower($split['2']); - - if (substr($ampm, 0, 1) == 'p' AND $hour < 12) - $hour = $hour + 12; - - if (substr($ampm, 0, 1) == 'a' AND $hour == 12) - $hour = '00'; - - if (strlen($hour) == 1) - $hour = '0'.$hour; - } - - return mktime($hour, $min, $sec, $month, $day, $year); -} - -// ------------------------------------------------------------------------ - -/** - * Timezone Menu - * - * Generates a drop-down menu of timezones. - * - * @access public - * @param string timezone - * @param string classname - * @param string menu name - * @return string - */ -function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') -{ - $CI =& get_instance(); - $CI->lang->load('date'); - - if ($default == 'GMT') - $default = 'UTC'; - - $menu = '"; - - return $menu; -} - -// ------------------------------------------------------------------------ - -/** - * Timezones - * - * Returns an array of timezones. This is a helper function - * for various other ones in this library - * - * @access public - * @param string timezone - * @return string - */ -function timezones($tz = '') -{ - // Note: Don't change the order of these even though - // some items appear to be in the wrong order - - $zones = array( - 'UM12' => -12, - 'UM11' => -11, - 'UM10' => -10, - 'UM9' => -9, - 'UM8' => -8, - 'UM7' => -7, - 'UM6' => -6, - 'UM5' => -5, - 'UM4' => -4, - 'UM25' => -2.5, - 'UM3' => -3, - 'UM2' => -2, - 'UM1' => -1, - 'UTC' => 0, - 'UP1' => +1, - 'UP2' => +2, - 'UP3' => +3, - 'UP25' => +2.5, - 'UP4' => +4, - 'UP35' => +3.5, - 'UP5' => +5, - 'UP45' => +4.5, - 'UP6' => +6, - 'UP7' => +7, - 'UP8' => +8, - 'UP9' => +9, - 'UP85' => +8.5, - 'UP10' => +10, - 'UP11' => +11, - 'UP12' => +12 - ); - - if ($tz == '') - { - return $zones; - } - - if ($tz == 'GMT') - $tz = 'UTC'; - - return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; -} - - +config->item('time_reference')) == 'gmt') + { + $now = time(); + $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + + if (strlen($system_time) < 10) + { + $system_time = time(); + log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); + } + + return $system_time; + } + else + { + return time(); + } +} + +// ------------------------------------------------------------------------ + +/** + * Convert MySQL Style Datecodes + * + * This function is identical to PHPs date() function, + * except that it allows date codes to be formatted using + * the MySQL style, where each code letter is preceded + * with a percent sign: %Y %m %d etc... + * + * The benefit of doing dates this way is that you don't + * have to worry about escaping your text letters that + * match the date codes. + * + * @access public + * @param string + * @param integer + * @return integer + */ +function mdate($datestr = '', $time = '') +{ + if ($datestr == '') + return ''; + + if ($time == '') + $time = now(); + + $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); + return date($datestr, $time); +} + +// ------------------------------------------------------------------------ + +/** + * Standard Date + * + * Returns a date formatted according to the submitted standard. + * + * @access public + * @param string the chosen format + * @param integer Unix timestamp + * @return string + */ +function standard_date($fmt = 'DATE_RFC822', $time = '') +{ + $formats = array( + 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%Q', + 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', + 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%O', + 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', + 'DATE_RFC850' => '%l, %d-%M-%y %H:%m:%i 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', + 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%Q' + ); + + if ( ! isset($formats[$fmt])) + { + return FALSE; + } + + return mdate($formats[$fmt], $time); +} + + +// ------------------------------------------------------------------------ + +/** + * Timespan + * + * Returns a span of seconds in this format: + * 10 days 14 hours 36 minutes 47 seconds + * + * @access public + * @param integer a number of seconds + * @param integer Unix timestamp + * @return integer + */ +function timespan($seconds = 1, $time = '') +{ + $CI =& get_instance(); + $CI->lang->load('date'); + + if ( ! is_numeric($seconds)) + { + $seconds = 1; + } + + if ( ! is_numeric($time)) + { + $time = time(); + } + + if ($time <= $seconds) + { + $seconds = 1; + } + else + { + $seconds = $time - $seconds; + } + + $str = ''; + $years = floor($seconds / 31536000); + + if ($years > 0) + { + $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; + } + + $seconds -= $years * 31536000; + $months = floor($seconds / 2628000); + + if ($years > 0 OR $months > 0) + { + if ($months > 0) + { + $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; + } + + $seconds -= $months * 2628000; + } + + $weeks = floor($seconds / 604800); + + if ($years > 0 OR $months > 0 OR $weeks > 0) + { + if ($weeks > 0) + { + $str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; + } + + $seconds -= $weeks * 604800; + } + + $days = floor($seconds / 86400); + + if ($months > 0 OR $weeks > 0 OR $days > 0) + { + if ($days > 0) + { + $str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; + } + + $seconds -= $days * 86400; + } + + $hours = floor($seconds / 3600); + + if ($days > 0 OR $hours > 0) + { + if ($hours > 0) + { + $str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; + } + + $seconds -= $hours * 3600; + } + + $minutes = floor($seconds / 60); + + if ($days > 0 OR $hours > 0 OR $minutes > 0) + { + if ($minutes > 0) + { + $str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; + } + + $seconds -= $minutes * 60; + } + + if ($str == '') + { + $str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; + } + + return substr(trim($str), 0, -1); +} + +// ------------------------------------------------------------------------ + +/** + * Number of days in a month + * + * Takes a month/year as input and returns the number of days + * for the given month/year. Takes leap years into consideration. + * + * @access public + * @param integer a numeric month + * @param integer a numeric year + * @return integer + */ +function days_in_month($month = 0, $year = '') +{ + if ($month < 1 OR $month > 12) + { + return 0; + } + + if ( ! is_numeric($year) OR strlen($year) != 4) + { + $year = date('Y'); + } + + if ($month == 2) + { + if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) + { + return 29; + } + } + + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + return $days_in_month[$month - 1]; +} + +// ------------------------------------------------------------------------ + +/** + * Converts a local Unix timestamp to GMT + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +function local_to_gmt($time = '') +{ + if ($time == '') + $time = time(); + + return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); +} + +// ------------------------------------------------------------------------ + +/** + * Converts GMT time to a localized value + * + * Takes a Unix timestamp (in GMT) as input, and returns + * at the local value based on the timezone and DST setting + * submitted + * + * @access public + * @param integer Unix timestamp + * @param string timezone + * @param bool whether DST is active + * @return integer + */ +function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) +{ + if ($time == '') + { + return now(); + } + + $time += timezones($timezone) * 3600; + + if ($dst == TRUE) + { + $time += 3600; + } + + return $time; +} + +// ------------------------------------------------------------------------ + +/** + * Converts a MySQL Timestamp to Unix + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +function mysql_to_unix($time = '') +{ + // We'll remove certain characters for backward compatibility + // since the formatting changed with MySQL 4.1 + // YYYY-MM-DD HH:MM:SS + + $time = str_replace('-', '', $time); + $time = str_replace(':', '', $time); + $time = str_replace(' ', '', $time); + + // YYYYMMDDHHMMSS + return mktime( + substr($time, 8, 2), + substr($time, 10, 2), + substr($time, 12, 2), + substr($time, 4, 2), + substr($time, 6, 2), + substr($time, 0, 4) + ); +} + +// ------------------------------------------------------------------------ + +/** + * Unix to "Human" + * + * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM + * + * @access public + * @param integer Unix timestamp + * @param bool whether to show seconds + * @param string format: us or euro + * @return string + */ +function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') +{ + $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; + + if ($fmt == 'us') + { + $r .= date('h', $time).':'.date('i', $time); + } + else + { + $r .= date('H', $time).':'.date('i', $time); + } + + if ($seconds) + { + $r .= ':'.date('s', $time); + } + + if ($fmt == 'us') + { + $r .= ' '.date('A', $time); + } + + return $r; +} + +// ------------------------------------------------------------------------ + +/** + * Convert "human" date to GMT + * + * Reverses the above process + * + * @access public + * @param string format: us or euro + * @return integer + */ +function human_to_unix($datestr = '') +{ + if ($datestr == '') + { + return FALSE; + } + + $datestr = trim($datestr); + $datestr = preg_replace("/\040+/", "\040", $datestr); + + if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr)) + { + return FALSE; + } + + $split = preg_split("/\040/", $datestr); + + $ex = explode("-", $split['0']); + + $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; + $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + + $ex = explode(":", $split['1']); + + $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; + $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + + if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) + { + $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + } + else + { + // Unless specified, seconds get set to zero. + $sec = '00'; + } + + if (isset($split['2'])) + { + $ampm = strtolower($split['2']); + + if (substr($ampm, 0, 1) == 'p' AND $hour < 12) + $hour = $hour + 12; + + if (substr($ampm, 0, 1) == 'a' AND $hour == 12) + $hour = '00'; + + if (strlen($hour) == 1) + $hour = '0'.$hour; + } + + return mktime($hour, $min, $sec, $month, $day, $year); +} + +// ------------------------------------------------------------------------ + +/** + * Timezone Menu + * + * Generates a drop-down menu of timezones. + * + * @access public + * @param string timezone + * @param string classname + * @param string menu name + * @return string + */ +function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') +{ + $CI =& get_instance(); + $CI->lang->load('date'); + + if ($default == 'GMT') + $default = 'UTC'; + + $menu = '"; + + return $menu; +} + +// ------------------------------------------------------------------------ + +/** + * Timezones + * + * Returns an array of timezones. This is a helper function + * for various other ones in this library + * + * @access public + * @param string timezone + * @return string + */ +function timezones($tz = '') +{ + // Note: Don't change the order of these even though + // some items appear to be in the wrong order + + $zones = array( + 'UM12' => -12, + 'UM11' => -11, + 'UM10' => -10, + 'UM9' => -9, + 'UM8' => -8, + 'UM7' => -7, + 'UM6' => -6, + 'UM5' => -5, + 'UM4' => -4, + 'UM25' => -2.5, + 'UM3' => -3, + 'UM2' => -2, + 'UM1' => -1, + 'UTC' => 0, + 'UP1' => +1, + 'UP2' => +2, + 'UP3' => +3, + 'UP25' => +2.5, + 'UP4' => +4, + 'UP35' => +3.5, + 'UP5' => +5, + 'UP45' => +4.5, + 'UP6' => +6, + 'UP7' => +7, + 'UP8' => +8, + 'UP9' => +9, + 'UP85' => +8.5, + 'UP10' => +10, + 'UP11' => +11, + 'UP12' => +12 + ); + + if ($tz == '') + { + return $zones; + } + + if ($tz == 'GMT') + $tz = 'UTC'; + + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; +} + + ?> \ No newline at end of file From 0cb3404d5e03b370805b2059addcaf325a0604cf Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 23 Mar 2007 21:02:11 +0000 Subject: [PATCH 0522/2544] --- user_guide/general/views.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 21f8b5c0..dd97c361 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -133,7 +133,7 @@

                    Adding Dynamic Data to the View

                    $data = array(
                                   'title' => 'My Title',
                    -               'heading' => 'My Heading'
                    +               'heading' => 'My Heading',
                                   'message' => 'My Message'
                              );

                    From 5c3905b4241b4ff68f768a81151f8c6e7a75fa5d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 24 Mar 2007 11:08:55 +0000 Subject: [PATCH 0523/2544] passes hostname and not database now --- system/database/drivers/odbc/odbc_driver.php | 904 +++++++++---------- 1 file changed, 452 insertions(+), 452 deletions(-) diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 7dd9295f..9d540c77 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -1,453 +1,453 @@ -database, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @odbc_pconnect($this->database, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - // Not needed for ODBC - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @odbc_exec($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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; - - return odbc_autocommit($this->conn_id, FALSE); - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = odbc_commit($this->conn_id); - odbc_autocommit($this->conn_id, TRUE); - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = odbc_rollback($this->conn_id); - odbc_autocommit($this->conn_id, TRUE); - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - // ODBC doesn't require escaping - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @odbc_num_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @odbc_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SHOW TABLES FROM `".$this->database."`"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$this->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT TOP 1 FROM ".$this->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return odbc_errormsg($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return odbc_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - // Does ODBC doesn't use the LIMIT clause? - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @odbc_close($conn_id); - } - - -} - - +hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @odbc_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for ODBC + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @odbc_exec($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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; + + return odbc_autocommit($this->conn_id, FALSE); + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = odbc_commit($this->conn_id); + odbc_autocommit($this->conn_id, TRUE); + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = odbc_rollback($this->conn_id); + odbc_autocommit($this->conn_id, TRUE); + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // ODBC doesn't require escaping + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @odbc_num_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @odbc_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT TOP 1 FROM ".$this->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return odbc_errormsg($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return odbc_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + // Does ODBC doesn't use the LIMIT clause? + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @odbc_close($conn_id); + } + + +} + + ?> \ No newline at end of file From d8b92a38e755564c62b57a3ed1d3441c212ef4b9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 28 Mar 2007 01:26:32 +0000 Subject: [PATCH 0524/2544] typo fix --- user_guide/libraries/loader.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 4bc5d634..d9fb64d3 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -103,7 +103,7 @@

                    $this->load->view('file_name', $data, true/fals

                    The third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way. If you set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you wan the data returned:

                    +to your browser. Remember to assign it to a variable if you want the data returned:

                    $string = $this->load->view('myfile', '', true); From 6d1ef22e5dca5790044e027583ee360624d272af Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 28 Mar 2007 01:26:37 +0000 Subject: [PATCH 0525/2544] typo fix --- user_guide/helpers/inflector_helper.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index c52cf030..2a9f4193 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -76,7 +76,7 @@

                    Loading this Helper

                    singular()

                    -

                    Changes a singular word to plural. Example:

                    +

                    Changes a plural word to singular. Example:

                    $word = "dogs";
                    @@ -86,7 +86,7 @@

                    singular()

                    plural()

                    -

                    Changes a plural word to singular. Example:

                    +

                    Changes a singular word to plural. Example:

                    $word = "dog";
                    From 2749c80ae5ebb46bceb82db8a8683b9e09a469f2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 29 Mar 2007 21:09:04 +0000 Subject: [PATCH 0526/2544] fixed broken link --- user_guide/libraries/ftp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 898f769b..48c3451e 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -295,7 +295,7 @@

                    $this->ftp->close();

                    From a06681fad3008fcaeb3f30468e516bc0b4b9009d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 1 Apr 2007 16:40:51 +0000 Subject: [PATCH 0528/2544] missing
                    fixed --- user_guide/libraries/benchmark.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 9d286aa5..0f447cdd 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -145,11 +145,11 @@

                    Profiling Your Benchmark Points

                    // Some more code happens here...

                    $this->benchmark->mark('another_mark_end'); +

                    Please read the Profiler page for more information.

                    -

                    Displaying Total Execution Time

                    From c2f90e23b62c7155a49e38a2958796e6a886e868 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 3 Apr 2007 11:17:44 +0000 Subject: [PATCH 0529/2544] array to string addition http://codeigniter.com/forums/viewthread/46994/ --- system/libraries/Profiler.php | 414 +++++++++++++++++----------------- 1 file changed, 212 insertions(+), 202 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 5b0f6e2b..37b34518 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -1,203 +1,213 @@ -CI =& get_instance(); - $this->CI->load->language('profiler'); - } - - // -------------------------------------------------------------------- - - /** - * Auto Profiler - * - * This function cycles through the entire array of mark points and - * matches any two points that are named identically (ending in "_start" - * and "_end" respectively). It then compiles the execution times for - * all points and returns it as an array - * - * @access private - * @return array - */ - function _compile_benchmarks() - { - $profile = array(); - foreach ($this->CI->benchmark->marker as $key => $val) - { - // We match the "end" marker so that the list ends - // up in the order that it was defined - if (preg_match("/(.+?)_end/i", $key, $match)) - { - if (isset($this->CI->benchmark->marker[$match[1].'_end']) AND isset($this->CI->benchmark->marker[$match[1].'_start'])) - { - $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); - } - } - } - - // Build a table containing the profile data. - // Note: At some point we should turn this into a template that can - // be modified. We also might want to make this data available to be logged - - $output = "\n\n"; - $output .= '
                    '; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; - $output .= "\n"; - $output .= "\n\n\n"; - - foreach ($profile as $key => $val) - { - $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "\n"; - } - - $output .= "
                    ".$key."  ".$val."
                    \n"; - $output .= "
                    "; - - return $output; - } - - // -------------------------------------------------------------------- - - /** - * Compile Queries - * - * @access private - * @return string - */ - function _compile_queries() - { - $output = "\n\n"; - $output .= '
                    '; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; - $output .= "\n"; - - if ( ! class_exists('CI_DB_driver')) - { - $output .= "
                    ".$this->CI->lang->line('profiler_no_db')."
                    "; - } - else - { - if (count($this->CI->db->queries) == 0) - { - $output .= "
                    ".$this->CI->lang->line('profiler_no_queries')."
                    "; - } - else - { - foreach ($this->CI->db->queries as $val) - { - $output .= '
                    '; - $output .= $val; - $output .= "
                    \n"; - } - } - } - - $output .= "
                    "; - - return $output; - } - - // -------------------------------------------------------------------- - - /** - * Compile $_POST Data - * - * @access private - * @return string - */ - function _compile_post() - { - $output = "\n\n"; - $output .= '
                    '; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; - $output .= "\n"; - - if (count($_POST) == 0) - { - $output .= "
                    ".$this->CI->lang->line('profiler_no_post')."
                    "; - } - else - { - $output .= "\n\n\n"; - - foreach ($_POST as $key => $val) - { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } - - $output .= "\n"; - } - - $output .= "
                    $_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."
                    \n"; - } - $output .= "
                    "; - - return $output; - } - - // -------------------------------------------------------------------- - - /** - * Run the Profiler - * - * @access private - * @return string - */ - function run($output = '') - { - $output = '
                    '; - $output .= "
                    "; - - $output .= $this->_compile_benchmarks(); - $output .= $this->_compile_post(); - $output .= $this->_compile_queries(); - - $output .= '
                    '; - - return $output; - } - -} - -// END CI_Profiler class +CI =& get_instance(); + $this->CI->load->language('profiler'); + } + + // -------------------------------------------------------------------- + + /** + * Auto Profiler + * + * This function cycles through the entire array of mark points and + * matches any two points that are named identically (ending in "_start" + * and "_end" respectively). It then compiles the execution times for + * all points and returns it as an array + * + * @access private + * @return array + */ + function _compile_benchmarks() + { + $profile = array(); + foreach ($this->CI->benchmark->marker as $key => $val) + { + // We match the "end" marker so that the list ends + // up in the order that it was defined + if (preg_match("/(.+?)_end/i", $key, $match)) + { + if (isset($this->CI->benchmark->marker[$match[1].'_end']) AND isset($this->CI->benchmark->marker[$match[1].'_start'])) + { + $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); + } + } + } + + // Build a table containing the profile data. + // Note: At some point we should turn this into a template that can + // be modified. We also might want to make this data available to be logged + + $output = "\n\n"; + $output .= '
                    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; + $output .= "\n"; + $output .= "\n\n\n"; + + foreach ($profile as $key => $val) + { + $key = ucwords(str_replace(array('_', '-'), ' ', $key)); + $output .= "\n"; + } + + $output .= "
                    ".$key."  ".$val."
                    \n"; + $output .= "
                    "; + + return $output; + } + + // -------------------------------------------------------------------- + + /** + * Compile Queries + * + * @access private + * @return string + */ + function _compile_queries() + { + $output = "\n\n"; + $output .= '
                    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; + $output .= "\n"; + + if ( ! class_exists('CI_DB_driver')) + { + $output .= "
                    ".$this->CI->lang->line('profiler_no_db')."
                    "; + } + else + { + if (count($this->CI->db->queries) == 0) + { + $output .= "
                    ".$this->CI->lang->line('profiler_no_queries')."
                    "; + } + else + { + foreach ($this->CI->db->queries as $val) + { + $output .= '
                    '; + $output .= $val; + $output .= "
                    \n"; + } + } + } + + $output .= "
                    "; + + return $output; + } + + // -------------------------------------------------------------------- + + /** + * Compile $_POST Data + * + * @access private + * @return string + */ + function _compile_post() + { + $output = "\n\n"; + $output .= '
                    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; + $output .= "\n"; + + if (count($_POST) == 0) + { + $output .= "
                    ".$this->CI->lang->line('profiler_no_post')."
                    "; + } + else + { + $output .= "\n\n\n"; + + foreach ($_POST as $key => $val) + { + if ( ! is_numeric($key)) + { + $key = "'".$key."'"; + } + +// $output .= "\n"; + $output .= "\n"; + } + + $output .= "
                    $_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."
                    $_POST[".$key."] "; + if (is_array($val)) + { + $output .= "
                    " . htmlspecialchars(stripslashes(print_r($val, true))) . "
                    "; + } + else + { + $output .= htmlspecialchars(stripslashes($val)); + } + $output .= "
                    \n"; + } + $output .= "
                    "; + + return $output; + } + + // -------------------------------------------------------------------- + + /** + * Run the Profiler + * + * @access private + * @return string + */ + function run($output = '') + { + $output = '
                    '; + $output .= "
                    "; + + $output .= $this->_compile_benchmarks(); + $output .= $this->_compile_post(); + $output .= $this->_compile_queries(); + + $output .= '
                    '; + + return $output; + } + +} + +// END CI_Profiler class ?> \ No newline at end of file From d9f3e177bac9b11aa29acf7e609c8cf57475a7f6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 3 Apr 2007 11:19:52 +0000 Subject: [PATCH 0530/2544] added array to string in profiler --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b848b086..7771abac 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

                    Version 1.5.3

                    Release Date:

                    • Fixed a version but in the Postgre driver
                    • +
                    • Array to string now supported in profiler

                    Version 1.5.2

                    Release Date: February 13, 2007

                    From 9da4dbc58ccae4f903e8a5c8d464fa00cd850381 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 3 Apr 2007 11:39:35 +0000 Subject: [PATCH 0531/2544] next and previous links fixed up --- user_guide/database/active_record.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/table_data.html | 4 ++-- user_guide/database/transactions.html | 5 ++--- user_guide/database/utilities.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/helpers/array_helper.html | 3 +-- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 4 ++-- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/table.html | 3 +-- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/overview/mvc.html | 2 +- 23 files changed, 26 insertions(+), 29 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 7e0c14c8..d1598c55 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -598,7 +598,7 @@

                    Method Chaining

                    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 091faaf6..af76e336 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -160,7 +160,7 @@

                    $this->db->field_data()

                    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 2bae2639..37a71180 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -133,7 +133,7 @@

                    Now What?

                    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index af76e336..710fc917 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -166,7 +166,7 @@

                    $this->db->field_data()

                    User Guide Home   ·   Next Topic:  Custom Function Calls

                    -

                    Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                    +

                    Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                  diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index b3bd3f68..6c25a557 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -149,7 +149,7 @@

                  $this->db->update_string();

                  User Guide Home   ·   Next Topic:  Active Record Pattern

                  -

                  Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                  +

                  Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                  diff --git a/user_guide/database/index.html b/user_guide/database/index.html index d9c62169..2321675e 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -96,7 +96,7 @@

                  The Database Class

                  User Guide Home   ·   Next Topic:  Quick Start: Usage Examples

                  -

                  Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                  +

                  Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                  diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index cefcf234..4217e4e4 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -135,7 +135,7 @@

                  Query Bindings

                  User Guide Home   ·   Next Topic:  Query Results

                  -

                  Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                  +

                  Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                  diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 7b46d21b..2f3be85c 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -236,7 +236,7 @@

                  $query->free_result()

                  User Guide Home   ·   Next Topic:  Query Helper Functions

                  -

                  Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                  +

                  Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                  diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 3d931ad0..23fa7c76 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -111,7 +111,7 @@

                  $this->db->table_exists();

                  User Guide Home   ·   Next Topic:   Field Metadata

                  -

                  Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                  +

                  Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 06ed295b..d2222e00 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -191,7 +191,7 @@

                Running Transactions Manually

                User Guide Home   ·   Next Topic:  Table Metadata

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 7ed52cb2..f4977b16 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -331,7 +331,7 @@

                Description of Backup Preferences

                User Guide Home   ·   Next Topic:   Email Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 23a41732..f603f1f0 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -145,7 +145,7 @@

                Alternative Control Structures

                User Guide Home   ·   Next Topic:  Security

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 78c3620d..7bf285f4 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -115,7 +115,7 @@

                get_instance()

                User Guide Home   ·   Next Topic:  Auto-loading Resources

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index c63ed72c..f3127ccb 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -98,7 +98,7 @@

                Auto-loading Resources

                User Guide Home   ·   Next Topic:  Scaffolding

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index bb743c50..9371ed3c 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -112,7 +112,7 @@

                Deleting Caches

                User Guide Home   ·   Next Topic:  Profiling Your Application

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 945791a4..0bb4ac44 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -428,7 +428,7 @@

                That's it!

                Next Topic:  Views

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 5121b7d8..0e13ce7d 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -167,7 +167,7 @@

                Setting Your Own Prefix

                User Guide Home   ·   Next Topic:  Hooks - Extending the Core

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 7ab97d60..d8fdb389 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -290,7 +290,7 @@

                Setting Your Own Prefix

                User Guide Home   ·   Next Topic:  Creating Core System Classes

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 77c080cb..c87c24b2 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -63,7 +63,7 @@

                Credits

                Code Igniter was developed by Rick Ellis, who in his other life is CEO of -pMachine, Inc. The core framework was written +Ellislab, Inc. The core framework was written specifically for this application, while many of the class libraries, helpers, and sub-systems borrow from the code-base of ExpressionEngine, a Content Management System written by Rick Ellis and Paul Burdick.

                @@ -89,7 +89,7 @@

                Credits

                Next Topic:  Downloading Code Igniter

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 60456d33..86e18881 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -135,7 +135,7 @@

                log_message('level', 'message')

                User Guide Home   ·   Next Topic:  Page Caching

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 37a71180..df522e95 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -139,7 +139,7 @@

                Now What?

                User Guide Home   ·   Next Topic:  Plugins

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 1b9ad7a8..14a2404f 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -186,7 +186,7 @@

                Hook Points

                User Guide Home   ·   Next Topic:  Auto-loading Resources

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 2d3ad90a..1354f871 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -92,7 +92,7 @@

                Getting Started With Code Igniter

                User Guide Home   ·   Next Topic:  Code Igniter URLs

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index d293920d..b5b63cea 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -92,7 +92,7 @@

                Creating Your Own Libraries

                User Guide Home   ·   Next Topic:  Creating Libraries

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 706b1a36..558e202a 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -132,7 +132,7 @@

                Running Multiple Applications with one Code Igniter Installation

                Next Topic:  Alternative PHP Syntax

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/models.html b/user_guide/general/models.html index d7e0e60a..cd93a429 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -252,7 +252,7 @@

                Connecting to your Database

                User Guide Home   ·   Next Topic:  Helpers

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 0e83c5ca..9358530e 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -125,7 +125,7 @@

                Using a Plugin

                User Guide Home   ·   Next Topic:  Using Libraries

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 688531e0..f02440b0 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -112,7 +112,7 @@

                Setting Benchmark Points

                User Guide Home   ·   Next Topic:  Managing Applications

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 2a7fee2f..e4bdb6c5 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -76,7 +76,7 @@

                Quick Reference Chart

                User Guide Home

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index e1d32417..0d7b33e8 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -81,7 +81,7 @@

                Server Requirements

                Next Topic:  License Agreement

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index a4ca8dca..5789b721 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -179,7 +179,7 @@

                Reserved Routes

                User Guide Home   ·   Next Topic:  Error Handling

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index ba1a804f..3d3ecac2 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -146,7 +146,7 @@

                A Final Note:

                User Guide Home   ·   Next Topic:  URI Routing

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 48c8ce81..e5602d30 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -152,7 +152,7 @@

                Best Practices

                User Guide Home   ·   Next Topic:  Benchmarking Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index e2ebbf23..1d24312b 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -152,7 +152,7 @@

                Enabling Query Strings

                User Guide Home   ·   Next Topic:  Controllers

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/general/views.html b/user_guide/general/views.html index dd97c361..4e749a6f 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -250,7 +250,7 @@

                My Todo List

                User Guide Home   ·   Next Topic:  Models

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 2d98a57d..76ceabc3 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -118,7 +118,7 @@

                random_element()

                User Guide Home   ·   Next Topic:  Cookie Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 53418c8b..db0f1a13 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -150,7 +150,7 @@

                delete_cookie()

                User Guide Home   ·   Next Topic:  Date Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 436ac88b..941ee9a0 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -364,7 +364,7 @@

                Timezone Reference

                User Guide Home   ·   Next Topic:  Directory Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 497ac99b..809ee3f4 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -138,7 +138,7 @@

                directory_map('source directory')

                User Guide Home   ·   Next Topic:  Download Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 06b56ed7..a48f2a08 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -111,7 +111,7 @@

                force_download('filename', 'data')

                User Guide Home   ·   Next Topic:  File Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 4d759a72..d2101314 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -147,7 +147,7 @@

                get_filenames('path/to/directory/')

                User Guide Home   ·   Next Topic:  Form Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 8eea9610..e3b6e9de 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -336,7 +336,7 @@

                form_prep()

                User Guide Home   ·   Next Topic:  HTML Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index baee88fe..316c3697 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -228,7 +228,7 @@

                br()

                User Guide Home   ·   Next Topic:   Inflector Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 66a0feec..3c99212b 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -124,7 +124,7 @@

                Now What?

                diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 9593999d..34eb56ba 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -146,7 +146,7 @@

                humanize()

                User Guide Home   ·   Next Topic:  Security Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index c0add4aa..81f41a2e 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -124,7 +124,7 @@

                encode_php_tags()

                User Guide Home   ·   Next Topic:  Smiley Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 54b6db03..619fac80 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -201,7 +201,7 @@

                parse_smileys()

                User Guide Home   ·   Next Topic:  String Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 2c39bb36..3d0cb7bd 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -137,7 +137,7 @@

                repeater()

                User Guide Home   ·   Next Topic:  Text Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index c5c413d2..c6db2792 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -190,7 +190,7 @@

                word_wrap()

                User Guide Home   ·   Next Topic:  Typography Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index b1137e8d..b7f10651 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -122,7 +122,7 @@

                nl2br_except_pre()

                User Guide Home   ·   Next Topic:  URL Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 53cad703..bedc8668 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -264,7 +264,7 @@

                redirect()

                User Guide Home   ·   Next Topic:  XML Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index af95ae55..175a44d0 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -103,7 +103,7 @@

                xml_convert('string')

                Top of Page   ·   User Guide Home

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/index.html b/user_guide/index.html index 10fee4bd..1e0f6cfe 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -98,7 +98,7 @@

                Who is Code Igniter For?

                diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 1f5922a8..081fddc3 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -94,7 +94,7 @@

                Subversion Server

                Next Topic:  Installation Instructions

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 60fa2acf..2f7977cd 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -95,7 +95,7 @@

                Installation Instructions

                Next Topic:  Upgrading from a Previous Version

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index ac131c46..fd8632dd 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -89,7 +89,7 @@

                Troubleshooting

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 45f30eb2..4885f3d9 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -91,7 +91,7 @@

                Upgrading From Beta 1.0 to Final 1.2

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index ce0359d8..694395c3 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -202,7 +202,7 @@

                Step 6: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 085e6f14..4509f157 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -101,7 +101,7 @@

                Step 2: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 1999ac08..a0dfe57d 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -99,7 +99,7 @@

                Step 2: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 4e6916b3..c9277c65 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -111,7 +111,7 @@

                Step 3: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 24676304..fc3c4e56 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -144,7 +144,7 @@

                Step 3: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index ae1a2f99..31a5e94a 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -148,7 +148,7 @@

                Step 4: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 2114dfd0..196231eb 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -177,7 +177,7 @@

                Step 5: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 947cd71d..c0411a57 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -110,7 +110,7 @@

                Step 2: Update your user guide

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 3a24e9ee..3e4799b5 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -143,7 +143,7 @@

                Step 5: Edit your config file

                Next Topic:  Code Igniter at a Glance

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 32907cda..68c6e5eb 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -91,7 +91,7 @@

                Upgrading From a Previous Version

                Next Topic:  Troubleshooting

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 7176d059..ce4eb899 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -195,7 +195,7 @@

                Displaying Memory Consumption

                User Guide Home   ·   Next Topic:  Calendaring Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 499a4328..7f043546 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -247,7 +247,7 @@

                Creating a Calendar Template

                User Guide Home   ·   Next Topic:  Config Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 9196ea4c..eeec28c7 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -181,7 +181,7 @@

                $this->config->system_url();

                User Guide Home   ·   Next Topic:  Database Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index c8d1c6e8..7ce56564 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -296,7 +296,7 @@

                Overriding Word Wrapping

                User Guide Home   ·   Next Topic:  Encryption Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index a69577c8..7a25e764 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -180,7 +180,7 @@

                $this->encrypt->sha1();

                User Guide Home   ·   Next Topic:  File Uploading Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 8a26a3e0..eea1feb6 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -429,7 +429,7 @@

                Explanation

                User Guide Home   ·   Next Topic:  FTP Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 48c3451e..8b50dee5 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -301,7 +301,7 @@

                $this->ftp->close();

                User Guide Home   ·   Next Topic:  HTML Table Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 87b68d2e..50063d3e 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -662,7 +662,7 @@

                Overlay Preferences

                User Guide Home   ·   Next Topic:  Input Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 9efa3017..f666bcf7 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -212,7 +212,7 @@

                $this->input->user_agent()

                User Guide Home   ·   Next Topic:  Loader Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index e84773cc..9bc90391 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -133,7 +133,7 @@

                Fetching a Line of Text

                User Guide Home   ·   Next Topic:  Output Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index d9fb64d3..d80695a6 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -165,7 +165,7 @@

                $this->load->config('file_name')

                User Guide Home   ·   Next Topic:  Language Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 82c2187b..6d2f9ae2 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -132,7 +132,7 @@

                $this->output->enable_profiler();

                User Guide Home   ·   Next Topic:  Pagination Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 35c43504..8f55628f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -211,7 +211,7 @@

                $config['num_tag_close'] = '</div>';

                User Guide Home   ·   Next Topic:  Session Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index e851561e..7238bcb4 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -208,7 +208,7 @@

                Variable Pairs

                User Guide Home   ·   Next Topic:  Unit Testing Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index b212b697..d86f9053 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -287,7 +287,7 @@

                Session Preferences

                User Guide Home   ·   Next Topic:  Trackback Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index d6661781..22fb610a 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -290,7 +290,7 @@

                $this->table->clear()

                User Guide Home   ·   Next Topic:  Image Manipulation Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 9d869980..e60a38e5 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -244,7 +244,7 @@

                Notes:

                User Guide Home   ·   Next Topic:  Template Parser Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 3941a7de..4351c4c3 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -203,7 +203,7 @@

                Creating a Template

                User Guide Home   ·   Next Topic:  URI Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 5472ee90..163d02db 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -251,7 +251,7 @@

                $this->uri->rsegment_array(n)

                User Guide Home   ·   Next Topic:  User Agent Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 7772ade7..725a0186 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -202,7 +202,7 @@

                $this->agent->accept_charset()

                User Guide Home   ·   Next Topic:  Validation Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index f4beb56f..ce06cf88 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -715,7 +715,7 @@

                set_radio()

                User Guide Home   ·   Next Topic:  XML-RPC Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5afbae98..e786d39e 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -487,7 +487,7 @@

                Data Types

                User Guide Home   ·   Next Topic:  Zip Encoding Class

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 8629bc15..dc39e9b1 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -276,7 +276,7 @@

                $this->zip->clear_data()

                User Guide Home   ·   Next Topic:  Array Helper

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/license.html b/user_guide/license.html index f8806271..f346c14d 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -106,7 +106,7 @@

                Limitations of Liability

                Next Topic:  Change Log

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index f9dcd30c..44f20211 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -94,7 +94,7 @@

                Application Flow Chart

                Next Topic:  Model-View-Controller

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 35f20540..2183d018 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -171,7 +171,7 @@

                Code Igniter has a Friendly Community of Users

                Next Topic:  Code Igniter Features

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index af7c2d4a..afebeb74 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -119,7 +119,7 @@

                Code Igniter Features

                Next Topic:  Application Flow Chart

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 3c325069..07549ed4 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -96,7 +96,7 @@

                Design and Architectural Goals

                User Guide Home   ·   Next Topic:  Getting Started

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 1166dee2..e8d60f37 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -82,7 +82,7 @@

                Code Igniter Overview

                diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index ccd8f204..c718ff50 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -98,7 +98,7 @@

                Model-View-Controller

                User Guide Home   ·   Next Topic:  Architectural Goals

                -

                Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

                +

                Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                diff --git a/user_guide/toc.html b/user_guide/toc.html index 59eb9e60..69d5f822 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -194,7 +194,7 @@

                Additional Resources

                From e1c29d2b6e1958890c3dcdf387c9b1dddb9493c5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 3 Apr 2007 20:31:07 +0000 Subject: [PATCH 0535/2544] example fix --- user_guide/database/examples.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 167c98bb..64ec3473 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -150,10 +150,10 @@

                Standard Query With Single Result (Array version)

                $query = $this->db->query('SELECT name FROM my_table LIMIT 1');

                $row = $query->row_array();
                -echo $row->['name'];
                +echo $row['name'];
                -

                The above row_array() function returns an array. Example: $row->['name']

                +

                The above row_array() function returns an array. Example: $row['name']

                Standard Insert

                From 72b58ca3afbf507d0b6fcedcecae01cc876ddd1f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 7 Apr 2007 20:58:23 +0000 Subject: [PATCH 0536/2544] repeater won't return any results if it is set to repeat 0 times. --- system/helpers/string_helper.php | 306 +++++++++++++++---------------- 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index ba704df9..c0a8854d 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,154 +1,154 @@ - 0) ? str_repeat($data, $num) : ''); +} + + ?> \ No newline at end of file From b8f3504b218f96c63ae6943476b6fcbdd31df21c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 9 Apr 2007 02:03:32 +0000 Subject: [PATCH 0537/2544] typo fix --- user_guide/general/managing_apps.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 558e202a..5d20efac 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -68,7 +68,7 @@

                Managing your Applications

                Renaming the Application Folder

                -

                If you would like to rename your applicaiton folder you may do so as long as you open your main index.php +

                If you would like to rename your application folder you may do so as long as you open your main index.php file and set its name using the $application_folder variable:

                $application_folder = "application"; From 0e254f16f26387e8f8feb0668c1d06a5fe97fa99 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 10 Apr 2007 21:53:38 +0000 Subject: [PATCH 0538/2544] typo fix --- system/libraries/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index b8ce9491..32223708 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -286,7 +286,7 @@ function generate($table_data = NULL) // -------------------------------------------------------------------- /** - * Clears the table arrays. Useful if multiple tables are beting generated + * Clears the table arrays. Useful if multiple tables are being generated * * @access public * @return void From 308462133f4a9cad38b5c0dbd725ec32b7ab5a45 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 10 Apr 2007 21:53:49 +0000 Subject: [PATCH 0539/2544] typo fix --- user_guide/helpers/smiley_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 619fac80..f76a4de8 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -188,7 +188,7 @@

                parse_smileys()

                $str = parse_smileys($str, "http://www.your-site.com/images/smileys/"); echo $str; - +
                From 9613e2c136c96fbb1d055b36a0a5055811f03451 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 14 Apr 2007 19:05:16 +0000 Subject: [PATCH 0540/2544] updates listed --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 217b34f6..318dae7e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,8 @@

                Version 1.5.3

                • Fixed a version but in the Postgre driver
                • Array to string now supported in profiler
                • +
                • Fixed a bug in the textarea function of the form helper for use with strings
                • +
                • Fixed doc typos.

                Version 1.5.2

                Release Date: February 13, 2007

                From d2df9bc7cc9d4b3e53818470c5d0977c9a36677c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Apr 2007 17:41:17 +0000 Subject: [PATCH 0541/2544] update pMachine to EllisLab update copyright year update Code Igniter to CodeIgniter --- license.txt | 104 +- system/application/config/config.php | 602 +-- system/application/views/welcome_message.php | 122 +- system/codeigniter/Base4.php | 132 +- system/codeigniter/Base5.php | 106 +- system/codeigniter/CodeIgniter.php | 4 +- system/codeigniter/Common.php | 518 +-- system/database/DB.php | 170 +- system/database/DB_active_rec.php | 4 +- system/database/DB_cache.php | 386 +- system/database/DB_driver.php | 2132 +++++----- system/database/DB_result.php | 578 +-- system/database/DB_utility.php | 908 ++--- .../database/drivers/mssql/mssql_driver.php | 914 ++--- .../database/drivers/mssql/mssql_result.php | 344 +- .../database/drivers/mssql/mssql_utility.php | 258 +- .../database/drivers/mysql/mysql_driver.php | 982 ++--- .../database/drivers/mysql/mysql_result.php | 344 +- .../database/drivers/mysql/mysql_utility.php | 486 +-- .../database/drivers/mysqli/mysqli_driver.php | 964 ++--- .../database/drivers/mysqli/mysqli_result.php | 344 +- .../drivers/mysqli/mysqli_utility.php | 488 +-- system/database/drivers/oci8/oci8_driver.php | 1208 +++--- system/database/drivers/oci8/oci8_result.php | 500 +-- system/database/drivers/oci8/oci8_utility.php | 256 +- system/database/drivers/odbc/odbc_driver.php | 4 +- system/database/drivers/odbc/odbc_result.php | 466 +-- system/database/drivers/odbc/odbc_utility.php | 320 +- .../drivers/postgre/postgre_driver.php | 4 +- .../drivers/postgre/postgre_result.php | 344 +- .../drivers/postgre/postgre_utility.php | 256 +- .../database/drivers/sqlite/sqlite_driver.php | 966 ++--- .../database/drivers/sqlite/sqlite_result.php | 350 +- .../drivers/sqlite/sqlite_utility.php | 306 +- system/helpers/array_helper.php | 140 +- system/helpers/cookie_helper.php | 250 +- system/helpers/date_helper.php | 6 +- system/helpers/directory_helper.php | 132 +- system/helpers/download_helper.php | 6 +- system/helpers/file_helper.php | 356 +- system/helpers/form_helper.php | 6 +- system/helpers/html_helper.php | 406 +- system/helpers/inflector_helper.php | 278 +- system/helpers/security_helper.php | 222 +- system/helpers/smiley_helper.php | 328 +- system/helpers/string_helper.php | 6 +- system/helpers/text_helper.php | 840 ++-- system/helpers/typography_helper.php | 1078 +++--- system/helpers/url_helper.php | 6 +- system/helpers/xml_helper.php | 114 +- system/libraries/Benchmark.php | 220 +- system/libraries/Calendar.php | 948 ++--- system/libraries/Config.php | 488 +-- system/libraries/Controller.php | 228 +- system/libraries/Email.php | 3436 ++++++++--------- system/libraries/Encrypt.php | 792 ++-- system/libraries/Exceptions.php | 4 +- system/libraries/Ftp.php | 1230 +++--- system/libraries/Hooks.php | 446 +-- system/libraries/Image_lib.php | 4 +- system/libraries/Input.php | 4 +- system/libraries/Language.php | 240 +- system/libraries/Loader.php | 4 +- system/libraries/Log.php | 234 +- system/libraries/Model.php | 162 +- system/libraries/Output.php | 726 ++-- system/libraries/Pagination.php | 420 +- system/libraries/Parser.php | 340 +- system/libraries/Profiler.php | 6 +- system/libraries/Router.php | 4 +- system/libraries/Session.php | 974 ++--- system/libraries/Sha1.php | 496 +-- system/libraries/Table.php | 4 +- system/libraries/Trackback.php | 1094 +++--- system/libraries/URI.php | 732 ++-- system/libraries/Unit_test.php | 660 ++-- system/libraries/Upload.php | 1616 ++++---- system/libraries/User_agent.php | 4 +- system/libraries/Validation.php | 1468 +++---- system/libraries/Xmlrpc.php | 2822 +++++++------- system/libraries/Xmlrpcs.php | 1004 ++--- system/libraries/Zip.php | 758 ++-- system/plugins/captcha_pi.php | 690 ++-- system/plugins/js_calendar_pi.php | 1206 +++--- system/scaffolding/Scaffolding.php | 576 +-- system/scaffolding/views/footer.php | 18 +- user_guide/changelog.html | 27 +- user_guide/database/active_record.html | 16 +- user_guide/database/caching.html | 14 +- user_guide/database/call_function.html | 14 +- user_guide/database/configuration.html | 14 +- user_guide/database/connecting.html | 10 +- user_guide/database/examples.html | 10 +- user_guide/database/fields.html | 10 +- user_guide/database/helpers.html | 10 +- user_guide/database/index.html | 12 +- user_guide/database/queries.html | 12 +- user_guide/database/results.html | 10 +- user_guide/database/table_data.html | 10 +- user_guide/database/transactions.html | 16 +- user_guide/database/utilities.html | 10 +- user_guide/general/alternative_php.html | 14 +- user_guide/general/ancillary_classes.html | 24 +- user_guide/general/autoloader.html | 12 +- user_guide/general/caching.html | 14 +- user_guide/general/controllers.html | 26 +- user_guide/general/core_classes.html | 20 +- user_guide/general/creating_libraries.html | 36 +- user_guide/general/credits.html | 18 +- user_guide/general/errors.html | 20 +- user_guide/general/helpers.html | 18 +- user_guide/general/hooks.html | 14 +- user_guide/general/index.html | 16 +- user_guide/general/libraries.html | 14 +- user_guide/general/managing_apps.html | 18 +- user_guide/general/models.html | 12 +- user_guide/general/plugins.html | 14 +- user_guide/general/profiling.html | 10 +- user_guide/general/quick_reference.html | 10 +- user_guide/general/requirements.html | 10 +- user_guide/general/routing.html | 12 +- user_guide/general/scaffolding.html | 18 +- user_guide/general/security.html | 22 +- user_guide/general/urls.html | 20 +- user_guide/general/views.html | 10 +- user_guide/helpers/array_helper.html | 10 +- user_guide/helpers/cookie_helper.html | 10 +- user_guide/helpers/date_helper.html | 10 +- user_guide/helpers/directory_helper.html | 10 +- user_guide/helpers/download_helper.html | 10 +- user_guide/helpers/file_helper.html | 14 +- user_guide/helpers/form_helper.html | 10 +- user_guide/helpers/html_helper.html | 10 +- user_guide/helpers/index.html | 16 +- user_guide/helpers/inflector_helper.html | 10 +- user_guide/helpers/security_helper.html | 10 +- user_guide/helpers/smiley_helper.html | 10 +- user_guide/helpers/string_helper.html | 10 +- user_guide/helpers/text_helper.html | 10 +- user_guide/helpers/typography_helper.html | 10 +- user_guide/helpers/url_helper.html | 10 +- user_guide/helpers/xml_helper.html | 10 +- user_guide/index.html | 22 +- user_guide/installation/downloads.html | 34 +- user_guide/installation/index.html | 18 +- user_guide/installation/troubleshooting.html | 14 +- user_guide/installation/upgrade_120.html | 12 +- user_guide/installation/upgrade_130.html | 16 +- user_guide/installation/upgrade_131.html | 14 +- user_guide/installation/upgrade_132.html | 14 +- user_guide/installation/upgrade_133.html | 18 +- user_guide/installation/upgrade_140.html | 14 +- user_guide/installation/upgrade_141.html | 14 +- user_guide/installation/upgrade_150.html | 14 +- user_guide/installation/upgrade_152.html | 14 +- user_guide/installation/upgrade_b11.html | 14 +- user_guide/installation/upgrading.html | 10 +- user_guide/libraries/benchmark.html | 16 +- user_guide/libraries/calendar.html | 12 +- user_guide/libraries/config.html | 16 +- user_guide/libraries/email.html | 18 +- user_guide/libraries/encryption.html | 12 +- user_guide/libraries/file_uploading.html | 16 +- user_guide/libraries/ftp.html | 14 +- user_guide/libraries/image_lib.html | 16 +- user_guide/libraries/input.html | 18 +- user_guide/libraries/language.html | 14 +- user_guide/libraries/loader.html | 12 +- user_guide/libraries/output.html | 14 +- user_guide/libraries/pagination.html | 12 +- user_guide/libraries/parser.html | 14 +- user_guide/libraries/sessions.html | 12 +- user_guide/libraries/table.html | 12 +- user_guide/libraries/trackback.html | 12 +- user_guide/libraries/unit_testing.html | 14 +- user_guide/libraries/uri.html | 22 +- user_guide/libraries/user_agent.html | 12 +- user_guide/libraries/validation.html | 20 +- user_guide/libraries/xmlrpc.html | 14 +- user_guide/libraries/zip.html | 14 +- user_guide/license.html | 20 +- user_guide/nav/nav.js | 252 +- user_guide/overview/appflow.html | 14 +- user_guide/overview/at_a_glance.html | 64 +- user_guide/overview/features.html | 16 +- user_guide/overview/goals.html | 20 +- user_guide/overview/index.html | 16 +- user_guide/overview/mvc.html | 18 +- user_guide/toc.html | 18 +- 189 files changed, 22951 insertions(+), 22944 deletions(-) diff --git a/license.txt b/license.txt index 4476208a..e93f3f55 100644 --- a/license.txt +++ b/license.txt @@ -1,52 +1,52 @@ -Copyright (c) 2006, pMachine, Inc. -All rights reserved. - -This license is a legal agreement between you and pMachine Inc. for the use -of Code Igniter 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 Code Igniter in their documentation and/or other - materials provided with the distribution. - -6. Products derived from the Software may not be called "Code Igniter", - nor may "Code Igniter" appear in their name, without prior written - permission from pMachine, 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. +Copyright (c) 2006, 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. diff --git a/system/application/config/config.php b/system/application/config/config.php index b1598b34..3bb9d1d2 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -1,302 +1,302 @@ - \ No newline at end of file diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php index 393fb56e..8313059e 100644 --- a/system/application/views/welcome_message.php +++ b/system/application/views/welcome_message.php @@ -1,62 +1,62 @@ - - -Welcome to Code Igniter - - - - - -

                Welcome to Code Igniter!

                - -

                The page you are looking at is being generated dynamically by Code Igniter.

                - -

                If you would like to edit this page you'll find it located at:

                -system/application/views/welcome_message.php - -

                The corresponding controller for this page is found at:

                -system/application/controllers/welcome.php - -

                If you are exploring Code Igniter for the very first time, you should start by reading the User Guide.

                - - -


                Page rendered in {elapsed_time} seconds

                - - + + +Welcome to CodeIgniter + + + + + +

                Welcome to CodeIgniter!

                + +

                The page you are looking at is being generated dynamically by CodeIgniter.

                + +

                If you would like to edit this page you'll find it located at:

                +system/application/views/welcome_message.php + +

                The corresponding controller for this page is found at:

                +system/application/controllers/welcome.php + +

                If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

                + + +


                Page rendered in {elapsed_time} seconds

                + + \ No newline at end of file diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index b2713b66..b00da8ba 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -1,67 +1,67 @@ -load->library('email') to instantiate - * classes that can then be used within controllers as $this->email->send() - * - * PHP 4 also has trouble referencing the CI super object within application - * constructors since objects do not exist until the class is fully - * instantiated. Basically PHP 4 sucks... - * - * Since PHP 5 doesn't suffer from this problem so we load one of - * two files based on the version of PHP being run. - * - * @package CodeIgniter - * @subpackage codeigniter - * @category front-controller - * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/ - */ - class CI_Base extends CI_Loader { - - function CI_Base() - { - // This allows syntax like $this->load->foo() to work - parent::CI_Loader(); - $this->load =& $this; - - // This allows resources used within controller constructors to work - global $OBJ; - $OBJ = $this->load; // Do NOT use a reference. - } -} - -function &get_instance() -{ - global $CI, $OBJ; - - if (is_object($CI)) - { - return $CI; - } - - return $OBJ->load; -} - +load->library('email') to instantiate + * classes that can then be used within controllers as $this->email->send() + * + * PHP 4 also has trouble referencing the CI super object within application + * constructors since objects do not exist until the class is fully + * instantiated. Basically PHP 4 sucks... + * + * Since PHP 5 doesn't suffer from this problem so we load one of + * two files based on the version of PHP being run. + * + * @package CodeIgniter + * @subpackage codeigniter + * @category front-controller + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/ + */ + class CI_Base extends CI_Loader { + + function CI_Base() + { + // This allows syntax like $this->load->foo() to work + parent::CI_Loader(); + $this->load =& $this; + + // This allows resources used within controller constructors to work + global $OBJ; + $OBJ = $this->load; // Do NOT use a reference. + } +} + +function &get_instance() +{ + global $CI, $OBJ; + + if (is_object($CI)) + { + return $CI; + } + + return $OBJ->load; +} + ?> \ No newline at end of file diff --git a/system/codeigniter/Base5.php b/system/codeigniter/Base5.php index 0d036fae..d1531a57 100644 --- a/system/codeigniter/Base5.php +++ b/system/codeigniter/Base5.php @@ -1,54 +1,54 @@ - \ No newline at end of file diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 12f1a0d5..aed05ddc 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -1,12 +1,12 @@ show_error('An Error Was Encountered', $message); - exit; -} - - -/** -* 404 Page Handler -* -* This function is similar to the show_error() function above -* However, instead of the standard error template it displays -* 404 errors. -* -* @access public -* @return void -*/ -function show_404($page = '') -{ - $error =& load_class('Exceptions'); - $error->show_404($page); - exit; -} - - -/** -* Error Logging Interface -* -* We use this as a simple mechanism to access the logging -* class and send messages to be logged. -* -* @access public -* @return void -*/ -function log_message($level = 'error', $message, $php_error = FALSE) -{ - static $LOG; - - $config =& get_config(); - if ($config['log_threshold'] == 0) - { - return; - } - - $LOG =& load_class('Log'); - $LOG->write_log($level, $message, $php_error); -} - -/** -* Exception Handler -* -* This is the custom exception handler that is declaired at the top -* of Codeigniter.php. The main reason we use this is permit -* PHP errors to be logged in our own log files since we may -* not have access to server logs. Since this function -* effectively intercepts PHP errors, however, we also need -* to display errors based on the current error_reporting level. -* We do that with the use of a PHP error template. -* -* @access private -* @return void -*/ -function _exception_handler($severity, $message, $filepath, $line) -{ - // We don't bother with "strict" notices since they will fill up - // the log file with information that isn't normally very - // helpful. For example, if you are running PHP 5 and you - // use version 4 style class functions (without prefixes - // like "public", "private", etc.) you'll get notices telling - // you that these have been deprecated. - - if ($severity == E_STRICT) - { - return; - } - - $error =& load_class('Exceptions'); - - // Should we display the error? - // We'll get the current error_reporting level and add its bits - // with the severity bits to find out. - - if (($severity & error_reporting()) == $severity) - { - $error->show_php_error($severity, $message, $filepath, $line); - } - - // Should we log the error? No? We're done... - $config =& get_config(); - if ($config['log_threshold'] == 0) - { - return; - } - - $error->log_exception($severity, $message, $filepath, $line); -} - - +show_error('An Error Was Encountered', $message); + exit; +} + + +/** +* 404 Page Handler +* +* This function is similar to the show_error() function above +* However, instead of the standard error template it displays +* 404 errors. +* +* @access public +* @return void +*/ +function show_404($page = '') +{ + $error =& load_class('Exceptions'); + $error->show_404($page); + exit; +} + + +/** +* Error Logging Interface +* +* We use this as a simple mechanism to access the logging +* class and send messages to be logged. +* +* @access public +* @return void +*/ +function log_message($level = 'error', $message, $php_error = FALSE) +{ + static $LOG; + + $config =& get_config(); + if ($config['log_threshold'] == 0) + { + return; + } + + $LOG =& load_class('Log'); + $LOG->write_log($level, $message, $php_error); +} + +/** +* Exception Handler +* +* This is the custom exception handler that is declaired at the top +* of Codeigniter.php. The main reason we use this is permit +* PHP errors to be logged in our own log files since we may +* not have access to server logs. Since this function +* effectively intercepts PHP errors, however, we also need +* to display errors based on the current error_reporting level. +* We do that with the use of a PHP error template. +* +* @access private +* @return void +*/ +function _exception_handler($severity, $message, $filepath, $line) +{ + // We don't bother with "strict" notices since they will fill up + // the log file with information that isn't normally very + // helpful. For example, if you are running PHP 5 and you + // use version 4 style class functions (without prefixes + // like "public", "private", etc.) you'll get notices telling + // you that these have been deprecated. + + if ($severity == E_STRICT) + { + return; + } + + $error =& load_class('Exceptions'); + + // Should we display the error? + // We'll get the current error_reporting level and add its bits + // with the severity bits to find out. + + if (($severity & error_reporting()) == $severity) + { + $error->show_php_error($severity, $message, $filepath, $line); + } + + // Should we log the error? No? We're done... + $config =& get_config(); + if ($config['log_threshold'] == 0) + { + return; + } + + $error->log_exception($severity, $message, $filepath, $line); +} + + ?> \ No newline at end of file diff --git a/system/database/DB.php b/system/database/DB.php index c6bd365d..4a119d04 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -1,86 +1,86 @@ - \ No newline at end of file diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 1c72528e..d79a068e 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1,12 +1,12 @@ CI - // and load the file helper since we use it a lot - $this->CI =& get_instance(); - $this->CI->load->helper('file'); - } - - // -------------------------------------------------------------------- - - /** - * Set Cache Directory Path - * - * @access public - * @param string the path to the cache directory - * @return bool - */ - function check_path($path = '') - { - if ($path == '') - { - if ($this->CI->db->cachedir == '') - { - return $this->CI->db->cache_off(); - } - - $path = $this->CI->db->cachedir; - } - - // Add a trailing slash to the path if needed - $path = preg_replace("/(.+?)\/*$/", "\\1/", $path); - - if ( ! is_dir($path) OR ! is_writable($path)) - { - if ($this->CI->db->db_debug) - { - return $this->CI->db->display_error('db_invalid_cache_path'); - } - - // If the path is wrong we'll turn off caching - return $this->CI->db->cache_off(); - } - - $this->CI->db->cachedir = $path; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Retrieve a cached query - * - * The URI being requested will become the name of the cache sub-folder. - * An MD5 hash of the SQL statement will become the cache file name - * - * @access public - * @return string - */ - function read($sql) - { - if ( ! $this->check_path()) - { - return $this->CI->db->cache_off(); - } - - $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+'; - $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - - $filepath = $uri.'/'.md5($sql); - - if (FALSE === ($cachedata = read_file($this->CI->db->cachedir.$filepath))) - { - return FALSE; - } - - return unserialize($cachedata); - } - - // -------------------------------------------------------------------- - - /** - * Write a query to a cache file - * - * @access public - * @return bool - */ - function write($sql, $object) - { - if ( ! $this->check_path()) - { - return $this->CI->db->cache_off(); - } - - $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+'; - $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - - $dir_path = $this->CI->db->cachedir.$uri.'/'; - - $filename = md5($sql); - - if ( ! @is_dir($dir_path)) - { - if ( ! @mkdir($dir_path, 0777)) - { - return FALSE; - } - - @chmod($dir_path, 0777); - } - - if (write_file($dir_path.$filename, serialize($object)) === FALSE) - { - return FALSE; - } - - @chmod($dir_path.$filename, 0777); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Delete cache files within a particular directory - * - * @access public - * @return bool - */ - function delete($segment_one = '', $segment_two = '') - { - if ($segment_one == '') - { - $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(2); - } - - if ($segment_two == '') - { - $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - } - - $dir_path = $this->CI->db->cachedir.$segment_one.'+'.$segment_two.'/'; - - delete_files($dir_path, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * Delete all existing cache files - * - * @access public - * @return bool - */ - function delete_all() - { - delete_files($this->CI->db->cachedir, TRUE); - } - -} - +CI + // and load the file helper since we use it a lot + $this->CI =& get_instance(); + $this->CI->load->helper('file'); + } + + // -------------------------------------------------------------------- + + /** + * Set Cache Directory Path + * + * @access public + * @param string the path to the cache directory + * @return bool + */ + function check_path($path = '') + { + if ($path == '') + { + if ($this->CI->db->cachedir == '') + { + return $this->CI->db->cache_off(); + } + + $path = $this->CI->db->cachedir; + } + + // Add a trailing slash to the path if needed + $path = preg_replace("/(.+?)\/*$/", "\\1/", $path); + + if ( ! is_dir($path) OR ! is_writable($path)) + { + if ($this->CI->db->db_debug) + { + return $this->CI->db->display_error('db_invalid_cache_path'); + } + + // If the path is wrong we'll turn off caching + return $this->CI->db->cache_off(); + } + + $this->CI->db->cachedir = $path; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Retrieve a cached query + * + * The URI being requested will become the name of the cache sub-folder. + * An MD5 hash of the SQL statement will become the cache file name + * + * @access public + * @return string + */ + function read($sql) + { + if ( ! $this->check_path()) + { + return $this->CI->db->cache_off(); + } + + $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+'; + $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + + $filepath = $uri.'/'.md5($sql); + + if (FALSE === ($cachedata = read_file($this->CI->db->cachedir.$filepath))) + { + return FALSE; + } + + return unserialize($cachedata); + } + + // -------------------------------------------------------------------- + + /** + * Write a query to a cache file + * + * @access public + * @return bool + */ + function write($sql, $object) + { + if ( ! $this->check_path()) + { + return $this->CI->db->cache_off(); + } + + $uri = ($this->CI->uri->segment(1) == FALSE) ? 'default.' : $this->CI->uri->segment(1).'+'; + $uri .= ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + + $dir_path = $this->CI->db->cachedir.$uri.'/'; + + $filename = md5($sql); + + if ( ! @is_dir($dir_path)) + { + if ( ! @mkdir($dir_path, 0777)) + { + return FALSE; + } + + @chmod($dir_path, 0777); + } + + if (write_file($dir_path.$filename, serialize($object)) === FALSE) + { + return FALSE; + } + + @chmod($dir_path.$filename, 0777); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Delete cache files within a particular directory + * + * @access public + * @return bool + */ + function delete($segment_one = '', $segment_two = '') + { + if ($segment_one == '') + { + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(2); + } + + if ($segment_two == '') + { + $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + } + + $dir_path = $this->CI->db->cachedir.$segment_one.'+'.$segment_two.'/'; + + delete_files($dir_path, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Delete all existing cache files + * + * @access public + * @return bool + */ + function delete_all() + { + delete_files($this->CI->db->cachedir, TRUE); + } + +} + ?> \ No newline at end of file diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 2a8510e1..7ff33246 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1,1067 +1,1067 @@ -initialize($params); - log_message('debug', 'Database Driver Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Initialize Database Settings - * - * @access private Called by the constructor - * @param mixed - * @return void - */ - function initialize($params = '') - { - if (is_array($params)) - { - $defaults = array( - 'hostname' => '', - 'username' => '', - 'password' => '', - 'database' => '', - 'conn_id' => FALSE, - 'dbdriver' => 'mysql', - 'dbprefix' => '', - 'port' => '', - 'pconnect' => FALSE, - 'db_debug' => FALSE, - 'cachedir' => '', - 'cache_on' => FALSE - ); - - foreach ($defaults as $key => $val) - { - $this->$key = ( ! isset($params[$key])) ? $val : $params[$key]; - } - } - elseif (strpos($params, '://')) - { - if (FALSE === ($dsn = @parse_url($params))) - { - log_message('error', 'Invalid DB Connection String'); - - if ($this->db_debug) - { - return $this->display_error('db_invalid_connection_str'); - } - return FALSE; - } - - $this->hostname = ( ! isset($dsn['host'])) ? '' : rawurldecode($dsn['host']); - $this->username = ( ! isset($dsn['user'])) ? '' : rawurldecode($dsn['user']); - $this->password = ( ! isset($dsn['pass'])) ? '' : rawurldecode($dsn['pass']); - $this->database = ( ! isset($dsn['path'])) ? '' : rawurldecode(substr($dsn['path'], 1)); - } - - // If an existing DB connection resource is supplied - // there is no need to connect and select the database - if (is_resource($this->conn_id)) - { - return TRUE; - } - - // Connect to the database - $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); - - // No connection? Throw an error - if ( ! $this->conn_id) - { - log_message('error', 'Unable to connect to the database'); - - if ($this->db_debug) - { - $this->display_error('db_unable_to_connect'); - } - return FALSE; - } - - // Select the database - if ($this->database != '') - { - if ( ! $this->db_select()) - { - log_message('error', 'Unable to select database: '.$this->database); - - if ($this->db_debug) - { - $this->display_error('db_unable_to_select', $this->database); - } - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * The name of the platform in use (mysql, mssql, etc...) - * - * @access public - * @return string - */ - function platform() - { - return $this->dbdriver; - } - - // -------------------------------------------------------------------- - - /** - * Database Version Number. Returns a string containing the - * version of the database being used - * - * @access public - * @return string - */ - function version() - { - if (FALSE === ($sql = $this->_version())) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - if ($this->dbdriver == 'oci8') - { - return $sql; - } - - $query = $this->query($sql); - $row = $query->row(); - return $row->ver; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * Accepts an SQL string as input and returns a result object upon - * successful execution of a "read" type query. Returns boolean TRUE - * upon successful execution of a "write" type query. Returns boolean - * FALSE upon failure, and if the $db_debug variable is set to TRUE - * will raise an error. - * - * @access public - * @param string An SQL query string - * @param array An array of binding data - * @return mixed - */ - function query($sql, $binds = FALSE, $return_object = TRUE) - { - if ($sql == '') - { - if ($this->db_debug) - { - log_message('error', 'Invalid query: '.$sql); - return $this->display_error('db_invalid_query'); - } - return FALSE; - } - - // Is query caching enabled? If the query is a "read type" - // we will load the caching class and return the previously - // cached query if it exists - if ($this->cache_on == TRUE AND stristr($sql, 'SELECT')) - { - if ($this->_cache_init()) - { - $this->load_rdriver(); - if (FALSE !== ($cache = $this->CACHE->read($sql))) - { - return $cache; - } - } - } - - // Compile binds if needed - if ($binds !== FALSE) - { - $sql = $this->compile_binds($sql, $binds); - } - - // Save the query for debugging - $this->queries[] = $sql; - - // Start the Query Timer - $time_start = list($sm, $ss) = explode(' ', microtime()); - - // Run the Query - if (FALSE === ($this->result_id = $this->simple_query($sql))) - { - // This will trigger a rollback if transactions are being used - $this->_trans_failure = TRUE; - - if ($this->db_debug) - { - log_message('error', 'Query error: '.$this->_error_message()); - return $this->display_error( - array( - 'Error Number: '.$this->_error_number(), - $this->_error_message(), - $sql - ) - ); - } - - return FALSE; - } - - // Stop and aggregate the query time results - $time_end = list($em, $es) = explode(' ', microtime()); - $this->benchmark += ($em + $es) - ($sm + $ss); - - // Increment the query counter - $this->query_count++; - - // Was the query a "write" type? - // If so we'll simply return true - if ($this->is_write_type($sql) === TRUE) - { - // If caching is enabled we'll auto-cleanup any - // existing files related to this particular URI - if ($this->cache_on == TRUE AND $this->cache_autodel == TRUE AND $this->_cache_init()) - { - $this->CACHE->delete(); - } - - return TRUE; - } - - // Return TRUE if we don't need to create a result object - // Currently only the Oracle driver uses this when stored - // procedures are used - if ($return_object !== TRUE) - { - return TRUE; - } - - // Load and instantiate the result driver - - $driver = $this->load_rdriver(); - $RES = new $driver(); - $RES->conn_id = $this->conn_id; - $RES->result_id = $this->result_id; - - if ($this->dbdriver == 'oci8') - { - $RES->stmt_id = $this->stmt_id; - $RES->curs_id = NULL; - $RES->limit_used = $this->limit_used; - } - - // Is query caching enabled? If so, we'll serialize the - // result object and save it to a cache file. - if ($this->cache_on == TRUE AND $this->_cache_init()) - { - // We'll create a new instance of the result object - // only without the platform specific driver since - // we can't use it with cached data (the query result - // resource ID won't be any good once we've cached the - // result object, so we'll have to compile the data - // and save it) - $CR = new CI_DB_result(); - $CR->num_rows = $RES->num_rows(); - $CR->result_object = $RES->result_object(); - $CR->result_array = $RES->result_array(); - - // Reset these since cached objects can not utilize resource IDs. - $CR->conn_id = NULL; - $CR->result_id = NULL; - - $this->CACHE->write($sql, $CR); - } - - return $RES; - } - - // -------------------------------------------------------------------- - - /** - * Load the result drivers - * - * @access public - * @return string the name of the result class - */ - function load_rdriver() - { - $driver = 'CI_DB_'.$this->dbdriver.'_result'; - - if ( ! class_exists($driver)) - { - include_once(BASEPATH.'database/DB_result'.EXT); - include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); - } - - return $driver; - } - - // -------------------------------------------------------------------- - - /** - * Simple Query - * This is a simplified version of the query() function. Internally - * we only use it when running transaction commands since they do - * not require all the features of the main query() function. - * - * @access public - * @param string the sql query - * @return mixed - */ - function simple_query($sql) - { - if ( ! $this->conn_id) - { - $this->initialize(); - } - - return $this->_execute($sql); - } - - // -------------------------------------------------------------------- - - /** - * Disable Transactions - * This permits transactions to be disabled at run-time. - * - * @access public - * @return void - */ - function trans_off() - { - $this->trans_enabled = FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Start Transaction - * - * @access public - * @return void - */ - function trans_start($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return FALSE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - $this->_trans_depth += 1; - return; - } - - $this->trans_begin($test_mode); - } - - // -------------------------------------------------------------------- - - /** - * Complete Transaction - * - * @access public - * @return bool - */ - function trans_complete() - { - if ( ! $this->trans_enabled) - { - return FALSE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 1) - { - $this->_trans_depth -= 1; - return TRUE; - } - - // The query() function will set this flag to TRUE in the event that a query failed - if ($this->_trans_failure === TRUE) - { - $this->trans_rollback(); - - if ($this->db_debug) - { - return $this->display_error('db_transaction_failure'); - } - return FALSE; - } - - $this->trans_commit(); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Lets you retrieve the transaction flag to determine if it has failed - * - * @access public - * @return bool - */ - function trans_status() - { - return $this->_trans_failure; - } - - // -------------------------------------------------------------------- - - /** - * Compile Bindings - * - * @access public - * @param string the sql statement - * @param array an array of bind data - * @return string - */ - function compile_binds($sql, $binds) - { - if (FALSE === strpos($sql, $this->bind_marker)) - { - return $sql; - } - - if ( ! is_array($binds)) - { - $binds = array($binds); - } - - foreach ($binds as $val) - { - $val = $this->escape($val); - - // Just in case the replacement string contains the bind - // character we'll temporarily replace it with a marker - $val = str_replace($this->bind_marker, '{%bind_marker%}', $val); - $sql = preg_replace("#".preg_quote($this->bind_marker, '#')."#", str_replace('$', '\$', $val), $sql, 1); - } - - return str_replace('{%bind_marker%}', $this->bind_marker, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Determines if a query is a "write" type. - * - * @access public - * @param string An SQL query string - * @return boolean - */ - function is_write_type($sql) - { - if ( ! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) - { - return FALSE; - } - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Calculate the aggregate query elapsed time - * - * @access public - * @param integer The number of decimal places - * @return integer - */ - function elapsed_time($decimals = 6) - { - return number_format($this->benchmark, $decimals); - } - - // -------------------------------------------------------------------- - - /** - * Returns the total number of queries - * - * @access public - * @return integer - */ - function total_queries() - { - return $this->query_count; - } - - // -------------------------------------------------------------------- - - /** - * Returns the last query that was executed - * - * @access public - * @return void - */ - function last_query() - { - return end($this->queries); - } - - // -------------------------------------------------------------------- - - /** - * "Smart" Escape String - * - * Escapes data based on type - * Sets boolean and null types - * - * @access public - * @param string - * @return integer - */ - function escape($str) - { - switch (gettype($str)) - { - case 'string' : $str = "'".$this->escape_str($str)."'"; - break; - case 'boolean' : $str = ($str === FALSE) ? 0 : 1; - break; - default : $str = ($str === NULL) ? 'NULL' : $str; - break; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Primary - * - * Retrieves the primary key. It assumes that the row in the first - * position is the primary key - * - * @access public - * @param string the table name - * @return string - */ - function primary($table = '') - { - $fields = $this->list_fields($table); - - if ( ! is_array($fields)) - { - return FALSE; - } - - return current($fields); - } - - // -------------------------------------------------------------------- - - /** - * Returns an array of table names - * - * @access public - * @return array - */ - function list_tables() - { - // Is there a cached result? - if (isset($this->data_cache['table_names'])) - { - return $this->data_cache['table_names']; - } - - if (FALSE === ($sql = $this->_list_tables())) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - $retval = array(); - $query = $this->query($sql); - - if ($query->num_rows() > 0) - { - foreach($query->result_array() as $row) - { - if (isset($row['TABLE_NAME'])) - { - $retval[] = $row['TABLE_NAME']; - } - else - { - $retval[] = array_shift($row); - } - } - } - - $this->data_cache['table_names'] = $retval; - return $this->data_cache['table_names']; - } - - // -------------------------------------------------------------------- - - /** - * Determine if a particular table exists - * @access public - * @return boolean - */ - function table_exists($table_name) - { - return ( ! in_array($this->dbprefix.$table_name, $this->list_tables())) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Fetch MySQL Field Names - * - * @access public - * @param string the table name - * @return array - */ - function list_fields($table = '') - { - // Is there a cached result? - if (isset($this->data_cache['field_names'][$table])) - { - return $this->data_cache['field_names'][$table]; - } - - if ($table == '') - { - if ($this->db_debug) - { - return $this->display_error('db_field_param_missing'); - } - return FALSE; - } - - if (FALSE === ($sql = $this->_list_columns($this->dbprefix.$table))) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - $query = $this->query($sql); - - $retval = array(); - foreach($query->result_array() as $row) - { - if (isset($row['COLUMN_NAME'])) - { - $retval[] = $row['COLUMN_NAME']; - } - else - { - $retval[] = current($row); - } - } - - $this->data_cache['field_names'][$table] = $retval; - return $this->data_cache['field_names'][$table]; - } - - // -------------------------------------------------------------------- - - /** - * Determine if a particular field exists - * @access public - * @param string - * @param string - * @return boolean - */ - function field_exists($field_name, $table_name) - { - return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * DEPRECATED - use list_fields() - */ - function field_names($table = '') - { - return $this->list_fields($table); - } - - // -------------------------------------------------------------------- - - /** - * Returns an object with field data - * - * @access public - * @param string the table name - * @return object - */ - function field_data($table = '') - { - if ($table == '') - { - if ($this->db_debug) - { - return $this->display_error('db_field_param_missing'); - } - return FALSE; - } - - $query = $this->query($this->_field_data($this->dbprefix.$table)); - return $query->field_data(); - } - - // -------------------------------------------------------------------- - - /** - * Generate an insert string - * - * @access public - * @param string the table upon which the query will be performed - * @param array an associative array data of key/values - * @return string - */ - function insert_string($table, $data) - { - $fields = array(); - $values = array(); - - foreach($data as $key => $val) - { - $fields[] = $key; - $values[] = $this->escape($val); - } - - return $this->_insert($this->dbprefix.$table, $fields, $values); - } - - // -------------------------------------------------------------------- - - /** - * Generate an update string - * - * @access public - * @param string the table upon which the query will be performed - * @param array an associative array data of key/values - * @param mixed the "where" statement - * @return string - */ - function update_string($table, $data, $where) - { - if ($where == '') - return false; - - $fields = array(); - foreach($data as $key => $val) - { - $fields[$key] = $this->escape($val); - } - - if ( ! is_array($where)) - { - $dest = array($where); - } - else - { - $dest = array(); - foreach ($where as $key => $val) - { - $prefix = (count($dest) == 0) ? '' : ' AND '; - - if ($val != '') - { - if ( ! $this->_has_operator($key)) - { - $key .= ' ='; - } - - $val = ' '.$this->escape($val); - } - - $dest[] = $prefix.$key.$val; - } - } - - return $this->_update($this->dbprefix.$table, $fields, $dest); - } - - // -------------------------------------------------------------------- - - /** - * Enables a native PHP function to be run, using a platform agnostic wrapper. - * - * @access public - * @param string the function name - * @param mixed any parameters needed by the function - * @return mixed - */ - function call_function($function) - { - $driver = ($this->dbdriver == 'postgre') ? 'pg_' : $this->dbdriver.'_'; - - if (FALSE === strpos($driver, $function)) - { - $function = $driver.$function; - } - - if ( ! function_exists($function)) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - else - { - $args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null; - - return call_user_func_array($function, $args); - } - } - - // -------------------------------------------------------------------- - - /** - * Set Cache Directory Path - * - * @access public - * @param string the path to the cache directory - * @return void - */ - function cache_set_path($path = '') - { - $this->cachedir = $path; - } - - // -------------------------------------------------------------------- - - /** - * Enable Query Caching - * - * @access public - * @return void - */ - function cache_on() - { - $this->cache_on = TRUE; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Disable Query Caching - * - * @access public - * @return void - */ - function cache_off() - { - $this->cache_on = FALSE; - return FALSE; - } - - - // -------------------------------------------------------------------- - - /** - * Delete the cache files associated with a particular URI - * - * @access public - * @return void - */ - function cache_delete($segment_one = '', $segment_two = '') - { - if ( ! $this->_cache_init()) - { - return FALSE; - } - return $this->CACHE->delete($segment_one, $segment_two); - } - - // -------------------------------------------------------------------- - - /** - * Delete All cache files - * - * @access public - * @return void - */ - function cache_delete_all() - { - if ( ! $this->_cache_init()) - { - return FALSE; - } - - return $this->CACHE->delete_all(); - } - - // -------------------------------------------------------------------- - - /** - * Initialize the Cache Class - * - * @access private - * @return void - */ - function _cache_init() - { - if (is_object($this->CACHE) AND class_exists('CI_DB_Cache')) - { - return TRUE; - } - - if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) - { - return $this->cache_off(); - } - - $this->CACHE = new CI_DB_Cache; - return TRUE; - } - - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @return void - */ - function close() - { - if (is_resource($this->conn_id)) - { - $this->_close($this->conn_id); - } - $this->conn_id = FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Display an error message - * - * @access public - * @param string the error message - * @param string any "swap" values - * @param boolean whether to localize the message - * @return string sends the application/error_db.php template - */ - function display_error($error = '', $swap = '', $native = FALSE) - { - $LANG = new CI_Language(); - $LANG->load('db'); - - $heading = 'MySQL Error'; - - if ($native == TRUE) - { - $message = $error; - } - else - { - $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; - } - - if ( ! class_exists('CI_Exceptions')) - { - include(BASEPATH.'libraries/Exceptions'.EXT); - } - - $error = new CI_Exceptions(); - echo $error->show_error('An Error Was Encountered', $message, 'error_db'); - exit; - } - -} - +initialize($params); + log_message('debug', 'Database Driver Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Database Settings + * + * @access private Called by the constructor + * @param mixed + * @return void + */ + function initialize($params = '') + { + if (is_array($params)) + { + $defaults = array( + 'hostname' => '', + 'username' => '', + 'password' => '', + 'database' => '', + 'conn_id' => FALSE, + 'dbdriver' => 'mysql', + 'dbprefix' => '', + 'port' => '', + 'pconnect' => FALSE, + 'db_debug' => FALSE, + 'cachedir' => '', + 'cache_on' => FALSE + ); + + foreach ($defaults as $key => $val) + { + $this->$key = ( ! isset($params[$key])) ? $val : $params[$key]; + } + } + elseif (strpos($params, '://')) + { + if (FALSE === ($dsn = @parse_url($params))) + { + log_message('error', 'Invalid DB Connection String'); + + if ($this->db_debug) + { + return $this->display_error('db_invalid_connection_str'); + } + return FALSE; + } + + $this->hostname = ( ! isset($dsn['host'])) ? '' : rawurldecode($dsn['host']); + $this->username = ( ! isset($dsn['user'])) ? '' : rawurldecode($dsn['user']); + $this->password = ( ! isset($dsn['pass'])) ? '' : rawurldecode($dsn['pass']); + $this->database = ( ! isset($dsn['path'])) ? '' : rawurldecode(substr($dsn['path'], 1)); + } + + // If an existing DB connection resource is supplied + // there is no need to connect and select the database + if (is_resource($this->conn_id)) + { + return TRUE; + } + + // Connect to the database + $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); + + // No connection? Throw an error + if ( ! $this->conn_id) + { + log_message('error', 'Unable to connect to the database'); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_connect'); + } + return FALSE; + } + + // Select the database + if ($this->database != '') + { + if ( ! $this->db_select()) + { + log_message('error', 'Unable to select database: '.$this->database); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_select', $this->database); + } + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * The name of the platform in use (mysql, mssql, etc...) + * + * @access public + * @return string + */ + function platform() + { + return $this->dbdriver; + } + + // -------------------------------------------------------------------- + + /** + * Database Version Number. Returns a string containing the + * version of the database being used + * + * @access public + * @return string + */ + function version() + { + if (FALSE === ($sql = $this->_version())) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + if ($this->dbdriver == 'oci8') + { + return $sql; + } + + $query = $this->query($sql); + $row = $query->row(); + return $row->ver; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * Accepts an SQL string as input and returns a result object upon + * successful execution of a "read" type query. Returns boolean TRUE + * upon successful execution of a "write" type query. Returns boolean + * FALSE upon failure, and if the $db_debug variable is set to TRUE + * will raise an error. + * + * @access public + * @param string An SQL query string + * @param array An array of binding data + * @return mixed + */ + function query($sql, $binds = FALSE, $return_object = TRUE) + { + if ($sql == '') + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$sql); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } + + // Is query caching enabled? If the query is a "read type" + // we will load the caching class and return the previously + // cached query if it exists + if ($this->cache_on == TRUE AND stristr($sql, 'SELECT')) + { + if ($this->_cache_init()) + { + $this->load_rdriver(); + if (FALSE !== ($cache = $this->CACHE->read($sql))) + { + return $cache; + } + } + } + + // Compile binds if needed + if ($binds !== FALSE) + { + $sql = $this->compile_binds($sql, $binds); + } + + // Save the query for debugging + $this->queries[] = $sql; + + // Start the Query Timer + $time_start = list($sm, $ss) = explode(' ', microtime()); + + // Run the Query + if (FALSE === ($this->result_id = $this->simple_query($sql))) + { + // This will trigger a rollback if transactions are being used + $this->_trans_failure = TRUE; + + if ($this->db_debug) + { + log_message('error', 'Query error: '.$this->_error_message()); + return $this->display_error( + array( + 'Error Number: '.$this->_error_number(), + $this->_error_message(), + $sql + ) + ); + } + + return FALSE; + } + + // Stop and aggregate the query time results + $time_end = list($em, $es) = explode(' ', microtime()); + $this->benchmark += ($em + $es) - ($sm + $ss); + + // Increment the query counter + $this->query_count++; + + // Was the query a "write" type? + // If so we'll simply return true + if ($this->is_write_type($sql) === TRUE) + { + // If caching is enabled we'll auto-cleanup any + // existing files related to this particular URI + if ($this->cache_on == TRUE AND $this->cache_autodel == TRUE AND $this->_cache_init()) + { + $this->CACHE->delete(); + } + + return TRUE; + } + + // Return TRUE if we don't need to create a result object + // Currently only the Oracle driver uses this when stored + // procedures are used + if ($return_object !== TRUE) + { + return TRUE; + } + + // Load and instantiate the result driver + + $driver = $this->load_rdriver(); + $RES = new $driver(); + $RES->conn_id = $this->conn_id; + $RES->result_id = $this->result_id; + + if ($this->dbdriver == 'oci8') + { + $RES->stmt_id = $this->stmt_id; + $RES->curs_id = NULL; + $RES->limit_used = $this->limit_used; + } + + // Is query caching enabled? If so, we'll serialize the + // result object and save it to a cache file. + if ($this->cache_on == TRUE AND $this->_cache_init()) + { + // We'll create a new instance of the result object + // only without the platform specific driver since + // we can't use it with cached data (the query result + // resource ID won't be any good once we've cached the + // result object, so we'll have to compile the data + // and save it) + $CR = new CI_DB_result(); + $CR->num_rows = $RES->num_rows(); + $CR->result_object = $RES->result_object(); + $CR->result_array = $RES->result_array(); + + // Reset these since cached objects can not utilize resource IDs. + $CR->conn_id = NULL; + $CR->result_id = NULL; + + $this->CACHE->write($sql, $CR); + } + + return $RES; + } + + // -------------------------------------------------------------------- + + /** + * Load the result drivers + * + * @access public + * @return string the name of the result class + */ + function load_rdriver() + { + $driver = 'CI_DB_'.$this->dbdriver.'_result'; + + if ( ! class_exists($driver)) + { + include_once(BASEPATH.'database/DB_result'.EXT); + include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + } + + return $driver; + } + + // -------------------------------------------------------------------- + + /** + * Simple Query + * This is a simplified version of the query() function. Internally + * we only use it when running transaction commands since they do + * not require all the features of the main query() function. + * + * @access public + * @param string the sql query + * @return mixed + */ + function simple_query($sql) + { + if ( ! $this->conn_id) + { + $this->initialize(); + } + + return $this->_execute($sql); + } + + // -------------------------------------------------------------------- + + /** + * Disable Transactions + * This permits transactions to be disabled at run-time. + * + * @access public + * @return void + */ + function trans_off() + { + $this->trans_enabled = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Start Transaction + * + * @access public + * @return void + */ + function trans_start($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return FALSE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + $this->_trans_depth += 1; + return; + } + + $this->trans_begin($test_mode); + } + + // -------------------------------------------------------------------- + + /** + * Complete Transaction + * + * @access public + * @return bool + */ + function trans_complete() + { + if ( ! $this->trans_enabled) + { + return FALSE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 1) + { + $this->_trans_depth -= 1; + return TRUE; + } + + // The query() function will set this flag to TRUE in the event that a query failed + if ($this->_trans_failure === TRUE) + { + $this->trans_rollback(); + + if ($this->db_debug) + { + return $this->display_error('db_transaction_failure'); + } + return FALSE; + } + + $this->trans_commit(); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Lets you retrieve the transaction flag to determine if it has failed + * + * @access public + * @return bool + */ + function trans_status() + { + return $this->_trans_failure; + } + + // -------------------------------------------------------------------- + + /** + * Compile Bindings + * + * @access public + * @param string the sql statement + * @param array an array of bind data + * @return string + */ + function compile_binds($sql, $binds) + { + if (FALSE === strpos($sql, $this->bind_marker)) + { + return $sql; + } + + if ( ! is_array($binds)) + { + $binds = array($binds); + } + + foreach ($binds as $val) + { + $val = $this->escape($val); + + // Just in case the replacement string contains the bind + // character we'll temporarily replace it with a marker + $val = str_replace($this->bind_marker, '{%bind_marker%}', $val); + $sql = preg_replace("#".preg_quote($this->bind_marker, '#')."#", str_replace('$', '\$', $val), $sql, 1); + } + + return str_replace('{%bind_marker%}', $this->bind_marker, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Determines if a query is a "write" type. + * + * @access public + * @param string An SQL query string + * @return boolean + */ + function is_write_type($sql) + { + if ( ! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) + { + return FALSE; + } + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Calculate the aggregate query elapsed time + * + * @access public + * @param integer The number of decimal places + * @return integer + */ + function elapsed_time($decimals = 6) + { + return number_format($this->benchmark, $decimals); + } + + // -------------------------------------------------------------------- + + /** + * Returns the total number of queries + * + * @access public + * @return integer + */ + function total_queries() + { + return $this->query_count; + } + + // -------------------------------------------------------------------- + + /** + * Returns the last query that was executed + * + * @access public + * @return void + */ + function last_query() + { + return end($this->queries); + } + + // -------------------------------------------------------------------- + + /** + * "Smart" Escape String + * + * Escapes data based on type + * Sets boolean and null types + * + * @access public + * @param string + * @return integer + */ + function escape($str) + { + switch (gettype($str)) + { + case 'string' : $str = "'".$this->escape_str($str)."'"; + break; + case 'boolean' : $str = ($str === FALSE) ? 0 : 1; + break; + default : $str = ($str === NULL) ? 'NULL' : $str; + break; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Primary + * + * Retrieves the primary key. It assumes that the row in the first + * position is the primary key + * + * @access public + * @param string the table name + * @return string + */ + function primary($table = '') + { + $fields = $this->list_fields($table); + + if ( ! is_array($fields)) + { + return FALSE; + } + + return current($fields); + } + + // -------------------------------------------------------------------- + + /** + * Returns an array of table names + * + * @access public + * @return array + */ + function list_tables() + { + // Is there a cached result? + if (isset($this->data_cache['table_names'])) + { + return $this->data_cache['table_names']; + } + + if (FALSE === ($sql = $this->_list_tables())) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $retval = array(); + $query = $this->query($sql); + + if ($query->num_rows() > 0) + { + foreach($query->result_array() as $row) + { + if (isset($row['TABLE_NAME'])) + { + $retval[] = $row['TABLE_NAME']; + } + else + { + $retval[] = array_shift($row); + } + } + } + + $this->data_cache['table_names'] = $retval; + return $this->data_cache['table_names']; + } + + // -------------------------------------------------------------------- + + /** + * Determine if a particular table exists + * @access public + * @return boolean + */ + function table_exists($table_name) + { + return ( ! in_array($this->dbprefix.$table_name, $this->list_tables())) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch MySQL Field Names + * + * @access public + * @param string the table name + * @return array + */ + function list_fields($table = '') + { + // Is there a cached result? + if (isset($this->data_cache['field_names'][$table])) + { + return $this->data_cache['field_names'][$table]; + } + + if ($table == '') + { + if ($this->db_debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + if (FALSE === ($sql = $this->_list_columns($this->dbprefix.$table))) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $query = $this->query($sql); + + $retval = array(); + foreach($query->result_array() as $row) + { + if (isset($row['COLUMN_NAME'])) + { + $retval[] = $row['COLUMN_NAME']; + } + else + { + $retval[] = current($row); + } + } + + $this->data_cache['field_names'][$table] = $retval; + return $this->data_cache['field_names'][$table]; + } + + // -------------------------------------------------------------------- + + /** + * Determine if a particular field exists + * @access public + * @param string + * @param string + * @return boolean + */ + function field_exists($field_name, $table_name) + { + return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * DEPRECATED - use list_fields() + */ + function field_names($table = '') + { + return $this->list_fields($table); + } + + // -------------------------------------------------------------------- + + /** + * Returns an object with field data + * + * @access public + * @param string the table name + * @return object + */ + function field_data($table = '') + { + if ($table == '') + { + if ($this->db_debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + $query = $this->query($this->_field_data($this->dbprefix.$table)); + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Generate an insert string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @return string + */ + function insert_string($table, $data) + { + $fields = array(); + $values = array(); + + foreach($data as $key => $val) + { + $fields[] = $key; + $values[] = $this->escape($val); + } + + return $this->_insert($this->dbprefix.$table, $fields, $values); + } + + // -------------------------------------------------------------------- + + /** + * Generate an update string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @param mixed the "where" statement + * @return string + */ + function update_string($table, $data, $where) + { + if ($where == '') + return false; + + $fields = array(); + foreach($data as $key => $val) + { + $fields[$key] = $this->escape($val); + } + + if ( ! is_array($where)) + { + $dest = array($where); + } + else + { + $dest = array(); + foreach ($where as $key => $val) + { + $prefix = (count($dest) == 0) ? '' : ' AND '; + + if ($val != '') + { + if ( ! $this->_has_operator($key)) + { + $key .= ' ='; + } + + $val = ' '.$this->escape($val); + } + + $dest[] = $prefix.$key.$val; + } + } + + return $this->_update($this->dbprefix.$table, $fields, $dest); + } + + // -------------------------------------------------------------------- + + /** + * Enables a native PHP function to be run, using a platform agnostic wrapper. + * + * @access public + * @param string the function name + * @param mixed any parameters needed by the function + * @return mixed + */ + function call_function($function) + { + $driver = ($this->dbdriver == 'postgre') ? 'pg_' : $this->dbdriver.'_'; + + if (FALSE === strpos($driver, $function)) + { + $function = $driver.$function; + } + + if ( ! function_exists($function)) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + else + { + $args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null; + + return call_user_func_array($function, $args); + } + } + + // -------------------------------------------------------------------- + + /** + * Set Cache Directory Path + * + * @access public + * @param string the path to the cache directory + * @return void + */ + function cache_set_path($path = '') + { + $this->cachedir = $path; + } + + // -------------------------------------------------------------------- + + /** + * Enable Query Caching + * + * @access public + * @return void + */ + function cache_on() + { + $this->cache_on = TRUE; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Disable Query Caching + * + * @access public + * @return void + */ + function cache_off() + { + $this->cache_on = FALSE; + return FALSE; + } + + + // -------------------------------------------------------------------- + + /** + * Delete the cache files associated with a particular URI + * + * @access public + * @return void + */ + function cache_delete($segment_one = '', $segment_two = '') + { + if ( ! $this->_cache_init()) + { + return FALSE; + } + return $this->CACHE->delete($segment_one, $segment_two); + } + + // -------------------------------------------------------------------- + + /** + * Delete All cache files + * + * @access public + * @return void + */ + function cache_delete_all() + { + if ( ! $this->_cache_init()) + { + return FALSE; + } + + return $this->CACHE->delete_all(); + } + + // -------------------------------------------------------------------- + + /** + * Initialize the Cache Class + * + * @access private + * @return void + */ + function _cache_init() + { + if (is_object($this->CACHE) AND class_exists('CI_DB_Cache')) + { + return TRUE; + } + + if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) + { + return $this->cache_off(); + } + + $this->CACHE = new CI_DB_Cache; + return TRUE; + } + + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @return void + */ + function close() + { + if (is_resource($this->conn_id)) + { + $this->_close($this->conn_id); + } + $this->conn_id = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Display an error message + * + * @access public + * @param string the error message + * @param string any "swap" values + * @param boolean whether to localize the message + * @return string sends the application/error_db.php template + */ + function display_error($error = '', $swap = '', $native = FALSE) + { + $LANG = new CI_Language(); + $LANG->load('db'); + + $heading = 'MySQL Error'; + + if ($native == TRUE) + { + $message = $error; + } + else + { + $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; + } + + if ( ! class_exists('CI_Exceptions')) + { + include(BASEPATH.'libraries/Exceptions'.EXT); + } + + $error = new CI_Exceptions(); + echo $error->show_error('An Error Was Encountered', $message, 'error_db'); + exit; + } + +} + ?> \ No newline at end of file diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 9784561d..7d85ebb9 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -1,290 +1,290 @@ -result_object() : $this->result_array(); - } - - // -------------------------------------------------------------------- - - /** - * Query result. "object" version. - * - * @access public - * @return object - */ - function result_object() - { - if (count($this->result_object) > 0) - { - return $this->result_object; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - $this->_data_seek(0); - while ($row = $this->_fetch_object()) - { - $this->result_object[] = $row; - } - - return $this->result_object; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @access public - * @return array - */ - function result_array() - { - if (count($this->result_array) > 0) - { - return $this->result_array; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - $this->_data_seek(0); - while ($row = $this->_fetch_assoc()) - { - $this->result_array[] = $row; - } - - return $this->result_array; - } - - // -------------------------------------------------------------------- - - /** - * Query result. Acts as a wrapper function for the following functions. - * - * @access public - * @param string can be "object" or "array" - * @return mixed either a result object or array - */ - function row($n = 0, $type = 'object') - { - return ($type == 'object') ? $this->row_object($n) : $this->row_array($n); - } - - // -------------------------------------------------------------------- - - /** - * Returns a single result row - object version - * - * @access public - * @return object - */ - function row_object($n = 0) - { - $result = $this->result_object(); - - if (count($result) == 0) - { - return $result; - } - - if ($n != $this->current_row AND isset($result[$n])) - { - $this->current_row = $n; - } - - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * Returns a single result row - array version - * - * @access public - * @return array - */ - function row_array($n = 0) - { - $result = $this->result_array(); - - if (count($result) == 0) - { - return $result; - } - - if ($n != $this->current_row AND isset($result[$n])) - { - $this->current_row = $n; - } - - return $result[$this->current_row]; - } - - - // -------------------------------------------------------------------- - - /** - * Returns the "first" row - * - * @access public - * @return object - */ - function first_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - return $result[0]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "last" row - * - * @access public - * @return object - */ - function last_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - return $result[count($result) -1]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "next" row - * - * @access public - * @return object - */ - function next_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - - if (isset($result[$this->current_row + 1])) - { - ++$this->current_row; - } - - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "previous" row - * - * @access public - * @return object - */ - function previous_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - - if (isset($result[$this->current_row - 1])) - { - --$this->current_row; - } - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * The following functions are normally overloaded by the identically named - * methods in the platform-specific driver -- except when query caching - * is used. When caching is enabled we do not load the other driver. - * These functions are primarily here to prevent undefined function errors - * when a cached result object is in use. They are not otherwise fully - * 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_names() { return array(); } // Deprecated - 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(); } - -} -// END DB_result class +result_object() : $this->result_array(); + } + + // -------------------------------------------------------------------- + + /** + * Query result. "object" version. + * + * @access public + * @return object + */ + function result_object() + { + if (count($this->result_object) > 0) + { + return $this->result_object; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + $this->_data_seek(0); + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + + return $this->result_object; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + $this->_data_seek(0); + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } + + // -------------------------------------------------------------------- + + /** + * Query result. Acts as a wrapper function for the following functions. + * + * @access public + * @param string can be "object" or "array" + * @return mixed either a result object or array + */ + function row($n = 0, $type = 'object') + { + return ($type == 'object') ? $this->row_object($n) : $this->row_array($n); + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - object version + * + * @access public + * @return object + */ + function row_object($n = 0) + { + $result = $this->result_object(); + + if (count($result) == 0) + { + return $result; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - array version + * + * @access public + * @return array + */ + function row_array($n = 0) + { + $result = $this->result_array(); + + if (count($result) == 0) + { + return $result; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + + // -------------------------------------------------------------------- + + /** + * Returns the "first" row + * + * @access public + * @return object + */ + function first_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + return $result[0]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "last" row + * + * @access public + * @return object + */ + function last_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + return $result[count($result) -1]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "next" row + * + * @access public + * @return object + */ + function next_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + + if (isset($result[$this->current_row + 1])) + { + ++$this->current_row; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "previous" row + * + * @access public + * @return object + */ + function previous_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + + if (isset($result[$this->current_row - 1])) + { + --$this->current_row; + } + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * The following functions are normally overloaded by the identically named + * methods in the platform-specific driver -- except when query caching + * is used. When caching is enabled we do not load the other driver. + * These functions are primarily here to prevent undefined function errors + * when a cached result object is in use. They are not otherwise fully + * 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_names() { return array(); } // Deprecated + 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(); } + +} +// END DB_result class ?> \ No newline at end of file diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 9533ec60..d48425d7 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,455 +1,455 @@ -db - $CI =& get_instance(); - $this->db =& $CI->db; - - log_message('debug', "Database Utility Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function create_database($db_name) - { - $sql = $this->_create_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access public - * @param string the database name - * @return bool - */ - function drop_database($db_name) - { - $sql = $this->_drop_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access public - * @return bool - */ - function list_databases() - { - // Is there a cached result? - if (isset($this->data_cache['db_names'])) - { - return $this->data_cache['db_names']; - } - - $query = $this->db->query($this->_list_databases()); - $dbs = array(); - if ($query->num_rows() > 0) - { - foreach ($query->result_array() as $row) - { - $dbs[] = current($row); - } - } - - $this->data_cache['db_names'] = $dbs; - return $this->data_cache['db_names']; - } - - // -------------------------------------------------------------------- - - /** - * Optimize Table - * - * @access public - * @param string the table name - * @return bool - */ - function optimize_table($table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - $res = $query->result_array(); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Optimize Database - * - * @access public - * @return array - */ - function optimize_database() - { - $result = array(); - foreach ($this->db->list_tables() as $table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Build the result array... - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - $res = current($res); - $key = str_replace($this->db->database.'.', '', current($res)); - $keys = array_keys($res); - unset($res[$keys[0]]); - - $result[$key] = $res; - } - - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Optimize Table - * - * @access public - * @param string the table name - * @return bool - */ - - function repair_table($table_name) - { - $sql = $this->_repair_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access public - * @param string the table name - * @return bool - */ - function drop_table($table_name) - { - $sql = $this->_drop_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Generate CSV from a query result object - * - * @access public - * @param object The query result object - * @param string The delimiter - tab by default - * @param string The newline character - \n by default - * @return string - */ - function csv_from_result($query, $delim = "\t", $newline = "\n") - { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } - - $out = ''; - - // First generate the headings from the table column names - foreach ($query->list_fields() as $name) - { - $out .= $name.$delim; - } - - $out = rtrim($out); - $out .= $newline; - - // Next blast through the result array and build out the rows - foreach ($query->result_array() as $row) - { - foreach ($row as $item) - { - $out .= $item.$delim; - } - $out = rtrim($out); - $out .= $newline; - } - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Generate XML data from a query result object - * - * @access public - * @param object The query result object - * @param array Any preferences - * @return string - */ - function xml_from_result($query, $params = array()) - { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } - - // Set our default values - foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) - { - if ( ! isset($params[$key])) - { - $params[$key] = $val; - } - } - - // Create variables for convenience - extract($params); - - // Load the xml helper - $CI =& get_instance(); - $CI->load->helper('xml'); - - // Generate the result - $xml = "<{$root}>".$newline; - foreach ($query->result_array() as $row) - { - $xml .= $tab."<{$element}>".$newline; - - foreach ($row as $key => $val) - { - $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; - } - $xml .= $tab."".$newline; - } - $xml .= "".$newline; - - return $xml; - } - - // -------------------------------------------------------------------- - - /** - * Database Backup - * - * @access public - * @return void - */ - function backup($params = array()) - { - // If the parameters have not been submitted as an - // array then we know that it is simply the table - // name, which is a valid short cut. - if (is_string($params)) - { - $params = array('tables' => $params); - } - - // ------------------------------------------------------ - - // Set up our default preferences - $prefs = array( - 'tables' => array(), - 'ignore' => array(), - 'filename' => '', - 'format' => 'gzip', // gzip, zip, txt - 'add_drop' => TRUE, - 'add_insert' => TRUE, - 'newline' => "\n" - ); - - // Did the user submit any preferences? If so set them.... - if (count($params) > 0) - { - foreach ($prefs as $key => $val) - { - if (isset($params[$key])) - { - $prefs[$key] = $params[$key]; - } - } - } - - // ------------------------------------------------------ - - // Are we backing up a complete database or individual tables? - // If no table names were submitted we'll fetch the entire table list - if (count($prefs['tables']) == 0) - { - $prefs['tables'] = $this->db->list_tables(); - } - - // ------------------------------------------------------ - - // Validate the format - if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) - { - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Is the encoder supported? If not, we'll either issue an - // error or use plain text depending on the debug settings - if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) - OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_compression'); - } - - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Set the filename if not provided - Only needed with Zip files - if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') - { - $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; - $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); - } - - // ------------------------------------------------------ - - // Was a Gzip file requested? - if ($prefs['format'] == 'gzip') - { - return gzencode($this->_backup($prefs)); - } - - // ------------------------------------------------------ - - // Was a text file requested? - if ($prefs['format'] == 'txt') - { - return $this->_backup($prefs); - } - - // ------------------------------------------------------ - - // Was a Zip file requested? - if ($prefs['format'] == 'zip') - { - // If they included the .zip file extension we'll remove it - if (preg_match("|.+?\.zip$|", $prefs['filename'])) - { - $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); - } - - // Tack on the ".sql" file extension if needed - if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) - { - $prefs['filename'] .= '.sql'; - } - - // Load the Zip class and output it - - $CI =& get_instance(); - $CI->load->library('zip'); - $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); - return $CI->zip->get_zip(); - } - - } - - - - - - -} - +db + $CI =& get_instance(); + $this->db =& $CI->db; + + log_message('debug', "Database Utility Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Create database + * + * @access public + * @param string the database name + * @return bool + */ + function create_database($db_name) + { + $sql = $this->_create_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access public + * @param string the database name + * @return bool + */ + function drop_database($db_name) + { + $sql = $this->_drop_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access public + * @return bool + */ + function list_databases() + { + // Is there a cached result? + if (isset($this->data_cache['db_names'])) + { + return $this->data_cache['db_names']; + } + + $query = $this->db->query($this->_list_databases()); + $dbs = array(); + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $dbs[] = current($row); + } + } + + $this->data_cache['db_names'] = $dbs; + return $this->data_cache['db_names']; + } + + // -------------------------------------------------------------------- + + /** + * Optimize Table + * + * @access public + * @param string the table name + * @return bool + */ + function optimize_table($table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + $res = $query->result_array(); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Optimize Database + * + * @access public + * @return array + */ + function optimize_database() + { + $result = array(); + foreach ($this->db->list_tables() as $table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Build the result array... + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + $res = current($res); + $key = str_replace($this->db->database.'.', '', current($res)); + $keys = array_keys($res); + unset($res[$keys[0]]); + + $result[$key] = $res; + } + + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Optimize Table + * + * @access public + * @param string the table name + * @return bool + */ + + function repair_table($table_name) + { + $sql = $this->_repair_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access public + * @param string the table name + * @return bool + */ + function drop_table($table_name) + { + $sql = $this->_drop_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Generate CSV from a query result object + * + * @access public + * @param object The query result object + * @param string The delimiter - tab by default + * @param string The newline character - \n by default + * @return string + */ + function csv_from_result($query, $delim = "\t", $newline = "\n") + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + $out = ''; + + // First generate the headings from the table column names + foreach ($query->list_fields() as $name) + { + $out .= $name.$delim; + } + + $out = rtrim($out); + $out .= $newline; + + // Next blast through the result array and build out the rows + foreach ($query->result_array() as $row) + { + foreach ($row as $item) + { + $out .= $item.$delim; + } + $out = rtrim($out); + $out .= $newline; + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Generate XML data from a query result object + * + * @access public + * @param object The query result object + * @param array Any preferences + * @return string + */ + function xml_from_result($query, $params = array()) + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + // Set our default values + foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) + { + if ( ! isset($params[$key])) + { + $params[$key] = $val; + } + } + + // Create variables for convenience + extract($params); + + // Load the xml helper + $CI =& get_instance(); + $CI->load->helper('xml'); + + // Generate the result + $xml = "<{$root}>".$newline; + foreach ($query->result_array() as $row) + { + $xml .= $tab."<{$element}>".$newline; + + foreach ($row as $key => $val) + { + $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; + } + $xml .= $tab."".$newline; + } + $xml .= "".$newline; + + return $xml; + } + + // -------------------------------------------------------------------- + + /** + * Database Backup + * + * @access public + * @return void + */ + function backup($params = array()) + { + // If the parameters have not been submitted as an + // array then we know that it is simply the table + // name, which is a valid short cut. + if (is_string($params)) + { + $params = array('tables' => $params); + } + + // ------------------------------------------------------ + + // Set up our default preferences + $prefs = array( + 'tables' => array(), + 'ignore' => array(), + 'filename' => '', + 'format' => 'gzip', // gzip, zip, txt + 'add_drop' => TRUE, + 'add_insert' => TRUE, + 'newline' => "\n" + ); + + // Did the user submit any preferences? If so set them.... + if (count($params) > 0) + { + foreach ($prefs as $key => $val) + { + if (isset($params[$key])) + { + $prefs[$key] = $params[$key]; + } + } + } + + // ------------------------------------------------------ + + // Are we backing up a complete database or individual tables? + // If no table names were submitted we'll fetch the entire table list + if (count($prefs['tables']) == 0) + { + $prefs['tables'] = $this->db->list_tables(); + } + + // ------------------------------------------------------ + + // Validate the format + if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) + { + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Is the encoder supported? If not, we'll either issue an + // error or use plain text depending on the debug settings + if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) + OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_compression'); + } + + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Set the filename if not provided - Only needed with Zip files + if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') + { + $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; + $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); + } + + // ------------------------------------------------------ + + // Was a Gzip file requested? + if ($prefs['format'] == 'gzip') + { + return gzencode($this->_backup($prefs)); + } + + // ------------------------------------------------------ + + // Was a text file requested? + if ($prefs['format'] == 'txt') + { + return $this->_backup($prefs); + } + + // ------------------------------------------------------ + + // Was a Zip file requested? + if ($prefs['format'] == 'zip') + { + // If they included the .zip file extension we'll remove it + if (preg_match("|.+?\.zip$|", $prefs['filename'])) + { + $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); + } + + // Tack on the ".sql" file extension if needed + if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) + { + $prefs['filename'] .= '.sql'; + } + + // Load the Zip class and output it + + $CI =& get_instance(); + $CI->load->library('zip'); + $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); + return $CI->zip->get_zip(); + } + + } + + + + + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 47cfa6bb..ef66e3f3 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -1,458 +1,458 @@ -hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @mssql_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return @mssql_select_db($this->database, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @mssql_query($sql, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('BEGIN TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - // Escape single quotes - return str_replace("'", "''", $str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mssql_rows_affected($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - // Not supported in MS SQL? - return 0; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; - } - - // -------------------------------------------------------------------- - - /** - * List column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access private - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->_escape_table($table)."'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT TOP 1 * FROM ".$this->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - // Are errros even supported in MS SQL? - return ''; - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - // Are error numbers supported? - return ''; - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - // I don't believe this is necessary with MS SQL. Not sure, though. - Rick - - /* - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - */ - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $i = $limit + $offset; - - return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mssql_close($conn_id); - } - -} - - +hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @mssql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mssql_select_db($this->database, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @mssql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('BEGIN TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // Escape single quotes + return str_replace("'", "''", $str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mssql_rows_affected($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + // Not supported in MS SQL? + return 0; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; + } + + // -------------------------------------------------------------------- + + /** + * List column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access private + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->_escape_table($table)."'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT TOP 1 * FROM ".$this->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + // Are errros even supported in MS SQL? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + // Are error numbers supported? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + // I don't believe this is necessary with MS SQL. Not sure, though. - Rick + + /* + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + */ + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $i = $limit + $offset; + + return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mssql_close($conn_id); + } + +} + + ?> \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index eb7afef7..eb471e4b 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -1,173 +1,173 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mssql_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mssql_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mssql_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->max_length = $field->max_length; - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - mssql_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mssql_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mssql_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mssql_fetch_object($this->result_id); - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mssql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->max_length = $field->max_length; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mssql_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mssql_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mssql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mssql_fetch_object($this->result_id); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index b2464612..7f4e7308 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -1,130 +1,130 @@ -db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access private - * @return bool - */ - function _list_databases() - { - return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return FALSE; // Is this supported in MS SQL? - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return FALSE; // Is this supported in MS SQL? - } - - // -------------------------------------------------------------------- - - /** - * MSSQL Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - - -} - +db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access private + * @return bool + */ + function _list_databases() + { + return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return FALSE; // Is this supported in MS SQL? + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return FALSE; // Is this supported in MS SQL? + } + + // -------------------------------------------------------------------- + + /** + * MSSQL Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 2104b9ab..367c2d11 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -1,492 +1,492 @@ -hostname, $this->username, $this->password, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @mysql_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return @mysql_select_db($this->database, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @mysql_query($sql, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies - // the query so that it returns the number of affected rows - if ($this->delete_hack === TRUE) - { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) - { - $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('SET AUTOCOMMIT=0'); - $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - if (get_magic_quotes_gpc()) - { - return $str; - } - - if (function_exists('mysql_real_escape_string')) - { - return mysql_real_escape_string($str, $this->conn_id); - } - elseif (function_exists('mysql_escape_string')) - { - return mysql_escape_string($str); - } - else - { - return addslashes($str); - } - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mysql_affected_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @mysql_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SHOW TABLES FROM `".$this->database."`"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$this->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return mysql_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return mysql_errno($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - if ($offset == 0) - { - $offset = ''; - } - else - { - $offset .= ", "; - } - - return $sql."LIMIT ".$offset.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mysql_close($conn_id); - } - -} - +hostname, $this->username, $this->password, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @mysql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysql_select_db($this->database, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @mysql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('SET AUTOCOMMIT=0'); + $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + return $str; + } + + if (function_exists('mysql_real_escape_string')) + { + return mysql_real_escape_string($str, $this->conn_id); + } + elseif (function_exists('mysql_escape_string')) + { + return mysql_escape_string($str); + } + else + { + return addslashes($str); + } + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysql_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysql_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return mysql_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return mysql_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mysql_close($conn_id); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 9b28dead..7dcd5cb0 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -1,173 +1,173 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mysql_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mysql_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mysql_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->default = $field->def; - $F->max_length = $field->max_length; - $F->primary_key = $field->primary_key; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - mysql_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mysql_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mysql_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mysql_fetch_object($this->result_id); - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mysql_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysql_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = $field->primary_key; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mysql_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mysql_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysql_fetch_object($this->result_id); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 32007d22..b357f47d 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -1,244 +1,244 @@ -db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return "OPTIMIZE TABLE ".$this->db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return "REPAIR TABLE ".$this->db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * MySQL Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - if (count($params) == 0) - { - return FALSE; - } - - // Extract the prefs for simplicity - extract($params); - - // Build the output - $output = ''; - foreach ((array)$tables as $table) - { - // Is the table in the "ignore" list? - if (in_array($table, (array)$ignore, TRUE)) - { - continue; - } - - // Get the table schema - $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); - - // No result means the table name was invalid - if ($query === FALSE) - { - continue; - } - - // Write out the table schema - $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - - if ($add_drop == TRUE) - { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; - } - - $i = 0; - $result = $query->result_array(); - foreach ($result[0] as $val) - { - if ($i++ % 2) - { - $output .= $val.';'.$newline.$newline; - } - } - - // If inserts are not needed we're done... - if ($add_insert == FALSE) - { - continue; - } - - // Grab all the data from the current table - $query = $this->db->query("SELECT * FROM $table"); - - if ($query->num_rows() == 0) - { - continue; - } - - // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to - // surround the data with quotes or not - - $i = 0; - $field_str = ''; - $is_int = array(); - while ($field = mysql_fetch_field($query->result_id)) - { - $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), - TRUE) - ) ? TRUE : FALSE; - - // Create a string of field names - $field_str .= $field->name.', '; - $i++; - } - - // Trim off the end comma - $field_str = preg_replace( "/, $/" , "" , $field_str); - - - // Build the insert string - foreach ($query->result_array() as $row) - { - $val_str = ''; - - $i = 0; - foreach ($row as $v) - { - // Do a little formatting... - $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); - $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); - $v = str_replace('\\', '\\\\', $v); - $v = str_replace('\'', '\\\'', $v); - $v = str_replace('\\\n', '\n', $v); - $v = str_replace('\\\r', '\r', $v); - $v = str_replace('\\\t', '\t', $v); - - // Escape the data if it's not an integer type - $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; - $val_str .= ', '; - - $i++; - } - - $val_str = preg_replace( "/, $/" , "" , $val_str); - - // Build the INSERT string - $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; - } - - $output .= $newline.$newline; - } - - return $output; - } - - -} - +db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return "OPTIMIZE TABLE ".$this->db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return "REPAIR TABLE ".$this->db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * MySQL Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + if (count($params) == 0) + { + return FALSE; + } + + // Extract the prefs for simplicity + extract($params); + + // Build the output + $output = ''; + foreach ((array)$tables as $table) + { + // Is the table in the "ignore" list? + if (in_array($table, (array)$ignore, TRUE)) + { + continue; + } + + // Get the table schema + $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); + + // No result means the table name was invalid + if ($query === FALSE) + { + continue; + } + + // Write out the table schema + $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; + + if ($add_drop == TRUE) + { + $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + } + + $i = 0; + $result = $query->result_array(); + foreach ($result[0] as $val) + { + if ($i++ % 2) + { + $output .= $val.';'.$newline.$newline; + } + } + + // If inserts are not needed we're done... + if ($add_insert == FALSE) + { + continue; + } + + // Grab all the data from the current table + $query = $this->db->query("SELECT * FROM $table"); + + if ($query->num_rows() == 0) + { + continue; + } + + // Fetch the field names and determine if the field is an + // integer type. We use this info to decide whether to + // surround the data with quotes or not + + $i = 0; + $field_str = ''; + $is_int = array(); + while ($field = mysql_fetch_field($query->result_id)) + { + $is_int[$i] = (in_array( + strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), + TRUE) + ) ? TRUE : FALSE; + + // Create a string of field names + $field_str .= $field->name.', '; + $i++; + } + + // Trim off the end comma + $field_str = preg_replace( "/, $/" , "" , $field_str); + + + // Build the insert string + foreach ($query->result_array() as $row) + { + $val_str = ''; + + $i = 0; + foreach ($row as $v) + { + // Do a little formatting... + $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); + $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); + $v = str_replace('\\', '\\\\', $v); + $v = str_replace('\'', '\\\'', $v); + $v = str_replace('\\\n', '\n', $v); + $v = str_replace('\\\r', '\r', $v); + $v = str_replace('\\\t', '\t', $v); + + // Escape the data if it's not an integer type + $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; + $val_str .= ', '; + + $i++; + } + + $val_str = preg_replace( "/, $/" , "" , $val_str); + + // Build the INSERT string + $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; + } + + $output .= $newline.$newline; + } + + return $output; + } + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index f8d3acf2..98e7f6c7 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -1,483 +1,483 @@ -hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return $this->db_connect(); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return @mysqli_select_db($this->conn_id, $this->database); - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - $result = @mysqli_query($this->conn_id, $sql); - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies - // the query so that it returns the number of affected rows - if ($this->delete_hack === TRUE) - { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) - { - $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('SET AUTOCOMMIT=0'); - $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - if (get_magic_quotes_gpc()) - { - return $str; - } - - return mysqli_real_escape_string($this->conn_id, $str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mysqli_affected_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @mysqli_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SHOW TABLES FROM `".$this->database."`"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$this->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return mysqli_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return mysqli_errno($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $sql .= "LIMIT ".$limit; - - if ($offset > 0) - { - $sql .= " OFFSET ".$offset; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mysqli_close($conn_id); - } - - -} - +hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return $this->db_connect(); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysqli_select_db($this->conn_id, $this->database); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + $result = @mysqli_query($this->conn_id, $sql); + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('SET AUTOCOMMIT=0'); + $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (get_magic_quotes_gpc()) + { + return $str; + } + + return mysqli_real_escape_string($this->conn_id, $str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysqli_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysqli_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SHOW TABLES FROM `".$this->database."`"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return mysqli_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return mysqli_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mysqli_close($conn_id); + } + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 57c89ea8..0f2eb534 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -1,173 +1,173 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mysqli_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mysqli_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mysqli_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->default = $field->def; - $F->max_length = $field->max_length; - $F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - mysqli_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mysqli_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mysqli_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mysqli_fetch_object($this->result_id); - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysqli_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mysqli_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysqli_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mysqli_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mysqli_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysqli_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysqli_fetch_object($this->result_id); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index d5dbf2fb..3e2b8da6 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -1,245 +1,245 @@ -db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access private - * @return bool - */ - function _list_databases() - { - return "SHOW DATABASES"; - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return "OPTIMIZE TABLE ".$this->db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return "REPAIR TABLE ".$this->db->_escape_table($table); - } - - // -------------------------------------------------------------------- - - /** - * MySQLi Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - if (count($params) == 0) - { - return FALSE; - } - - // Extract the prefs for simplicity - extract($params); - - // Build the output - $output = ''; - foreach ((array)$tables as $table) - { - // Is the table in the "ignore" list? - if (in_array($table, (array)$ignore, TRUE)) - { - continue; - } - - // Get the table schema - $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); - - // No result means the table name was invalid - if ($query === FALSE) - { - continue; - } - - // Write out the table schema - $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - - if ($add_drop == TRUE) - { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; - } - - $i = 0; - $result = $query->result_array(); - foreach ($result[0] as $val) - { - if ($i++ % 2) - { - $output .= $val.';'.$newline.$newline; - } - } - - // If inserts are not needed we're done... - if ($add_insert == FALSE) - { - continue; - } - - // Grab all the data from the current table - $query = $this->db->query("SELECT * FROM $table"); - - if ($query->num_rows() == 0) - { - continue; - } - - // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to - // surround the data with quotes or not - - $i = 0; - $field_str = ''; - $is_int = array(); - while ($field = mysqli_fetch_field($query->result_id)) - { - $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), - TRUE) - ) ? TRUE : FALSE; - - // Create a string of field names - $field_str .= $field->name.', '; - $i++; - } - - // Trim off the end comma - $field_str = preg_replace( "/, $/" , "" , $field_str); - - - // Build the insert string - foreach ($query->result_array() as $row) - { - $val_str = ''; - - $i = 0; - foreach ($row as $v) - { - // Do a little formatting... - $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); - $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); - $v = str_replace('\\', '\\\\', $v); - $v = str_replace('\'', '\\\'', $v); - $v = str_replace('\\\n', '\n', $v); - $v = str_replace('\\\r', '\r', $v); - $v = str_replace('\\\t', '\t', $v); - - // Escape the data if it's not an integer type - $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; - $val_str .= ', '; - - $i++; - } - - $val_str = preg_replace( "/, $/" , "" , $val_str); - - // Build the INSERT string - $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; - } - - $output .= $newline.$newline; - } - - return $output; - } - - - -} - +db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access private + * @return bool + */ + function _list_databases() + { + return "SHOW DATABASES"; + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return "OPTIMIZE TABLE ".$this->db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return "REPAIR TABLE ".$this->db->_escape_table($table); + } + + // -------------------------------------------------------------------- + + /** + * MySQLi Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + if (count($params) == 0) + { + return FALSE; + } + + // Extract the prefs for simplicity + extract($params); + + // Build the output + $output = ''; + foreach ((array)$tables as $table) + { + // Is the table in the "ignore" list? + if (in_array($table, (array)$ignore, TRUE)) + { + continue; + } + + // Get the table schema + $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); + + // No result means the table name was invalid + if ($query === FALSE) + { + continue; + } + + // Write out the table schema + $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; + + if ($add_drop == TRUE) + { + $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + } + + $i = 0; + $result = $query->result_array(); + foreach ($result[0] as $val) + { + if ($i++ % 2) + { + $output .= $val.';'.$newline.$newline; + } + } + + // If inserts are not needed we're done... + if ($add_insert == FALSE) + { + continue; + } + + // Grab all the data from the current table + $query = $this->db->query("SELECT * FROM $table"); + + if ($query->num_rows() == 0) + { + continue; + } + + // Fetch the field names and determine if the field is an + // integer type. We use this info to decide whether to + // surround the data with quotes or not + + $i = 0; + $field_str = ''; + $is_int = array(); + while ($field = mysqli_fetch_field($query->result_id)) + { + $is_int[$i] = (in_array( + strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), + TRUE) + ) ? TRUE : FALSE; + + // Create a string of field names + $field_str .= $field->name.', '; + $i++; + } + + // Trim off the end comma + $field_str = preg_replace( "/, $/" , "" , $field_str); + + + // Build the insert string + foreach ($query->result_array() as $row) + { + $val_str = ''; + + $i = 0; + foreach ($row as $v) + { + // Do a little formatting... + $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); + $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); + $v = str_replace('\\', '\\\\', $v); + $v = str_replace('\'', '\\\'', $v); + $v = str_replace('\\\n', '\n', $v); + $v = str_replace('\\\r', '\r', $v); + $v = str_replace('\\\t', '\t', $v); + + // Escape the data if it's not an integer type + $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; + $val_str .= ', '; + + $i++; + } + + $val_str = preg_replace( "/, $/" , "" , $val_str); + + // Build the INSERT string + $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; + } + + $output .= $newline.$newline; + } + + return $output; + } + + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index ff301a57..291e168e 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -1,605 +1,605 @@ -username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @ociplogon($this->username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return ociserverversion($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - 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->_set_stmt_id($sql); - ocisetprefetch($this->stmt_id, 1000); - return @ociexecute($this->stmt_id, $this->_commit); - } - - /** - * Generate a statement ID - * - * @access private - * @param string an SQL query - * @return none - */ - function _set_stmt_id($sql) - { - if ( ! is_resource($this->stmt_id)) - { - $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); - } - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * getCursor. Returns a cursor from the datbase - * - * @access public - * @return cursor id - */ - function get_cursor() - { - $this->curs_id = ocinewcursor($this->conn_id); - return $this->curs_id; - } - - // -------------------------------------------------------------------- - - /** - * Stored Procedure. Executes a stored procedure - * - * @access public - * @param package package stored procedure is in - * @param procedure stored procedure to execute - * @param params array of parameters - * @return array - * - * params array keys - * - * KEY OPTIONAL NOTES - * name no the name of the parameter should be in : format - * value no the value of the parameter. If this is an OUT or IN OUT parameter, - * this should be a reference to a variable - * type yes the type of the parameter - * length yes the max size of the parameter - */ - function stored_procedure($package, $procedure, $params) - { - if ($package == '' OR $procedure == '' OR ! is_array($params)) - { - if ($this->db_debug) - { - log_message('error', 'Invalid query: '.$package.'.'.$procedure); - return $this->display_error('db_invalid_query'); - } - return FALSE; - } - - // build the query string - $sql = "begin $package.$procedure("; - - $have_cursor = FALSE; - foreach($params as $param) - { - $sql .= $param['name'] . ","; - - if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR)) - { - $have_cursor = TRUE; - } - } - $sql = trim($sql, ",") . "); end;"; - - $this->stmt_id = FALSE; - $this->_set_stmt_id($sql); - $this->_bind_params($params); - $this->query($sql, FALSE, $have_cursor); - } - - // -------------------------------------------------------------------- - - /** - * Bind parameters - * - * @access private - * @return none - */ - function _bind_params($params) - { - if ( ! is_array($params) OR ! is_resource($this->stmt_id)) - { - return; - } - - foreach ($params as $param) - { - foreach (array('name', 'value', 'type', 'length') as $val) - { - if ( ! isset($param[$val])) - { - $param[$val] = ''; - } - } - - ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); - } - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->_commit = OCI_DEFAULT; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = OCIcommit($this->conn_id); - $this->_commit = OCI_COMMIT_ON_SUCCESS; - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = OCIrollback($this->conn_id); - $this->_commit = OCI_COMMIT_ON_SUCCESS; - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @ocirowcount($this->stmt_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - // not supported in oracle - return 0; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(1) AS numrows FROM ".$table); - - if ($query == FALSE) - { - return 0; - } - - $row = $query->row(); - return $row->NUMROWS; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SELECT TABLE_NAME FROM ALL_TABLES"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$this->_escape_table($table)." where rownum = 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - $error = ocierror($this->conn_id); - return $error['message']; - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - $error = ocierror($this->conn_id); - return $error['code']; - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $limit = $offset + $limit; - $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; - - if ($offset != 0) - { - $newsql .= " WHERE rnum >= $offset"; - } - - // remember that we used limits - $this->limit_used = TRUE; - - return $newsql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @ocilogoff($conn_id); - } - - -} - - +username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @ociplogon($this->username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return ociserverversion($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + 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->_set_stmt_id($sql); + ocisetprefetch($this->stmt_id, 1000); + return @ociexecute($this->stmt_id, $this->_commit); + } + + /** + * Generate a statement ID + * + * @access private + * @param string an SQL query + * @return none + */ + function _set_stmt_id($sql) + { + if ( ! is_resource($this->stmt_id)) + { + $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); + } + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * getCursor. Returns a cursor from the datbase + * + * @access public + * @return cursor id + */ + function get_cursor() + { + $this->curs_id = ocinewcursor($this->conn_id); + return $this->curs_id; + } + + // -------------------------------------------------------------------- + + /** + * Stored Procedure. Executes a stored procedure + * + * @access public + * @param package package stored procedure is in + * @param procedure stored procedure to execute + * @param params array of parameters + * @return array + * + * params array keys + * + * KEY OPTIONAL NOTES + * name no the name of the parameter should be in : format + * value no the value of the parameter. If this is an OUT or IN OUT parameter, + * this should be a reference to a variable + * type yes the type of the parameter + * length yes the max size of the parameter + */ + function stored_procedure($package, $procedure, $params) + { + if ($package == '' OR $procedure == '' OR ! is_array($params)) + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$package.'.'.$procedure); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } + + // build the query string + $sql = "begin $package.$procedure("; + + $have_cursor = FALSE; + foreach($params as $param) + { + $sql .= $param['name'] . ","; + + if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR)) + { + $have_cursor = TRUE; + } + } + $sql = trim($sql, ",") . "); end;"; + + $this->stmt_id = FALSE; + $this->_set_stmt_id($sql); + $this->_bind_params($params); + $this->query($sql, FALSE, $have_cursor); + } + + // -------------------------------------------------------------------- + + /** + * Bind parameters + * + * @access private + * @return none + */ + function _bind_params($params) + { + if ( ! is_array($params) OR ! is_resource($this->stmt_id)) + { + return; + } + + foreach ($params as $param) + { + foreach (array('name', 'value', 'type', 'length') as $val) + { + if ( ! isset($param[$val])) + { + $param[$val] = ''; + } + } + + ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); + } + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->_commit = OCI_DEFAULT; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = OCIcommit($this->conn_id); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = OCIrollback($this->conn_id); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @ocirowcount($this->stmt_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + // not supported in oracle + return 0; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(1) AS numrows FROM ".$table); + + if ($query == FALSE) + { + return 0; + } + + $row = $query->row(); + return $row->NUMROWS; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SELECT TABLE_NAME FROM ALL_TABLES"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$this->_escape_table($table)." where rownum = 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + $error = ocierror($this->conn_id); + return $error['message']; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + $error = ocierror($this->conn_id); + return $error['code']; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $limit = $offset + $limit; + $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; + + if ($offset != 0) + { + $newsql .= " WHERE rnum >= $offset"; + } + + // remember that we used limits + $this->limit_used = TRUE; + + return $newsql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @ocilogoff($conn_id); + } + + +} + + ?> \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index fb4ed1f0..07f15448 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -1,251 +1,251 @@ -result_array()); - @ociexecute($this->stmt_id); - if ($this->curs_id) - { - @ociexecute($this->curs_id); - } - return $rowcount; - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - $count = @ocinumcols($this->stmt_id); - - // if we used a limit we subtract it - if ($this->limit_used) - { - $count = $count - 1; - } - - return $count; - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) - { - $field_names[] = ocicolumnname($this->stmt_id, $c); - } - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $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); - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - ocifreestatement($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc(&$row) - { - $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; - - return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - 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; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @access public - * @return array - */ - 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)) - { - $this->result_array[] = $row; - } - - return $this->result_array; - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return FALSE; // Not needed - } - -} - +result_array()); + @ociexecute($this->stmt_id); + if ($this->curs_id) + { + @ociexecute($this->curs_id); + } + return $rowcount; + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + $count = @ocinumcols($this->stmt_id); + + // if we used a limit we subtract it + if ($this->limit_used) + { + $count = $count - 1; + } + + return $count; + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + $fieldCount = $this->num_fields(); + for ($c = 1; $c <= $fieldCount; $c++) + { + $field_names[] = ocicolumnname($this->stmt_id, $c); + } + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + $fieldCount = $this->num_fields(); + for ($c = 1; $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); + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + ocifreestatement($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc(&$row) + { + $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; + + return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + 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; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + 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)) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return FALSE; // Not needed + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 1d83af1f..1b49f413 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -1,129 +1,129 @@ -db->display_error('db_unsuported_feature'); - } - -} - +db->display_error('db_unsuported_feature'); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 9d540c77..d6451e04 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -1,12 +1,12 @@ result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @odbc_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $field_names[] = odbc_field_name($this->result_id, $i); - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = odbc_field_name($this->result_id, $i); - $F->type = odbc_field_type($this->result_id, $i); - $F->max_length = odbc_field_len($this->result_id, $i); - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - odbc_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - if (function_exists('odbc_fetch_object')) - { - return odbc_fetch_array($this->result_id); - } - else - { - return $this->_odbc_fetch_array($this->result_id); - } - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - if (function_exists('odbc_fetch_object')) - { - return odbc_fetch_object($this->result_id); - } - else - { - return $this->_odbc_fetch_object($this->result_id); - } - } - - - /** - * Result - object - * - * subsititutes the odbc_fetch_object function when - * not available (odbc_fetch_object requires unixODBC) - * - * @access private - * @return object - */ - - function _odbc_fetch_object(& $odbc_result) { - $rs = array(); - $rs_obj = false; - if (odbc_fetch_into($odbc_result, $rs)) { - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); - $rs_obj->$field_name = $v; - } - } - return $rs_obj; - } - - - /** - * Result - array - * - * subsititutes the odbc_fetch_array function when - * not available (odbc_fetch_array requires unixODBC) - * - * @access private - * @return array - */ - - function _odbc_fetch_array(& $odbc_result) { - $rs = array(); - $rs_assoc = false; - if (odbc_fetch_into($odbc_result, $rs)) { - $rs_assoc=array(); - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); - $rs_assoc[$field_name] = $v; - } - } - return $rs_assoc; - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @odbc_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $field_names[] = odbc_field_name($this->result_id, $i); + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = odbc_field_name($this->result_id, $i); + $F->type = odbc_field_type($this->result_id, $i); + $F->max_length = odbc_field_len($this->result_id, $i); + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + odbc_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_array($this->result_id); + } + else + { + return $this->_odbc_fetch_array($this->result_id); + } + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_object($this->result_id); + } + else + { + return $this->_odbc_fetch_object($this->result_id); + } + } + + + /** + * Result - object + * + * subsititutes the odbc_fetch_object function when + * not available (odbc_fetch_object requires unixODBC) + * + * @access private + * @return object + */ + + function _odbc_fetch_object(& $odbc_result) { + $rs = array(); + $rs_obj = false; + if (odbc_fetch_into($odbc_result, $rs)) { + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_obj->$field_name = $v; + } + } + return $rs_obj; + } + + + /** + * Result - array + * + * subsititutes the odbc_fetch_array function when + * not available (odbc_fetch_array requires unixODBC) + * + * @access private + * @return array + */ + + function _odbc_fetch_array(& $odbc_result) { + $rs = array(); + $rs_assoc = false; + if (odbc_fetch_into($odbc_result, $rs)) { + $rs_assoc=array(); + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_assoc[$field_name] = $v; + } + } + return $rs_assoc; + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index 8af463b1..f8d9e3c4 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -1,161 +1,161 @@ -db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - // ODBC has no "drop database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access private - * @return bool - */ - function _list_databases() - { - // Not sure if ODBC lets you list all databases... - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return bool - */ - function _drop_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * ODBC Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - -} - +db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + // ODBC has no "drop database" command since it's + // designed to connect to an existing database + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access private + * @return bool + */ + function _list_databases() + { + // Not sure if ODBC lets you list all databases... + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return bool + */ + function _drop_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * ODBC Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 58cc69a9..bfb212cf 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -1,12 +1,12 @@ result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @pg_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $Ffield_names[] = pg_field_name($this->result_id, $i); - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = pg_field_name($this->result_id, $i); - $F->type = pg_field_type($this->result_id, $i); - $F->max_length = pg_field_size($this->result_id, $i); - $F->primary_key = $i == 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - pg_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return pg_result_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return pg_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return pg_fetch_object($this->result_id); - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @pg_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $Ffield_names[] = pg_field_name($this->result_id, $i); + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = pg_field_name($this->result_id, $i); + $F->type = pg_field_type($this->result_id, $i); + $F->max_length = pg_field_size($this->result_id, $i); + $F->primary_key = $i == 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + pg_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return pg_result_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return pg_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return pg_fetch_object($this->result_id); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index bebe0941..9d56af36 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -1,129 +1,129 @@ -db->_escape_table($table)." CASCADE"; - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Is table optimization supported in Postgre? - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Are table repairs supported in Postgre? - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Postgre Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - -} - +db->_escape_table($table)." CASCADE"; + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Is table optimization supported in Postgre? + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Are table repairs supported in Postgre? + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Postgre Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 877f445b..b82618c6 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -1,484 +1,484 @@ -database, 0666, $error)) - { - log_message('error', $error); - - if ($this->db_debug) - { - $this->display_error($error, '', TRUE); - } - - return FALSE; - } - - return $conn_id; - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - if ( ! $conn_id = @sqlite_popen($this->database, 0666, $error)) - { - log_message('error', $error); - - if ($this->db_debug) - { - $this->display_error($error, '', TRUE); - } - - return FALSE; - } - - return $conn_id; - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return sqlite_libversion(); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @sqlite_query($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('BEGIN TRANSACTION'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return sqlite_escape_string($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return sqlite_changes($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @sqlite_last_insert_rowid($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SELECT name from sqlite_master WHERE type='table'"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - // Not supported - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return sqlite_error_string(sqlite_last_error($this->conn_id)); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return sqlite_last_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - if ($offset == 0) - { - $offset = ''; - } - else - { - $offset .= ", "; - } - - return $sql."LIMIT ".$offset.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @sqlite_close($conn_id); - } - - -} - +database, 0666, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + + return FALSE; + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ( ! $conn_id = @sqlite_popen($this->database, 0666, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + + return FALSE; + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return sqlite_libversion(); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @sqlite_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('BEGIN TRANSACTION'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return sqlite_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return sqlite_changes($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @sqlite_last_insert_rowid($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SELECT name from sqlite_master WHERE type='table'"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + // Not supported + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$this->_escape_table($table)." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return sqlite_error_string(sqlite_last_error($this->conn_id)); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return sqlite_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @sqlite_close($conn_id); + } + + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index a406a935..a16a5b05 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -1,176 +1,176 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @sqlite_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $Ffield_names[] = sqlite_field_name($this->result_id, $i); - } - - return $field_names; - } - - // Deprecated - function field_names() - { - return $this->list_fields(); - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = sqlite_field_name($this->result_id, $i); - $F->type = 'varchar'; - $F->max_length = 0; - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - // Not implemented in SQLite - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return sqlite_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return sqlite_fetch_array($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - if (function_exists('sqlite_fetch_object')) - { - return sqlite_fetch_object($this->result_id); - } - else - { - return $this->_fetch_assoc(); - } - } - -} - +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @sqlite_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $Ffield_names[] = sqlite_field_name($this->result_id, $i); + } + + return $field_names; + } + + // Deprecated + function field_names() + { + return $this->list_fields(); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = sqlite_field_name($this->result_id, $i); + $F->type = 'varchar'; + $F->max_length = 0; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + // Not implemented in SQLite + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return sqlite_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return sqlite_fetch_array($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + if (function_exists('sqlite_fetch_object')) + { + return sqlite_fetch_object($this->result_id); + } + else + { + return $this->_fetch_assoc(); + } + } + +} + ?> \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 91649c78..9683b175 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -1,154 +1,154 @@ -db->database) OR ! @unlink($this->db->database)) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unable_to_drop'); - } - return FALSE; - } - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * I don't believe you can do a database listing with SQLite - * since each database is its own file. I suppose we could - * try reading a directory looking for SQLite files, but - * that doesn't seem like a terribly good idea - * - * @access private - * @return bool - */ - function _list_databases() - { - if ($this->db_debug) - { - return $this->display_error('db_unsuported_feature'); - } - return array(); - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * Unsupported feature in SQLite - * - * @access private - * @return bool - */ - function _drop_table($table) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return array(); - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Is optimization even supported in SQLite? - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Are table repairs even supported in SQLite? - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * SQLite Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - -} - +db->database) OR ! @unlink($this->db->database)) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unable_to_drop'); + } + return FALSE; + } + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * I don't believe you can do a database listing with SQLite + * since each database is its own file. I suppose we could + * try reading a directory looking for SQLite files, but + * that doesn't seem like a terribly good idea + * + * @access private + * @return bool + */ + function _list_databases() + { + if ($this->db_debug) + { + return $this->display_error('db_unsuported_feature'); + } + return array(); + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * Unsupported feature in SQLite + * + * @access private + * @return bool + */ + function _drop_table($table) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return array(); + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Is optimization even supported in SQLite? + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Are table repairs even supported in SQLite? + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * SQLite Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + +} + ?> \ No newline at end of file diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 491c6157..674ef3be 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -1,71 +1,71 @@ - \ No newline at end of file diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index b117816e..9dc5df9b 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -1,126 +1,126 @@ -config->item('cookie_prefix') != '') - { - $CI->config->item('cookie_prefix'); - } - if ($domain == '' AND $CI->config->item('cookie_domain') != '') - { - $CI->config->item('cookie_domain'); - } - if ($prefix == '/' AND $CI->config->item('cookie_path') != '/') - { - $CI->config->item('cookie_path'); - } - - if ( ! is_numeric($expire)) - { - $expire = time() - 86500; - } - else - { - if ($expire > 0) - { - $expire = time() + $expire; - } - else - { - $expire = 0; - } - } - - setcookie($prefix.$name, $value, $expire, $path, $domain, 0); -} - -// -------------------------------------------------------------------- - -/** - * Fetch an item from the COOKIE array - * - * @access public - * @param string - * @param bool - * @return mixed - */ -function get_cookie($index = '', $xss_clean = FALSE) -{ - $CI =& get_instance(); - return $CI->input->cookie($index, $xss_clean); -} - -// -------------------------------------------------------------------- - -/** - * Delete a COOKIE - * - * @param mixed - * @param string the cookie domain. Usually: .yourdomain.com - * @param string the cookie path - * @param string the cookie prefix - * @return void - */ -function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') -{ - set_cookie($name, '', '', $domain, $path, $prefix); -} - - +config->item('cookie_prefix') != '') + { + $CI->config->item('cookie_prefix'); + } + if ($domain == '' AND $CI->config->item('cookie_domain') != '') + { + $CI->config->item('cookie_domain'); + } + if ($prefix == '/' AND $CI->config->item('cookie_path') != '/') + { + $CI->config->item('cookie_path'); + } + + if ( ! is_numeric($expire)) + { + $expire = time() - 86500; + } + else + { + if ($expire > 0) + { + $expire = time() + $expire; + } + else + { + $expire = 0; + } + } + + setcookie($prefix.$name, $value, $expire, $path, $domain, 0); +} + +// -------------------------------------------------------------------- + +/** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return mixed + */ +function get_cookie($index = '', $xss_clean = FALSE) +{ + $CI =& get_instance(); + return $CI->input->cookie($index, $xss_clean); +} + +// -------------------------------------------------------------------- + +/** + * Delete a COOKIE + * + * @param mixed + * @param string the cookie domain. Usually: .yourdomain.com + * @param string the cookie path + * @param string the cookie prefix + * @return void + */ +function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') +{ + set_cookie($name, '', '', $domain, $path, $prefix); +} + + ?> \ No newline at end of file diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 504a962c..c67e3da2 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -1,12 +1,12 @@ \ No newline at end of file diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 34cc152c..c9d81f69 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,12 +1,12 @@ 0) - { - $data =& fread($fp, filesize($file)); - } - - flock($fp, LOCK_UN); - fclose($fp); - - return $data; -} - -// ------------------------------------------------------------------------ - -/** - * Write File - * - * Writes data to the file specified in the path. - * Creates a new file if non-existent. - * - * @access public - * @param string path to file - * @param string file data - * @return bool - */ -function write_file($path, $data, $mode = 'wb') -{ - if ( ! $fp = @fopen($path, $mode)) - { - return FALSE; - } - - flock($fp, LOCK_EX); - fwrite($fp, $data); - flock($fp, LOCK_UN); - fclose($fp); - - return TRUE; -} - -// ------------------------------------------------------------------------ - -/** - * Delete Files - * - * Deletes all files contained in the supplied directory path. - * Files must be writable or owned by the system in order to be deleted. - * If the second parameter is set to TRUE, any directories contained - * within the supplied base directory will be nuked as well. - * - * @access public - * @param string path to file - * @param bool whether to delete any directories found in the path - * @return bool - */ -function delete_files($path, $del_dir = FALSE, $level = 0) -{ - // Trim the trailing slash - $path = preg_replace("|^(.+?)/*$|", "\\1", $path); - - if ( ! $current_dir = @opendir($path)) - return; - - while(FALSE !== ($filename = @readdir($current_dir))) - { - if ($filename != "." and $filename != "..") - { - if (is_dir($path.'/'.$filename)) - { - $level++; - delete_files($path.'/'.$filename, $del_dir, $level); - } - else - { - unlink($path.'/'.$filename); - } - } - } - @closedir($current_dir); - - if ($del_dir == TRUE AND $level > 0) - { - @rmdir($path); - } -} - -// ------------------------------------------------------------------------ - -/** - * Get Filenames - * - * Reads the specified directory and builds an array containing the filenames. - * Any sub-folders contained within the specified path are read as well. - * - * @access public - * @param string path to source - * @param bool whether to include the path as part of the filename - * @return array - */ -function get_filenames($source_dir, $include_path = FALSE) -{ - static $_filedata = array(); - - if ($fp = @opendir($source_dir)) - { - while (FALSE !== ($file = readdir($fp))) - { - if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.') - { - get_filenames($source_dir.$file."/", $include_path); - } - elseif (substr($file, 0, 1) != ".") - { - - $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file; - } - } - return $_filedata; - } -} - + 0) + { + $data =& fread($fp, filesize($file)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + return $data; +} + +// ------------------------------------------------------------------------ + +/** + * Write File + * + * Writes data to the file specified in the path. + * Creates a new file if non-existent. + * + * @access public + * @param string path to file + * @param string file data + * @return bool + */ +function write_file($path, $data, $mode = 'wb') +{ + if ( ! $fp = @fopen($path, $mode)) + { + return FALSE; + } + + flock($fp, LOCK_EX); + fwrite($fp, $data); + flock($fp, LOCK_UN); + fclose($fp); + + return TRUE; +} + +// ------------------------------------------------------------------------ + +/** + * Delete Files + * + * Deletes all files contained in the supplied directory path. + * Files must be writable or owned by the system in order to be deleted. + * If the second parameter is set to TRUE, any directories contained + * within the supplied base directory will be nuked as well. + * + * @access public + * @param string path to file + * @param bool whether to delete any directories found in the path + * @return bool + */ +function delete_files($path, $del_dir = FALSE, $level = 0) +{ + // Trim the trailing slash + $path = preg_replace("|^(.+?)/*$|", "\\1", $path); + + if ( ! $current_dir = @opendir($path)) + return; + + while(FALSE !== ($filename = @readdir($current_dir))) + { + if ($filename != "." and $filename != "..") + { + if (is_dir($path.'/'.$filename)) + { + $level++; + delete_files($path.'/'.$filename, $del_dir, $level); + } + else + { + unlink($path.'/'.$filename); + } + } + } + @closedir($current_dir); + + if ($del_dir == TRUE AND $level > 0) + { + @rmdir($path); + } +} + +// ------------------------------------------------------------------------ + +/** + * Get Filenames + * + * Reads the specified directory and builds an array containing the filenames. + * Any sub-folders contained within the specified path are read as well. + * + * @access public + * @param string path to source + * @param bool whether to include the path as part of the filename + * @return array + */ +function get_filenames($source_dir, $include_path = FALSE) +{ + static $_filedata = array(); + + if ($fp = @opendir($source_dir)) + { + while (FALSE !== ($file = readdir($fp))) + { + if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.') + { + get_filenames($source_dir.$file."/", $include_path); + } + elseif (substr($file, 0, 1) != ".") + { + + $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file; + } + } + return $_filedata; + } +} + ?> \ No newline at end of file diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a166198f..adbddd5a 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1,12 +1,12 @@ ".$data.""; -} - -// ------------------------------------------------------------------------ - -/** - * Unordered List - * - * Generates an HTML unordered list from an single or multi-dimensional array. - * - * @access public - * @param array - * @param mixed - * @return string - */ -function ul($list, $attributes = '') -{ - return _list('ul', $list, $attributes); -} - -// ------------------------------------------------------------------------ - -/** - * Ordered List - * - * Generates an HTML ordered list from an single or multi-dimensional array. - * - * @access public - * @param array - * @param mixed - * @return string - */ -function ol($list, $attributes = '') -{ - return _list('ol', $list, $attributes); -} - -// ------------------------------------------------------------------------ - -/** - * Generates the list - * - * Generates an HTML ordered list from an single or multi-dimensional array. - * - * @access private - * @param string - * @param mixed - * @param mixed - * @param intiger - * @return string - */ -function _list($type = 'ul', $list, $attributes = '', $depth = 0) -{ - // If an array wasn't submitted there's nothing to do... - if ( ! is_array($list)) - { - return $list; - } - - // Set the indentation based on the depth - $out = str_repeat(" ", $depth); - - // Were any attributes submitted? If so generate a string - if (is_array($attributes)) - { - $atts = ''; - foreach ($attributes as $key => $val) - { - $atts .= ' ' . $key . '="' . $val . '"'; - } - $attributes = $atts; - } - - // Write the opening list tag - $out .= "<".$type.$attributes.">\n"; - - // Cycle through the list elements. If an array is - // encountered we will recursively call _list() - - static $_last_list_item = ''; - foreach ($list as $key => $val) - { - $_last_list_item = $key; - - $out .= str_repeat(" ", $depth + 2); - $out .= "
              • "; - - if ( ! is_array($val)) - { - $out .= $val; - } - else - { - $out .= $_last_list_item."\n"; - $out .= _list($type, $val, '', $depth + 4); - $out .= str_repeat(" ", $depth + 2); - } - - $out .= "
              • \n"; - } - - // Set the indentation for the closing tag - $out .= str_repeat(" ", $depth); - - // Write the closing list tag - $out .= "\n"; - - return $out; -} - -// ------------------------------------------------------------------------ - -/** - * Generates HTML BR tags based on number supplied - * - * @access public - * @param integer - * @return string - */ -function br($num = 1) -{ - return str_repeat("
                ", $num); -} - -// ------------------------------------------------------------------------ - -/** - * Generates non-breaking space entities based on number supplied - * - * @access public - * @param integer - * @return string - */ -function nbs($num = 1) -{ - return str_repeat(" ", $num); -} - -// ------------------------------------------------------------------------ - -/** - * Generates meta tags from an array of key/values - * - * @access public - * @param array - * @return string - */ -function meta($meta = array(), $newline = "\n") -{ - $str = ''; - foreach ($meta as $key => $val) - { - $str .= ''.$newline; - } - - return $str; -} - - - - +".$data.""; +} + +// ------------------------------------------------------------------------ + +/** + * Unordered List + * + * Generates an HTML unordered list from an single or multi-dimensional array. + * + * @access public + * @param array + * @param mixed + * @return string + */ +function ul($list, $attributes = '') +{ + return _list('ul', $list, $attributes); +} + +// ------------------------------------------------------------------------ + +/** + * Ordered List + * + * Generates an HTML ordered list from an single or multi-dimensional array. + * + * @access public + * @param array + * @param mixed + * @return string + */ +function ol($list, $attributes = '') +{ + return _list('ol', $list, $attributes); +} + +// ------------------------------------------------------------------------ + +/** + * Generates the list + * + * Generates an HTML ordered list from an single or multi-dimensional array. + * + * @access private + * @param string + * @param mixed + * @param mixed + * @param intiger + * @return string + */ +function _list($type = 'ul', $list, $attributes = '', $depth = 0) +{ + // If an array wasn't submitted there's nothing to do... + if ( ! is_array($list)) + { + return $list; + } + + // Set the indentation based on the depth + $out = str_repeat(" ", $depth); + + // Were any attributes submitted? If so generate a string + if (is_array($attributes)) + { + $atts = ''; + foreach ($attributes as $key => $val) + { + $atts .= ' ' . $key . '="' . $val . '"'; + } + $attributes = $atts; + } + + // Write the opening list tag + $out .= "<".$type.$attributes.">\n"; + + // Cycle through the list elements. If an array is + // encountered we will recursively call _list() + + static $_last_list_item = ''; + foreach ($list as $key => $val) + { + $_last_list_item = $key; + + $out .= str_repeat(" ", $depth + 2); + $out .= "
              • "; + + if ( ! is_array($val)) + { + $out .= $val; + } + else + { + $out .= $_last_list_item."\n"; + $out .= _list($type, $val, '', $depth + 4); + $out .= str_repeat(" ", $depth + 2); + } + + $out .= "
              • \n"; + } + + // Set the indentation for the closing tag + $out .= str_repeat(" ", $depth); + + // Write the closing list tag + $out .= "\n"; + + return $out; +} + +// ------------------------------------------------------------------------ + +/** + * Generates HTML BR tags based on number supplied + * + * @access public + * @param integer + * @return string + */ +function br($num = 1) +{ + return str_repeat("
                ", $num); +} + +// ------------------------------------------------------------------------ + +/** + * Generates non-breaking space entities based on number supplied + * + * @access public + * @param integer + * @return string + */ +function nbs($num = 1) +{ + return str_repeat(" ", $num); +} + +// ------------------------------------------------------------------------ + +/** + * Generates meta tags from an array of key/values + * + * @access public + * @param array + * @return string + */ +function meta($meta = array(), $newline = "\n") +{ + $str = ''; + foreach ($meta as $key => $val) + { + $str .= ''.$newline; + } + + return $str; +} + + + + ?> \ No newline at end of file diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 666ec40b..fbe851f3 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -1,140 +1,140 @@ - \ No newline at end of file diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 06228468..eec04015 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -1,112 +1,112 @@ -input->xss_clean($str, $charset); -} - -// -------------------------------------------------------------------- - -/** - * Hash encode a string - * - * @access public - * @param string - * @return string - */ -function dohash($str, $type = 'sha1') -{ - if ($type == 'sha1') - { - if ( ! function_exists('sha1')) - { - if ( ! function_exists('mhash')) - { - require_once(BASEPATH.'libraries/Sha1'.EXT); - $SH = new CI_SHA; - return $SH->generate($str); - } - else - { - return bin2hex(mhash(MHASH_SHA1, $str)); - } - } - else - { - return sha1($str); - } - } - else - { - return md5($str); - } -} - -// ------------------------------------------------------------------------ - -/** - * Strip Image Tags - * - * @access public - * @param string - * @return string - */ -function strip_image_tags($str) -{ - $str = preg_replace("##", "\\1", $str); - $str = preg_replace("##", "\\1", $str); - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Convert PHP tags to entities - * - * @access public - * @param string - * @return string - */ -function encode_php_tags($str) -{ - return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); -} - +input->xss_clean($str, $charset); +} + +// -------------------------------------------------------------------- + +/** + * Hash encode a string + * + * @access public + * @param string + * @return string + */ +function dohash($str, $type = 'sha1') +{ + if ($type == 'sha1') + { + if ( ! function_exists('sha1')) + { + if ( ! function_exists('mhash')) + { + require_once(BASEPATH.'libraries/Sha1'.EXT); + $SH = new CI_SHA; + return $SH->generate($str); + } + else + { + return bin2hex(mhash(MHASH_SHA1, $str)); + } + } + else + { + return sha1($str); + } + } + else + { + return md5($str); + } +} + +// ------------------------------------------------------------------------ + +/** + * Strip Image Tags + * + * @access public + * @param string + * @return string + */ +function strip_image_tags($str) +{ + $str = preg_replace("##", "\\1", $str); + $str = preg_replace("##", "\\1", $str); + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Convert PHP tags to entities + * + * @access public + * @param string + * @return string + */ +function encode_php_tags($str) +{ + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); +} + ?> \ No newline at end of file diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index a0733724..9f16d313 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -1,165 +1,165 @@ - - function insert_smiley(smiley) - { - document.{$form_name}.{$form_field}.value += " " + smiley; - } - -EOF; -} - -// ------------------------------------------------------------------------ - -/** - * Get Clickable Smileys - * - * Returns an array of image tag links that can be clicked to be inserted - * into a form field. - * - * @access public - * @param string the URL to the folder containing the smiley images - * @return array - */ -function get_clickable_smileys($image_url = '', $smileys = NULL) -{ - if ( ! is_array($smileys)) - { - if (FALSE === ($smileys = _get_smiley_array())) - { - return $str; - } - } - - // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); - - $used = array(); - foreach ($smileys as $key => $val) - { - // Keep duplicates from being used, which can happen if the - // mapping array contains multiple identical replacements. For example: - // :-) and :) might be replaced with the same image so both smileys - // will be in the array. - if (isset($used[$smileys[$key][0]])) - { - continue; - } - - $link[] = "\"".$smileys[$key][3]."\""; - - $used[$smileys[$key][0]] = TRUE; - } - - return $link; -} - -// ------------------------------------------------------------------------ - -/** - * Parse Smileys - * - * Takes a string as input and swaps any contained smileys for the actual image - * - * @access public - * @param string the text to be parsed - * @param string the URL to the folder containing the smiley images - * @return string - */ -function parse_smileys($str = '', $image_url = '', $smileys = NULL) -{ - if ($image_url == '') - { - return $str; - } - - if ( ! is_array($smileys)) - { - if (FALSE === ($smileys = _get_smiley_array())) - { - return $str; - } - } - - // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); - - foreach ($smileys as $key => $val) - { - $str = str_replace($key, "\"".$smileys[$key][3]."\"", $str); - } - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Get Smiley Array - * - * Fetches the config/smiley.php file - * - * @access private - * @return mixed - */ -function _get_smiley_array() -{ - if ( ! file_exists(APPPATH.'config/smileys'.EXT)) - { - return FALSE; - } - - include(APPPATH.'config/smileys'.EXT); - - if ( ! isset($smileys) OR ! is_array($smileys)) - { - return FALSE; - } - - return $smileys; -} - - - - + + function insert_smiley(smiley) + { + document.{$form_name}.{$form_field}.value += " " + smiley; + } + +EOF; +} + +// ------------------------------------------------------------------------ + +/** + * Get Clickable Smileys + * + * Returns an array of image tag links that can be clicked to be inserted + * into a form field. + * + * @access public + * @param string the URL to the folder containing the smiley images + * @return array + */ +function get_clickable_smileys($image_url = '', $smileys = NULL) +{ + if ( ! is_array($smileys)) + { + if (FALSE === ($smileys = _get_smiley_array())) + { + return $str; + } + } + + // Add a trailing slash to the file path if needed + $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); + + $used = array(); + foreach ($smileys as $key => $val) + { + // Keep duplicates from being used, which can happen if the + // mapping array contains multiple identical replacements. For example: + // :-) and :) might be replaced with the same image so both smileys + // will be in the array. + if (isset($used[$smileys[$key][0]])) + { + continue; + } + + $link[] = "\"".$smileys[$key][3]."\""; + + $used[$smileys[$key][0]] = TRUE; + } + + return $link; +} + +// ------------------------------------------------------------------------ + +/** + * Parse Smileys + * + * Takes a string as input and swaps any contained smileys for the actual image + * + * @access public + * @param string the text to be parsed + * @param string the URL to the folder containing the smiley images + * @return string + */ +function parse_smileys($str = '', $image_url = '', $smileys = NULL) +{ + if ($image_url == '') + { + return $str; + } + + if ( ! is_array($smileys)) + { + if (FALSE === ($smileys = _get_smiley_array())) + { + return $str; + } + } + + // Add a trailing slash to the file path if needed + $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); + + foreach ($smileys as $key => $val) + { + $str = str_replace($key, "\"".$smileys[$key][3]."\"", $str); + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Get Smiley Array + * + * Fetches the config/smiley.php file + * + * @access private + * @return mixed + */ +function _get_smiley_array() +{ + if ( ! file_exists(APPPATH.'config/smileys'.EXT)) + { + return FALSE; + } + + include(APPPATH.'config/smileys'.EXT); + + if ( ! isset($smileys) OR ! is_array($smileys)) + { + return FALSE; + } + + return $smileys; +} + + + + ?> \ No newline at end of file diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index c0a8854d..04c3a592 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,12 +1,12 @@ = $n) - { - return trim($out).$end_char; - } - } -} - -// ------------------------------------------------------------------------ - -/** - * High ASCII to Entities - * - * Converts High ascii text and MS Word special characters to character entities - * - * @access public - * @param string - * @return string - */ -function ascii_to_entities($str) -{ - $count = 1; - $out = ''; - $temp = array(); - - for ($i = 0, $s = strlen($str); $i < $s; $i++) - { - $ordinal = ord($str[$i]); - - if ($ordinal < 128) - { - $out .= $str[$i]; - } - else - { - if (count($temp) == 0) - { - $count = ($ordinal < 224) ? 2 : 3; - } - - $temp[] = $ordinal; - - if (count($temp) == $count) - { - $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); - - $out .= '&#'.$number.';'; - $count = 1; - $temp = array(); - } - } - } - - return $out; -} - -// ------------------------------------------------------------------------ - -/** - * Entities to ASCII - * - * Converts character entities back to ASCII - * - * @access public - * @param string - * @param bool - * @return string - */ -function entities_to_ascii($str, $all = TRUE) -{ - if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) - { - for ($i = 0, $s = count($matches['0']); $i < $s; $i++) - { - $digits = $matches['1'][$i]; - - $out = ''; - - if ($digits < 128) - { - $out .= chr($digits); - - } - elseif ($digits < 2048) - { - $out .= chr(192 + (($digits - ($digits % 64)) / 64)); - $out .= chr(128 + ($digits % 64)); - } - else - { - $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)); - $out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)); - $out .= chr(128 + ($digits % 64)); - } - - $str = str_replace($matches['0'][$i], $out, $str); - } - } - - if ($all) - { - $str = str_replace(array("&", "<", ">", """, "'", "-"), - array("&","<",">","\"", "'", "-"), - $str); - } - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Word Censoring Function - * - * Supply a string and an array of disallowed words and any - * matched words will be converted to #### or to the replacement - * word you've submitted. - * - * @access public - * @param string the text string - * @param string the array of censoered words - * @param string the optional replacement value - * @return string - */ -function word_censor($str, $censored, $replacement = '') -{ - if ( ! is_array($censored)) - { - return $str; - } - - $str = ' '.$str.' '; - foreach ($censored as $badword) - { - if ($replacement != '') - { - $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str); - } - else - { - $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str); - } - } - - return trim($str); -} - -// ------------------------------------------------------------------------ - -/** - * Code Highlighter - * - * Colorizes code strings - * - * @access public - * @param string the text string - * @return string - */ -function highlight_code($str) -{ - // The highlight string function encodes and highlights - // brackets so we need them to start raw - $str = str_replace(array('<', '>'), array('<', '>'), $str); - - // Replace any existing PHP tags to temporary markers so they don't accidentally - // break the string out of PHP, and thus, thwart the highlighting. - - $str = str_replace(array('<?php', '?>', '\\'), array('phptagopen', 'phptagclose', 'backslashtmp'), $str); - - // The highlight_string function requires that the text be surrounded - // by PHP tags. Since we don't know if A) the submitted text has PHP tags, - // or B) whether the PHP tags enclose the entire string, we will add our - // own PHP tags around the string along with some markers to make replacement easier later - - $str = ''; - - // All the magic happens here, baby! - $str = highlight_string($str, TRUE); - - // Prior to PHP 5, the highlight function used icky font tags - // so we'll replace them with span tags. - if (abs(phpversion()) < 5) - { - $str = str_replace(array(''), array(''), $str); - $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); - } - - // Remove our artificially added PHP - $str = preg_replace("#\.+?//tempstart\
                \#is", "\n", $str); - $str = preg_replace("#\.+?//tempstart\
                #is", "\n", $str); - $str = preg_replace("#//tempend.+#is", "
                \n", $str); - - // Replace our markers back to PHP tags. - $str = str_replace(array('phptagopen', 'phptagclose', 'backslashtmp'), array('<?php', '?>', '\\'), $str); //', $tag_close = '') -{ - if ($str == '') - { - return ''; - } - - if ($phrase != '') - { - return preg_replace('/('.preg_quote($phrase).')/i', $tag_open."\\1".$tag_close, $str); - } - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Word Wrap - * - * Wraps text at the specified character. Maintains the integrity of words. - * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor - * will URLs. - * - * @access public - * @param string the text string - * @param integer the number of characters to wrap at - * @return string - */ -function word_wrap($str, $charlim = '76') -{ - // Se the character limit - if ( ! is_numeric($charlim)) - $charlim = 76; - - // Reduce multiple spaces - $str = preg_replace("| +|", " ", $str); - - // Standardize newlines - $str = preg_replace("/\r\n|\r/", "\n", $str); - - // If the current word is surrounded by {unwrap} tags we'll - // strip the entire chunk and replace it with a marker. - $unwrap = array(); - if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) - { - for ($i = 0; $i < count($matches['0']); $i++) - { - $unwrap[] = $matches['1'][$i]; - $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); - } - } - - // Use PHP's native function to do the initial wordwrap. - // We set the cut flag to FALSE so that any individual words that are - // too long get left alone. In the next step we'll deal with them. - $str = wordwrap($str, $charlim, "\n", FALSE); - - // Split the string into individual lines of text and cycle through them - $output = ""; - foreach (explode("\n", $str) as $line) - { - // Is the line within the allowed character count? - // If so we'll join it to the output and continue - if (strlen($line) <= $charlim) - { - $output .= $line."\n"; - continue; - } - - $temp = ''; - while((strlen($line)) > $charlim) - { - // If the over-length word is a URL we won't wrap it - if (preg_match("!\[url.+\]|://|wwww.!", $line)) - { - break; - } - - // Trim the word down - $temp .= substr($line, 0, $charlim-1); - $line = substr($line, $charlim-1); - } - - // 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 .= "\n"; - } - - // Put our markers back - if (count($unwrap) > 0) - { - foreach ($unwrap as $key => $val) - { - $output = str_replace("{{unwrapped".$key."}}", $val, $output); - } - } - - // Remove the unwrap tags - $output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output); - - return $output; -} - - += $n) + { + return trim($out).$end_char; + } + } +} + +// ------------------------------------------------------------------------ + +/** + * High ASCII to Entities + * + * Converts High ascii text and MS Word special characters to character entities + * + * @access public + * @param string + * @return string + */ +function ascii_to_entities($str) +{ + $count = 1; + $out = ''; + $temp = array(); + + for ($i = 0, $s = strlen($str); $i < $s; $i++) + { + $ordinal = ord($str[$i]); + + if ($ordinal < 128) + { + $out .= $str[$i]; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + + $out .= '&#'.$number.';'; + $count = 1; + $temp = array(); + } + } + } + + return $out; +} + +// ------------------------------------------------------------------------ + +/** + * Entities to ASCII + * + * Converts character entities back to ASCII + * + * @access public + * @param string + * @param bool + * @return string + */ +function entities_to_ascii($str, $all = TRUE) +{ + if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) + { + for ($i = 0, $s = count($matches['0']); $i < $s; $i++) + { + $digits = $matches['1'][$i]; + + $out = ''; + + if ($digits < 128) + { + $out .= chr($digits); + + } + elseif ($digits < 2048) + { + $out .= chr(192 + (($digits - ($digits % 64)) / 64)); + $out .= chr(128 + ($digits % 64)); + } + else + { + $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)); + $out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)); + $out .= chr(128 + ($digits % 64)); + } + + $str = str_replace($matches['0'][$i], $out, $str); + } + } + + if ($all) + { + $str = str_replace(array("&", "<", ">", """, "'", "-"), + array("&","<",">","\"", "'", "-"), + $str); + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Word Censoring Function + * + * Supply a string and an array of disallowed words and any + * matched words will be converted to #### or to the replacement + * word you've submitted. + * + * @access public + * @param string the text string + * @param string the array of censoered words + * @param string the optional replacement value + * @return string + */ +function word_censor($str, $censored, $replacement = '') +{ + if ( ! is_array($censored)) + { + return $str; + } + + $str = ' '.$str.' '; + foreach ($censored as $badword) + { + if ($replacement != '') + { + $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str); + } + else + { + $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str); + } + } + + return trim($str); +} + +// ------------------------------------------------------------------------ + +/** + * Code Highlighter + * + * Colorizes code strings + * + * @access public + * @param string the text string + * @return string + */ +function highlight_code($str) +{ + // The highlight string function encodes and highlights + // brackets so we need them to start raw + $str = str_replace(array('<', '>'), array('<', '>'), $str); + + // Replace any existing PHP tags to temporary markers so they don't accidentally + // break the string out of PHP, and thus, thwart the highlighting. + + $str = str_replace(array('<?php', '?>', '\\'), array('phptagopen', 'phptagclose', 'backslashtmp'), $str); + + // The highlight_string function requires that the text be surrounded + // by PHP tags. Since we don't know if A) the submitted text has PHP tags, + // or B) whether the PHP tags enclose the entire string, we will add our + // own PHP tags around the string along with some markers to make replacement easier later + + $str = ''; + + // All the magic happens here, baby! + $str = highlight_string($str, TRUE); + + // Prior to PHP 5, the highlight function used icky font tags + // so we'll replace them with span tags. + if (abs(phpversion()) < 5) + { + $str = str_replace(array(''), array(''), $str); + $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); + } + + // Remove our artificially added PHP + $str = preg_replace("#\.+?//tempstart\
                \#is", "\n", $str); + $str = preg_replace("#\.+?//tempstart\
                #is", "\n", $str); + $str = preg_replace("#//tempend.+#is", "
                \n", $str); + + // Replace our markers back to PHP tags. + $str = str_replace(array('phptagopen', 'phptagclose', 'backslashtmp'), array('<?php', '?>', '\\'), $str); //', $tag_close = '') +{ + if ($str == '') + { + return ''; + } + + if ($phrase != '') + { + return preg_replace('/('.preg_quote($phrase).')/i', $tag_open."\\1".$tag_close, $str); + } + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Word Wrap + * + * Wraps text at the specified character. Maintains the integrity of words. + * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor + * will URLs. + * + * @access public + * @param string the text string + * @param integer the number of characters to wrap at + * @return string + */ +function word_wrap($str, $charlim = '76') +{ + // Se the character limit + if ( ! is_numeric($charlim)) + $charlim = 76; + + // Reduce multiple spaces + $str = preg_replace("| +|", " ", $str); + + // Standardize newlines + $str = preg_replace("/\r\n|\r/", "\n", $str); + + // If the current word is surrounded by {unwrap} tags we'll + // strip the entire chunk and replace it with a marker. + $unwrap = array(); + if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $unwrap[] = $matches['1'][$i]; + $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); + } + } + + // Use PHP's native function to do the initial wordwrap. + // We set the cut flag to FALSE so that any individual words that are + // too long get left alone. In the next step we'll deal with them. + $str = wordwrap($str, $charlim, "\n", FALSE); + + // Split the string into individual lines of text and cycle through them + $output = ""; + foreach (explode("\n", $str) as $line) + { + // Is the line within the allowed character count? + // If so we'll join it to the output and continue + if (strlen($line) <= $charlim) + { + $output .= $line."\n"; + continue; + } + + $temp = ''; + while((strlen($line)) > $charlim) + { + // If the over-length word is a URL we won't wrap it + if (preg_match("!\[url.+\]|://|wwww.!", $line)) + { + break; + } + + // Trim the word down + $temp .= substr($line, 0, $charlim-1); + $line = substr($line, $charlim-1); + } + + // 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 .= "\n"; + } + + // Put our markers back + if (count($unwrap) > 0) + { + foreach ($unwrap as $key => $val) + { + $output = str_replace("{{unwrapped".$key."}}", $val, $output); + } + } + + // Remove the unwrap tags + $output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output); + + return $output; +} + + ?> \ No newline at end of file diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 1681fa37..131358c6 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -1,540 +1,540 @@ -",$str); - $ct = count($ex); - - $newstr = ""; - for ($i = 0; $i < $ct; $i++) - { - if (($i % 2) == 0) - { - $newstr .= nl2br($ex[$i]); - } - else - { - $newstr .= $ex[$i]; - } - - if ($ct - 1 != $i) - $newstr .= "pre>"; - } - - return $newstr; -} - -// ------------------------------------------------------------------------ - -/** - * Auto Typography Wrapper Function - * - * - * @access public - * @param string - * @return string - */ -function auto_typography($str) -{ - $TYPE = new Auto_typography(); - return $TYPE->convert($str); -} - -// ------------------------------------------------------------------------ - -/** - * Auto Typography Class - * - * - * @access private - * @category Helpers - * @author Rick Ellis - * @author Paul Burdick - * @link http://www.codeigniter.com/user_guide/helpers/ - */ -class Auto_typography { - - // Block level elements that should not be wrapped inside

                tags - var $block_elements = 'div|blockquote|pre|code|h\d|script|ol|un'; - - // Elements that should not have

                and
                tags within them. - var $skip_elements = 'pre|ol|ul'; - - // Tags we want the parser to completely ignore when splitting the string. - var $ignore_elements = 'a|b|i|em|strong|span|img|li'; - - - /** - * Main Processing Function - * - */ - function convert($str) - { - if ($str == '') - { - return ''; - } - - $str = ' '.$str.' '; - - // Standardize Newlines to make matching easier - $str = preg_replace("/(\r\n|\r)/", "\n", $str); - - /* - * Reduce line breaks - * - * If there are more than two consecutive line - * breaks we'll compress them down to a maximum - * of two since there's no benefit to more. - * - */ - $str = preg_replace("/\n\n+/", "\n\n", $str); - - /* - * Convert quotes within tags to temporary marker - * - * We don't want quotes converted within - * tags so we'll temporarily convert them to - * {@DQ} and {@SQ} - * - */ - if (preg_match_all("#\<.+?>#si", $str, $matches)) - { - for ($i = 0; $i < count($matches['0']); $i++) - { - $str = str_replace($matches['0'][$i], - str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches['0'][$i]), - $str); - } - } - - - /* - * Add closing/opening paragraph tags before/after "block" elements - * - * Since block elements (like ,

                , etc.) do not get
                -		 * wrapped in paragraph tags we will add a closing 

                tag just before - * each block element starts and an opening

                tag right after the block element - * ends. Later on we'll do some further clean up. - * - */ - $str = preg_replace("#(<.*?)(".$this->block_elements.")(.*?>)#", "

                \\1\\2\\3", $str); - $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

                ", $str); - - /* - * Convert "ignore" tags to temporary marker - * - * The parser splits out the string at every tag - * it encounters. Certain inline tags, like image - * tags, links, span tags, etc. will be adversely - * affected if they are split out so we'll convert - * the opening < temporarily to: {@TAG} - * - */ - $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{@TAG}\\1\\2", $str); - - /* - * Split the string at every tag - * - * This creates an array with this prototype: - * - * [array] - * { - * [0] = - * [1] = Content contained between the tags - * [2] = - * Etc... - * } - * - */ - $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); - - /* - * Build our finalized string - * - * We'll cycle through the array, skipping tags, - * and processing the contained text - * - */ - $str = ''; - $process = TRUE; - foreach ($chunks as $chunk) - { - /* - * Are we dealing with a tag? - * - * If so, we'll skip the processing for this cycle. - * Well also set the "process" flag which allows us - * to skip

                 tags and a few other things.
                -			 *
                -			 */
                -			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match))
                -			{
                -				if (preg_match("#".$this->skip_elements."#", $match['2']))
                -				{
                -					$process =  ($match['1'] == '/') ? TRUE : FALSE;		
                -				}
                -		
                -				$str .= $chunk;
                -				continue;
                -			}
                -		
                -			if ($process == FALSE)
                -			{
                -				$str .= $chunk;
                -				continue;
                -			}
                -			
                -			//  Convert Newlines into 

                and
                tags - $str .= $this->format_newlines($chunk); - } - - // FINAL CLEAN UP - // IMPORTANT: DO NOT ALTER THE ORDER OF THE ITEMS BELOW! - - /* - * Clean up paragraph tags before/after "block" elements - * - * Earlier we added

                tags before/after block level elements. - * Then, we added paragraph tags around double line breaks. This - * potentially created incorrectly formatted paragraphs so we'll - * clean it up here. - * - */ - $str = preg_replace("#

                ({@TAG}.*?)(".$this->block_elements.")(.*?>)#", "\\1\\2\\3", $str); - $str = preg_replace("#({@TAG}/.*?)(".$this->block_elements.")(.*?>)

                #", "\\1\\2\\3", $str); - - // Convert Quotes and other characters - $str = $this->format_characters($str); - - // Fix an artifact that happens during the paragraph replacement - $str = preg_replace('#(

                \n*

                )#', '', $str); - - // If the user submitted their own paragraph tags with class data - // in them we will retain them instead of using our tags. - $str = preg_replace('#()

                #', "\\1", $str); - - // Final clean up - $str = str_replace( - array( - '

                ', - '

                ', - '

                ', - '

                ', - '{@TAG}', - '{@DQ}', - '{@SQ}', - '

                ' - ), - array( - '

                ', - '

                ', - '

                ', - '

                ', - '<', - '"', - "'", - '' - ), - $str - ); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Format Characters - * - * This function mainly converts double and single quotes - * to entities, but since these are directional, it does - * it based on some rules. It also converts em-dashes - * and a couple other things. - */ - function format_characters($str) - { - $table = array( - ' "' => " “", - '" ' => "” ", - " '" => " ‘", - "' " => "’ ", - - '>"' => ">“", - '"<' => "”<", - ">'" => ">‘", - "'<" => "’<", - - "\"." => "”.", - "\"," => "”,", - "\";" => "”;", - "\":" => "”:", - "\"!" => "”!", - "\"?" => "”?", - - ". " => ".  ", - "? " => "?  ", - "! " => "!  ", - ": " => ":  ", - ); - - // These deal with quotes within quotes, like: "'hi here'" - $start = 0; - $space = array("\n", "\t", " "); - - while(TRUE) - { - $current = strpos(substr($str, $start), "\"'"); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+2, 1); - - if ( ! in_array($one_after, $space, TRUE) && $one_after != "<") - { - $str = str_replace( $one_before."\"'".$one_after, - $one_before."“‘".$one_after, - $str); - } - elseif ( ! in_array($one_before, $space, TRUE) && (in_array($one_after, $space, TRUE) OR $one_after == '<')) - { - $str = str_replace( $one_before."\"'".$one_after, - $one_before."”’".$one_after, - $str); - } - - $start = $start+$current+2; - } - - $start = 0; - - while(TRUE) - { - $current = strpos(substr($str, $start), "'\""); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+2, 1); - - if ( in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE) && $one_after != "<") - { - $str = str_replace( $one_before."'\"".$one_after, - $one_before."‘“".$one_after, - $str); - } - elseif ( ! in_array($one_before, $space, TRUE) && $one_before != ">") - { - $str = str_replace( $one_before."'\"".$one_after, - $one_before."’”".$one_after, - $str); - } - - $start = $start+$current+2; - } - - // Are there quotes within a word, as in: ("something") - if (preg_match_all("/(.)\"(\S+?)\"(.)/", $str, $matches)) - { - for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) - { - if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE)) - { - $str = str_replace( $matches['0'][$i], - $matches['1'][$i]."“".$matches['2'][$i]."”".$matches['3'][$i], - $str); - } - } - } - - if (preg_match_all("/(.)\'(\S+?)\'(.)/", $str, $matches)) - { - for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) - { - if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE)) - { - $str = str_replace( $matches['0'][$i], - $matches['1'][$i]."‘".$matches['2'][$i]."’".$matches['3'][$i], - $str); - } - } - } - - // How about one apostrophe, as in Rick's - $start = 0; - - while(TRUE) - { - $current = strpos(substr($str, $start), "'"); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+1, 1); - - if ( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE)) - { - $str = str_replace( $one_before."'".$one_after, - $one_before."’".$one_after, - $str); - } - - $start = $start+$current+2; - } - - // Em-dashes - $start = 0; - while(TRUE) - { - $current = strpos(substr($str, $start), "--"); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+2, 1); - $two_before = substr($str, $start+$current-2, 1); - $two_after = substr($str, $start+$current+3, 1); - - if (( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE)) - OR - ( ! in_array($two_before, $space, TRUE) && ! in_array($two_after, $space, TRUE) && $one_before == ' ' && $one_after == ' ') - ) - { - $str = str_replace( $two_before.$one_before."--".$one_after.$two_after, - $two_before.trim($one_before)."—".trim($one_after).$two_after, - $str); - } - - $start = $start+$current+2; - } - - // Ellipsis - $str = preg_replace("#(\w)\.\.\.(\s|
                |

                )#", "\\1…\\2", $str); - $str = preg_replace("#(\s|
                |

                )\.\.\.(\w)#", "\\1…\\2", $str); - - // Run the translation array we defined above - $str = str_replace(array_keys($table), array_values($table), $str); - - // If there are any stray double quotes we'll catch them here - - $start = 0; - - while(TRUE) - { - $current = strpos(substr($str, $start), '"'); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+1, 1); - - if ( ! in_array($one_after, $space, TRUE)) - { - $str = str_replace( $one_before.'"'.$one_after, - $one_before."“".$one_after, - $str); - } - elseif( ! in_array($one_before, $space, TRUE)) - { - $str = str_replace( $one_before."'".$one_after, - $one_before."”".$one_after, - $str); - } - - $start = $start+$current+2; - } - - $start = 0; - - while(TRUE) - { - $current = strpos(substr($str, $start), "'"); - - if ($current === FALSE) break; - - $one_before = substr($str, $start+$current-1, 1); - $one_after = substr($str, $start+$current+1, 1); - - if ( ! in_array($one_after, $space, TRUE)) - { - $str = str_replace( $one_before."'".$one_after, - $one_before."‘".$one_after, - $str); - } - elseif( ! in_array($one_before, $space, TRUE)) - { - $str = str_replace( $one_before."'".$one_after, - $one_before."’".$one_after, - $str); - } - - $start = $start+$current+2; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Format Newlines - * - * Converts newline characters into either

                tags or
                - * - */ - function format_newlines($str) - { - if ($str == '') - { - return $str; - } - - if (strpos($str, "\n") === FALSE) - { - return '

                '.$str.'

                '; - } - - $str = str_replace("\n\n", "

                \n\n

                ", $str); - $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
                \\2\\3", $str); - - return '

                '.$str.'

                '; - } -} - - +",$str); + $ct = count($ex); + + $newstr = ""; + for ($i = 0; $i < $ct; $i++) + { + if (($i % 2) == 0) + { + $newstr .= nl2br($ex[$i]); + } + else + { + $newstr .= $ex[$i]; + } + + if ($ct - 1 != $i) + $newstr .= "pre>"; + } + + return $newstr; +} + +// ------------------------------------------------------------------------ + +/** + * Auto Typography Wrapper Function + * + * + * @access public + * @param string + * @return string + */ +function auto_typography($str) +{ + $TYPE = new Auto_typography(); + return $TYPE->convert($str); +} + +// ------------------------------------------------------------------------ + +/** + * Auto Typography Class + * + * + * @access private + * @category Helpers + * @author Rick Ellis + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/helpers/ + */ +class Auto_typography { + + // Block level elements that should not be wrapped inside

                tags + var $block_elements = 'div|blockquote|pre|code|h\d|script|ol|un'; + + // Elements that should not have

                and
                tags within them. + var $skip_elements = 'pre|ol|ul'; + + // Tags we want the parser to completely ignore when splitting the string. + var $ignore_elements = 'a|b|i|em|strong|span|img|li'; + + + /** + * Main Processing Function + * + */ + function convert($str) + { + if ($str == '') + { + return ''; + } + + $str = ' '.$str.' '; + + // Standardize Newlines to make matching easier + $str = preg_replace("/(\r\n|\r)/", "\n", $str); + + /* + * Reduce line breaks + * + * If there are more than two consecutive line + * breaks we'll compress them down to a maximum + * of two since there's no benefit to more. + * + */ + $str = preg_replace("/\n\n+/", "\n\n", $str); + + /* + * Convert quotes within tags to temporary marker + * + * We don't want quotes converted within + * tags so we'll temporarily convert them to + * {@DQ} and {@SQ} + * + */ + if (preg_match_all("#\<.+?>#si", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $str = str_replace($matches['0'][$i], + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches['0'][$i]), + $str); + } + } + + + /* + * Add closing/opening paragraph tags before/after "block" elements + * + * Since block elements (like ,

                , etc.) do not get
                +		 * wrapped in paragraph tags we will add a closing 

                tag just before + * each block element starts and an opening

                tag right after the block element + * ends. Later on we'll do some further clean up. + * + */ + $str = preg_replace("#(<.*?)(".$this->block_elements.")(.*?>)#", "

                \\1\\2\\3", $str); + $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

                ", $str); + + /* + * Convert "ignore" tags to temporary marker + * + * The parser splits out the string at every tag + * it encounters. Certain inline tags, like image + * tags, links, span tags, etc. will be adversely + * affected if they are split out so we'll convert + * the opening < temporarily to: {@TAG} + * + */ + $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{@TAG}\\1\\2", $str); + + /* + * Split the string at every tag + * + * This creates an array with this prototype: + * + * [array] + * { + * [0] = + * [1] = Content contained between the tags + * [2] = + * Etc... + * } + * + */ + $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); + + /* + * Build our finalized string + * + * We'll cycle through the array, skipping tags, + * and processing the contained text + * + */ + $str = ''; + $process = TRUE; + foreach ($chunks as $chunk) + { + /* + * Are we dealing with a tag? + * + * If so, we'll skip the processing for this cycle. + * Well also set the "process" flag which allows us + * to skip

                 tags and a few other things.
                +			 *
                +			 */
                +			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match))
                +			{
                +				if (preg_match("#".$this->skip_elements."#", $match['2']))
                +				{
                +					$process =  ($match['1'] == '/') ? TRUE : FALSE;		
                +				}
                +		
                +				$str .= $chunk;
                +				continue;
                +			}
                +		
                +			if ($process == FALSE)
                +			{
                +				$str .= $chunk;
                +				continue;
                +			}
                +			
                +			//  Convert Newlines into 

                and
                tags + $str .= $this->format_newlines($chunk); + } + + // FINAL CLEAN UP + // IMPORTANT: DO NOT ALTER THE ORDER OF THE ITEMS BELOW! + + /* + * Clean up paragraph tags before/after "block" elements + * + * Earlier we added

                tags before/after block level elements. + * Then, we added paragraph tags around double line breaks. This + * potentially created incorrectly formatted paragraphs so we'll + * clean it up here. + * + */ + $str = preg_replace("#

                ({@TAG}.*?)(".$this->block_elements.")(.*?>)#", "\\1\\2\\3", $str); + $str = preg_replace("#({@TAG}/.*?)(".$this->block_elements.")(.*?>)

                #", "\\1\\2\\3", $str); + + // Convert Quotes and other characters + $str = $this->format_characters($str); + + // Fix an artifact that happens during the paragraph replacement + $str = preg_replace('#(

                \n*

                )#', '', $str); + + // If the user submitted their own paragraph tags with class data + // in them we will retain them instead of using our tags. + $str = preg_replace('#()

                #', "\\1", $str); + + // Final clean up + $str = str_replace( + array( + '

                ', + '

                ', + '

                ', + '

                ', + '{@TAG}', + '{@DQ}', + '{@SQ}', + '

                ' + ), + array( + '

                ', + '

                ', + '

                ', + '

                ', + '<', + '"', + "'", + '' + ), + $str + ); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Format Characters + * + * This function mainly converts double and single quotes + * to entities, but since these are directional, it does + * it based on some rules. It also converts em-dashes + * and a couple other things. + */ + function format_characters($str) + { + $table = array( + ' "' => " “", + '" ' => "” ", + " '" => " ‘", + "' " => "’ ", + + '>"' => ">“", + '"<' => "”<", + ">'" => ">‘", + "'<" => "’<", + + "\"." => "”.", + "\"," => "”,", + "\";" => "”;", + "\":" => "”:", + "\"!" => "”!", + "\"?" => "”?", + + ". " => ".  ", + "? " => "?  ", + "! " => "!  ", + ": " => ":  ", + ); + + // These deal with quotes within quotes, like: "'hi here'" + $start = 0; + $space = array("\n", "\t", " "); + + while(TRUE) + { + $current = strpos(substr($str, $start), "\"'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + + if ( ! in_array($one_after, $space, TRUE) && $one_after != "<") + { + $str = str_replace( $one_before."\"'".$one_after, + $one_before."“‘".$one_after, + $str); + } + elseif ( ! in_array($one_before, $space, TRUE) && (in_array($one_after, $space, TRUE) OR $one_after == '<')) + { + $str = str_replace( $one_before."\"'".$one_after, + $one_before."”’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'\""); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + + if ( in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE) && $one_after != "<") + { + $str = str_replace( $one_before."'\"".$one_after, + $one_before."‘“".$one_after, + $str); + } + elseif ( ! in_array($one_before, $space, TRUE) && $one_before != ">") + { + $str = str_replace( $one_before."'\"".$one_after, + $one_before."’”".$one_after, + $str); + } + + $start = $start+$current+2; + } + + // Are there quotes within a word, as in: ("something") + if (preg_match_all("/(.)\"(\S+?)\"(.)/", $str, $matches)) + { + for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) + { + if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE)) + { + $str = str_replace( $matches['0'][$i], + $matches['1'][$i]."“".$matches['2'][$i]."”".$matches['3'][$i], + $str); + } + } + } + + if (preg_match_all("/(.)\'(\S+?)\'(.)/", $str, $matches)) + { + for ($i=0, $s=sizeof($matches['0']); $i < $s; ++$i) + { + if ( ! in_array($matches['1'][$i], $space, TRUE) && ! in_array($matches['3'][$i], $space, TRUE)) + { + $str = str_replace( $matches['0'][$i], + $matches['1'][$i]."‘".$matches['2'][$i]."’".$matches['3'][$i], + $str); + } + } + } + + // How about one apostrophe, as in Rick's + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + // Em-dashes + $start = 0; + while(TRUE) + { + $current = strpos(substr($str, $start), "--"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+2, 1); + $two_before = substr($str, $start+$current-2, 1); + $two_after = substr($str, $start+$current+3, 1); + + if (( ! in_array($one_before, $space, TRUE) && ! in_array($one_after, $space, TRUE)) + OR + ( ! in_array($two_before, $space, TRUE) && ! in_array($two_after, $space, TRUE) && $one_before == ' ' && $one_after == ' ') + ) + { + $str = str_replace( $two_before.$one_before."--".$one_after.$two_after, + $two_before.trim($one_before)."—".trim($one_after).$two_after, + $str); + } + + $start = $start+$current+2; + } + + // Ellipsis + $str = preg_replace("#(\w)\.\.\.(\s|
                |

                )#", "\\1…\\2", $str); + $str = preg_replace("#(\s|
                |

                )\.\.\.(\w)#", "\\1…\\2", $str); + + // Run the translation array we defined above + $str = str_replace(array_keys($table), array_values($table), $str); + + // If there are any stray double quotes we'll catch them here + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), '"'); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_after, $space, TRUE)) + { + $str = str_replace( $one_before.'"'.$one_after, + $one_before."“".$one_after, + $str); + } + elseif( ! in_array($one_before, $space, TRUE)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."”".$one_after, + $str); + } + + $start = $start+$current+2; + } + + $start = 0; + + while(TRUE) + { + $current = strpos(substr($str, $start), "'"); + + if ($current === FALSE) break; + + $one_before = substr($str, $start+$current-1, 1); + $one_after = substr($str, $start+$current+1, 1); + + if ( ! in_array($one_after, $space, TRUE)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."‘".$one_after, + $str); + } + elseif( ! in_array($one_before, $space, TRUE)) + { + $str = str_replace( $one_before."'".$one_after, + $one_before."’".$one_after, + $str); + } + + $start = $start+$current+2; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Format Newlines + * + * Converts newline characters into either

                tags or
                + * + */ + function format_newlines($str) + { + if ($str == '') + { + return $str; + } + + if (strpos($str, "\n") === FALSE) + { + return '

                '.$str.'

                '; + } + + $str = str_replace("\n\n", "

                \n\n

                ", $str); + $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
                \\2\\3", $str); + + return '

                '.$str.'

                '; + } +} + + ?> \ No newline at end of file diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index baac0e5d..c05bc208 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -1,12 +1,12 @@ ","\"", "'", "-"), - array("&", "<", ">", """, "'", "-"), - $str); - - // Decode the temp markers back to entities - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;", $str); - - return $str; -} - - +","\"", "'", "-"), + array("&", "<", ">", """, "'", "-"), + $str); + + // Decode the temp markers back to entities + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;", $str); + + return $str; +} + + ?> \ No newline at end of file diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index 66e8a24c..cf980a81 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -1,111 +1,111 @@ -marker[$name] = microtime(); - } - - // -------------------------------------------------------------------- - - /** - * Calculates the time difference between two marked points. - * - * If the first parameter is empty this function instead returns the - * {elapsed_time} pseudo-variable. This permits the full system - * execution time to be shown in a template. The output class will - * swap the real value for this variable. - * - * @access public - * @param string a particular marked point - * @param string a particular marked point - * @param integer the number of decimal places - * @return mixed - */ - function elapsed_time($point1 = '', $point2 = '', $decimals = 4) - { - if ($point1 == '') - { - return '{elapsed_time}'; - } - - if ( ! isset($this->marker[$point1])) - { - return ''; - } - - if ( ! isset($this->marker[$point2])) - { - $this->marker[$point2] = microtime(); - } - - list($sm, $ss) = explode(' ', $this->marker[$point1]); - list($em, $es) = explode(' ', $this->marker[$point2]); - - return number_format(($em + $es) - ($sm + $ss), $decimals); - } - - // -------------------------------------------------------------------- - - /** - * Memory Usage - * - * This function returns the {memory_usage} pseudo-variable. - * This permits it to be put it anywhere in a template - * without the memory being calculated until the end. - * The output class will swap the real value for this variable. - * - * @access public - * @return string - */ - function memory_usage() - { - return '{memory_usage}'; - } - -} - -// END CI_Benchmark class +marker[$name] = microtime(); + } + + // -------------------------------------------------------------------- + + /** + * Calculates the time difference between two marked points. + * + * If the first parameter is empty this function instead returns the + * {elapsed_time} pseudo-variable. This permits the full system + * execution time to be shown in a template. The output class will + * swap the real value for this variable. + * + * @access public + * @param string a particular marked point + * @param string a particular marked point + * @param integer the number of decimal places + * @return mixed + */ + function elapsed_time($point1 = '', $point2 = '', $decimals = 4) + { + if ($point1 == '') + { + return '{elapsed_time}'; + } + + if ( ! isset($this->marker[$point1])) + { + return ''; + } + + if ( ! isset($this->marker[$point2])) + { + $this->marker[$point2] = microtime(); + } + + list($sm, $ss) = explode(' ', $this->marker[$point1]); + list($em, $es) = explode(' ', $this->marker[$point2]); + + return number_format(($em + $es) - ($sm + $ss), $decimals); + } + + // -------------------------------------------------------------------- + + /** + * Memory Usage + * + * This function returns the {memory_usage} pseudo-variable. + * This permits it to be put it anywhere in a template + * without the memory being calculated until the end. + * The output class will swap the real value for this variable. + * + * @access public + * @return string + */ + function memory_usage() + { + return '{memory_usage}'; + } + +} + +// END CI_Benchmark class ?> \ No newline at end of file diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index fdef5dd7..ef6a3f84 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -1,475 +1,475 @@ -CI =& get_instance(); - - if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE)) - { - $this->CI->lang->load('calendar'); - } - - $this->local_time = time(); - - if (count($config) > 0) - { - $this->initialize($config); - } - - log_message('debug', "Calendar Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize the user preferences - * - * Accepts an associative array as input, containing display preferences - * - * @access public - * @param array config preferences - * @return void - */ - function initialize($config = array()) - { - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $this->$key = $val; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Generate the calendar - * - * @access public - * @param integer the year - * @param integer the month - * @param array the data to be shown in the calendar cells - * @return string - */ - 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 = '200'.$year; - - if (strlen($year) == 2) - $year = '20'.$year; - - if (strlen($month) == 1) - $month = '0'.$month; - - $adjusted_date = $this->adjust_date($month, $year); - - $month = $adjusted_date['month']; - $year = $adjusted_date['year']; - - // Determine the total days in the month - $total_days = $this->get_total_days($month, $year); - - // Set the starting day of the week - $start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6); - $start_day = ( ! isset($start_days[$this->start_day])) ? 0 : $start_days[$this->start_day]; - - // Set the starting day number - $local_date = mktime(12, 0, 0, $month, 1, $year); - $date = getdate($local_date); - $day = $start_day + 1 - $date["wday"]; - - while ($day > 1) - { - $day -= 7; - } - - // 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); - - $is_current_month = ($cur_year == $year AND $cur_month == $month) ? TRUE : FALSE; - - // Generate the template data array - $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"; - - // "previous" month link - if ($this->show_next_prev == TRUE) - { - // Add a trailing slash to the URL if needed - $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"; - } - - // 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']); - - $out .= $this->temp['heading_title_cell']; - $out .= "\n"; - - // "next" month link - if ($this->show_next_prev == TRUE) - { - $adjusted_date = $this->adjust_date($month + 1, $year); - $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"; - - $day_names = $this->get_day_names(); - - for ($i = 0; $i < 7; $i ++) - { - $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"; - - // Build the main body of the calendar - while ($day <= $total_days) - { - $out .= "\n"; - $out .= $this->temp['cal_row_start']; - $out .= "\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']; - - 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)); - } - 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']; - $out .= str_replace('{day}', $day, $temp); - } - } - else - { - // Blank cells - $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']; - $day++; - } - - $out .= "\n"; - $out .= $this->temp['cal_row_end']; - $out .= "\n"; - } - - $out .= "\n"; - $out .= $this->temp['table_close']; - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Get Month Name - * - * Generates a textual month name based on the numeric - * month provided. - * - * @access public - * @param integer the month - * @return string - */ - function get_month_name($month) - { - if ($this->month_type == 'short') - { - $month_names = array('01' => 'cal_jan', '02' => 'cal_feb', '03' => 'cal_mar', '04' => 'cal_apr', '05' => 'cal_may', '06' => 'cal_jun', '07' => 'cal_jul', '08' => 'cal_aug', '09' => 'cal_sep', '10' => 'cal_oct', '11' => 'cal_nov', '12' => 'cal_dec'); - } - else - { - $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_november', '12' => 'cal_december'); - } - - $month = $month_names[$month]; - - if ($this->CI->lang->line($month) === FALSE) - { - return ucfirst(str_replace('cal_', '', $month)); - } - - return $this->CI->lang->line($month); - } - - // -------------------------------------------------------------------- - - /** - * Get Day Names - * - * Returns an array of day names (Sunday, Monday, etc.) based - * on the type. Options: long, short, abrev - * - * @access public - * @param string - * @return array - */ - function get_day_names($day_type = '') - { - if ($day_type != '') - $this->day_type = $day_type; - - if ($this->day_type == 'long') - { - $day_names = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); - } - elseif ($this->day_type == 'short') - { - $day_names = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); - } - else - { - $day_names = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'); - } - - $days = array(); - foreach ($day_names as $val) - { - $days[] = ($this->CI->lang->line('cal_'.$val) === FALSE) ? ucfirst($val) : $this->CI->lang->line('cal_'.$val); - } - - return $days; - } - - // -------------------------------------------------------------------- - - /** - * Adjust Date - * - * This function makes sure that we have a valid month/year. - * For example, if you submit 13 as the month, the year will - * increment and the month will become January. - * - * @access public - * @param integer the month - * @param integer the year - * @return array - */ - function adjust_date($month, $year) - { - $date = array(); - - $date['month'] = $month; - $date['year'] = $year; - - while ($date['month'] > 12) - { - $date['month'] -= 12; - $date['year']++; - } - - while ($date['month'] <= 0) - { - $date['month'] += 12; - $date['year']--; - } - - if (strlen($date['month']) == 1) - { - $date['month'] = '0'.$date['month']; - } - - return $date; - } - - // -------------------------------------------------------------------- - - /** - * Total days in a given month - * - * @access public - * @param integer the month - * @param integer the year - * @return integer - */ - function get_total_days($month, $year) - { - $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); - - if ($month < 1 OR $month > 12) - { - return 0; - } - - // Is the year a leap year? - if ($month == 2) - { - if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) - { - return 29; - } - } - - return $days_in_month[$month - 1]; - } - - // -------------------------------------------------------------------- - - /** - * Set Default Template Data - * - * This is used in the event that the user has not created their own template - * - * @access public - * @return array - */ - function default_template() - { - return array ( - 'table_open' => '', - 'heading_row_start' => '', - 'heading_previous_cell' => '', - 'heading_title_cell' => '', - 'heading_next_cell' => '', - 'heading_row_end' => '', - 'week_row_start' => '', - 'week_day_cell' => '', - 'week_row_end' => '', - 'cal_row_start' => '', - 'cal_cell_start' => '', - 'cal_cell_end_today' => '', - 'cal_row_end' => '', - 'table_close' => '
                <<{heading}>>
                {week_day}
                ', - 'cal_cell_start_today' => '', - 'cal_cell_content' => '{day}', - 'cal_cell_content_today' => '{day}', - 'cal_cell_no_content' => '{day}', - 'cal_cell_no_content_today' => '{day}', - 'cal_cell_blank' => ' ', - 'cal_cell_end' => '
                ' - ); - } - - // -------------------------------------------------------------------- - - /** - * Parse Template - * - * Harvests the data within the template {pseudo-variables} - * used to display the calendar - * - * @access public - * @return void - */ - function parse_template() - { - $this->temp = $this->default_template(); - - if ($this->template == '') - { - return; - } - - $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); - - foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) - { - if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) - { - $this->temp[$val] = $match['1']; - } - else - { - if (in_array($val, $today, TRUE)) - { - $this->temp[$val] = $this->temp[str_replace('_today', '', $val)]; - } - } - } - } - -} - -// END CI_Calendar class +CI =& get_instance(); + + if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE)) + { + $this->CI->lang->load('calendar'); + } + + $this->local_time = time(); + + if (count($config) > 0) + { + $this->initialize($config); + } + + log_message('debug', "Calendar Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize the user preferences + * + * Accepts an associative array as input, containing display preferences + * + * @access public + * @param array config preferences + * @return void + */ + function initialize($config = array()) + { + foreach ($config as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Generate the calendar + * + * @access public + * @param integer the year + * @param integer the month + * @param array the data to be shown in the calendar cells + * @return string + */ + 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 = '200'.$year; + + if (strlen($year) == 2) + $year = '20'.$year; + + if (strlen($month) == 1) + $month = '0'.$month; + + $adjusted_date = $this->adjust_date($month, $year); + + $month = $adjusted_date['month']; + $year = $adjusted_date['year']; + + // Determine the total days in the month + $total_days = $this->get_total_days($month, $year); + + // Set the starting day of the week + $start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6); + $start_day = ( ! isset($start_days[$this->start_day])) ? 0 : $start_days[$this->start_day]; + + // Set the starting day number + $local_date = mktime(12, 0, 0, $month, 1, $year); + $date = getdate($local_date); + $day = $start_day + 1 - $date["wday"]; + + while ($day > 1) + { + $day -= 7; + } + + // 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); + + $is_current_month = ($cur_year == $year AND $cur_month == $month) ? TRUE : FALSE; + + // Generate the template data array + $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"; + + // "previous" month link + if ($this->show_next_prev == TRUE) + { + // Add a trailing slash to the URL if needed + $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"; + } + + // 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']); + + $out .= $this->temp['heading_title_cell']; + $out .= "\n"; + + // "next" month link + if ($this->show_next_prev == TRUE) + { + $adjusted_date = $this->adjust_date($month + 1, $year); + $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"; + + $day_names = $this->get_day_names(); + + for ($i = 0; $i < 7; $i ++) + { + $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"; + + // Build the main body of the calendar + while ($day <= $total_days) + { + $out .= "\n"; + $out .= $this->temp['cal_row_start']; + $out .= "\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']; + + 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)); + } + 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']; + $out .= str_replace('{day}', $day, $temp); + } + } + else + { + // Blank cells + $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']; + $day++; + } + + $out .= "\n"; + $out .= $this->temp['cal_row_end']; + $out .= "\n"; + } + + $out .= "\n"; + $out .= $this->temp['table_close']; + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Get Month Name + * + * Generates a textual month name based on the numeric + * month provided. + * + * @access public + * @param integer the month + * @return string + */ + function get_month_name($month) + { + if ($this->month_type == 'short') + { + $month_names = array('01' => 'cal_jan', '02' => 'cal_feb', '03' => 'cal_mar', '04' => 'cal_apr', '05' => 'cal_may', '06' => 'cal_jun', '07' => 'cal_jul', '08' => 'cal_aug', '09' => 'cal_sep', '10' => 'cal_oct', '11' => 'cal_nov', '12' => 'cal_dec'); + } + else + { + $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_november', '12' => 'cal_december'); + } + + $month = $month_names[$month]; + + if ($this->CI->lang->line($month) === FALSE) + { + return ucfirst(str_replace('cal_', '', $month)); + } + + return $this->CI->lang->line($month); + } + + // -------------------------------------------------------------------- + + /** + * Get Day Names + * + * Returns an array of day names (Sunday, Monday, etc.) based + * on the type. Options: long, short, abrev + * + * @access public + * @param string + * @return array + */ + function get_day_names($day_type = '') + { + if ($day_type != '') + $this->day_type = $day_type; + + if ($this->day_type == 'long') + { + $day_names = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); + } + elseif ($this->day_type == 'short') + { + $day_names = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); + } + else + { + $day_names = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'); + } + + $days = array(); + foreach ($day_names as $val) + { + $days[] = ($this->CI->lang->line('cal_'.$val) === FALSE) ? ucfirst($val) : $this->CI->lang->line('cal_'.$val); + } + + return $days; + } + + // -------------------------------------------------------------------- + + /** + * Adjust Date + * + * This function makes sure that we have a valid month/year. + * For example, if you submit 13 as the month, the year will + * increment and the month will become January. + * + * @access public + * @param integer the month + * @param integer the year + * @return array + */ + function adjust_date($month, $year) + { + $date = array(); + + $date['month'] = $month; + $date['year'] = $year; + + while ($date['month'] > 12) + { + $date['month'] -= 12; + $date['year']++; + } + + while ($date['month'] <= 0) + { + $date['month'] += 12; + $date['year']--; + } + + if (strlen($date['month']) == 1) + { + $date['month'] = '0'.$date['month']; + } + + return $date; + } + + // -------------------------------------------------------------------- + + /** + * Total days in a given month + * + * @access public + * @param integer the month + * @param integer the year + * @return integer + */ + function get_total_days($month, $year) + { + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + + if ($month < 1 OR $month > 12) + { + return 0; + } + + // Is the year a leap year? + if ($month == 2) + { + if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) + { + return 29; + } + } + + return $days_in_month[$month - 1]; + } + + // -------------------------------------------------------------------- + + /** + * Set Default Template Data + * + * This is used in the event that the user has not created their own template + * + * @access public + * @return array + */ + function default_template() + { + return array ( + 'table_open' => '', + 'heading_row_start' => '', + 'heading_previous_cell' => '', + 'heading_title_cell' => '', + 'heading_next_cell' => '', + 'heading_row_end' => '', + 'week_row_start' => '', + 'week_day_cell' => '', + 'week_row_end' => '', + 'cal_row_start' => '', + 'cal_cell_start' => '', + 'cal_cell_end_today' => '', + 'cal_row_end' => '', + 'table_close' => '
                <<{heading}>>
                {week_day}
                ', + 'cal_cell_start_today' => '', + 'cal_cell_content' => '{day}', + 'cal_cell_content_today' => '{day}', + 'cal_cell_no_content' => '{day}', + 'cal_cell_no_content_today' => '{day}', + 'cal_cell_blank' => ' ', + 'cal_cell_end' => '
                ' + ); + } + + // -------------------------------------------------------------------- + + /** + * Parse Template + * + * Harvests the data within the template {pseudo-variables} + * used to display the calendar + * + * @access public + * @return void + */ + function parse_template() + { + $this->temp = $this->default_template(); + + if ($this->template == '') + { + return; + } + + $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); + + foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) + { + if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) + { + $this->temp[$val] = $match['1']; + } + else + { + if (in_array($val, $today, TRUE)) + { + $this->temp[$val] = $this->temp[str_replace('_today', '', $val)]; + } + } + } + } + +} + +// END CI_Calendar class ?> \ No newline at end of file diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 28409fbc..831ba925 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -1,245 +1,245 @@ -config =& get_config(); - log_message('debug', "Config Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Load Config File - * - * @access public - * @param string the config file name - * @return boolean if the file was loaded correctly - */ - function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) - { - $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); - - if (in_array($file, $this->is_loaded, TRUE)) - { - return TRUE; - } - - if ( ! file_exists(APPPATH.'config/'.$file.EXT)) - { - if ($fail_gracefully === TRUE) - { - return FALSE; - } - show_error('The configuration file '.$file.EXT.' does not exist.'); - } - - include(APPPATH.'config/'.$file.EXT); - - if ( ! isset($config) OR ! is_array($config)) - { - if ($fail_gracefully === TRUE) - { - return FALSE; - } - show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.'); - } - - if ($use_sections === TRUE) - { - if (isset($this->config[$file])) - { - $this->config[$file] = array_merge($this->config[$file], $config); - } - else - { - $this->config[$file] = $config; - } - } - else - { - $this->config = array_merge($this->config, $config); - } - - $this->is_loaded[] = $file; - unset($config); - - log_message('debug', 'Config file loaded: config/'.$file.EXT); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a config file item - * - * - * @access public - * @param string the config item name - * @param string the index name - * @param bool - * @return string - */ - function item($item, $index = '') - { - if ($index == '') - { - if ( ! isset($this->config[$item])) - { - return FALSE; - } - - $pref = $this->config[$item]; - } - else - { - if ( ! isset($this->config[$index])) - { - return FALSE; - } - - if ( ! isset($this->config[$index][$item])) - { - return FALSE; - } - - $pref = $this->config[$index][$item]; - } - - return $pref; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a config file item - adds slash after item - * - * The second parameter allows a slash to be added to the end of - * the item, in the case of a path. - * - * @access public - * @param string the config item name - * @param bool - * @return string - */ - function slash_item($item) - { - if ( ! isset($this->config[$item])) - { - return FALSE; - } - - $pref = $this->config[$item]; - - if ($pref != '') - { - if (ereg("/$", $pref) === FALSE) - { - $pref .= '/'; - } - } - - return $pref; - } - - // -------------------------------------------------------------------- - - /** - * Site URL - * - * @access public - * @param string the URI string - * @return string - */ - function site_url($uri = '') - { - if (is_array($uri)) - { - $uri = implode('/', $uri); - } - - if ($uri == '') - { - return $this->slash_item('base_url').$this->item('index_page'); - } - else - { - $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); - return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; - } - } - - // -------------------------------------------------------------------- - - /** - * System URL - * - * @access public - * @return string - */ - function system_url() - { - $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); - return $this->slash_item('base_url').end($x).'/'; - } - - // -------------------------------------------------------------------- - - /** - * Set a config file item - * - * @access public - * @param string the config item key - * @param string the config item value - * @return void - */ - function set_item($item, $value) - { - $this->config[$item] = $value; - } - -} - -// END CI_Config class +config =& get_config(); + log_message('debug', "Config Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Load Config File + * + * @access public + * @param string the config file name + * @return boolean if the file was loaded correctly + */ + function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { + $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); + + if (in_array($file, $this->is_loaded, TRUE)) + { + return TRUE; + } + + if ( ! file_exists(APPPATH.'config/'.$file.EXT)) + { + if ($fail_gracefully === TRUE) + { + return FALSE; + } + show_error('The configuration file '.$file.EXT.' does not exist.'); + } + + include(APPPATH.'config/'.$file.EXT); + + if ( ! isset($config) OR ! is_array($config)) + { + if ($fail_gracefully === TRUE) + { + return FALSE; + } + show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.'); + } + + if ($use_sections === TRUE) + { + if (isset($this->config[$file])) + { + $this->config[$file] = array_merge($this->config[$file], $config); + } + else + { + $this->config[$file] = $config; + } + } + else + { + $this->config = array_merge($this->config, $config); + } + + $this->is_loaded[] = $file; + unset($config); + + log_message('debug', 'Config file loaded: config/'.$file.EXT); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item + * + * + * @access public + * @param string the config item name + * @param string the index name + * @param bool + * @return string + */ + function item($item, $index = '') + { + if ($index == '') + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + + $pref = $this->config[$item]; + } + else + { + if ( ! isset($this->config[$index])) + { + return FALSE; + } + + if ( ! isset($this->config[$index][$item])) + { + return FALSE; + } + + $pref = $this->config[$index][$item]; + } + + return $pref; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a config file item - adds slash after item + * + * The second parameter allows a slash to be added to the end of + * the item, in the case of a path. + * + * @access public + * @param string the config item name + * @param bool + * @return string + */ + function slash_item($item) + { + if ( ! isset($this->config[$item])) + { + return FALSE; + } + + $pref = $this->config[$item]; + + if ($pref != '') + { + if (ereg("/$", $pref) === FALSE) + { + $pref .= '/'; + } + } + + return $pref; + } + + // -------------------------------------------------------------------- + + /** + * Site URL + * + * @access public + * @param string the URI string + * @return string + */ + function site_url($uri = '') + { + if (is_array($uri)) + { + $uri = implode('/', $uri); + } + + if ($uri == '') + { + return $this->slash_item('base_url').$this->item('index_page'); + } + else + { + $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix'); + return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix; + } + } + + // -------------------------------------------------------------------- + + /** + * System URL + * + * @access public + * @return string + */ + function system_url() + { + $x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH)); + return $this->slash_item('base_url').end($x).'/'; + } + + // -------------------------------------------------------------------- + + /** + * Set a config file item + * + * @access public + * @param string the config item key + * @param string the config item value + * @return void + */ + function set_item($item, $value) + { + $this->config[$item] = $value; + } + +} + +// END CI_Config class ?> \ No newline at end of file diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index c8fa646c..81421cf3 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -1,115 +1,115 @@ -_ci_initialize(); - log_message('debug', "Controller Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize - * - * Assigns all the bases classes loaded by the front controller to - * variables in this class. Also calls the autoload routine. - * - * @access private - * @return void - */ - function _ci_initialize() - { - // Assign all the class objects that were instantiated by the - // front controller to local class variables so that CI can be - // run as one big super object. - $classes = array( - 'config' => 'Config', - 'input' => 'Input', - 'benchmark' => 'Benchmark', - 'uri' => 'URI', - 'output' => 'Output', - 'lang' => 'Language' - ); - - foreach ($classes as $var => $class) - { - $this->$var =& load_class($class); - } - - // In PHP 5 the Loader class is run as a discreet - // class. In PHP 4 it extends the Controller - if (floor(phpversion()) >= 5) - { - $this->load =& load_class('Loader'); - $this->load->_ci_autoloader(); - } - else - { - $this->_ci_autoloader(); - } - } - - // -------------------------------------------------------------------- - - /** - * Run Scaffolding - * - * @access private - * @return void - */ - function _ci_scaffolding() - { - if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE) - { - show_404('Scaffolding unavailable'); - } - - $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3); - - require_once(BASEPATH.'scaffolding/Scaffolding'.EXT); - $scaff = new Scaffolding($this->_ci_scaff_table); - $scaff->$method(); - } - - -} -// END _Controller class +_ci_initialize(); + log_message('debug', "Controller Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize + * + * Assigns all the bases classes loaded by the front controller to + * variables in this class. Also calls the autoload routine. + * + * @access private + * @return void + */ + function _ci_initialize() + { + // Assign all the class objects that were instantiated by the + // front controller to local class variables so that CI can be + // run as one big super object. + $classes = array( + 'config' => 'Config', + 'input' => 'Input', + 'benchmark' => 'Benchmark', + 'uri' => 'URI', + 'output' => 'Output', + 'lang' => 'Language' + ); + + foreach ($classes as $var => $class) + { + $this->$var =& load_class($class); + } + + // In PHP 5 the Loader class is run as a discreet + // class. In PHP 4 it extends the Controller + if (floor(phpversion()) >= 5) + { + $this->load =& load_class('Loader'); + $this->load->_ci_autoloader(); + } + else + { + $this->_ci_autoloader(); + } + } + + // -------------------------------------------------------------------- + + /** + * Run Scaffolding + * + * @access private + * @return void + */ + function _ci_scaffolding() + { + if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE) + { + show_404('Scaffolding unavailable'); + } + + $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3); + + require_once(BASEPATH.'scaffolding/Scaffolding'.EXT); + $scaff = new Scaffolding($this->_ci_scaff_table); + $scaff->$method(); + } + + +} +// END _Controller class ?> \ No newline at end of file diff --git a/system/libraries/Email.php b/system/libraries/Email.php index e6dd614f..a8acec67 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1,1719 +1,1719 @@ - 0) - { - $this->initialize($config); - } - - log_message('debug', "Email Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize preferences - * - * @access public - * @param array - * @return void - */ - function initialize($config = array()) - { - $this->clear(); - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $method = 'set_'.$key; - - if (method_exists($this, $method)) - { - $this->$method($val); - } - else - { - $this->$key = $val; - } - } - } - $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = (@ini_get("safe_mode") == 0) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Initialize the Email Data - * - * @access public - * @return void - */ - function clear($clear_attachments = FALSE) - { - $this->_subject = ""; - $this->_body = ""; - $this->_finalbody = ""; - $this->_header_str = ""; - $this->_replyto_flag = FALSE; - $this->_recipients = array(); - $this->_headers = array(); - $this->_debug_msg = array(); - - $this->_set_header('User-Agent', $this->useragent); - $this->_set_header('Date', $this->_set_date()); - - if ($clear_attachments !== FALSE) - { - $this->_attach_name = array(); - $this->_attach_type = array(); - $this->_attach_disp = array(); - } - } - - // -------------------------------------------------------------------- - - /** - * Set FROM - * - * @access public - * @param string - * @param string - * @return void - */ - function from($from, $name = '') - { - if (preg_match( '/\<(.*)\>/', $from, $match)) - $from = $match['1']; - - if ($this->validate) - $this->validate_email($this->_str_to_array($from)); - - if ($name != '' && substr($name, 0, 1) != '"') - { - $name = '"'.$name.'"'; - } - - $this->_set_header('From', $name.' <'.$from.'>'); - $this->_set_header('Return-Path', '<'.$from.'>'); - } - - // -------------------------------------------------------------------- - - /** - * Set Reply-to - * - * @access public - * @param string - * @param string - * @return void - */ - function reply_to($replyto, $name = '') - { - if (preg_match( '/\<(.*)\>/', $replyto, $match)) - $replyto = $match['1']; - - if ($this->validate) - $this->validate_email($this->_str_to_array($replyto)); - - if ($name == '') - { - $name = $replyto; - } - - if (substr($name, 0, 1) != '"') - { - $name = '"'.$name.'"'; - } - - $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); - $this->_replyto_flag = TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Recipients - * - * @access public - * @param string - * @return void - */ - function to($to) - { - $to = $this->_str_to_array($to); - $to = $this->clean_email($to); - - if ($this->validate) - $this->validate_email($to); - - if ($this->_get_protocol() != 'mail') - $this->_set_header('To', implode(", ", $to)); - - switch ($this->_get_protocol()) - { - case 'smtp' : $this->_recipients = $to; - break; - case 'sendmail' : $this->_recipients = implode(", ", $to); - break; - case 'mail' : $this->_recipients = implode(", ", $to); - break; - } - } - - // -------------------------------------------------------------------- - - /** - * Set CC - * - * @access public - * @param string - * @return void - */ - function cc($cc) - { - $cc = $this->_str_to_array($cc); - $cc = $this->clean_email($cc); - - if ($this->validate) - $this->validate_email($cc); - - $this->_set_header('Cc', implode(", ", $cc)); - - if ($this->_get_protocol() == "smtp") - $this->_cc_array = $cc; - } - - // -------------------------------------------------------------------- - - /** - * Set BCC - * - * @access public - * @param string - * @param string - * @return void - */ - function bcc($bcc, $limit = '') - { - if ($limit != '' && is_numeric($limit)) - { - $this->bcc_batch_mode = true; - $this->bcc_batch_size = $limit; - } - - $bcc = $this->_str_to_array($bcc); - $bcc = $this->clean_email($bcc); - - if ($this->validate) - $this->validate_email($bcc); - - if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) - $this->_bcc_array = $bcc; - else - $this->_set_header('Bcc', implode(", ", $bcc)); - } - - // -------------------------------------------------------------------- - - /** - * Set Email Subject - * - * @access public - * @param string - * @return void - */ - function subject($subject) - { - $subject = preg_replace("/(\r\n)|(\r)|(\n)/", "", $subject); - $subject = preg_replace("/(\t)/", " ", $subject); - - $this->_set_header('Subject', trim($subject)); - } - - // -------------------------------------------------------------------- - - /** - * Set Body - * - * @access public - * @param string - * @return void - */ - function message($body) - { - $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); - } - - // -------------------------------------------------------------------- - - /** - * Assign file attachments - * - * @access public - * @param string - * @return string - */ - function attach($filename, $disposition = 'attachment') - { - $this->_attach_name[] = $filename; - $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); - $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters - } - - // -------------------------------------------------------------------- - - /** - * Add a Header Item - * - * @access public - * @param string - * @param string - * @return void - */ - function _set_header($header, $value) - { - $this->_headers[$header] = $value; - } - - // -------------------------------------------------------------------- - - /** - * Convert a String to an Array - * - * @access public - * @param string - * @return array - */ - function _str_to_array($email) - { - if ( ! is_array($email)) - { - if (ereg(',$', $email)) - $email = substr($email, 0, -1); - - if (ereg('^,', $email)) - $email = substr($email, 1); - - if (ereg(',', $email)) - { - $x = explode(',', $email); - $email = array(); - - for ($i = 0; $i < count($x); $i ++) - $email[] = trim($x[$i]); - } - else - { - $email = trim($email); - settype($email, "array"); - } - } - return $email; - } - - // -------------------------------------------------------------------- - - /** - * Set Multipart Value - * - * @access public - * @param string - * @return void - */ - function set_alt_message($str = '') - { - $this->alt_message = ($str == '') ? '' : $str; - } - - // -------------------------------------------------------------------- - - /** - * Set Mailtype - * - * @access public - * @param string - * @return void - */ - function set_mailtype($type = 'text') - { - $this->mailtype = ($type == 'html') ? 'html' : 'text'; - } - - // -------------------------------------------------------------------- - - /** - * Set Wordwrap - * - * @access public - * @param string - * @return void - */ - function set_wordwrap($wordwrap = TRUE) - { - $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Protocol - * - * @access public - * @param string - * @return void - */ - function set_protocol($protocol = 'mail') - { - $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); - } - - // -------------------------------------------------------------------- - - /** - * Set Priority - * - * @access public - * @param integer - * @return void - */ - function set_priority($n = 3) - { - if ( ! is_numeric($n)) - { - $this->priority = 3; - return; - } - - if ($n < 1 OR $n > 5) - { - $this->priority = 3; - return; - } - - $this->priority = $n; - } - - // -------------------------------------------------------------------- - - /** - * Set Newline Character - * - * @access public - * @param string - * @return void - */ - function set_newline($newline = "\n") - { - if ($newline != "\n" OR $newline != "\r\n" OR $newline != "\r") - { - $this->newline = "\n"; - return; - } - - $this->newline = $newline; - } - - // -------------------------------------------------------------------- - - /** - * Set Message Boundary - * - * @access private - * @return void - */ - function _set_boundaries() - { - $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative - $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary - } - - // -------------------------------------------------------------------- - - /** - * Get the Message ID - * - * @access private - * @return string - */ - function _get_message_id() - { - $from = $this->_headers['Return-Path']; - $from = str_replace(">", "", $from); - $from = str_replace("<", "", $from); - - return "<".uniqid('').strstr($from, '@').">"; - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Protocol - * - * @access private - * @param bool - * @return string - */ - function _get_protocol($return = true) - { - $this->protocol = strtolower($this->protocol); - $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol; - - if ($return == true) - return $this->protocol; - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Encoding - * - * @access private - * @param bool - * @return string - */ - function _get_encoding($return = true) - { - $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '7bit' : $this->_encoding; - - if ( ! in_array($this->charset, $this->_base_charsets, TRUE)) - $this->_encoding = "8bit"; - - if ($return == true) - return $this->_encoding; - } - - // -------------------------------------------------------------------- - - /** - * Get content type (text/html/attachment) - * - * @access private - * @return string - */ - function _get_content_type() - { - if ($this->mailtype == 'html' && count($this->_attach_name) == 0) - return 'html'; - - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) - return 'html-attach'; - - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) - return 'plain-attach'; - - else return 'plain'; - } - - // -------------------------------------------------------------------- - - /** - * Set RFC 822 Date - * - * @access public - * @return string - */ - function _set_date() - { - $timezone = date("Z"); - $operator = (substr($timezone, 0, 1) == '-') ? '-' : '+'; - $timezone = abs($timezone); - $timezone = ($timezone/3600) * 100 + ($timezone % 3600) /60; - - return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); - } - - // -------------------------------------------------------------------- - - /** - * Mime message - * - * @access private - * @return string - */ - function _get_mime_message() - { - return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; - } - - // -------------------------------------------------------------------- - - /** - * Validate Email Address - * - * @access public - * @param string - * @return bool - */ - function validate_email($email) - { - if ( ! is_array($email)) - { - $this->_set_error_message('email_must_be_array'); - return FALSE; - } - - foreach ($email as $val) - { - if ( ! $this->valid_email($val)) - { - $this->_set_error_message('email_invalid_address', $val); - return FALSE; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Email Validation - * - * @access public - * @param string - * @return bool - */ - function valid_email($address) - { - if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) - return FALSE; - else - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Clean Extended Email Address: Joe Smith - * - * @access public - * @param string - * @return string - */ - function clean_email($email) - { - if ( ! is_array($email)) - { - if (preg_match('/\<(.*)\>/', $email, $match)) - return $match['1']; - else - return $email; - } - - $clean_email = array(); - - for ($i=0; $i < count($email); $i++) - { - if (preg_match( '/\<(.*)\>/', $email[$i], $match)) - $clean_email[] = $match['1']; - else - $clean_email[] = $email[$i]; - } - - return $clean_email; - } - - // -------------------------------------------------------------------- - - /** - * Build alternative plain text message - * - * This function provides the raw message for use - * in plain-text headers of HTML-formatted emails. - * If the user hasn't specified his own alternative message - * it creates one by stripping the HTML - * - * @access private - * @return string - */ - function _get_alt_message() - { - if ($this->alt_message != "") - { - return $this->word_wrap($this->alt_message, '76'); - } - - if (eregi( '\', $this->_body, $match)) - { - $body = $match['1']; - $body = substr($body, strpos($body, ">") + 1); - } - else - { - $body = $this->_body; - } - - $body = trim(strip_tags($body)); - $body = preg_replace( '# '.$msg."\n"; - - flock($fp, LOCK_EX); - fwrite($fp, $message); - flock($fp, LOCK_UN); - fclose($fp); - - @chmod($filepath, 0666); - return TRUE; - } - -} -// END Log Class + '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); + + /** + * Constructor + * + * @access public + * @param string the log file path + * @param string the error threshold + * @param string the date formatting codes + */ + function CI_Log() + { + $config =& get_config(); + + $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; + + if ( ! is_dir($this->log_path) OR ! is_writable($this->log_path)) + { + $this->_enabled = FALSE; + } + + if (is_numeric($config['log_threshold'])) + { + $this->_threshold = $config['log_threshold']; + } + + if ($config['log_date_format'] != '') + { + $this->_date_fmt = $config['log_date_format']; + } + } + + // -------------------------------------------------------------------- + + /** + * Write Log File + * + * Generally this function will be called using the global log_message() function + * + * @access public + * @param string the error level + * @param string the error message + * @param bool whether the error is a native PHP error + * @return bool + */ + function write_log($level = 'error', $msg, $php_error = FALSE) + { + if ($this->_enabled === FALSE) + { + return FALSE; + } + + $level = strtoupper($level); + + if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) + { + return FALSE; + } + + $filepath = $this->log_path.'log-'.date('Y-m-d').EXT; + $message = ''; + + if ( ! file_exists($filepath)) + { + $message .= "<"."?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; + } + + if ( ! $fp = @fopen($filepath, "a")) + { + return FALSE; + } + + $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; + + flock($fp, LOCK_EX); + fwrite($fp, $message); + flock($fp, LOCK_UN); + fclose($fp); + + @chmod($filepath, 0666); + return TRUE; + } + +} +// END Log Class ?> \ No newline at end of file diff --git a/system/libraries/Model.php b/system/libraries/Model.php index 6f4f7e7e..3b4c2e14 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -1,82 +1,82 @@ -_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE ); - - // We don't want to assign the model object to itself when using the - // assign_libraries function below so we'll grab the name of the model parent - $this->_parent_name = ucfirst(get_class($this)); - - log_message('debug', "Model Class Initialized"); - } - - /** - * Assign Libraries - * - * Creates local references to all currently instantiated objects - * so that any syntax that can be legally used in a controller - * can be used within models. - * - * @access private - */ - function _assign_libraries($use_reference = TRUE) - { - $CI =& get_instance(); - foreach (array_keys(get_object_vars($CI)) as $key) - { - if ( ! isset($this->$key) AND $key != $this->_parent_name) - { - // In some cases using references can cause - // problems so we'll conditionally use them - if ($use_reference == TRUE) - { - // Needed to prevent reference errors with some configurations - $this->$key = ''; - $this->$key =& $CI->$key; - } - else - { - $this->$key = $CI->$key; - } - } - } - } - -} -// END Model Class +_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE ); + + // We don't want to assign the model object to itself when using the + // assign_libraries function below so we'll grab the name of the model parent + $this->_parent_name = ucfirst(get_class($this)); + + log_message('debug', "Model Class Initialized"); + } + + /** + * Assign Libraries + * + * Creates local references to all currently instantiated objects + * so that any syntax that can be legally used in a controller + * can be used within models. + * + * @access private + */ + function _assign_libraries($use_reference = TRUE) + { + $CI =& get_instance(); + foreach (array_keys(get_object_vars($CI)) as $key) + { + if ( ! isset($this->$key) AND $key != $this->_parent_name) + { + // In some cases using references can cause + // problems so we'll conditionally use them + if ($use_reference == TRUE) + { + // Needed to prevent reference errors with some configurations + $this->$key = ''; + $this->$key =& $CI->$key; + } + else + { + $this->$key = $CI->$key; + } + } + } + } + +} +// END Model Class ?> \ No newline at end of file diff --git a/system/libraries/Output.php b/system/libraries/Output.php index e5362740..743228e5 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -1,364 +1,364 @@ -final_output; - } - - // -------------------------------------------------------------------- - - /** - * Set Output - * - * Sets the output string - * - * @access public - * @param string - * @return void - */ - function set_output($output) - { - $this->final_output = $output; - } - - // -------------------------------------------------------------------- - - /** - * Set Header - * - * Lets you set a server header which will be outputted with the final display. - * - * Note: If a file is cached, headers will not be sent. We need to figure out - * how to permit header data to be saved with the cache data... - * - * @access public - * @param string - * @return void - */ - function set_header($header) - { - $this->headers[] = $header; - } - - // -------------------------------------------------------------------- - - /** - * Enable/disable Profiler - * - * @access public - * @param bool - * @return void - */ - function enable_profiler($val = TRUE) - { - $this->enable_profiler = (is_bool($val)) ? $val : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Cache - * - * @access public - * @param integer - * @return void - */ - function cache($time) - { - $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; - } - - // -------------------------------------------------------------------- - - /** - * Display Output - * - * All "view" data is automatically put into this variable by the controller class: - * - * $this->final_output - * - * This function sends the finalized output data to the browser along - * with any server headers and profile data. It also stops the - * benchmark timer so the page rendering speed and memory usage can be shown. - * - * @access public - * @return mixed - */ - function _display($output = '') - { - // Note: We use globals because we can't use $CI =& get_instance() - // since this function is sometimes called by the caching mechanism, - // which happens before the CI super object is available. - global $BM, $CFG; - - // -------------------------------------------------------------------- - - // Set the output data - if ($output == '') - { - $output =& $this->final_output; - } - - // -------------------------------------------------------------------- - - // Do we need to write a cache file? - if ($this->cache_expiration > 0) - { - $this->_write_cache($output); - } - - // -------------------------------------------------------------------- - - // Parse out the elapsed time and memory usage, - // then swap the pseudo-variables with the data - - $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); - $output = str_replace('{elapsed_time}', $elapsed, $output); - - $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; - $output = str_replace('{memory_usage}', $memory, $output); - - // -------------------------------------------------------------------- - - // Is compression requested? - if ($CFG->item('compress_output') === TRUE) - { - if (extension_loaded('zlib')) - { - if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) - { - ob_start('ob_gzhandler'); - } - } - } - - // -------------------------------------------------------------------- - - // Are there any server headers to send? - if (count($this->headers) > 0) - { - foreach ($this->headers as $header) - { - @header($header); - } - } - - // -------------------------------------------------------------------- - - // Does the get_instance() function exist? - // If not we know we are dealing with a cache file so we'll - // simply echo out the data and exit. - if ( ! function_exists('get_instance')) - { - echo $output; - log_message('debug', "Final output sent to browser"); - log_message('debug', "Total execution time: ".$elapsed); - return TRUE; - } - - // -------------------------------------------------------------------- - - // Grab the super object. We'll need it in a moment... - $CI =& get_instance(); - - // Do we need to generate profile data? - // If so, load the Profile class and run it. - if ($this->enable_profiler == TRUE) - { - $CI->load->library('profiler'); - - // If the output data contains closing and tags - // we will remove them and add them back after we insert the profile data - if (preg_match("|.*?|is", $output)) - { - $output = preg_replace("|.*?|is", '', $output); - $output .= $CI->profiler->run(); - $output .= ''; - } - else - { - $output .= $CI->profiler->run(); - } - } - - // -------------------------------------------------------------------- - - // Does the controller contain a function named _output()? - // If so send the output there. Otherwise, echo it. - if (method_exists($CI, '_output')) - { - $CI->_output($output); - } - else - { - echo $output; // Send it to the browser! - } - - log_message('debug', "Final output sent to browser"); - log_message('debug', "Total execution time: ".$elapsed); - } - - // -------------------------------------------------------------------- - - /** - * Write a Cache File - * - * @access public - * @return void - */ - function _write_cache($output) - { - $CI =& get_instance(); - $path = $CI->config->item('cache_path'); - - $cache_path = ($path == '') ? BASEPATH.'cache/' : $path; - - if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) - { - return; - } - - $uri = $CI->config->item('base_url'). - $CI->config->item('index_page'). - $CI->uri->uri_string(); - - $cache_path .= md5($uri); - - if ( ! $fp = @fopen($cache_path, 'wb')) - { - log_message('error', "Unable to write ache file: ".$cache_path); - return; - } - - $expire = time() + ($this->cache_expiration * 60); - - flock($fp, LOCK_EX); - fwrite($fp, $expire.'TS--->'.$output); - flock($fp, LOCK_UN); - fclose($fp); - @chmod($cache_path, 0777); - - log_message('debug', "Cache file written: ".$cache_path); - } - - // -------------------------------------------------------------------- - - /** - * Update/serve a cached file - * - * @access public - * @return void - */ - function _display_cache(&$CFG, &$RTR) - { - $CFG =& load_class('Config'); - $RTR =& load_class('Router'); - - $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); - - if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) - { - return FALSE; - } - - // Build the file path. The file name is an MD5 hash of the full URI - $uri = $CFG->item('base_url'). - $CFG->item('index_page'). - $RTR->uri_string; - - $filepath = $cache_path.md5($uri); - - if ( ! @file_exists($filepath)) - { - return FALSE; - } - - if ( ! $fp = @fopen($filepath, 'rb')) - { - return FALSE; - } - - flock($fp, LOCK_SH); - - $cache = ''; - if (filesize($filepath) > 0) - { - $cache = fread($fp, filesize($filepath)); - } - - flock($fp, LOCK_UN); - fclose($fp); - - // Strip out the embedded timestamp - if ( ! preg_match("/(\d+TS--->)/", $cache, $match)) - { - return FALSE; - } - - // Has the file expired? If so we'll delete it. - if (time() >= trim(str_replace('TS--->', '', $match['1']))) - { - @unlink($filepath); - log_message('debug', "Cache file has expired. File deleted"); - return FALSE; - } - - // Display the cache - $this->_display(str_replace($match['0'], '', $cache)); - log_message('debug', "Cache file is current. Sending it to browser."); - return TRUE; - } - - -} -// END Output Class +final_output; + } + + // -------------------------------------------------------------------- + + /** + * Set Output + * + * Sets the output string + * + * @access public + * @param string + * @return void + */ + function set_output($output) + { + $this->final_output = $output; + } + + // -------------------------------------------------------------------- + + /** + * Set Header + * + * Lets you set a server header which will be outputted with the final display. + * + * Note: If a file is cached, headers will not be sent. We need to figure out + * how to permit header data to be saved with the cache data... + * + * @access public + * @param string + * @return void + */ + function set_header($header) + { + $this->headers[] = $header; + } + + // -------------------------------------------------------------------- + + /** + * Enable/disable Profiler + * + * @access public + * @param bool + * @return void + */ + function enable_profiler($val = TRUE) + { + $this->enable_profiler = (is_bool($val)) ? $val : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set Cache + * + * @access public + * @param integer + * @return void + */ + function cache($time) + { + $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time; + } + + // -------------------------------------------------------------------- + + /** + * Display Output + * + * All "view" data is automatically put into this variable by the controller class: + * + * $this->final_output + * + * This function sends the finalized output data to the browser along + * with any server headers and profile data. It also stops the + * benchmark timer so the page rendering speed and memory usage can be shown. + * + * @access public + * @return mixed + */ + function _display($output = '') + { + // Note: We use globals because we can't use $CI =& get_instance() + // since this function is sometimes called by the caching mechanism, + // which happens before the CI super object is available. + global $BM, $CFG; + + // -------------------------------------------------------------------- + + // Set the output data + if ($output == '') + { + $output =& $this->final_output; + } + + // -------------------------------------------------------------------- + + // Do we need to write a cache file? + if ($this->cache_expiration > 0) + { + $this->_write_cache($output); + } + + // -------------------------------------------------------------------- + + // Parse out the elapsed time and memory usage, + // then swap the pseudo-variables with the data + + $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); + $output = str_replace('{elapsed_time}', $elapsed, $output); + + $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB'; + $output = str_replace('{memory_usage}', $memory, $output); + + // -------------------------------------------------------------------- + + // Is compression requested? + if ($CFG->item('compress_output') === TRUE) + { + if (extension_loaded('zlib')) + { + if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) + { + ob_start('ob_gzhandler'); + } + } + } + + // -------------------------------------------------------------------- + + // Are there any server headers to send? + if (count($this->headers) > 0) + { + foreach ($this->headers as $header) + { + @header($header); + } + } + + // -------------------------------------------------------------------- + + // Does the get_instance() function exist? + // If not we know we are dealing with a cache file so we'll + // simply echo out the data and exit. + if ( ! function_exists('get_instance')) + { + echo $output; + log_message('debug', "Final output sent to browser"); + log_message('debug', "Total execution time: ".$elapsed); + return TRUE; + } + + // -------------------------------------------------------------------- + + // Grab the super object. We'll need it in a moment... + $CI =& get_instance(); + + // Do we need to generate profile data? + // If so, load the Profile class and run it. + if ($this->enable_profiler == TRUE) + { + $CI->load->library('profiler'); + + // If the output data contains closing and tags + // we will remove them and add them back after we insert the profile data + if (preg_match("|.*?|is", $output)) + { + $output = preg_replace("|.*?|is", '', $output); + $output .= $CI->profiler->run(); + $output .= ''; + } + else + { + $output .= $CI->profiler->run(); + } + } + + // -------------------------------------------------------------------- + + // Does the controller contain a function named _output()? + // If so send the output there. Otherwise, echo it. + if (method_exists($CI, '_output')) + { + $CI->_output($output); + } + else + { + echo $output; // Send it to the browser! + } + + log_message('debug', "Final output sent to browser"); + log_message('debug', "Total execution time: ".$elapsed); + } + + // -------------------------------------------------------------------- + + /** + * Write a Cache File + * + * @access public + * @return void + */ + function _write_cache($output) + { + $CI =& get_instance(); + $path = $CI->config->item('cache_path'); + + $cache_path = ($path == '') ? BASEPATH.'cache/' : $path; + + if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) + { + return; + } + + $uri = $CI->config->item('base_url'). + $CI->config->item('index_page'). + $CI->uri->uri_string(); + + $cache_path .= md5($uri); + + if ( ! $fp = @fopen($cache_path, 'wb')) + { + log_message('error', "Unable to write ache file: ".$cache_path); + return; + } + + $expire = time() + ($this->cache_expiration * 60); + + flock($fp, LOCK_EX); + fwrite($fp, $expire.'TS--->'.$output); + flock($fp, LOCK_UN); + fclose($fp); + @chmod($cache_path, 0777); + + log_message('debug', "Cache file written: ".$cache_path); + } + + // -------------------------------------------------------------------- + + /** + * Update/serve a cached file + * + * @access public + * @return void + */ + function _display_cache(&$CFG, &$RTR) + { + $CFG =& load_class('Config'); + $RTR =& load_class('Router'); + + $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); + + if ( ! is_dir($cache_path) OR ! is_writable($cache_path)) + { + return FALSE; + } + + // Build the file path. The file name is an MD5 hash of the full URI + $uri = $CFG->item('base_url'). + $CFG->item('index_page'). + $RTR->uri_string; + + $filepath = $cache_path.md5($uri); + + if ( ! @file_exists($filepath)) + { + return FALSE; + } + + if ( ! $fp = @fopen($filepath, 'rb')) + { + return FALSE; + } + + flock($fp, LOCK_SH); + + $cache = ''; + if (filesize($filepath) > 0) + { + $cache = fread($fp, filesize($filepath)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + // Strip out the embedded timestamp + if ( ! preg_match("/(\d+TS--->)/", $cache, $match)) + { + return FALSE; + } + + // Has the file expired? If so we'll delete it. + if (time() >= trim(str_replace('TS--->', '', $match['1']))) + { + @unlink($filepath); + log_message('debug', "Cache file has expired. File deleted"); + return FALSE; + } + + // Display the cache + $this->_display(str_replace($match['0'], '', $cache)); + log_message('debug', "Cache file is current. Sending it to browser."); + return TRUE; + } + + +} +// END Output Class ?> \ No newline at end of file diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 07ad6a68..27104c95 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -1,211 +1,211 @@ -'; - var $cur_tag_close = ''; - var $next_tag_open = ' '; - var $next_tag_close = ' '; - var $prev_tag_open = ' '; - var $prev_tag_close = ''; - var $num_tag_open = ' '; - var $num_tag_close = ''; - - /** - * Constructor - * - * @access public - * @param array initialization parameters - */ - function CI_Pagination($params = array()) - { - if (count($params) > 0) - { - $this->initialize($params); - } - - log_message('debug', "Pagination Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize Preferences - * - * @access public - * @param array initialization parameters - * @return void - */ - function initialize($params = array()) - { - if (count($params) > 0) - { - foreach ($params as $key => $val) - { - if (isset($this->$key)) - { - $this->$key = $val; - } - } - } - } - - // -------------------------------------------------------------------- - - /** - * Generate the pagination links - * - * @access public - * @return string - */ - 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) - { - return ''; - } - - // Calculate the total number of pages - $num_pages = ceil($this->total_rows / $this->per_page); - - // Is there only one page? Hm... nothing more to do here then. - if ($num_pages == 1) - { - return ''; - } - - // Determine the current page number. - $CI =& get_instance(); - if ($CI->uri->segment($this->uri_segment) != 0) - { - $this->cur_page = $CI->uri->segment($this->uri_segment); - - // Prep the current page - no funny business! - $this->cur_page = preg_replace("/[a-z\-]/", "", $this->cur_page); - } - - if ( ! is_numeric($this->cur_page)) - { - $this->cur_page = 0; - } - - // Is the page number beyond the result range? - // If so we show the last page - if ($this->cur_page > $this->total_rows) - { - $this->cur_page = ($num_pages - 1) * $this->per_page; - } - - $uri_page_number = $this->cur_page; - $this->cur_page = floor(($this->cur_page/$this->per_page) + 1); - - // Calculate the start and end numbers. These determine - // which number to start and end the digit links with - $start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1; - $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; - - // Add a trailing slash to the base URL if needed - $this->base_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->base_url); - - // And here we go... - $output = ''; - - // Render the "First" link - if ($this->cur_page > $this->num_links) - { - $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; - } - - // Render the "previous" link - if (($this->cur_page - $this->num_links) >= 0) - { - $i = $uri_page_number - $this->per_page; - if ($i == 0) $i = ''; - $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; - } - - // Write the digit links - for ($loop = $start -1; $loop <= $end; $loop++) - { - $i = ($loop * $this->per_page) - $this->per_page; - - if ($i >= 0) - { - if ($this->cur_page == $loop) - { - $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page - } - else - { - $n = ($i == 0) ? '' : $i; - $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; - } - } - } - - // Render the "next" link - if ($this->cur_page < $num_pages) - { - $output .= $this->next_tag_open.''.$this->next_link.''.$this->next_tag_close; - } - - // Render the "Last" link - if (($this->cur_page + $this->num_links) < $num_pages) - { - $i = (($num_pages * $this->per_page) - $this->per_page); - $output .= $this->last_tag_open.''.$this->last_link.''.$this->last_tag_close; - } - - // 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); - - // Add the wrapper HTML if exists - $output = $this->full_tag_open.$output.$this->full_tag_close; - - return $output; - } -} -// END Pagination Class +'; + var $cur_tag_close = ''; + var $next_tag_open = ' '; + var $next_tag_close = ' '; + var $prev_tag_open = ' '; + var $prev_tag_close = ''; + var $num_tag_open = ' '; + var $num_tag_close = ''; + + /** + * Constructor + * + * @access public + * @param array initialization parameters + */ + function CI_Pagination($params = array()) + { + if (count($params) > 0) + { + $this->initialize($params); + } + + log_message('debug', "Pagination Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Preferences + * + * @access public + * @param array initialization parameters + * @return void + */ + function initialize($params = array()) + { + if (count($params) > 0) + { + foreach ($params as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + } + + // -------------------------------------------------------------------- + + /** + * Generate the pagination links + * + * @access public + * @return string + */ + 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) + { + return ''; + } + + // Calculate the total number of pages + $num_pages = ceil($this->total_rows / $this->per_page); + + // Is there only one page? Hm... nothing more to do here then. + if ($num_pages == 1) + { + return ''; + } + + // Determine the current page number. + $CI =& get_instance(); + if ($CI->uri->segment($this->uri_segment) != 0) + { + $this->cur_page = $CI->uri->segment($this->uri_segment); + + // Prep the current page - no funny business! + $this->cur_page = preg_replace("/[a-z\-]/", "", $this->cur_page); + } + + if ( ! is_numeric($this->cur_page)) + { + $this->cur_page = 0; + } + + // Is the page number beyond the result range? + // If so we show the last page + if ($this->cur_page > $this->total_rows) + { + $this->cur_page = ($num_pages - 1) * $this->per_page; + } + + $uri_page_number = $this->cur_page; + $this->cur_page = floor(($this->cur_page/$this->per_page) + 1); + + // Calculate the start and end numbers. These determine + // which number to start and end the digit links with + $start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1; + $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; + + // Add a trailing slash to the base URL if needed + $this->base_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->base_url); + + // And here we go... + $output = ''; + + // Render the "First" link + if ($this->cur_page > $this->num_links) + { + $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; + } + + // Render the "previous" link + if (($this->cur_page - $this->num_links) >= 0) + { + $i = $uri_page_number - $this->per_page; + if ($i == 0) $i = ''; + $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; + } + + // Write the digit links + for ($loop = $start -1; $loop <= $end; $loop++) + { + $i = ($loop * $this->per_page) - $this->per_page; + + if ($i >= 0) + { + if ($this->cur_page == $loop) + { + $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page + } + else + { + $n = ($i == 0) ? '' : $i; + $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; + } + } + } + + // Render the "next" link + if ($this->cur_page < $num_pages) + { + $output .= $this->next_tag_open.''.$this->next_link.''.$this->next_tag_close; + } + + // Render the "Last" link + if (($this->cur_page + $this->num_links) < $num_pages) + { + $i = (($num_pages * $this->per_page) - $this->per_page); + $output .= $this->last_tag_open.''.$this->last_link.''.$this->last_tag_close; + } + + // 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); + + // Add the wrapper HTML if exists + $output = $this->full_tag_open.$output.$this->full_tag_close; + + return $output; + } +} +// END Pagination Class ?> \ No newline at end of file diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 760d5d4d..613668ac 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -1,171 +1,171 @@ -load->view($template, $data, TRUE); - - if ($template == '') - { - return FALSE; - } - - foreach ($data as $key => $val) - { - if (is_string($val)) - { - $template = $this->_parse_single($key, $val, $template); - } - elseif (is_array($val)) - { - $template = $this->_parse_pair($key, $val, $template); - } - } - - if ($return == FALSE) - { - $CI->output->final_output = $template; - } - - return $template; - } - - // -------------------------------------------------------------------- - - /** - * Set the left/right variable delimiters - * - * @access public - * @param string - * @param string - * @return void - */ - function set_delimiters($l = '{', $r = '}') - { - $this->l_delim = $l; - $this->r_delim = $r; - } - - // -------------------------------------------------------------------- - - /** - * Parse a single key/value - * - * @access private - * @param string - * @param string - * @param string - * @return string - */ - function _parse_single($key, $val, $string) - { - return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); - } - - // -------------------------------------------------------------------- - - /** - * Parse a tag pair - * - * Parses tag pairs: {some_tag} string... {/some_tag} - * - * @access private - * @param string - * @param array - * @param string - * @return string - */ - function _parse_pair($variable, $data, $string) - { - if (FALSE === ($match = $this->_match_pair($string, $variable))) - { - return $string; - } - - $str = ''; - foreach ($data as $row) - { - $temp = $match['1']; - foreach ($row as $key => $val) - { - if ( ! is_array($val)) - { - $temp = $this->_parse_single($key, $val, $temp); - } - else - { - $temp = $this->_parse_pair($key, $val, $temp); - } - } - - $str .= $temp; - } - - return str_replace($match['0'], $str, $string); - } - - // -------------------------------------------------------------------- - - /** - * Matches a variable pair - * - * @access private - * @param string - * @param string - * @return mixed - */ - function _match_pair($string, $variable) - { - if ( ! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match)) - { - return FALSE; - } - - return $match; - } - -} -// END Parser Class +load->view($template, $data, TRUE); + + if ($template == '') + { + return FALSE; + } + + foreach ($data as $key => $val) + { + if (is_string($val)) + { + $template = $this->_parse_single($key, $val, $template); + } + elseif (is_array($val)) + { + $template = $this->_parse_pair($key, $val, $template); + } + } + + if ($return == FALSE) + { + $CI->output->final_output = $template; + } + + return $template; + } + + // -------------------------------------------------------------------- + + /** + * Set the left/right variable delimiters + * + * @access public + * @param string + * @param string + * @return void + */ + function set_delimiters($l = '{', $r = '}') + { + $this->l_delim = $l; + $this->r_delim = $r; + } + + // -------------------------------------------------------------------- + + /** + * Parse a single key/value + * + * @access private + * @param string + * @param string + * @param string + * @return string + */ + function _parse_single($key, $val, $string) + { + return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); + } + + // -------------------------------------------------------------------- + + /** + * Parse a tag pair + * + * Parses tag pairs: {some_tag} string... {/some_tag} + * + * @access private + * @param string + * @param array + * @param string + * @return string + */ + function _parse_pair($variable, $data, $string) + { + if (FALSE === ($match = $this->_match_pair($string, $variable))) + { + return $string; + } + + $str = ''; + foreach ($data as $row) + { + $temp = $match['1']; + foreach ($row as $key => $val) + { + if ( ! is_array($val)) + { + $temp = $this->_parse_single($key, $val, $temp); + } + else + { + $temp = $this->_parse_pair($key, $val, $temp); + } + } + + $str .= $temp; + } + + return str_replace($match['0'], $str, $string); + } + + // -------------------------------------------------------------------- + + /** + * Matches a variable pair + * + * @access private + * @param string + * @param string + * @return mixed + */ + function _match_pair($string, $variable) + { + if ( ! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match)) + { + return FALSE; + } + + return $match; + } + +} +// END Parser Class ?> \ No newline at end of file diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 37b34518..cdc4f6fc 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -1,12 +1,12 @@ CI =& get_instance(); - - log_message('debug', "Session Class Initialized"); - $this->sess_run(); - } - - // -------------------------------------------------------------------- - - /** - * Run the session routines - * - * @access public - * @return void - */ - function sess_run() - { - /* - * Set the "now" time - * - * It can either set to GMT or time(). The pref - * is set in the config file. If the developer - * is doing any sort of time localization they - * might want to set the session time to GMT so - * they can offset the "last_activity" and - * "last_visit" times based on each user's locale. - * - */ - if (strtolower($this->CI->config->item('time_reference')) == 'gmt') - { - $now = time(); - $this->now = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); - - if (strlen($this->now) < 10) - { - $this->now = time(); - log_message('error', 'The session class could not set a proper GMT timestamp so the local time() value was used.'); - } - } - else - { - $this->now = time(); - } - - /* - * Set the session length - * - * If the session expiration is set to zero in - * the config file we'll set the expiration - * two years from now. - * - */ - $expiration = $this->CI->config->item('sess_expiration'); - - if (is_numeric($expiration)) - { - if ($expiration > 0) - { - $this->sess_length = $this->CI->config->item('sess_expiration'); - } - else - { - $this->sess_length = (60*60*24*365*2); - } - } - - // Do we need encryption? - $this->encryption = $this->CI->config->item('sess_encrypt_cookie'); - - if ($this->encryption == TRUE) - { - $this->CI->load->library('encrypt'); - } - - // Are we using a database? - if ($this->CI->config->item('sess_use_database') === TRUE AND $this->CI->config->item('sess_table_name') != '') - { - $this->use_database = TRUE; - $this->session_table = $this->CI->config->item('sess_table_name'); - $this->CI->load->database(); - } - - // Set the cookie name - if ($this->CI->config->item('sess_cookie_name') != FALSE) - { - $this->sess_cookie = $this->CI->config->item('cookie_prefix').$this->CI->config->item('sess_cookie_name'); - } - - /* - * Fetch the current session - * - * If a session doesn't exist we'll create - * a new one. If it does, we'll update it. - * - */ - if ( ! $this->sess_read()) - { - $this->sess_create(); - } - else - { - // We only update the session every five minutes - if (($this->userdata['last_activity'] + 300) < $this->now) - { - $this->sess_update(); - } - } - - // Delete expired sessions if necessary - if ($this->use_database === TRUE) - { - $this->sess_gc(); - } - } - - // -------------------------------------------------------------------- - - /** - * Fetch the current session data if it exists - * - * @access public - * @return void - */ - function sess_read() - { - // Fetch the cookie - $session = $this->CI->input->cookie($this->sess_cookie); - - if ($session === FALSE) - { - log_message('debug', 'A session cookie was not found.'); - return FALSE; - } - - // Decrypt and unserialize the data - if ($this->encryption == TRUE) - { - $session = $this->CI->encrypt->decode($session); - } - - $session = @unserialize($this->strip_slashes($session)); - - if ( ! is_array($session) OR ! isset($session['last_activity'])) - { - log_message('error', 'The session cookie data did not contain a valid array. This could be a possible hacking attempt.'); - return FALSE; - } - - // Is the session current? - if (($session['last_activity'] + $this->sess_length) < $this->now) - { - $this->sess_destroy(); - return FALSE; - } - - // Does the IP Match? - if ($this->CI->config->item('sess_match_ip') == TRUE AND $session['ip_address'] != $this->CI->input->ip_address()) - { - $this->sess_destroy(); - return FALSE; - } - - // Does the User Agent Match? - if ($this->CI->config->item('sess_match_useragent') == TRUE AND $session['user_agent'] != substr($this->CI->input->user_agent(), 0, 50)) - { - $this->sess_destroy(); - return FALSE; - } - - // Is there a corresponding session in the DB? - if ($this->use_database === TRUE) - { - $this->CI->db->where('session_id', $session['session_id']); - - if ($this->CI->config->item('sess_match_ip') == TRUE) - { - $this->CI->db->where('ip_address', $session['ip_address']); - } - - if ($this->CI->config->item('sess_match_useragent') == TRUE) - { - $this->CI->db->where('user_agent', $session['user_agent']); - } - - $query = $this->CI->db->get($this->session_table); - - if ($query->num_rows() == 0) - { - $this->sess_destroy(); - return FALSE; - } - else - { - $row = $query->row(); - if (($row->last_activity + $this->sess_length) < $this->now) - { - $this->CI->db->where('session_id', $session['session_id']); - $this->CI->db->delete($this->session_table); - $this->sess_destroy(); - return FALSE; - } - } - } - - // Session is valid! - $this->userdata = $session; - unset($session); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Write the session cookie - * - * @access public - * @return void - */ - function sess_write() - { - $cookie_data = serialize($this->userdata); - - if ($this->encryption == TRUE) - { - $cookie_data = $this->CI->encrypt->encode($cookie_data); - } - - setcookie( - $this->sess_cookie, - $cookie_data, - $this->sess_length + time(), - $this->CI->config->item('cookie_path'), - $this->CI->config->item('cookie_domain'), - 0 - ); - } - - // -------------------------------------------------------------------- - - /** - * Create a new session - * - * @access public - * @return void - */ - function sess_create() - { - $sessid = ''; - while (strlen($sessid) < 32) - { - $sessid .= mt_rand(0, mt_getrandmax()); - } - - $this->userdata = array( - 'session_id' => md5(uniqid($sessid, TRUE)), - 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), - 'last_activity' => $this->now - ); - - - // Save the session in the DB if needed - if ($this->use_database === TRUE) - { - $this->CI->db->query($this->CI->db->insert_string($this->session_table, $this->userdata)); - } - - // Write the cookie - $this->userdata['last_visit'] = 0; - $this->sess_write(); - } - - // -------------------------------------------------------------------- - - /** - * Update an existing session - * - * @access public - * @return void - */ - function sess_update() - { - if (($this->userdata['last_activity'] + $this->sess_length) < $this->now) - { - $this->userdata['last_visit'] = $this->userdata['last_activity']; - } - - $this->userdata['last_activity'] = $this->now; - - // Update the session in the DB if needed - if ($this->use_database === TRUE) - { - $this->CI->db->query($this->CI->db->update_string($this->session_table, array('last_activity' => $this->now), array('session_id' => $this->userdata['session_id']))); - } - - // Write the cookie - $this->sess_write(); - } - - // -------------------------------------------------------------------- - - /** - * Destroy the current session - * - * @access public - * @return void - */ - function sess_destroy() - { - setcookie( - $this->sess_cookie, - addslashes(serialize(array())), - ($this->now - 31500000), - $this->CI->config->item('cookie_path'), - $this->CI->config->item('cookie_domain'), - 0 - ); - } - - // -------------------------------------------------------------------- - - /** - * Garbage collection - * - * This deletes expired session rows from database - * if the probability percentage is met - * - * @access public - * @return void - */ - function sess_gc() - { - srand(time()); - if ((rand() % 100) < $this->gc_probability) - { - $expire = $this->now - $this->sess_length; - - $this->CI->db->where("last_activity < {$expire}"); - $this->CI->db->delete($this->session_table); - - log_message('debug', 'Session garbage collection performed.'); - } - } - - // -------------------------------------------------------------------- - - /** - * Fetch a specific item form the session array - * - * @access public - * @param string - * @return string - */ - function userdata($item) - { - return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; - } - - // -------------------------------------------------------------------- - - /** - * Add or change data in the "userdata" array - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_userdata($newdata = array(), $newval = '') - { - if (is_string($newdata)) - { - $newdata = array($newdata => $newval); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - $this->userdata[$key] = $val; - } - } - - $this->sess_write(); - } - - // -------------------------------------------------------------------- - - /** - * Delete a session variable from the "userdata" array - * - * @access array - * @return void - */ - function unset_userdata($newdata = array()) - { - if (is_string($newdata)) - { - $newdata = array($newdata => ''); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - unset($this->userdata[$key]); - } - } - - $this->sess_write(); - } - - // -------------------------------------------------------------------- - - /** - * Strip slashes - * - * @access public - * @param mixed - * @return mixed - */ - function strip_slashes($vals) - { - if (is_array($vals)) - { - foreach ($vals as $key=>$val) - { - $vals[$key] = $this->strip_slashes($val); - } - } - else - { - $vals = stripslashes($vals); - } - - return $vals; - } - -} -// END Session Class +CI =& get_instance(); + + log_message('debug', "Session Class Initialized"); + $this->sess_run(); + } + + // -------------------------------------------------------------------- + + /** + * Run the session routines + * + * @access public + * @return void + */ + function sess_run() + { + /* + * Set the "now" time + * + * It can either set to GMT or time(). The pref + * is set in the config file. If the developer + * is doing any sort of time localization they + * might want to set the session time to GMT so + * they can offset the "last_activity" and + * "last_visit" times based on each user's locale. + * + */ + if (strtolower($this->CI->config->item('time_reference')) == 'gmt') + { + $now = time(); + $this->now = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + + if (strlen($this->now) < 10) + { + $this->now = time(); + log_message('error', 'The session class could not set a proper GMT timestamp so the local time() value was used.'); + } + } + else + { + $this->now = time(); + } + + /* + * Set the session length + * + * If the session expiration is set to zero in + * the config file we'll set the expiration + * two years from now. + * + */ + $expiration = $this->CI->config->item('sess_expiration'); + + if (is_numeric($expiration)) + { + if ($expiration > 0) + { + $this->sess_length = $this->CI->config->item('sess_expiration'); + } + else + { + $this->sess_length = (60*60*24*365*2); + } + } + + // Do we need encryption? + $this->encryption = $this->CI->config->item('sess_encrypt_cookie'); + + if ($this->encryption == TRUE) + { + $this->CI->load->library('encrypt'); + } + + // Are we using a database? + if ($this->CI->config->item('sess_use_database') === TRUE AND $this->CI->config->item('sess_table_name') != '') + { + $this->use_database = TRUE; + $this->session_table = $this->CI->config->item('sess_table_name'); + $this->CI->load->database(); + } + + // Set the cookie name + if ($this->CI->config->item('sess_cookie_name') != FALSE) + { + $this->sess_cookie = $this->CI->config->item('cookie_prefix').$this->CI->config->item('sess_cookie_name'); + } + + /* + * Fetch the current session + * + * If a session doesn't exist we'll create + * a new one. If it does, we'll update it. + * + */ + if ( ! $this->sess_read()) + { + $this->sess_create(); + } + else + { + // We only update the session every five minutes + if (($this->userdata['last_activity'] + 300) < $this->now) + { + $this->sess_update(); + } + } + + // Delete expired sessions if necessary + if ($this->use_database === TRUE) + { + $this->sess_gc(); + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current session data if it exists + * + * @access public + * @return void + */ + function sess_read() + { + // Fetch the cookie + $session = $this->CI->input->cookie($this->sess_cookie); + + if ($session === FALSE) + { + log_message('debug', 'A session cookie was not found.'); + return FALSE; + } + + // Decrypt and unserialize the data + if ($this->encryption == TRUE) + { + $session = $this->CI->encrypt->decode($session); + } + + $session = @unserialize($this->strip_slashes($session)); + + if ( ! is_array($session) OR ! isset($session['last_activity'])) + { + log_message('error', 'The session cookie data did not contain a valid array. This could be a possible hacking attempt.'); + return FALSE; + } + + // Is the session current? + if (($session['last_activity'] + $this->sess_length) < $this->now) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the IP Match? + if ($this->CI->config->item('sess_match_ip') == TRUE AND $session['ip_address'] != $this->CI->input->ip_address()) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the User Agent Match? + if ($this->CI->config->item('sess_match_useragent') == TRUE AND $session['user_agent'] != substr($this->CI->input->user_agent(), 0, 50)) + { + $this->sess_destroy(); + return FALSE; + } + + // Is there a corresponding session in the DB? + if ($this->use_database === TRUE) + { + $this->CI->db->where('session_id', $session['session_id']); + + if ($this->CI->config->item('sess_match_ip') == TRUE) + { + $this->CI->db->where('ip_address', $session['ip_address']); + } + + if ($this->CI->config->item('sess_match_useragent') == TRUE) + { + $this->CI->db->where('user_agent', $session['user_agent']); + } + + $query = $this->CI->db->get($this->session_table); + + if ($query->num_rows() == 0) + { + $this->sess_destroy(); + return FALSE; + } + else + { + $row = $query->row(); + if (($row->last_activity + $this->sess_length) < $this->now) + { + $this->CI->db->where('session_id', $session['session_id']); + $this->CI->db->delete($this->session_table); + $this->sess_destroy(); + return FALSE; + } + } + } + + // Session is valid! + $this->userdata = $session; + unset($session); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Write the session cookie + * + * @access public + * @return void + */ + function sess_write() + { + $cookie_data = serialize($this->userdata); + + if ($this->encryption == TRUE) + { + $cookie_data = $this->CI->encrypt->encode($cookie_data); + } + + setcookie( + $this->sess_cookie, + $cookie_data, + $this->sess_length + time(), + $this->CI->config->item('cookie_path'), + $this->CI->config->item('cookie_domain'), + 0 + ); + } + + // -------------------------------------------------------------------- + + /** + * Create a new session + * + * @access public + * @return void + */ + function sess_create() + { + $sessid = ''; + while (strlen($sessid) < 32) + { + $sessid .= mt_rand(0, mt_getrandmax()); + } + + $this->userdata = array( + 'session_id' => md5(uniqid($sessid, TRUE)), + 'ip_address' => $this->CI->input->ip_address(), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'last_activity' => $this->now + ); + + + // Save the session in the DB if needed + if ($this->use_database === TRUE) + { + $this->CI->db->query($this->CI->db->insert_string($this->session_table, $this->userdata)); + } + + // Write the cookie + $this->userdata['last_visit'] = 0; + $this->sess_write(); + } + + // -------------------------------------------------------------------- + + /** + * Update an existing session + * + * @access public + * @return void + */ + function sess_update() + { + if (($this->userdata['last_activity'] + $this->sess_length) < $this->now) + { + $this->userdata['last_visit'] = $this->userdata['last_activity']; + } + + $this->userdata['last_activity'] = $this->now; + + // Update the session in the DB if needed + if ($this->use_database === TRUE) + { + $this->CI->db->query($this->CI->db->update_string($this->session_table, array('last_activity' => $this->now), array('session_id' => $this->userdata['session_id']))); + } + + // Write the cookie + $this->sess_write(); + } + + // -------------------------------------------------------------------- + + /** + * Destroy the current session + * + * @access public + * @return void + */ + function sess_destroy() + { + setcookie( + $this->sess_cookie, + addslashes(serialize(array())), + ($this->now - 31500000), + $this->CI->config->item('cookie_path'), + $this->CI->config->item('cookie_domain'), + 0 + ); + } + + // -------------------------------------------------------------------- + + /** + * Garbage collection + * + * This deletes expired session rows from database + * if the probability percentage is met + * + * @access public + * @return void + */ + function sess_gc() + { + srand(time()); + if ((rand() % 100) < $this->gc_probability) + { + $expire = $this->now - $this->sess_length; + + $this->CI->db->where("last_activity < {$expire}"); + $this->CI->db->delete($this->session_table); + + log_message('debug', 'Session garbage collection performed.'); + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch a specific item form the session array + * + * @access public + * @param string + * @return string + */ + function userdata($item) + { + return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; + } + + // -------------------------------------------------------------------- + + /** + * Add or change data in the "userdata" array + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_userdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $this->userdata[$key] = $val; + } + } + + $this->sess_write(); + } + + // -------------------------------------------------------------------- + + /** + * Delete a session variable from the "userdata" array + * + * @access array + * @return void + */ + function unset_userdata($newdata = array()) + { + if (is_string($newdata)) + { + $newdata = array($newdata => ''); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + unset($this->userdata[$key]); + } + } + + $this->sess_write(); + } + + // -------------------------------------------------------------------- + + /** + * Strip slashes + * + * @access public + * @param mixed + * @return mixed + */ + function strip_slashes($vals) + { + if (is_array($vals)) + { + foreach ($vals as $key=>$val) + { + $vals[$key] = $this->strip_slashes($val); + } + } + else + { + $vals = stripslashes($vals); + } + + return $vals; + } + +} +// END Session Class ?> \ No newline at end of file diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index 4dde0403..451428de 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -1,249 +1,249 @@ -> 6) + 1; - - for ($i = 0; $i < $n * 16; $i++) - { - $x[$i] = 0; - } - - for ($i = 0; $i < strlen($str); $i++) - { - $x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8); - } - - $x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8); - - $x[$n * 16 - 1] = strlen($str) * 8; - - $a = 1732584193; - $b = -271733879; - $c = -1732584194; - $d = 271733878; - $e = -1009589776; - - for ($i = 0; $i < sizeof($x); $i += 16) - { - $olda = $a; - $oldb = $b; - $oldc = $c; - $oldd = $d; - $olde = $e; - - for($j = 0; $j < 80; $j++) - { - if ($j < 16) - { - $w[$j] = $x[$i + $j]; - } - else - { - $w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1); - } - - $t = $this->_safe_add($this->_safe_add($this->_rol($a, 5), $this->_ft($j, $b, $c, $d)), $this->_safe_add($this->_safe_add($e, $w[$j]), $this->_kt($j))); - - $e = $d; - $d = $c; - $c = $this->_rol($b, 30); - $b = $a; - $a = $t; - } - - $a = $this->_safe_add($a, $olda); - $b = $this->_safe_add($b, $oldb); - $c = $this->_safe_add($c, $oldc); - $d = $this->_safe_add($d, $oldd); - $e = $this->_safe_add($e, $olde); - } - - return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e); - } - - // -------------------------------------------------------------------- - - /** - * Convert a decimal to hex - * - * @access private - * @param string - * @return string - */ - function _hex($str) - { - $str = dechex($str); - - if (strlen($str) == 7) - { - $str = '0'.$str; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Return result based on iteration - * - * @access private - * @return string - */ - function _ft($t, $b, $c, $d) - { - if ($t < 20) - return ($b & $c) | ((~$b) & $d); - if ($t < 40) - return $b ^ $c ^ $d; - if ($t < 60) - return ($b & $c) | ($b & $d) | ($c & $d); - - return $b ^ $c ^ $d; - } - - // -------------------------------------------------------------------- - - /** - * Determine the additive constant - * - * @access private - * @return string - */ - function _kt($t) - { - if ($t < 20) - { - return 1518500249; - } - else if ($t < 40) - { - return 1859775393; - } - else if ($t < 60) - { - return -1894007588; - } - else - { - return -899497514; - } - } - - // -------------------------------------------------------------------- - - /** - * Add integers, wrapping at 2^32 - * - * @access private - * @return string - */ - function _safe_add($x, $y) - { - $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); - $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); - - return ($msw << 16) | ($lsw & 0xFFFF); - } - - // -------------------------------------------------------------------- - - /** - * Bitwise rotate a 32-bit number - * - * @access private - * @return integer - */ - function _rol($num, $cnt) - { - return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt); - } - - // -------------------------------------------------------------------- - - /** - * Pad string with zero - * - * @access private - * @return string - */ - function _zero_fill($a, $b) - { - $bin = decbin($a); - - if (strlen($bin) < $b) - { - $bin = 0; - } - else - { - $bin = substr($bin, 0, strlen($bin) - $b); - } - - for ($i=0; $i < $b; $i++) - { - $bin = "0".$bin; - } - - return bindec($bin); - } -} -// END CI_SHA +> 6) + 1; + + for ($i = 0; $i < $n * 16; $i++) + { + $x[$i] = 0; + } + + for ($i = 0; $i < strlen($str); $i++) + { + $x[$i >> 2] |= ord(substr($str, $i, 1)) << (24 - ($i % 4) * 8); + } + + $x[$i >> 2] |= 0x80 << (24 - ($i % 4) * 8); + + $x[$n * 16 - 1] = strlen($str) * 8; + + $a = 1732584193; + $b = -271733879; + $c = -1732584194; + $d = 271733878; + $e = -1009589776; + + for ($i = 0; $i < sizeof($x); $i += 16) + { + $olda = $a; + $oldb = $b; + $oldc = $c; + $oldd = $d; + $olde = $e; + + for($j = 0; $j < 80; $j++) + { + if ($j < 16) + { + $w[$j] = $x[$i + $j]; + } + else + { + $w[$j] = $this->_rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1); + } + + $t = $this->_safe_add($this->_safe_add($this->_rol($a, 5), $this->_ft($j, $b, $c, $d)), $this->_safe_add($this->_safe_add($e, $w[$j]), $this->_kt($j))); + + $e = $d; + $d = $c; + $c = $this->_rol($b, 30); + $b = $a; + $a = $t; + } + + $a = $this->_safe_add($a, $olda); + $b = $this->_safe_add($b, $oldb); + $c = $this->_safe_add($c, $oldc); + $d = $this->_safe_add($d, $oldd); + $e = $this->_safe_add($e, $olde); + } + + return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e); + } + + // -------------------------------------------------------------------- + + /** + * Convert a decimal to hex + * + * @access private + * @param string + * @return string + */ + function _hex($str) + { + $str = dechex($str); + + if (strlen($str) == 7) + { + $str = '0'.$str; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Return result based on iteration + * + * @access private + * @return string + */ + function _ft($t, $b, $c, $d) + { + if ($t < 20) + return ($b & $c) | ((~$b) & $d); + if ($t < 40) + return $b ^ $c ^ $d; + if ($t < 60) + return ($b & $c) | ($b & $d) | ($c & $d); + + return $b ^ $c ^ $d; + } + + // -------------------------------------------------------------------- + + /** + * Determine the additive constant + * + * @access private + * @return string + */ + function _kt($t) + { + if ($t < 20) + { + return 1518500249; + } + else if ($t < 40) + { + return 1859775393; + } + else if ($t < 60) + { + return -1894007588; + } + else + { + return -899497514; + } + } + + // -------------------------------------------------------------------- + + /** + * Add integers, wrapping at 2^32 + * + * @access private + * @return string + */ + function _safe_add($x, $y) + { + $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); + $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); + + return ($msw << 16) | ($lsw & 0xFFFF); + } + + // -------------------------------------------------------------------- + + /** + * Bitwise rotate a 32-bit number + * + * @access private + * @return integer + */ + function _rol($num, $cnt) + { + return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt); + } + + // -------------------------------------------------------------------- + + /** + * Pad string with zero + * + * @access private + * @return string + */ + function _zero_fill($a, $b) + { + $bin = decbin($a); + + if (strlen($bin) < $b) + { + $bin = 0; + } + else + { + $bin = substr($bin, 0, strlen($bin) - $b); + } + + for ($i=0; $i < $b; $i++) + { + $bin = "0".$bin; + } + + return bindec($bin); + } +} +// END CI_SHA ?> \ No newline at end of file diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 32223708..44acce65 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -1,12 +1,12 @@ '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => ''); - var $convert_ascii = TRUE; - var $response = ''; - var $error_msg = array(); - - /** - * Constructor - * - * @access public - */ - function CI_Trackback() - { - log_message('debug', "Trackback Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Send Trackback - * - * @access public - * @param array - * @return bool - */ - function send($tb_data) - { - if ( ! is_array($tb_data)) - { - $this->set_error('The send() method must be passed an array'); - return FALSE; - } - - // Pre-process the Trackback Data - foreach (array('url', 'title', 'excerpt', 'blog_name', 'ping_url') as $item) - { - if ( ! isset($tb_data[$item])) - { - $this->set_error('Required item missing: '.$item); - return FALSE; - } - - switch ($item) - { - case 'ping_url' : $$item = $this->extract_urls($tb_data[$item]); - break; - case 'excerpt' : $$item = $this->limit_characters($this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); - break; - case 'url' : $$item = str_replace('-', '-', $this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); - break; - default : $$item = $this->convert_xml(strip_tags(stripslashes($tb_data[$item]))); - break; - } - - // Convert High ASCII Characters - if ($this->convert_ascii == TRUE) - { - if ($item == 'excerpt') - { - $$item = $this->convert_ascii($$item); - } - elseif ($item == 'title') - { - $$item = $this->convert_ascii($$item); - } - elseif($item == 'blog_name') - { - $$item = $this->convert_ascii($$item); - } - } - } - - // Build the Trackback data string - $charset = ( ! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset']; - - $data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt)."&charset=".rawurlencode($charset); - - // Send Trackback(s) - $return = TRUE; - if (count($ping_url) > 0) - { - foreach ($ping_url as $url) - { - if ($this->process($url, $data) == FALSE) - { - $return = FALSE; - } - } - } - - return $return; - } - - // -------------------------------------------------------------------- - - /** - * Receive Trackback Data - * - * This function simply validates the incoming TB data. - * It returns false on failure and true on success. - * If the data is valid it is set to the $this->data array - * so that it can be inserted into a database. - * - * @access public - * @return bool - */ - function receive() - { - foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) - { - if ( ! isset($_POST[$val]) OR $_POST[$val] == '') - { - $this->set_error('The following required POST variable is missing: '.$val); - return FALSE; - } - - $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset'])); - - if ($val != 'url' && function_exists('mb_convert_encoding')) - { - $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']); - } - - $_POST[$val] = ($val != 'url') ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]); - - if ($val == 'excerpt') - { - $_POST['excerpt'] = $this->limit_characters($_POST['excerpt']); - } - - $this->data[$val] = $_POST[$val]; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Send Trackback Error Message - * - * Allows custom errors to be set. By default it - * sends the "incomplete information" error, as that's - * the most common one. - * - * @access public - * @param string - * @return void - */ - function send_error($message = 'Incomplete Information') - { - echo "\n\n1\n".$message."\n"; - exit; - } - - // -------------------------------------------------------------------- - - /** - * Send Trackback Success Message - * - * This should be called when a trackback has been - * successfully received and inserted. - * - * @access public - * @return void - */ - function send_success() - { - echo "\n\n0\n"; - exit; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a particular item - * - * @access public - * @param string - * @return string - */ - function data($item) - { - return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; - } - - // -------------------------------------------------------------------- - - /** - * Process Trackback - * - * Opens a socket connection and passes the data to - * the server. Returns true on success, false on failure - * - * @access public - * @param string - * @param string - * @return bool - */ - function process($url, $data) - { - $target = parse_url($url); - - // Open the socket - if ( ! $fp = @fsockopen($target['host'], 80)) - { - $this->set_error('Invalid Connection: '.$url); - return FALSE; - } - - // Build the path - $ppath = ( ! isset($target['path'])) ? $url : $target['path']; - - $path = (isset($target['query']) && $target['query'] != "") ? $ppath.'?'.$target['query'] : $ppath; - - // Add the Trackback ID to the data string - if ($id = $this->get_id($url)) - { - $data = "tb_id=".$id."&".$data; - } - - // Transfer the data - fputs ($fp, "POST " . $path . " HTTP/1.0\r\n" ); - fputs ($fp, "Host: " . $target['host'] . "\r\n" ); - fputs ($fp, "Content-type: application/x-www-form-urlencoded\r\n" ); - fputs ($fp, "Content-length: " . strlen($data) . "\r\n" ); - fputs ($fp, "Connection: close\r\n\r\n" ); - fputs ($fp, $data); - - // Was it successful? - $this->response = ""; - - while(!feof($fp)) - { - $this->response .= fgets($fp, 128); - } - @fclose($fp); - - if ( ! eregi("0", $this->response)) - { - $message = 'An unknown error was encountered'; - - if (preg_match("/(.*?)<\/message>/is", $this->response, $match)) - { - $message = trim($match['1']); - } - - $this->set_error($message); - return FALSE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Extract Trackback URLs - * - * This function lets multiple trackbacks be sent. - * It takes a string of URLs (separated by comma or - * space) and puts each URL into an array - * - * @access public - * @param string - * @return string - */ - function extract_urls($urls) - { - // Remove the pesky white space and replace with a comma. - $urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls); - - // If they use commas get rid of the doubles. - $urls = str_replace(",,", ",", $urls); - - // Remove any comma that might be at the end - if (substr($urls, -1) == ",") - { - $urls = substr($urls, 0, -1); - } - - // Break into an array via commas - $urls = preg_split('/[,]/', $urls); - - // Removes duplicates - $urls = array_unique($urls); - - array_walk($urls, array($this, 'validate_url')); - - return $urls; - } - - // -------------------------------------------------------------------- - - /** - * Validate URL - * - * Simply adds "http://" if missing - * - * @access public - * @param string - * @return string - */ - function validate_url($url) - { - $url = trim($url); - - if (substr($url, 0, 4) != "http") - { - $url = "http://".$url; - } - } - - // -------------------------------------------------------------------- - - /** - * Find the Trackback URL's ID - * - * @access public - * @param string - * @return string - */ - function get_id($url) - { - $tb_id = ""; - - if (strstr($url, '?')) - { - $tb_array = explode('/', $url); - $tb_end = $tb_array[count($tb_array)-1]; - - if ( ! is_numeric($tb_end)) - { - $tb_end = $tb_array[count($tb_array)-2]; - } - - $tb_array = explode('=', $tb_end); - $tb_id = $tb_array[count($tb_array)-1]; - } - else - { - if (ereg("/$", $url)) - { - $url = substr($url, 0, -1); - } - - $tb_array = explode('/', $url); - $tb_id = $tb_array[count($tb_array)-1]; - - if ( ! is_numeric($tb_id)) - { - $tb_id = $tb_array[count($tb_array)-2]; - } - } - - if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) - { - return false; - } - else - { - return $tb_id; - } - } - - // -------------------------------------------------------------------- - - /** - * Convert Reserved XML characters to Entities - * - * @access public - * @param string - * @return string - */ - function convert_xml($str) - { - $temp = '__TEMP_AMPERSANDS__'; - - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - - $str = str_replace(array("&","<",">","\"", "'", "-"), - array("&", "<", ">", """, "'", "-"), - $str); - - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;", $str); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Character limiter - * - * Limits the string based on the character count. Will preserve complete words. - * - * @access public - * @param string - * @param integer - * @param string - * @return string - */ - function limit_characters($str, $n = 500, $end_char = '…') - { - if (strlen($str) < $n) - { - return $str; - } - - $str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str)); - - if (strlen($str) <= $n) - { - return $str; - } - - $out = ""; - foreach (explode(' ', trim($str)) as $val) - { - $out .= $val.' '; - if (strlen($out) >= $n) - { - return trim($out).$end_char; - } - } - } - - // -------------------------------------------------------------------- - - /** - * High ASCII to Entities - * - * Converts Hight ascii text and MS Word special chars - * to character entities - * - * @access public - * @param string - * @return string - */ - function convert_ascii($str) - { - $count = 1; - $out = ''; - $temp = array(); - - for ($i = 0, $s = strlen($str); $i < $s; $i++) - { - $ordinal = ord($str[$i]); - - if ($ordinal < 128) - { - $out .= $str[$i]; - } - else - { - if (count($temp) == 0) - { - $count = ($ordinal < 224) ? 2 : 3; - } - - $temp[] = $ordinal; - - if (count($temp) == $count) - { - $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); - - $out .= '&#'.$number.';'; - $count = 1; - $temp = array(); - } - } - } - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Set error message - * - * @access public - * @param string - * @return void - */ - function set_error($msg) - { - log_message('error', $msg); - $this->error_msg[] = $msg; - } - - // -------------------------------------------------------------------- - - /** - * Show error messages - * - * @access public - * @param string - * @param string - * @return string - */ - function display_errors($open = '

                ', $close = '

                ') - { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; - } - -} -// END Trackback Class + '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => ''); + var $convert_ascii = TRUE; + var $response = ''; + var $error_msg = array(); + + /** + * Constructor + * + * @access public + */ + function CI_Trackback() + { + log_message('debug', "Trackback Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Send Trackback + * + * @access public + * @param array + * @return bool + */ + function send($tb_data) + { + if ( ! is_array($tb_data)) + { + $this->set_error('The send() method must be passed an array'); + return FALSE; + } + + // Pre-process the Trackback Data + foreach (array('url', 'title', 'excerpt', 'blog_name', 'ping_url') as $item) + { + if ( ! isset($tb_data[$item])) + { + $this->set_error('Required item missing: '.$item); + return FALSE; + } + + switch ($item) + { + case 'ping_url' : $$item = $this->extract_urls($tb_data[$item]); + break; + case 'excerpt' : $$item = $this->limit_characters($this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); + break; + case 'url' : $$item = str_replace('-', '-', $this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); + break; + default : $$item = $this->convert_xml(strip_tags(stripslashes($tb_data[$item]))); + break; + } + + // Convert High ASCII Characters + if ($this->convert_ascii == TRUE) + { + if ($item == 'excerpt') + { + $$item = $this->convert_ascii($$item); + } + elseif ($item == 'title') + { + $$item = $this->convert_ascii($$item); + } + elseif($item == 'blog_name') + { + $$item = $this->convert_ascii($$item); + } + } + } + + // Build the Trackback data string + $charset = ( ! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset']; + + $data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt)."&charset=".rawurlencode($charset); + + // Send Trackback(s) + $return = TRUE; + if (count($ping_url) > 0) + { + foreach ($ping_url as $url) + { + if ($this->process($url, $data) == FALSE) + { + $return = FALSE; + } + } + } + + return $return; + } + + // -------------------------------------------------------------------- + + /** + * Receive Trackback Data + * + * This function simply validates the incoming TB data. + * It returns false on failure and true on success. + * If the data is valid it is set to the $this->data array + * so that it can be inserted into a database. + * + * @access public + * @return bool + */ + function receive() + { + foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) + { + if ( ! isset($_POST[$val]) OR $_POST[$val] == '') + { + $this->set_error('The following required POST variable is missing: '.$val); + return FALSE; + } + + $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset'])); + + if ($val != 'url' && function_exists('mb_convert_encoding')) + { + $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']); + } + + $_POST[$val] = ($val != 'url') ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]); + + if ($val == 'excerpt') + { + $_POST['excerpt'] = $this->limit_characters($_POST['excerpt']); + } + + $this->data[$val] = $_POST[$val]; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Send Trackback Error Message + * + * Allows custom errors to be set. By default it + * sends the "incomplete information" error, as that's + * the most common one. + * + * @access public + * @param string + * @return void + */ + function send_error($message = 'Incomplete Information') + { + echo "\n\n1\n".$message."\n"; + exit; + } + + // -------------------------------------------------------------------- + + /** + * Send Trackback Success Message + * + * This should be called when a trackback has been + * successfully received and inserted. + * + * @access public + * @return void + */ + function send_success() + { + echo "\n\n0\n"; + exit; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a particular item + * + * @access public + * @param string + * @return string + */ + function data($item) + { + return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; + } + + // -------------------------------------------------------------------- + + /** + * Process Trackback + * + * Opens a socket connection and passes the data to + * the server. Returns true on success, false on failure + * + * @access public + * @param string + * @param string + * @return bool + */ + function process($url, $data) + { + $target = parse_url($url); + + // Open the socket + if ( ! $fp = @fsockopen($target['host'], 80)) + { + $this->set_error('Invalid Connection: '.$url); + return FALSE; + } + + // Build the path + $ppath = ( ! isset($target['path'])) ? $url : $target['path']; + + $path = (isset($target['query']) && $target['query'] != "") ? $ppath.'?'.$target['query'] : $ppath; + + // Add the Trackback ID to the data string + if ($id = $this->get_id($url)) + { + $data = "tb_id=".$id."&".$data; + } + + // Transfer the data + fputs ($fp, "POST " . $path . " HTTP/1.0\r\n" ); + fputs ($fp, "Host: " . $target['host'] . "\r\n" ); + fputs ($fp, "Content-type: application/x-www-form-urlencoded\r\n" ); + fputs ($fp, "Content-length: " . strlen($data) . "\r\n" ); + fputs ($fp, "Connection: close\r\n\r\n" ); + fputs ($fp, $data); + + // Was it successful? + $this->response = ""; + + while(!feof($fp)) + { + $this->response .= fgets($fp, 128); + } + @fclose($fp); + + if ( ! eregi("0", $this->response)) + { + $message = 'An unknown error was encountered'; + + if (preg_match("/(.*?)<\/message>/is", $this->response, $match)) + { + $message = trim($match['1']); + } + + $this->set_error($message); + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Extract Trackback URLs + * + * This function lets multiple trackbacks be sent. + * It takes a string of URLs (separated by comma or + * space) and puts each URL into an array + * + * @access public + * @param string + * @return string + */ + function extract_urls($urls) + { + // Remove the pesky white space and replace with a comma. + $urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls); + + // If they use commas get rid of the doubles. + $urls = str_replace(",,", ",", $urls); + + // Remove any comma that might be at the end + if (substr($urls, -1) == ",") + { + $urls = substr($urls, 0, -1); + } + + // Break into an array via commas + $urls = preg_split('/[,]/', $urls); + + // Removes duplicates + $urls = array_unique($urls); + + array_walk($urls, array($this, 'validate_url')); + + return $urls; + } + + // -------------------------------------------------------------------- + + /** + * Validate URL + * + * Simply adds "http://" if missing + * + * @access public + * @param string + * @return string + */ + function validate_url($url) + { + $url = trim($url); + + if (substr($url, 0, 4) != "http") + { + $url = "http://".$url; + } + } + + // -------------------------------------------------------------------- + + /** + * Find the Trackback URL's ID + * + * @access public + * @param string + * @return string + */ + function get_id($url) + { + $tb_id = ""; + + if (strstr($url, '?')) + { + $tb_array = explode('/', $url); + $tb_end = $tb_array[count($tb_array)-1]; + + if ( ! is_numeric($tb_end)) + { + $tb_end = $tb_array[count($tb_array)-2]; + } + + $tb_array = explode('=', $tb_end); + $tb_id = $tb_array[count($tb_array)-1]; + } + else + { + if (ereg("/$", $url)) + { + $url = substr($url, 0, -1); + } + + $tb_array = explode('/', $url); + $tb_id = $tb_array[count($tb_array)-1]; + + if ( ! is_numeric($tb_id)) + { + $tb_id = $tb_array[count($tb_array)-2]; + } + } + + if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) + { + return false; + } + else + { + return $tb_id; + } + } + + // -------------------------------------------------------------------- + + /** + * Convert Reserved XML characters to Entities + * + * @access public + * @param string + * @return string + */ + function convert_xml($str) + { + $temp = '__TEMP_AMPERSANDS__'; + + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + $str = str_replace(array("&","<",">","\"", "'", "-"), + array("&", "<", ">", """, "'", "-"), + $str); + + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;", $str); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Character limiter + * + * Limits the string based on the character count. Will preserve complete words. + * + * @access public + * @param string + * @param integer + * @param string + * @return string + */ + function limit_characters($str, $n = 500, $end_char = '…') + { + if (strlen($str) < $n) + { + return $str; + } + + $str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", " ", $str)); + + if (strlen($str) <= $n) + { + return $str; + } + + $out = ""; + foreach (explode(' ', trim($str)) as $val) + { + $out .= $val.' '; + if (strlen($out) >= $n) + { + return trim($out).$end_char; + } + } + } + + // -------------------------------------------------------------------- + + /** + * High ASCII to Entities + * + * Converts Hight ascii text and MS Word special chars + * to character entities + * + * @access public + * @param string + * @return string + */ + function convert_ascii($str) + { + $count = 1; + $out = ''; + $temp = array(); + + for ($i = 0, $s = strlen($str); $i < $s; $i++) + { + $ordinal = ord($str[$i]); + + if ($ordinal < 128) + { + $out .= $str[$i]; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + + $out .= '&#'.$number.';'; + $count = 1; + $temp = array(); + } + } + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Set error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + log_message('error', $msg); + $this->error_msg[] = $msg; + } + + // -------------------------------------------------------------------- + + /** + * Show error messages + * + * @access public + * @param string + * @param string + * @return string + */ + function display_errors($open = '

                ', $close = '

                ') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + +} +// END Trackback Class ?> \ No newline at end of file diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 10654a69..5cedd8e0 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -1,367 +1,367 @@ -router =& load_class('Router'); - log_message('debug', "URI Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment - * - * This function returns the URI segment based on the number provided. - * - * @access public - * @param integer - * @param bool - * @return string - */ - function segment($n, $no_result = FALSE) - { - return ( ! isset($this->router->segments[$n])) ? $no_result : $this->router->segments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI "routed" Segment - * - * This function returns the re-routed URI segment (assuming routing rules are used) - * based on the number provided. If there is no routing this function returns the - * same result as $this->segment() - * - * @access public - * @param integer - * @param bool - * @return string - */ - function rsegment($n, $no_result = FALSE) - { - return ( ! isset($this->router->rsegments[$n])) ? $no_result : $this->router->rsegments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string - * - * This function generates and associative array of URI data starting - * at the supplied segment. For example, if this is your URI: - * - * www.your-site.com/user/search/name/joe/location/UK/gender/male - * - * You can use this function to generate an array with this prototype: - * - * array ( - * name => joe - * location => UK - * gender => male - * ) - * - * @access public - * @param integer the starting segment number - * @param array an array of default values - * @return array - */ - function uri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'segment'); - } - /** - * Identical to above only it uses the re-routed segment array - * - */ - function ruri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string or Re-routed URI string - * - * @access private - * @param integer the starting segment number - * @param array an array of default values - * @param string which array we should use - * @return array - */ - function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') - { - if ($which == 'segment') - { - $total_segments = 'total_segments'; - $segment_array = 'segment_array'; - } - else - { - $total_segments = 'total_rsegments'; - $segment_array = 'rsegment_array'; - } - - if ( ! is_numeric($n)) - { - return $default; - } - - if (isset($this->keyval[$n])) - { - return $this->keyval[$n]; - } - - if ($this->$total_segments() < $n) - { - if (count($default) == 0) - { - return array(); - } - - $retval = array(); - foreach ($default as $val) - { - $retval[$val] = FALSE; - } - return $retval; - } - - $segments = array_slice($this->$segment_array(), ($n - 1)); - - $i = 0; - $lastval = ''; - $retval = array(); - foreach ($segments as $seg) - { - if ($i % 2) - { - $retval[$lastval] = $seg; - } - else - { - $retval[$seg] = FALSE; - $lastval = $seg; - } - - $i++; - } - - if (count($default) > 0) - { - foreach ($default as $val) - { - if ( ! array_key_exists($val, $retval)) - { - $retval[$val] = FALSE; - } - } - } - - // Cache the array for reuse - $this->keyval[$n] = $retval; - return $retval; - } - - /** - * Generate a URI string from an associative array - * - * - * @access public - * @param array an associative array of key/values - * @return array - */ function assoc_to_uri($array) - { - $temp = array(); - foreach ((array)$array as $key => $val) - { - $temp[] = $key; - $temp[] = $val; - } - - return implode('/', $temp); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_segment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'segment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_rsegment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - helper function - * - * @access private - * @param integer - * @param string - * @param string - * @return string - */ - function _slash_segment($n, $where = 'trailing', $which = 'segment') - { - if ($where == 'trailing') - { - $trailing = '/'; - $leading = ''; - } - elseif ($where == 'leading') - { - $leading = '/'; - $trailing = ''; - } - else - { - $leading = '/'; - $trailing = '/'; - } - return $leading.$this->$which($n).$trailing; - } - - // -------------------------------------------------------------------- - - /** - * Segment Array - * - * @access public - * @return array - */ - function segment_array() - { - return $this->router->segments; - } - - // -------------------------------------------------------------------- - - /** - * Routed Segment Array - * - * @access public - * @return array - */ - function rsegment_array() - { - return $this->router->rsegments; - } - - // -------------------------------------------------------------------- - - /** - * Total number of segments - * - * @access public - * @return integer - */ - function total_segments() - { - return count($this->router->segments); - } - - // -------------------------------------------------------------------- - - /** - * Total number of routed segments - * - * @access public - * @return integer - */ - function total_rsegments() - { - return count($this->router->rsegments); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the entire URI string - * - * @access public - * @return string - */ - function uri_string() - { - return $this->router->uri_string; - } - - - // -------------------------------------------------------------------- - - /** - * Fetch the entire Re-routed URI string - * - * @access public - * @return string - */ - function ruri_string() - { - return '/'.implode('/', $this->rsegment_array()).'/'; - } - -} -// END URI Class +router =& load_class('Router'); + log_message('debug', "URI Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment + * + * This function returns the URI segment based on the number provided. + * + * @access public + * @param integer + * @param bool + * @return string + */ + function segment($n, $no_result = FALSE) + { + return ( ! isset($this->router->segments[$n])) ? $no_result : $this->router->segments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI "routed" Segment + * + * This function returns the re-routed URI segment (assuming routing rules are used) + * based on the number provided. If there is no routing this function returns the + * same result as $this->segment() + * + * @access public + * @param integer + * @param bool + * @return string + */ + function rsegment($n, $no_result = FALSE) + { + return ( ! isset($this->router->rsegments[$n])) ? $no_result : $this->router->rsegments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string + * + * This function generates and associative array of URI data starting + * at the supplied segment. For example, if this is your URI: + * + * www.your-site.com/user/search/name/joe/location/UK/gender/male + * + * You can use this function to generate an array with this prototype: + * + * array ( + * name => joe + * location => UK + * gender => male + * ) + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + */ + function uri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'segment'); + } + /** + * Identical to above only it uses the re-routed segment array + * + */ + function ruri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string or Re-routed URI string + * + * @access private + * @param integer the starting segment number + * @param array an array of default values + * @param string which array we should use + * @return array + */ + function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') + { + if ($which == 'segment') + { + $total_segments = 'total_segments'; + $segment_array = 'segment_array'; + } + else + { + $total_segments = 'total_rsegments'; + $segment_array = 'rsegment_array'; + } + + if ( ! is_numeric($n)) + { + return $default; + } + + if (isset($this->keyval[$n])) + { + return $this->keyval[$n]; + } + + if ($this->$total_segments() < $n) + { + if (count($default) == 0) + { + return array(); + } + + $retval = array(); + foreach ($default as $val) + { + $retval[$val] = FALSE; + } + return $retval; + } + + $segments = array_slice($this->$segment_array(), ($n - 1)); + + $i = 0; + $lastval = ''; + $retval = array(); + foreach ($segments as $seg) + { + if ($i % 2) + { + $retval[$lastval] = $seg; + } + else + { + $retval[$seg] = FALSE; + $lastval = $seg; + } + + $i++; + } + + if (count($default) > 0) + { + foreach ($default as $val) + { + if ( ! array_key_exists($val, $retval)) + { + $retval[$val] = FALSE; + } + } + } + + // Cache the array for reuse + $this->keyval[$n] = $retval; + return $retval; + } + + /** + * Generate a URI string from an associative array + * + * + * @access public + * @param array an associative array of key/values + * @return array + */ function assoc_to_uri($array) + { + $temp = array(); + foreach ((array)$array as $key => $val) + { + $temp[] = $key; + $temp[] = $val; + } + + return implode('/', $temp); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_segment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'segment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_rsegment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash - helper function + * + * @access private + * @param integer + * @param string + * @param string + * @return string + */ + function _slash_segment($n, $where = 'trailing', $which = 'segment') + { + if ($where == 'trailing') + { + $trailing = '/'; + $leading = ''; + } + elseif ($where == 'leading') + { + $leading = '/'; + $trailing = ''; + } + else + { + $leading = '/'; + $trailing = '/'; + } + return $leading.$this->$which($n).$trailing; + } + + // -------------------------------------------------------------------- + + /** + * Segment Array + * + * @access public + * @return array + */ + function segment_array() + { + return $this->router->segments; + } + + // -------------------------------------------------------------------- + + /** + * Routed Segment Array + * + * @access public + * @return array + */ + function rsegment_array() + { + return $this->router->rsegments; + } + + // -------------------------------------------------------------------- + + /** + * Total number of segments + * + * @access public + * @return integer + */ + function total_segments() + { + return count($this->router->segments); + } + + // -------------------------------------------------------------------- + + /** + * Total number of routed segments + * + * @access public + * @return integer + */ + function total_rsegments() + { + return count($this->router->rsegments); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the entire URI string + * + * @access public + * @return string + */ + function uri_string() + { + return $this->router->uri_string; + } + + + // -------------------------------------------------------------------- + + /** + * Fetch the entire Re-routed URI string + * + * @access public + * @return string + */ + function ruri_string() + { + return '/'.implode('/', $this->rsegment_array()).'/'; + } + +} +// END URI Class ?> \ No newline at end of file diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index f68f69e7..74ed1275 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -1,331 +1,331 @@ -active == FALSE) - return FALSE; - - if (in_array($expected, array('is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'), TRUE)) - { - $expected = str_replace('is_float', 'is_double', $expected); - $result = ($expected($test)) ? TRUE : FALSE; - $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); - } - else - { - if ($this->strict == TRUE) - $result = ($test === $expected) ? TRUE : FALSE; - else - $result = ($test == $expected) ? TRUE : FALSE; - - $extype = gettype($expected); - } - - $back = $this->_backtrace(); - - $report[] = array ( - 'test_name' => $test_name, - 'test_datatype' => gettype($test), - 'res_datatype' => $extype, - 'result' => ($result === TRUE) ? 'passed' : 'failed', - 'file' => $back['file'], - 'line' => $back['line'] - ); - - $this->results[] = $report; - - return($this->report($this->result($report))); - } - - // -------------------------------------------------------------------- - - /** - * Generate a report - * - * Displays a table with the test data - * - * @access public - * @return string - */ - function report($result = array()) - { - if (count($result) == 0) - { - $result = $this->result(); - } - - $this->_parse_template(); - - $r = ''; - foreach ($result as $res) - { - $table = ''; - - foreach ($res as $key => $val) - { - $temp = $this->_template_rows; - $temp = str_replace('{item}', $key, $temp); - $temp = str_replace('{result}', $val, $temp); - $table .= $temp; - } - - $r .= str_replace('{rows}', $table, $this->_template); - } - - return $r; - } - - // -------------------------------------------------------------------- - - /** - * Use strict comparison - * - * Causes the evaluation to use === rather then == - * - * @access public - * @param bool - * @return null - */ - function use_strict($state = TRUE) - { - $this->strict = ($state == FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Make Unit testing active - * - * Enables/disables unit testing - * - * @access public - * @param bool - * @return null - */ - function active($state = TRUE) - { - $this->active = ($state == FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Result Array - * - * Returns the raw result data - * - * @access public - * @return array - */ - function result($results = array()) - { - $CI =& get_instance(); - $CI->load->language('unit_test'); - - if (count($results) == 0) - { - $results = $this->results; - } - - $retval = array(); - foreach ($results as $result) - { - $temp = array(); - foreach ($result as $key => $val) - { - if (is_array($val)) - { - foreach ($val as $k => $v) - { - if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v)))) - { - $v = $line; - } - $temp[$CI->lang->line('ut_'.$k)] = $v; - } - } - else - { - if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) - { - $val = $line; - } - $temp[$CI->lang->line('ut_'.$key)] = $val; - } - } - - $retval[] = $temp; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Set the template - * - * This lets us set the template to be used to display results - * - * @access public - * @param string - * @return void - */ - function set_template($template) - { - $this->_template = $template; - } - - // -------------------------------------------------------------------- - - /** - * Generate a backtrace - * - * This lets us show file names and line numbers - * - * @access private - * @return array - */ - function _backtrace() - { - if (function_exists('debug_backtrace')) - { - $back = debug_backtrace(); - - $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; - $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; - - return array('file' => $file, 'line' => $line); - } - return array('file' => 'Unknown', 'line' => 'Unknown'); - } - - // -------------------------------------------------------------------- - - /** - * Get Default Template - * - * @access private - * @return string - */ - function _default_template() - { - $this->_template = ' -
                - - {rows} -
                '; - - $this->_template_rows = ' - - {item} - {result} - - '; - } - - // -------------------------------------------------------------------- - - /** - * Parse Template - * - * Harvests the data within the template {pseudo-variables} - * - * @access private - * @return void - */ - function _parse_template() - { - if ( ! is_null($this->_template_rows)) - { - return; - } - - if (is_null($this->_template)) - { - $this->_default_template(); - return; - } - - if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) - { - $this->_default_template(); - return; - } - - $this->_template_rows = $match['1']; - $this->_template = str_replace($match['0'], '{rows}', $this->_template); - } - -} -// END Unit_test Class - -/** - * Helper functions to test boolean true/false - * - * - * @access private - * @return bool - */ -function is_true($test) -{ - return (is_bool($test) AND $test === TRUE) ? TRUE : FALSE; -} -function is_false($test) -{ - return (is_bool($test) AND $test === FALSE) ? TRUE : FALSE; -} - +active == FALSE) + return FALSE; + + if (in_array($expected, array('is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'), TRUE)) + { + $expected = str_replace('is_float', 'is_double', $expected); + $result = ($expected($test)) ? TRUE : FALSE; + $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); + } + else + { + if ($this->strict == TRUE) + $result = ($test === $expected) ? TRUE : FALSE; + else + $result = ($test == $expected) ? TRUE : FALSE; + + $extype = gettype($expected); + } + + $back = $this->_backtrace(); + + $report[] = array ( + 'test_name' => $test_name, + 'test_datatype' => gettype($test), + 'res_datatype' => $extype, + 'result' => ($result === TRUE) ? 'passed' : 'failed', + 'file' => $back['file'], + 'line' => $back['line'] + ); + + $this->results[] = $report; + + return($this->report($this->result($report))); + } + + // -------------------------------------------------------------------- + + /** + * Generate a report + * + * Displays a table with the test data + * + * @access public + * @return string + */ + function report($result = array()) + { + if (count($result) == 0) + { + $result = $this->result(); + } + + $this->_parse_template(); + + $r = ''; + foreach ($result as $res) + { + $table = ''; + + foreach ($res as $key => $val) + { + $temp = $this->_template_rows; + $temp = str_replace('{item}', $key, $temp); + $temp = str_replace('{result}', $val, $temp); + $table .= $temp; + } + + $r .= str_replace('{rows}', $table, $this->_template); + } + + return $r; + } + + // -------------------------------------------------------------------- + + /** + * Use strict comparison + * + * Causes the evaluation to use === rather then == + * + * @access public + * @param bool + * @return null + */ + function use_strict($state = TRUE) + { + $this->strict = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Make Unit testing active + * + * Enables/disables unit testing + * + * @access public + * @param bool + * @return null + */ + function active($state = TRUE) + { + $this->active = ($state == FALSE) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Result Array + * + * Returns the raw result data + * + * @access public + * @return array + */ + function result($results = array()) + { + $CI =& get_instance(); + $CI->load->language('unit_test'); + + if (count($results) == 0) + { + $results = $this->results; + } + + $retval = array(); + foreach ($results as $result) + { + $temp = array(); + foreach ($result as $key => $val) + { + if (is_array($val)) + { + foreach ($val as $k => $v) + { + if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v)))) + { + $v = $line; + } + $temp[$CI->lang->line('ut_'.$k)] = $v; + } + } + else + { + if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) + { + $val = $line; + } + $temp[$CI->lang->line('ut_'.$key)] = $val; + } + } + + $retval[] = $temp; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Set the template + * + * This lets us set the template to be used to display results + * + * @access public + * @param string + * @return void + */ + function set_template($template) + { + $this->_template = $template; + } + + // -------------------------------------------------------------------- + + /** + * Generate a backtrace + * + * This lets us show file names and line numbers + * + * @access private + * @return array + */ + function _backtrace() + { + if (function_exists('debug_backtrace')) + { + $back = debug_backtrace(); + + $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; + $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; + + return array('file' => $file, 'line' => $line); + } + return array('file' => 'Unknown', 'line' => 'Unknown'); + } + + // -------------------------------------------------------------------- + + /** + * Get Default Template + * + * @access private + * @return string + */ + function _default_template() + { + $this->_template = ' +
                + + {rows} +
                '; + + $this->_template_rows = ' + + {item} + {result} + + '; + } + + // -------------------------------------------------------------------- + + /** + * Parse Template + * + * Harvests the data within the template {pseudo-variables} + * + * @access private + * @return void + */ + function _parse_template() + { + if ( ! is_null($this->_template_rows)) + { + return; + } + + if (is_null($this->_template)) + { + $this->_default_template(); + return; + } + + if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) + { + $this->_default_template(); + return; + } + + $this->_template_rows = $match['1']; + $this->_template = str_replace($match['0'], '{rows}', $this->_template); + } + +} +// END Unit_test Class + +/** + * Helper functions to test boolean true/false + * + * + * @access private + * @return bool + */ +function is_true($test) +{ + return (is_bool($test) AND $test === TRUE) ? TRUE : FALSE; +} +function is_false($test) +{ + return (is_bool($test) AND $test === FALSE) ? TRUE : FALSE; +} + ?> \ No newline at end of file diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index ff0fb1cb..564e2993 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -1,809 +1,809 @@ - 0) - { - $this->initialize($props); - } - - log_message('debug', "Upload Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize preferences - * - * @access public - * @param array - * @return void - */ - function initialize($config = array()) - { - $defaults = array( - 'max_size' => 0, - 'max_width' => 0, - 'max_height' => 0, - 'allowed_types' => "", - 'file_temp' => "", - 'file_name' => "", - 'orig_name' => "", - 'file_type' => "", - 'file_size' => "", - 'file_ext' => "", - 'upload_path' => "", - 'overwrite' => FALSE, - 'encrypt_name' => FALSE, - 'is_image' => FALSE, - 'image_width' => '', - 'image_height' => '', - 'image_type' => '', - 'image_size_str' => '', - 'error_msg' => array(), - 'mimes' => array(), - 'remove_spaces' => TRUE, - 'xss_clean' => FALSE, - 'temp_prefix' => "temp_file_" - ); - - - foreach ($defaults as $key => $val) - { - if (isset($config[$key])) - { - $method = 'set_'.$key; - if (method_exists($this, $method)) - { - $this->$method($config[$key]); - } - else - { - $this->$key = $config[$key]; - } - } - else - { - $this->$key = $val; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Perform the file upload - * - * @access public - * @return bool - */ - function do_upload($field = 'userfile') - { - // Is $_FILES[$field] set? If not, no reason to continue. - if ( ! isset($_FILES[$field])) - { - $this->set_error('upload_userfile_not_set'); - return FALSE; - } - - // Is the upload path valid? - if ( ! $this->validate_upload_path()) - { - return FALSE; - } - - // Was the file able to be uploaded? If not, determine the reason why. - if ( ! is_uploaded_file($_FILES[$field]['tmp_name'])) - { - $error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error']; - - switch($error) - { - case 1 : $this->set_error('upload_file_exceeds_limit'); - break; - case 3 : $this->set_error('upload_file_partial'); - break; - case 4 : $this->set_error('upload_no_file_selected'); - break; - default : $this->set_error('upload_no_file_selected'); - break; - } - - return FALSE; - } - - // Set the uploaded data as class variables - $this->file_temp = $_FILES[$field]['tmp_name']; - $this->file_name = $_FILES[$field]['name']; - $this->file_size = $_FILES[$field]['size']; - $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); - $this->file_type = strtolower($this->file_type); - $this->file_ext = $this->get_extension($_FILES[$field]['name']); - - // Convert the file size to kilobytes - if ($this->file_size > 0) - { - $this->file_size = round($this->file_size/1024, 2); - } - - // Is the file type allowed to be uploaded? - if ( ! $this->is_allowed_filetype()) - { - $this->set_error('upload_invalid_filetype'); - return FALSE; - } - - // Is the file size within the allowed maximum? - if ( ! $this->is_allowed_filesize()) - { - $this->set_error('upload_invalid_filesize'); - return FALSE; - } - - // Are the image dimensions within the allowed size? - // Note: This can fail if the server has an open_basdir restriction. - if ( ! $this->is_allowed_dimensions()) - { - $this->set_error('upload_invalid_dimensions'); - return FALSE; - } - - // Sanitize the file name for security - $this->file_name = $this->clean_file_name($this->file_name); - - // Remove white spaces in the name - if ($this->remove_spaces == TRUE) - { - $this->file_name = preg_replace("/\s+/", "_", $this->file_name); - } - - /* - * Validate the file name - * This function appends an number onto the end of - * the file if one with the same name already exists. - * If it returns false there was a problem. - */ - $this->orig_name = $this->file_name; - - if ($this->overwrite == FALSE) - { - $this->file_name = $this->set_filename($this->upload_path, $this->file_name); - - if ($this->file_name === FALSE) - { - return FALSE; - } - } - - /* - * Move the file to the final destination - * To deal with different server configurations - * we'll attempt to use copy() first. If that fails - * we'll use move_uploaded_file(). One of the two should - * reliably work in most environments - */ - if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) - { - if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) - { - $this->set_error('upload_destination_error'); - return FALSE; - } - } - - /* - * Run the file through the XSS hacking filter - * This helps prevent malicious code from being - * embedded within a file. Scripts can easily - * be disguised as images or other file types. - */ - if ($this->xss_clean == TRUE) - { - $this->do_xss_clean(); - } - - /* - * Set the finalized image dimensions - * This sets the image width/height (assuming the - * file was an image). We use this information - * in the "data" function. - */ - $this->set_image_properties($this->upload_path.$this->file_name); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Finalized Data Array - * - * Returns an associative array containing all of the information - * related to the upload, allowing the developer easy access in one array. - * - * @access public - * @return array - */ - function data() - { - return array ( - 'file_name' => $this->file_name, - 'file_type' => $this->file_type, - 'file_path' => $this->upload_path, - 'full_path' => $this->upload_path.$this->file_name, - 'raw_name' => str_replace($this->file_ext, '', $this->file_name), - 'orig_name' => $this->orig_name, - 'file_ext' => $this->file_ext, - 'file_size' => $this->file_size, - 'is_image' => $this->is_image(), - 'image_width' => $this->image_width, - 'image_height' => $this->image_height, - 'image_type' => $this->image_type, - 'image_size_str' => $this->image_size_str, - ); - } - - // -------------------------------------------------------------------- - - /** - * Set Upload Path - * - * @access public - * @param string - * @return void - */ - function set_upload_path($path) - { - $this->upload_path = $path; - } - - // -------------------------------------------------------------------- - - /** - * Set the file name - * - * This function takes a filename/path as input and looks for the - * existence of a file with the same name. If found, it will append a - * number to the end of the filename to avoid overwriting a pre-existing file. - * - * @access public - * @param string - * @param string - * @return string - */ - function set_filename($path, $filename) - { - if ($this->encrypt_name == TRUE) - { - mt_srand(); - $filename = md5(uniqid(mt_rand())).$this->file_ext; - } - - if ( ! file_exists($path.$filename)) - { - return $filename; - } - - $filename = str_replace($this->file_ext, '', $filename); - - $new_filename = ''; - for ($i = 1; $i < 100; $i++) - { - if ( ! file_exists($path.$filename.$i.$this->file_ext)) - { - $new_filename = $filename.$i.$this->file_ext; - break; - } - } - - if ($new_filename == '') - { - $this->set_error('upload_bad_filename'); - return FALSE; - } - else - { - return $new_filename; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Maximum File Size - * - * @access public - * @param integer - * @return void - */ - function set_max_filesize($n) - { - $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; - } - - // -------------------------------------------------------------------- - - /** - * Set Maximum Image Width - * - * @access public - * @param integer - * @return void - */ - function set_max_width($n) - { - $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; - } - - // -------------------------------------------------------------------- - - /** - * Set Maximum Image Height - * - * @access public - * @param integer - * @return void - */ - function set_max_height($n) - { - $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; - } - - // -------------------------------------------------------------------- - - /** - * Set Allowed File Types - * - * @access public - * @param string - * @return void - */ - function set_allowed_types($types) - { - $this->allowed_types = explode('|', $types); - } - - // -------------------------------------------------------------------- - - /** - * Set Image Properties - * - * Uses GD to determine the width/height/type of image - * - * @access public - * @param string - * @return void - */ - function set_image_properties($path = '') - { - if ( ! $this->is_image()) - { - return; - } - - if (function_exists('getimagesize')) - { - if (FALSE !== ($D = @getimagesize($path))) - { - $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); - - $this->image_width = $D['0']; - $this->image_height = $D['1']; - $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']]; - $this->image_size_str = $D['3']; // string containing height and width - } - } - } - - // -------------------------------------------------------------------- - - /** - * Set XSS Clean - * - * Enables the XSS flag so that the file that was uploaded - * will be run through the XSS filter. - * - * @access public - * @param bool - * @return void - */ - function set_xss_clean($flag = FALSE) - { - $this->xss_clean = ($flag == TRUE) ? TRUE : FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Validate the image - * - * @access public - * @return bool - */ - function is_image() - { - $img_mimes = array( - 'image/gif', - 'image/jpg', - 'image/jpe', - 'image/jpeg', - 'image/pjpeg', - 'image/png', - 'image/x-png' - ); - - - return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Verify that the filetype is allowed - * - * @access public - * @return bool - */ - function is_allowed_filetype() - { - if (count($this->allowed_types) == 0) - { - $this->set_error('upload_no_file_types'); - return FALSE; - } - - foreach ($this->allowed_types as $val) - { - $mime = $this->mimes_types(strtolower($val)); - - if (is_array($mime)) - { - if (in_array($this->file_type, $mime, TRUE)) - { - return TRUE; - } - } - else - { - if ($mime == $this->file_type) - { - return TRUE; - } - } - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Verify that the file is within the allowed size - * - * @access public - * @return bool - */ - function is_allowed_filesize() - { - if ($this->max_size != 0 AND $this->file_size > $this->max_size) - { - return FALSE; - } - else - { - return TRUE; - } - } - - // -------------------------------------------------------------------- - - /** - * Verify that the image is within the allowed width/height - * - * @access public - * @return bool - */ - function is_allowed_dimensions() - { - if ( ! $this->is_image()) - { - return TRUE; - } - - if (function_exists('getimagesize')) - { - $D = @getimagesize($this->file_temp); - - if ($this->max_width > 0 AND $D['0'] > $this->max_width) - { - return FALSE; - } - - if ($this->max_height > 0 AND $D['1'] > $this->max_height) - { - return FALSE; - } - - return TRUE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Validate Upload Path - * - * Verifies that it is a valid upload path with proper permissions. - * - * - * @access public - * @return bool - */ - function validate_upload_path() - { - if ($this->upload_path == '') - { - $this->set_error('upload_no_filepath'); - return FALSE; - } - - if (function_exists('realpath') AND @realpath($this->upload_path) !== FALSE) - { - $this->upload_path = str_replace("\\", "/", realpath($this->upload_path)); - } - - if ( ! @is_dir($this->upload_path)) - { - $this->set_error('upload_no_filepath'); - return FALSE; - } - - if ( ! is_writable($this->upload_path)) - { - $this->set_error('upload_not_writable'); - return FALSE; - } - - $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Extract the file extension - * - * @access public - * @param string - * @return string - */ - function get_extension($filename) - { - $x = explode('.', $filename); - return '.'.end($x); - } - - // -------------------------------------------------------------------- - - /** - * Clean the file name for security - * - * @access public - * @param string - * @return string - */ - function clean_file_name($filename) - { - $bad = array( - "", - "'", - "<", - ">", - '"', - '&', - '$', - '=', - ';', - '?', - '/', - "%20", - "%22", - "%3c", // < - "%253c", // < - "%3e", // > - "%0e", // > - "%28", // ( - "%29", // ) - "%2528", // ( - "%26", // & - "%24", // $ - "%3f", // ? - "%3b", // ; - "%3d" // = - ); - - foreach ($bad as $val) - { - $filename = str_replace($val, '', $filename); - } - - return $filename; - } - - // -------------------------------------------------------------------- - - /** - * Runs the file through the XSS clean function - * - * This prevents people from embedding malicious code in their files. - * I'm not sure that it won't negatively affect certain files in unexpected ways, - * but so far I haven't found that it causes trouble. - * - * @access public - * @return void - */ - function do_xss_clean() - { - $file = $this->upload_path.$this->file_name; - - if (filesize($file) == 0) - { - return FALSE; - } - - if ( ! $fp = @fopen($file, 'rb')) - { - return FALSE; - } - - flock($fp, LOCK_EX); - - $data = fread($fp, filesize($file)); - - $CI =& get_instance(); - $data = $CI->input->xss_clean($data); - - fwrite($fp, $data); - flock($fp, LOCK_UN); - fclose($fp); - } - - // -------------------------------------------------------------------- - - /** - * Set an error message - * - * @access public - * @param string - * @return void - */ - function set_error($msg) - { - $CI =& get_instance(); - $CI->lang->load('upload'); - - if (is_array($msg)) - { - foreach ($msg as $val) - { - $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); - $this->error_msg[] = $msg; - log_message('error', $msg); - } - } - else - { - $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); - $this->error_msg[] = $msg; - log_message('error', $msg); - } - } - - // -------------------------------------------------------------------- - - /** - * Display the error message - * - * @access public - * @param string - * @param string - * @return string - */ - function display_errors($open = '

                ', $close = '

                ') - { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * List of Mime Types - * - * This is a list of mime types. We use it to validate - * the "allowed types" set by the developer - * - * @access public - * @param string - * @return string - */ - function mimes_types($mime) - { - if (count($this->mimes) == 0) - { - if (@include(APPPATH.'config/mimes'.EXT)) - { - $this->mimes = $mimes; - unset($mimes); - } - } - - return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; - } - -} -// END Upload Class + 0) + { + $this->initialize($props); + } + + log_message('debug', "Upload Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Initialize preferences + * + * @access public + * @param array + * @return void + */ + function initialize($config = array()) + { + $defaults = array( + 'max_size' => 0, + 'max_width' => 0, + 'max_height' => 0, + 'allowed_types' => "", + 'file_temp' => "", + 'file_name' => "", + 'orig_name' => "", + 'file_type' => "", + 'file_size' => "", + 'file_ext' => "", + 'upload_path' => "", + 'overwrite' => FALSE, + 'encrypt_name' => FALSE, + 'is_image' => FALSE, + 'image_width' => '', + 'image_height' => '', + 'image_type' => '', + 'image_size_str' => '', + 'error_msg' => array(), + 'mimes' => array(), + 'remove_spaces' => TRUE, + 'xss_clean' => FALSE, + 'temp_prefix' => "temp_file_" + ); + + + foreach ($defaults as $key => $val) + { + if (isset($config[$key])) + { + $method = 'set_'.$key; + if (method_exists($this, $method)) + { + $this->$method($config[$key]); + } + else + { + $this->$key = $config[$key]; + } + } + else + { + $this->$key = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Perform the file upload + * + * @access public + * @return bool + */ + function do_upload($field = 'userfile') + { + // Is $_FILES[$field] set? If not, no reason to continue. + if ( ! isset($_FILES[$field])) + { + $this->set_error('upload_userfile_not_set'); + return FALSE; + } + + // Is the upload path valid? + if ( ! $this->validate_upload_path()) + { + return FALSE; + } + + // Was the file able to be uploaded? If not, determine the reason why. + if ( ! is_uploaded_file($_FILES[$field]['tmp_name'])) + { + $error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error']; + + switch($error) + { + case 1 : $this->set_error('upload_file_exceeds_limit'); + break; + case 3 : $this->set_error('upload_file_partial'); + break; + case 4 : $this->set_error('upload_no_file_selected'); + break; + default : $this->set_error('upload_no_file_selected'); + break; + } + + return FALSE; + } + + // Set the uploaded data as class variables + $this->file_temp = $_FILES[$field]['tmp_name']; + $this->file_name = $_FILES[$field]['name']; + $this->file_size = $_FILES[$field]['size']; + $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); + $this->file_type = strtolower($this->file_type); + $this->file_ext = $this->get_extension($_FILES[$field]['name']); + + // Convert the file size to kilobytes + if ($this->file_size > 0) + { + $this->file_size = round($this->file_size/1024, 2); + } + + // Is the file type allowed to be uploaded? + if ( ! $this->is_allowed_filetype()) + { + $this->set_error('upload_invalid_filetype'); + return FALSE; + } + + // Is the file size within the allowed maximum? + if ( ! $this->is_allowed_filesize()) + { + $this->set_error('upload_invalid_filesize'); + return FALSE; + } + + // Are the image dimensions within the allowed size? + // Note: This can fail if the server has an open_basdir restriction. + if ( ! $this->is_allowed_dimensions()) + { + $this->set_error('upload_invalid_dimensions'); + return FALSE; + } + + // Sanitize the file name for security + $this->file_name = $this->clean_file_name($this->file_name); + + // Remove white spaces in the name + if ($this->remove_spaces == TRUE) + { + $this->file_name = preg_replace("/\s+/", "_", $this->file_name); + } + + /* + * Validate the file name + * This function appends an number onto the end of + * the file if one with the same name already exists. + * If it returns false there was a problem. + */ + $this->orig_name = $this->file_name; + + if ($this->overwrite == FALSE) + { + $this->file_name = $this->set_filename($this->upload_path, $this->file_name); + + if ($this->file_name === FALSE) + { + return FALSE; + } + } + + /* + * Move the file to the final destination + * To deal with different server configurations + * we'll attempt to use copy() first. If that fails + * we'll use move_uploaded_file(). One of the two should + * reliably work in most environments + */ + if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) + { + if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) + { + $this->set_error('upload_destination_error'); + return FALSE; + } + } + + /* + * Run the file through the XSS hacking filter + * This helps prevent malicious code from being + * embedded within a file. Scripts can easily + * be disguised as images or other file types. + */ + if ($this->xss_clean == TRUE) + { + $this->do_xss_clean(); + } + + /* + * Set the finalized image dimensions + * This sets the image width/height (assuming the + * file was an image). We use this information + * in the "data" function. + */ + $this->set_image_properties($this->upload_path.$this->file_name); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Finalized Data Array + * + * Returns an associative array containing all of the information + * related to the upload, allowing the developer easy access in one array. + * + * @access public + * @return array + */ + function data() + { + return array ( + 'file_name' => $this->file_name, + 'file_type' => $this->file_type, + 'file_path' => $this->upload_path, + 'full_path' => $this->upload_path.$this->file_name, + 'raw_name' => str_replace($this->file_ext, '', $this->file_name), + 'orig_name' => $this->orig_name, + 'file_ext' => $this->file_ext, + 'file_size' => $this->file_size, + 'is_image' => $this->is_image(), + 'image_width' => $this->image_width, + 'image_height' => $this->image_height, + 'image_type' => $this->image_type, + 'image_size_str' => $this->image_size_str, + ); + } + + // -------------------------------------------------------------------- + + /** + * Set Upload Path + * + * @access public + * @param string + * @return void + */ + function set_upload_path($path) + { + $this->upload_path = $path; + } + + // -------------------------------------------------------------------- + + /** + * Set the file name + * + * This function takes a filename/path as input and looks for the + * existence of a file with the same name. If found, it will append a + * number to the end of the filename to avoid overwriting a pre-existing file. + * + * @access public + * @param string + * @param string + * @return string + */ + function set_filename($path, $filename) + { + if ($this->encrypt_name == TRUE) + { + mt_srand(); + $filename = md5(uniqid(mt_rand())).$this->file_ext; + } + + if ( ! file_exists($path.$filename)) + { + return $filename; + } + + $filename = str_replace($this->file_ext, '', $filename); + + $new_filename = ''; + for ($i = 1; $i < 100; $i++) + { + if ( ! file_exists($path.$filename.$i.$this->file_ext)) + { + $new_filename = $filename.$i.$this->file_ext; + break; + } + } + + if ($new_filename == '') + { + $this->set_error('upload_bad_filename'); + return FALSE; + } + else + { + return $new_filename; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum File Size + * + * @access public + * @param integer + * @return void + */ + function set_max_filesize($n) + { + $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Width + * + * @access public + * @param integer + * @return void + */ + function set_max_width($n) + { + $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Maximum Image Height + * + * @access public + * @param integer + * @return void + */ + function set_max_height($n) + { + $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + + /** + * Set Allowed File Types + * + * @access public + * @param string + * @return void + */ + function set_allowed_types($types) + { + $this->allowed_types = explode('|', $types); + } + + // -------------------------------------------------------------------- + + /** + * Set Image Properties + * + * Uses GD to determine the width/height/type of image + * + * @access public + * @param string + * @return void + */ + function set_image_properties($path = '') + { + if ( ! $this->is_image()) + { + return; + } + + if (function_exists('getimagesize')) + { + if (FALSE !== ($D = @getimagesize($path))) + { + $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); + + $this->image_width = $D['0']; + $this->image_height = $D['1']; + $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']]; + $this->image_size_str = $D['3']; // string containing height and width + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set XSS Clean + * + * Enables the XSS flag so that the file that was uploaded + * will be run through the XSS filter. + * + * @access public + * @param bool + * @return void + */ + function set_xss_clean($flag = FALSE) + { + $this->xss_clean = ($flag == TRUE) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Validate the image + * + * @access public + * @return bool + */ + function is_image() + { + $img_mimes = array( + 'image/gif', + 'image/jpg', + 'image/jpe', + 'image/jpeg', + 'image/pjpeg', + 'image/png', + 'image/x-png' + ); + + + return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the filetype is allowed + * + * @access public + * @return bool + */ + function is_allowed_filetype() + { + if (count($this->allowed_types) == 0) + { + $this->set_error('upload_no_file_types'); + return FALSE; + } + + foreach ($this->allowed_types as $val) + { + $mime = $this->mimes_types(strtolower($val)); + + if (is_array($mime)) + { + if (in_array($this->file_type, $mime, TRUE)) + { + return TRUE; + } + } + else + { + if ($mime == $this->file_type) + { + return TRUE; + } + } + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Verify that the file is within the allowed size + * + * @access public + * @return bool + */ + function is_allowed_filesize() + { + if ($this->max_size != 0 AND $this->file_size > $this->max_size) + { + return FALSE; + } + else + { + return TRUE; + } + } + + // -------------------------------------------------------------------- + + /** + * Verify that the image is within the allowed width/height + * + * @access public + * @return bool + */ + function is_allowed_dimensions() + { + if ( ! $this->is_image()) + { + return TRUE; + } + + if (function_exists('getimagesize')) + { + $D = @getimagesize($this->file_temp); + + if ($this->max_width > 0 AND $D['0'] > $this->max_width) + { + return FALSE; + } + + if ($this->max_height > 0 AND $D['1'] > $this->max_height) + { + return FALSE; + } + + return TRUE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Validate Upload Path + * + * Verifies that it is a valid upload path with proper permissions. + * + * + * @access public + * @return bool + */ + function validate_upload_path() + { + if ($this->upload_path == '') + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if (function_exists('realpath') AND @realpath($this->upload_path) !== FALSE) + { + $this->upload_path = str_replace("\\", "/", realpath($this->upload_path)); + } + + if ( ! @is_dir($this->upload_path)) + { + $this->set_error('upload_no_filepath'); + return FALSE; + } + + if ( ! is_writable($this->upload_path)) + { + $this->set_error('upload_not_writable'); + return FALSE; + } + + $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Extract the file extension + * + * @access public + * @param string + * @return string + */ + function get_extension($filename) + { + $x = explode('.', $filename); + return '.'.end($x); + } + + // -------------------------------------------------------------------- + + /** + * Clean the file name for security + * + * @access public + * @param string + * @return string + */ + function clean_file_name($filename) + { + $bad = array( + "", + "'", + "<", + ">", + '"', + '&', + '$', + '=', + ';', + '?', + '/', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + foreach ($bad as $val) + { + $filename = str_replace($val, '', $filename); + } + + return $filename; + } + + // -------------------------------------------------------------------- + + /** + * Runs the file through the XSS clean function + * + * This prevents people from embedding malicious code in their files. + * I'm not sure that it won't negatively affect certain files in unexpected ways, + * but so far I haven't found that it causes trouble. + * + * @access public + * @return void + */ + function do_xss_clean() + { + $file = $this->upload_path.$this->file_name; + + if (filesize($file) == 0) + { + return FALSE; + } + + if ( ! $fp = @fopen($file, 'rb')) + { + return FALSE; + } + + flock($fp, LOCK_EX); + + $data = fread($fp, filesize($file)); + + $CI =& get_instance(); + $data = $CI->input->xss_clean($data); + + fwrite($fp, $data); + flock($fp, LOCK_UN); + fclose($fp); + } + + // -------------------------------------------------------------------- + + /** + * Set an error message + * + * @access public + * @param string + * @return void + */ + function set_error($msg) + { + $CI =& get_instance(); + $CI->lang->load('upload'); + + if (is_array($msg)) + { + foreach ($msg as $val) + { + $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + else + { + $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); + $this->error_msg[] = $msg; + log_message('error', $msg); + } + } + + // -------------------------------------------------------------------- + + /** + * Display the error message + * + * @access public + * @param string + * @param string + * @return string + */ + function display_errors($open = '

                ', $close = '

                ') + { + $str = ''; + foreach ($this->error_msg as $val) + { + $str .= $open.$val.$close; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * List of Mime Types + * + * This is a list of mime types. We use it to validate + * the "allowed types" set by the developer + * + * @access public + * @param string + * @return string + */ + function mimes_types($mime) + { + if (count($this->mimes) == 0) + { + if (@include(APPPATH.'config/mimes'.EXT)) + { + $this->mimes = $mimes; + unset($mimes); + } + } + + return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; + } + +} +// END Upload Class ?> \ No newline at end of file diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index afd012e3..b93bd340 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -1,12 +1,12 @@ '; - var $_error_suffix = '

                '; - - - - /** - * Constructor - * - */ - function CI_Validation() - { - $this->CI =& get_instance(); - log_message('debug', "Validation Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Set Fields - * - * This function takes an array of field names as input - * and generates class variables with the same name, which will - * either be blank or contain the $_POST value corresponding to it - * - * @access public - * @param string - * @param string - * @return void - */ - function set_fields($data = '', $field = '') - { - if ($data == '') - { - if (count($this->_fields) == 0) - { - return FALSE; - } - } - else - { - if ( ! is_array($data)) - { - $data = array($data => $field); - } - - if (count($data) > 0) - { - $this->_fields = $data; - } - } - - foreach($this->_fields as $key => $val) - { - $this->$key = ( ! isset($_POST[$key]) OR is_array($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]); - - $error = $key.'_error'; - if ( ! isset($this->$error)) - { - $this->$error = ''; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Set Rules - * - * This function takes an array of field names and validation - * rules as input ad simply stores is for use later. - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_rules($data, $rules = '') - { - if ( ! is_array($data)) - { - if ($rules == '') - return; - - $data[$data] = $rules; - } - - foreach ($data as $key => $val) - { - $this->_rules[$key] = $val; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Error Message - * - * Lets users set their own error messages on the fly. Note: The key - * name has to match the function name that it corresponds to. - * - * @access public - * @param string - * @param string - * @return string - */ - function set_message($lang, $val = '') - { - if ( ! is_array($lang)) - { - $lang = array($lang => $val); - } - - $this->_error_messages = array_merge($this->_error_messages, $lang); - } - - // -------------------------------------------------------------------- - - /** - * Set The Error Delimiter - * - * Permits a prefix/suffix to be added to each error message - * - * @access public - * @param string - * @param string - * @return void - */ - function set_error_delimiters($prefix = '

                ', $suffix = '

                ') - { - $this->_error_prefix = $prefix; - $this->_error_suffix = $suffix; - } - - // -------------------------------------------------------------------- - - /** - * Run the Validator - * - * This function does all the work. - * - * @access public - * @return bool - */ - function run() - { - // Do we even have any data to process? Mm? - if (count($_POST) == 0 OR count($this->_rules) == 0) - { - return FALSE; - } - - // Load the language file containing error messages - $this->CI->lang->load('validation'); - - // Cycle through the rules and test for errors - foreach ($this->_rules as $field => $rules) - { - //Explode out the rules! - $ex = explode('|', $rules); - - // Is the field required? If not, if the field is blank we'll move on to the next text - if ( ! in_array('required', $ex, TRUE) AND strpos($rules, 'callback_') === FALSE) - { - if ( ! isset($_POST[$field]) OR $_POST[$field] == '') - { - continue; - } - } - - /* - * Are we dealing with an "isset" rule? - * - * Before going further, we'll see if one of the rules - * is to check whether the item is set (typically this - * applies only to checkboxes). If so, we'll - * test for it here since there's not reason to go - * further - */ - if ( ! isset($_POST[$field])) - { - if (in_array('isset', $ex, TRUE) OR in_array('required', $ex)) - { - if ( ! isset($this->_error_messages['isset'])) - { - if (FALSE === ($line = $this->CI->lang->line('isset'))) - { - $line = 'The field was not set'; - } - } - else - { - $line = $this->_error_messages['isset']; - } - - $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $this->_error_array[] = sprintf($line, $field); - } - - continue; - } - - /* - * Set the current field - * - * The various prepping functions need to know the - * current field name so they can do this: - * - * $_POST[$this->_current_field] == 'bla bla'; - */ - $this->_current_field = $field; - - // Cycle through the rules! - foreach ($ex As $rule) - { - // Is the rule a callback? - $callback = FALSE; - if (substr($rule, 0, 9) == 'callback_') - { - $rule = substr($rule, 9); - $callback = TRUE; - } - - // Strip the parameter (if exists) from the rule - // Rules can contain a parameter: max_length[5] - $param = FALSE; - if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) - { - $rule = $match[1]; - $param = $match[2]; - } - - // Call the function that corresponds to the rule - if ($callback === TRUE) - { - if ( ! method_exists($this->CI, $rule)) - { - continue; - } - - $result = $this->CI->$rule($_POST[$field], $param); - - // If the field isn't required and we just processed a callback we'll move on... - if ( ! in_array('required', $ex, TRUE) AND $result !== FALSE) - { - continue 2; - } - - } - else - { - if ( ! method_exists($this, $rule)) - { - /* - * Run the native PHP function if called for - * - * If our own wrapper function doesn't exist we see - * if a native PHP function does. Users can use - * any native PHP function call that has one param. - */ - if (function_exists($rule)) - { - $_POST[$field] = $rule($_POST[$field]); - $this->$field = $_POST[$field]; - } - - continue; - } - - $result = $this->$rule($_POST[$field], $param); - } - - // Did the rule test negatively? If so, grab the error. - if ($result === FALSE) - { - if ( ! isset($this->_error_messages[$rule])) - { - if (FALSE === ($line = $this->CI->lang->line($rule))) - { - $line = 'Unable to access an error message corresponding to your field name.'; - } - } - else - { - $line = $this->_error_messages[$rule];; - } - - // Build the error message - $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param]; - $message = sprintf($line, $mfield, $mparam); - - // Set the error variable. Example: $this->username_error - $error = $field.'_error'; - $this->$error = $this->_error_prefix.$message.$this->_error_suffix; - - // Add the error to the error array - $this->_error_array[] = $message; - continue 2; - } - } - - } - - $total_errors = count($this->_error_array); - - /* - * Recompile the class variables - * - * If any prepping functions were called the $_POST data - * might now be different then the corresponding class - * variables so we'll set them anew. - */ - if ($total_errors > 0) - { - $this->_safe_form_data = TRUE; - } - - $this->set_fields(); - - // Did we end up with any errors? - if ($total_errors == 0) - { - return TRUE; - } - - // Generate the error string - foreach ($this->_error_array as $val) - { - $this->error_string .= $this->_error_prefix.$val.$this->_error_suffix."\n"; - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Required - * - * @access public - * @param string - * @return bool - */ - function required($str) - { - if ( ! is_array($str)) - { - return (trim($str) == '') ? FALSE : TRUE; - } - else - { - return ( ! empty($str)); - } - } - - // -------------------------------------------------------------------- - - /** - * Match one field to another - * - * @access public - * @param string - * @return bool - */ - function matches($str, $field) - { - if ( ! isset($_POST[$field])) - { - return FALSE; - } - - return ($str !== $_POST[$field]) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Minimum Length - * - * @access public - * @param string - * @return bool - */ - function min_length($str, $val) - { - if ( ! is_numeric($val)) - { - return FALSE; - } - - return (strlen($str) < $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Max Length - * - * @access public - * @param string - * @return bool - */ - function max_length($str, $val) - { - if ( ! is_numeric($val)) - { - return FALSE; - } - - return (strlen($str) > $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Exact Length - * - * @access public - * @param string - * @return bool - */ - function exact_length($str, $val) - { - if ( ! is_numeric($val)) - { - return FALSE; - } - - return (strlen($str) != $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Valid Email - * - * @access public - * @param string - * @return bool - */ - function valid_email($str) - { - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Validate IP Address - * - * @access public - * @param string - * @return string - */ - function valid_ip($ip) - { - return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Alpha - * - * @access public - * @param string - * @return bool - */ - function alpha($str) - { - return ( ! preg_match("/^([-a-z])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Alpha-numeric - * - * @access public - * @param string - * @return bool - */ - function alpha_numeric($str) - { - return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Alpha-numeric with underscores and dashes - * - * @access public - * @param string - * @return bool - */ - function alpha_dash($str) - { - return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Numeric - * - * @access public - * @param int - * @return bool - */ - function numeric($str) - { - return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Is Numeric - * - * @access public - * @param string - * @return bool - */ - function is_numeric($str) - { - return ( ! is_numeric($str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Select - * - * Enables pull-down lists to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_select($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' selected="selected"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Radio - * - * Enables radio buttons to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_radio($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' checked="checked"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Checkbox - * - * Enables checkboxes to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_checkbox($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' checked="checked"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Prep data for form - * - * This function allows HTML to be safely shown in a form. - * Special characters are converted. - * - * @access public - * @param string - * @return string - */ - function prep_for_form($str = '') - { - if ($this->_safe_form_data == FALSE OR $str == '') - { - return $str; - } - - return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($str)); - } - - // -------------------------------------------------------------------- - - /** - * Prep URL - * - * @access public - * @param string - * @return string - */ - function prep_url($str = '') - { - if ($str == 'http://' OR $str == '') - { - $_POST[$this->_current_field] = ''; - return; - } - - if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') - { - $str = 'http://'.$str; - } - - $_POST[$this->_current_field] = $str; - } - - // -------------------------------------------------------------------- - - /** - * Strip Image Tags - * - * @access public - * @param string - * @return string - */ - function strip_image_tags($str) - { - $_POST[$this->_current_field] = $this->input->strip_image_tags($str); - } - - // -------------------------------------------------------------------- - - /** - * XSS Clean - * - * @access public - * @param string - * @return string - */ - function xss_clean($str) - { - $_POST[$this->_current_field] = $this->CI->input->xss_clean($str); - } - - // -------------------------------------------------------------------- - - /** - * Convert PHP tags to entities - * - * @access public - * @param string - * @return string - */ - function encode_php_tags($str) - { - $_POST[$this->_current_field] = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); - } - -} -// END Validation Class +'; + var $_error_suffix = '

                '; + + + + /** + * Constructor + * + */ + function CI_Validation() + { + $this->CI =& get_instance(); + log_message('debug', "Validation Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set Fields + * + * This function takes an array of field names as input + * and generates class variables with the same name, which will + * either be blank or contain the $_POST value corresponding to it + * + * @access public + * @param string + * @param string + * @return void + */ + function set_fields($data = '', $field = '') + { + if ($data == '') + { + if (count($this->_fields) == 0) + { + return FALSE; + } + } + else + { + if ( ! is_array($data)) + { + $data = array($data => $field); + } + + if (count($data) > 0) + { + $this->_fields = $data; + } + } + + foreach($this->_fields as $key => $val) + { + $this->$key = ( ! isset($_POST[$key]) OR is_array($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]); + + $error = $key.'_error'; + if ( ! isset($this->$error)) + { + $this->$error = ''; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Set Rules + * + * This function takes an array of field names and validation + * rules as input ad simply stores is for use later. + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_rules($data, $rules = '') + { + if ( ! is_array($data)) + { + if ($rules == '') + return; + + $data[$data] = $rules; + } + + foreach ($data as $key => $val) + { + $this->_rules[$key] = $val; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Error Message + * + * Lets users set their own error messages on the fly. Note: The key + * name has to match the function name that it corresponds to. + * + * @access public + * @param string + * @param string + * @return string + */ + function set_message($lang, $val = '') + { + if ( ! is_array($lang)) + { + $lang = array($lang => $val); + } + + $this->_error_messages = array_merge($this->_error_messages, $lang); + } + + // -------------------------------------------------------------------- + + /** + * Set The Error Delimiter + * + * Permits a prefix/suffix to be added to each error message + * + * @access public + * @param string + * @param string + * @return void + */ + function set_error_delimiters($prefix = '

                ', $suffix = '

                ') + { + $this->_error_prefix = $prefix; + $this->_error_suffix = $suffix; + } + + // -------------------------------------------------------------------- + + /** + * Run the Validator + * + * This function does all the work. + * + * @access public + * @return bool + */ + function run() + { + // Do we even have any data to process? Mm? + if (count($_POST) == 0 OR count($this->_rules) == 0) + { + return FALSE; + } + + // Load the language file containing error messages + $this->CI->lang->load('validation'); + + // Cycle through the rules and test for errors + foreach ($this->_rules as $field => $rules) + { + //Explode out the rules! + $ex = explode('|', $rules); + + // Is the field required? If not, if the field is blank we'll move on to the next text + if ( ! in_array('required', $ex, TRUE) AND strpos($rules, 'callback_') === FALSE) + { + if ( ! isset($_POST[$field]) OR $_POST[$field] == '') + { + continue; + } + } + + /* + * Are we dealing with an "isset" rule? + * + * Before going further, we'll see if one of the rules + * is to check whether the item is set (typically this + * applies only to checkboxes). If so, we'll + * test for it here since there's not reason to go + * further + */ + if ( ! isset($_POST[$field])) + { + if (in_array('isset', $ex, TRUE) OR in_array('required', $ex)) + { + if ( ! isset($this->_error_messages['isset'])) + { + if (FALSE === ($line = $this->CI->lang->line('isset'))) + { + $line = 'The field was not set'; + } + } + else + { + $line = $this->_error_messages['isset']; + } + + $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $this->_error_array[] = sprintf($line, $field); + } + + continue; + } + + /* + * Set the current field + * + * The various prepping functions need to know the + * current field name so they can do this: + * + * $_POST[$this->_current_field] == 'bla bla'; + */ + $this->_current_field = $field; + + // Cycle through the rules! + foreach ($ex As $rule) + { + // Is the rule a callback? + $callback = FALSE; + if (substr($rule, 0, 9) == 'callback_') + { + $rule = substr($rule, 9); + $callback = TRUE; + } + + // Strip the parameter (if exists) from the rule + // Rules can contain a parameter: max_length[5] + $param = FALSE; + if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) + { + $rule = $match[1]; + $param = $match[2]; + } + + // Call the function that corresponds to the rule + if ($callback === TRUE) + { + if ( ! method_exists($this->CI, $rule)) + { + continue; + } + + $result = $this->CI->$rule($_POST[$field], $param); + + // If the field isn't required and we just processed a callback we'll move on... + if ( ! in_array('required', $ex, TRUE) AND $result !== FALSE) + { + continue 2; + } + + } + else + { + if ( ! method_exists($this, $rule)) + { + /* + * Run the native PHP function if called for + * + * If our own wrapper function doesn't exist we see + * if a native PHP function does. Users can use + * any native PHP function call that has one param. + */ + if (function_exists($rule)) + { + $_POST[$field] = $rule($_POST[$field]); + $this->$field = $_POST[$field]; + } + + continue; + } + + $result = $this->$rule($_POST[$field], $param); + } + + // Did the rule test negatively? If so, grab the error. + if ($result === FALSE) + { + if ( ! isset($this->_error_messages[$rule])) + { + if (FALSE === ($line = $this->CI->lang->line($rule))) + { + $line = 'Unable to access an error message corresponding to your field name.'; + } + } + else + { + $line = $this->_error_messages[$rule];; + } + + // Build the error message + $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param]; + $message = sprintf($line, $mfield, $mparam); + + // Set the error variable. Example: $this->username_error + $error = $field.'_error'; + $this->$error = $this->_error_prefix.$message.$this->_error_suffix; + + // Add the error to the error array + $this->_error_array[] = $message; + continue 2; + } + } + + } + + $total_errors = count($this->_error_array); + + /* + * Recompile the class variables + * + * If any prepping functions were called the $_POST data + * might now be different then the corresponding class + * variables so we'll set them anew. + */ + if ($total_errors > 0) + { + $this->_safe_form_data = TRUE; + } + + $this->set_fields(); + + // Did we end up with any errors? + if ($total_errors == 0) + { + return TRUE; + } + + // Generate the error string + foreach ($this->_error_array as $val) + { + $this->error_string .= $this->_error_prefix.$val.$this->_error_suffix."\n"; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Required + * + * @access public + * @param string + * @return bool + */ + function required($str) + { + if ( ! is_array($str)) + { + return (trim($str) == '') ? FALSE : TRUE; + } + else + { + return ( ! empty($str)); + } + } + + // -------------------------------------------------------------------- + + /** + * Match one field to another + * + * @access public + * @param string + * @return bool + */ + function matches($str, $field) + { + if ( ! isset($_POST[$field])) + { + return FALSE; + } + + return ($str !== $_POST[$field]) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Minimum Length + * + * @access public + * @param string + * @return bool + */ + function min_length($str, $val) + { + if ( ! is_numeric($val)) + { + return FALSE; + } + + return (strlen($str) < $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Max Length + * + * @access public + * @param string + * @return bool + */ + function max_length($str, $val) + { + if ( ! is_numeric($val)) + { + return FALSE; + } + + return (strlen($str) > $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Exact Length + * + * @access public + * @param string + * @return bool + */ + function exact_length($str, $val) + { + if ( ! is_numeric($val)) + { + return FALSE; + } + + return (strlen($str) != $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Valid Email + * + * @access public + * @param string + * @return bool + */ + function valid_email($str) + { + return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + return ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $ip)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha + * + * @access public + * @param string + * @return bool + */ + function alpha($str) + { + return ( ! preg_match("/^([-a-z])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric + * + * @access public + * @param string + * @return bool + */ + function alpha_numeric($str) + { + return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric with underscores and dashes + * + * @access public + * @param string + * @return bool + */ + function alpha_dash($str) + { + return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Numeric + * + * @access public + * @param int + * @return bool + */ + function numeric($str) + { + return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Is Numeric + * + * @access public + * @param string + * @return bool + */ + function is_numeric($str) + { + return ( ! is_numeric($str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set Select + * + * Enables pull-down lists to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_select($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' selected="selected"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Radio + * + * Enables radio buttons to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_radio($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' checked="checked"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Set Checkbox + * + * Enables checkboxes to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_checkbox($field = '', $value = '') + { + if ($field == '' OR $value == '' OR ! isset($_POST[$field])) + { + return ''; + } + + if ($_POST[$field] == $value) + { + return ' checked="checked"'; + } + } + + // -------------------------------------------------------------------- + + /** + * Prep data for form + * + * This function allows HTML to be safely shown in a form. + * Special characters are converted. + * + * @access public + * @param string + * @return string + */ + function prep_for_form($str = '') + { + if ($this->_safe_form_data == FALSE OR $str == '') + { + return $str; + } + + return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($str)); + } + + // -------------------------------------------------------------------- + + /** + * Prep URL + * + * @access public + * @param string + * @return string + */ + function prep_url($str = '') + { + if ($str == 'http://' OR $str == '') + { + $_POST[$this->_current_field] = ''; + return; + } + + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + { + $str = 'http://'.$str; + } + + $_POST[$this->_current_field] = $str; + } + + // -------------------------------------------------------------------- + + /** + * Strip Image Tags + * + * @access public + * @param string + * @return string + */ + function strip_image_tags($str) + { + $_POST[$this->_current_field] = $this->input->strip_image_tags($str); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * @access public + * @param string + * @return string + */ + function xss_clean($str) + { + $_POST[$this->_current_field] = $this->CI->input->xss_clean($str); + } + + // -------------------------------------------------------------------- + + /** + * Convert PHP tags to entities + * + * @access public + * @param string + * @return string + */ + function encode_php_tags($str) + { + $_POST[$this->_current_field] = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + } + +} +// END Validation Class ?> \ No newline at end of file diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 2d9a4c11..49747e48 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1,1412 +1,1412 @@ -xmlrpcName = $this->xmlrpcName; - $this->xmlrpc_backslash = chr(92).chr(92); - - // Types for info sent back and forth - $this->xmlrpcTypes = array( - $this->xmlrpcI4 => '1', - $this->xmlrpcInt => '1', - $this->xmlrpcBoolean => '1', - $this->xmlrpcString => '1', - $this->xmlrpcDouble => '1', - $this->xmlrpcDateTime => '1', - $this->xmlrpcBase64 => '1', - $this->xmlrpcArray => '2', - $this->xmlrpcStruct => '3' - ); - - // Array of Valid Parents for Various XML-RPC elements - $this->valid_parents = array('BOOLEAN' => array('VALUE'), - 'I4' => array('VALUE'), - 'INT' => array('VALUE'), - 'STRING' => array('VALUE'), - 'DOUBLE' => array('VALUE'), - 'DATETIME.ISO8601' => array('VALUE'), - 'BASE64' => array('VALUE'), - 'ARRAY' => array('VALUE'), - 'STRUCT' => array('VALUE'), - 'PARAM' => array('PARAMS'), - 'METHODNAME' => array('METHODCALL'), - 'PARAMS' => array('METHODCALL', 'METHODRESPONSE'), - 'MEMBER' => array('STRUCT'), - 'NAME' => array('MEMBER'), - 'DATA' => array('ARRAY'), - 'FAULT' => array('METHODRESPONSE'), - 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT') - ); - - - // XML-RPC Responses - $this->xmlrpcerr['unknown_method'] = '1'; - $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; - $this->xmlrpcerr['invalid_return'] = '2'; - $this->xmlrpcstr['invalid_return'] = 'The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; - $this->xmlrpcerr['incorrect_params'] = '3'; - $this->xmlrpcstr['incorrect_params'] = 'Incorrect parameters were passed to method'; - $this->xmlrpcerr['introspect_unknown'] = '4'; - $this->xmlrpcstr['introspect_unknown'] = "Cannot inspect signature for request: method unknown"; - $this->xmlrpcerr['http_error'] = '5'; - $this->xmlrpcstr['http_error'] = "Did not receive a '200 OK' response from remote server."; - $this->xmlrpcerr['no_data'] = '6'; - $this->xmlrpcstr['no_data'] ='No data received from server.'; - - $this->initialize($config); - - log_message('debug', "XML-RPC Class Initialized"); - } - - - //------------------------------------- - // Initialize Prefs - //------------------------------------- - - function initialize($config = array()) - { - if (sizeof($config) > 0) - { - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $this->$key = $val; - } - } - } - } - // END - - //------------------------------------- - // Take URL and parse it - //------------------------------------- - - function server($url, $port=80) - { - if (substr($url, 0, 4) != "http") - { - $url = "http://".$url; - } - - $parts = parse_url($url); - - $path = (!isset($parts['path'])) ? '/' : $parts['path']; - - if (isset($parts['query']) && $parts['query'] != '') - { - $path .= '?'.$parts['query']; - } - - $this->client = new XML_RPC_Client($path, $parts['host'], $port); - } - // END - - //------------------------------------- - // Set Timeout - //------------------------------------- - - function timeout($seconds=5) - { - if ( ! is_null($this->client) && is_int($seconds)) - { - $this->client->timeout = $seconds; - } - } - // END - - //------------------------------------- - // Set Methods - //------------------------------------- - - function method($function) - { - $this->method = $function; - } - // END - - //------------------------------------- - // Take Array of Data and Create Objects - //------------------------------------- - - function request($incoming) - { - if ( ! is_array($incoming)) - { - // Send Error - } - - foreach($incoming as $key => $value) - { - $this->data[$key] = $this->values_parsing($value); - } - } - // END - - - //------------------------------------- - // Set Debug - //------------------------------------- - - function set_debug($flag = TRUE) - { - $this->debug = ($flag == TRUE) ? TRUE : FALSE; - } - - //------------------------------------- - // Values Parsing - //------------------------------------- - - function values_parsing($value, $return = FALSE) - { - if (is_array($value) && isset($value['0'])) - { - if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])])) - { - $temp = new XML_RPC_Values($value['0'], 'string'); - } - elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array')) - { - while (list($k) = each($value['0'])) - { - $value['0'][$k] = $this->values_parsing($value['0'][$k], TRUE); - } - - $temp = new XML_RPC_Values($value['0'], $value['1']); - } - else - { - $temp = new XML_RPC_Values($value['0'], $value['1']); - } - } - else - { - $temp = new XML_RPC_Values($value, 'string'); - } - - return $temp; - } - // END - - - //------------------------------------- - // Sends XML-RPC Request - //------------------------------------- - - function send_request() - { - $this->message = new XML_RPC_Message($this->method,$this->data); - $this->message->debug = $this->debug; - - if ( ! $this->result = $this->client->send($this->message)) - { - $this->error = $this->result->errstr; - return FALSE; - } - elseif( ! is_object($this->result->val)) - { - $this->error = $this->result->errstr; - return FALSE; - } - - $this->response = $this->result->decode(); - - return TRUE; - } - // END - - //------------------------------------- - // Returns Error - //------------------------------------- - - function display_error() - { - return $this->error; - } - // END - - //------------------------------------- - // Returns Remote Server Response - //------------------------------------- - - function display_response() - { - return $this->response; - } - // END - - //------------------------------------- - // Sends an Error Message for Server Request - //------------------------------------- - - function send_error_message($number, $message) - { - return new XML_RPC_Response('0',$number, $message); - } - // END - - - //------------------------------------- - // Send Response for Server Request - //------------------------------------- - - function send_response($response) - { - // $response should be array of values, which will be parsed - // based on their data and type into a valid group of XML-RPC values - - $response = $this->values_parsing($response); - - return new XML_RPC_Response($response); - } - // END - -} // END XML_RPC Class - - - -/** - * XML-RPC Client class - * - * @category XML-RPC - * @author Paul Burdick - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html - */ -class XML_RPC_Client extends CI_Xmlrpc -{ - var $path = ''; - var $server = ''; - var $port = 80; - var $errno = ''; - var $errstring = ''; - var $timeout = 5; - var $no_multicall = false; - - function XML_RPC_Client($path, $server, $port=80) - { - parent::CI_Xmlrpc(); - - $this->port = $port; - $this->server = $server; - $this->path = $path; - } - - function send($msg) - { - if (is_array($msg)) - { - // Multi-call disabled - $r = new XML_RPC_Response(0, $this->xmlrpcerr['multicall_recursion'],$this->xmlrpcstr['multicall_recursion']); - return $r; - } - - return $this->sendPayload($msg); - } - - function sendPayload($msg) - { - $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout); - - if (! is_resource($fp)) - { - error_log($this->xmlrpcstr['http_error']); - $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']); - return $r; - } - - if(empty($msg->payload)) - { - // $msg = XML_RPC_Messages - $msg->createPayload(); - } - - $r = "\r\n"; - $op = "POST {$this->path} HTTP/1.0$r"; - $op .= "Host: {$this->server}$r"; - $op .= "Content-Type: text/xml$r"; - $op .= "User-Agent: {$this->xmlrpcName}$r"; - $op .= "Content-Length: ".strlen($msg->payload). "$r$r"; - $op .= $msg->payload; - - - if (!fputs($fp, $op, strlen($op))) - { - error_log($this->xmlrpcstr['http_error']); - $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']); - return $r; - } - $resp = $msg->parseResponse($fp); - fclose($fp); - return $resp; - } - -} // end class XML_RPC_Client - - -/** - * XML-RPC Response class - * - * @category XML-RPC - * @author Paul Burdick - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html - */ -class XML_RPC_Response -{ - var $val = 0; - var $errno = 0; - var $errstr = ''; - var $headers = array(); - - function XML_RPC_Response($val, $code = 0, $fstr = '') - { - if ($code != 0) - { - // error - $this->errno = $code; - $this->errstr = htmlentities($fstr); - } - else if (!is_object($val)) - { - // programmer error, not an object - error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); - $this->val = new XML_RPC_Values(); - } - else - { - $this->val = $val; - } - } - - function faultCode() - { - return $this->errno; - } - - function faultString() - { - return $this->errstr; - } - - function value() - { - return $this->val; - } - - function prepare_response() - { - $result = "\n"; - if ($this->errno) - { - $result .= ' - - - - faultCode - ' . $this->errno . ' - - - faultString - ' . $this->errstr . ' - - - -'; - } - else - { - $result .= "\n\n" . - $this->val->serialize_class() . - "\n"; - } - $result .= "\n"; - return $result; - } - - function decode($array=FALSE) - { - $CI =& get_instance(); - - if ($array !== FALSE && is_array($array)) - { - while (list($key) = each($array)) - { - if (is_array($array[$key])) - { - $array[$key] = $this->decode($array[$key]); - } - else - { - $array[$key] = $CI->input->xss_clean($array[$key]); - } - } - - $result = $array; - } - else - { - $result = $this->xmlrpc_decoder($this->val); - - if (is_array($result)) - { - $result = $this->decode($result); - } - else - { - $result = $CI->input->xss_clean($result); - } - } - - return $result; - } - - - - //------------------------------------- - // XML-RPC Object to PHP Types - //------------------------------------- - - function xmlrpc_decoder($xmlrpc_val) - { - $kind = $xmlrpc_val->kindOf(); - - if($kind == 'scalar') - { - return $xmlrpc_val->scalarval(); - } - elseif($kind == 'array') - { - reset($xmlrpc_val->me); - list($a,$b) = each($xmlrpc_val->me); - $size = sizeof($b); - - $arr = array(); - - for($i = 0; $i < $size; $i++) - { - $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]); - } - return $arr; - } - elseif($kind == 'struct') - { - reset($xmlrpc_val->me['struct']); - $arr = array(); - - while(list($key,$value) = each($xmlrpc_val->me['struct'])) - { - $arr[$key] = $this->xmlrpc_decoder($value); - } - return $arr; - } - } - - - //------------------------------------- - // ISO-8601 time to server or UTC time - //------------------------------------- - - function iso8601_decode($time, $utc=0) - { - // return a timet in the localtime, or UTC - $t = 0; - if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})", $time, $regs)) - { - if ($utc == 1) - $t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); - else - $t = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); - } - return $t; - } - -} // End Response Class - - - -/** - * XML-RPC Message class - * - * @category XML-RPC - * @author Paul Burdick - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html - */ -class XML_RPC_Message extends CI_Xmlrpc -{ - var $payload; - var $method_name; - var $params = array(); - var $xh = array(); - - function XML_RPC_Message($method, $pars=0) - { - parent::CI_Xmlrpc(); - - $this->method_name = $method; - if (is_array($pars) && sizeof($pars) > 0) - { - for($i=0; $iparams[] = $pars[$i]; - } - } - } - - //------------------------------------- - // Create Payload to Send - //------------------------------------- - - function createPayload() - { - $this->payload = "\r\n\r\n"; - $this->payload .= '' . $this->method_name . "\r\n"; - $this->payload .= "\r\n"; - - for($i=0; $iparams); $i++) - { - // $p = XML_RPC_Values - $p = $this->params[$i]; - $this->payload .= "\r\n".$p->serialize_class()."\r\n"; - } - - $this->payload .= "\r\n\r\n"; - } - - //------------------------------------- - // Parse External XML-RPC Server's Response - //------------------------------------- - - function parseResponse($fp) - { - $data = ''; - - while($datum = fread($fp, 4096)) - { - $data .= $datum; - } - - //------------------------------------- - // DISPLAY HTTP CONTENT for DEBUGGING - //------------------------------------- - - if ($this->debug === TRUE) - { - echo "
                ";
                -			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
                -			echo "
                "; - } - - //------------------------------------- - // Check for data - //------------------------------------- - - if($data == "") - { - error_log($this->xmlrpcstr['no_data']); - $r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']); - return $r; - } - - - //------------------------------------- - // Check for HTTP 200 Response - //------------------------------------- - - if(ereg("^HTTP",$data) && !ereg("^HTTP/[0-9\.]+ 200 ", $data)) - { - $errstr= substr($data, 0, strpos($data, "\n")-1); - $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')'); - return $r; - } - - //------------------------------------- - // Create and Set Up XML Parser - //------------------------------------- - - $parser = xml_parser_create($this->xmlrpc_defencoding); - - $this->xh[$parser] = array(); - $this->xh[$parser]['isf'] = 0; - $this->xh[$parser]['ac'] = ''; - $this->xh[$parser]['headers'] = array(); - $this->xh[$parser]['stack'] = array(); - $this->xh[$parser]['valuestack'] = array(); - $this->xh[$parser]['isf_reason'] = 0; - - xml_set_object($parser, $this); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); - xml_set_element_handler($parser, 'open_tag', 'closing_tag'); - xml_set_character_data_handler($parser, 'character_data'); - //xml_set_default_handler($parser, 'default_handler'); - - - //------------------------------------- - // GET HEADERS - //------------------------------------- - - $lines = explode("\r\n", $data); - while (($line = array_shift($lines))) - { - if (strlen($line) < 1) - { - break; - } - $this->xh[$parser]['headers'][] = $line; - } - $data = implode("\r\n", $lines); - - - //------------------------------------- - // PARSE XML DATA - //------------------------------------- - - if (!xml_parse($parser, $data, sizeof($data))) - { - $errstr = sprintf('XML error: %s at line %d', - xml_error_string(xml_get_error_code($parser)), - xml_get_current_line_number($parser)); - //error_log($errstr); - $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); - xml_parser_free($parser); - return $r; - } - xml_parser_free($parser); - - // --------------------------------------- - // Got Ourselves Some Badness, It Seems - // --------------------------------------- - - if ($this->xh[$parser]['isf'] > 1) - { - if ($this->debug === TRUE) - { - echo "---Invalid Return---\n"; - echo $this->xh[$parser]['isf_reason']; - echo "---Invalid Return---\n\n"; - } - - $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); - return $r; - } - elseif ( ! is_object($this->xh[$parser]['value'])) - { - $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); - return $r; - } - - //------------------------------------- - // DISPLAY XML CONTENT for DEBUGGING - //------------------------------------- - - if ($this->debug === TRUE) - { - echo "
                ";
                -			
                -			if (count($this->xh[$parser]['headers'] > 0))
                -			{
                -				echo "---HEADERS---\n";
                -				foreach ($this->xh[$parser]['headers'] as $header)
                -				{
                -					echo "$header\n";
                -				}
                -				echo "---END HEADERS---\n\n";
                -			}
                -			
                -			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
                -			
                -			echo "---PARSED---\n" ;
                -			var_dump($this->xh[$parser]['value']);
                -			echo "\n---END PARSED---
                "; - } - - //------------------------------------- - // SEND RESPONSE - //------------------------------------- - - $v = $this->xh[$parser]['value']; - - if ($this->xh[$parser]['isf']) - { - $errno_v = $v->me['struct']['faultCode']; - $errstr_v = $v->me['struct']['faultString']; - $errno = $errno_v->scalarval(); - - if ($errno == 0) - { - // FAULT returned, errno needs to reflect that - $errno = -1; - } - - $r = new XML_RPC_Response($v, $errno, $errstr_v->scalarval()); - } - else - { - $r = new XML_RPC_Response($v); - } - - $r->headers = $this->xh[$parser]['headers']; - return $r; - } - - // ------------------------------------ - // Begin Return Message Parsing section - // ------------------------------------ - - // quick explanation of components: - // ac - used to accumulate values - // isf - used to indicate a fault - // lv - used to indicate "looking for a value": implements - // the logic to allow values with no types to be strings - // params - used to store parameters in method calls - // method - used to store method name - // stack - array with parent tree of the xml element, - // used to validate the nesting of elements - - //------------------------------------- - // Start Element Handler - //------------------------------------- - - function open_tag($the_parser, $name, $attrs) - { - // If invalid nesting, then return - if ($this->xh[$the_parser]['isf'] > 1) return; - - // Evaluate and check for correct nesting of XML elements - - if (count($this->xh[$the_parser]['stack']) == 0) - { - if ($name != 'METHODRESPONSE' && $name != 'METHODCALL') - { - $this->xh[$the_parser]['isf'] = 2; - $this->xh[$the_parser]['isf_reason'] = 'Top level XML-RPC element is missing'; - return; - } - } - else - { - // not top level element: see if parent is OK - if (!in_array($this->xh[$the_parser]['stack'][0], $this->valid_parents[$name], TRUE)) - { - $this->xh[$the_parser]['isf'] = 2; - $this->xh[$the_parser]['isf_reason'] = "XML-RPC element $name cannot be child of ".$this->xh[$the_parser]['stack'][0]; - return; - } - } - - switch($name) - { - case 'STRUCT': - case 'ARRAY': - // Creates array for child elements - - $cur_val = array('value' => array(), - 'type' => $name); - - array_unshift($this->xh[$the_parser]['valuestack'], $cur_val); - break; - case 'METHODNAME': - case 'NAME': - $this->xh[$the_parser]['ac'] = ''; - break; - case 'FAULT': - $this->xh[$the_parser]['isf'] = 1; - break; - case 'PARAM': - $this->xh[$the_parser]['value'] = null; - break; - case 'VALUE': - $this->xh[$the_parser]['vt'] = 'value'; - $this->xh[$the_parser]['ac'] = ''; - $this->xh[$the_parser]['lv'] = 1; - break; - case 'I4': - case 'INT': - case 'STRING': - case 'BOOLEAN': - case 'DOUBLE': - case 'DATETIME.ISO8601': - case 'BASE64': - if ($this->xh[$the_parser]['vt'] != 'value') - { - //two data elements inside a value: an error occurred! - $this->xh[$the_parser]['isf'] = 2; - $this->xh[$the_parser]['isf_reason'] = "'Twas a $name element following a ".$this->xh[$the_parser]['vt']." element inside a single value"; - return; - } - - $this->xh[$the_parser]['ac'] = ''; - break; - case 'MEMBER': - // Set name of to nothing to prevent errors later if no is found - $this->xh[$the_parser]['valuestack'][0]['name'] = ''; - - // Set NULL value to check to see if value passed for this param/member - $this->xh[$the_parser]['value'] = null; - break; - case 'DATA': - case 'METHODCALL': - case 'METHODRESPONSE': - case 'PARAMS': - // valid elements that add little to processing - break; - default: - /// An Invalid Element is Found, so we have trouble - $this->xh[$the_parser]['isf'] = 2; - $this->xh[$the_parser]['isf_reason'] = "Invalid XML-RPC element found: $name"; - break; - } - - // Add current element name to stack, to allow validation of nesting - array_unshift($this->xh[$the_parser]['stack'], $name); - - if ($name != 'VALUE') $this->xh[$the_parser]['lv'] = 0; - } - // END - - - //------------------------------------- - // End Element Handler - //------------------------------------- - - function closing_tag($the_parser, $name) - { - if ($this->xh[$the_parser]['isf'] > 1) return; - - // Remove current element from stack and set variable - // NOTE: If the XML validates, then we do not have to worry about - // the opening and closing of elements. Nesting is checked on the opening - // tag so we be safe there as well. - - $curr_elem = array_shift($this->xh[$the_parser]['stack']); - - switch($name) - { - case 'STRUCT': - case 'ARRAY': - $cur_val = array_shift($this->xh[$the_parser]['valuestack']); - $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values']; - $this->xh[$the_parser]['vt'] = strtolower($name); - break; - case 'NAME': - $this->xh[$the_parser]['valuestack'][0]['name'] = $this->xh[$the_parser]['ac']; - break; - case 'BOOLEAN': - case 'I4': - case 'INT': - case 'STRING': - case 'DOUBLE': - case 'DATETIME.ISO8601': - case 'BASE64': - $this->xh[$the_parser]['vt'] = strtolower($name); - - if ($name == 'STRING') - { - $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; - } - elseif ($name=='DATETIME.ISO8601') - { - $this->xh[$the_parser]['vt'] = $this->xmlrpcDateTime; - $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; - } - elseif ($name=='BASE64') - { - $this->xh[$the_parser]['value'] = base64_decode($this->xh[$the_parser]['ac']); - } - elseif ($name=='BOOLEAN') - { - // Translated BOOLEAN values to TRUE AND FALSE - if ($this->xh[$the_parser]['ac'] == '1') - { - $this->xh[$the_parser]['value'] = TRUE; - } - else - { - $this->xh[$the_parser]['value'] = FALSE; - } - } - elseif ($name=='DOUBLE') - { - // we have a DOUBLE - // we must check that only 0123456789-. are characters here - if (!ereg("^[+-]?[eE0123456789 \\t\\.]+$", $this->xh[$the_parser]['ac'])) - { - $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; - } - else - { - $this->xh[$the_parser]['value'] = (double)$this->xh[$the_parser]['ac']; - } - } - else - { - // we have an I4/INT - // we must check that only 0123456789- are characters here - if (!ereg("^[+-]?[0123456789 \\t]+$", $this->xh[$the_parser]['ac'])) - { - $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; - } - else - { - $this->xh[$the_parser]['value'] = (int)$this->xh[$the_parser]['ac']; - } - } - $this->xh[$the_parser]['ac'] = ''; - $this->xh[$the_parser]['lv'] = 3; // indicate we've found a value - break; - case 'VALUE': - // This if() detects if no scalar was inside - if ($this->xh[$the_parser]['vt']=='value') - { - $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; - $this->xh[$the_parser]['vt'] = $this->xmlrpcString; - } - - // build the XML-RPC value out of the data received, and substitute it - $temp = new XML_RPC_Values($this->xh[$the_parser]['value'], $this->xh[$the_parser]['vt']); - - if (count($this->xh[$the_parser]['valuestack']) && $this->xh[$the_parser]['valuestack'][0]['type'] == 'ARRAY') - { - // Array - $this->xh[$the_parser]['valuestack'][0]['values'][] = $temp; - } - else - { - // Struct - $this->xh[$the_parser]['value'] = $temp; - } - break; - case 'MEMBER': - $this->xh[$the_parser]['ac']=''; - - // If value add to array in the stack for the last element built - if ($this->xh[$the_parser]['value']) - { - $this->xh[$the_parser]['valuestack'][0]['values'][$this->xh[$the_parser]['valuestack'][0]['name']] = $this->xh[$the_parser]['value']; - } - break; - case 'DATA': - $this->xh[$the_parser]['ac']=''; - break; - case 'PARAM': - if ($this->xh[$the_parser]['value']) - { - $this->xh[$the_parser]['params'][] = $this->xh[$the_parser]['value']; - } - break; - case 'METHODNAME': - $this->xh[$the_parser]['method'] = ereg_replace("^[\n\r\t ]+", '', $this->xh[$the_parser]['ac']); - break; - case 'PARAMS': - case 'FAULT': - case 'METHODCALL': - case 'METHORESPONSE': - // We're all good kids with nuthin' to do - break; - default: - // End of an Invalid Element. Taken care of during the opening tag though - break; - } - } - - //------------------------------------- - // Parses Character Data - //------------------------------------- - - function character_data($the_parser, $data) - { - if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already - - // If a value has not been found - if ($this->xh[$the_parser]['lv'] != 3) - { - if ($this->xh[$the_parser]['lv'] == 1) - { - $this->xh[$the_parser]['lv'] = 2; // Found a value - } - - if( ! @isset($this->xh[$the_parser]['ac'])) - { - $this->xh[$the_parser]['ac'] = ''; - } - - $this->xh[$the_parser]['ac'] .= $data; - } - } - - - function addParam($par) { $this->params[]=$par; } - - function output_parameters($array=FALSE) - { - $CI =& get_instance(); - - if ($array !== FALSE && is_array($array)) - { - while (list($key) = each($array)) - { - if (is_array($array[$key])) - { - $array[$key] = $this->output_parameters($array[$key]); - } - else - { - $array[$key] = $CI->input->xss_clean($array[$key]); - } - } - - $parameters = $array; - } - else - { - $parameters = array(); - - for ($i = 0; $i < sizeof($this->params); $i++) - { - $a_param = $this->decode_message($this->params[$i]); - - if (is_array($a_param)) - { - $parameters[] = $this->output_parameters($a_param); - } - else - { - $parameters[] = $CI->input->xss_clean($a_param); - } - } - } - - return $parameters; - } - - - function decode_message($param) - { - $kind = $param->kindOf(); - - if($kind == 'scalar') - { - return $param->scalarval(); - } - elseif($kind == 'array') - { - reset($param->me); - list($a,$b) = each($param->me); - - $arr = array(); - - for($i = 0; $i < sizeof($b); $i++) - { - $arr[] = $this->decode_message($param->me['array'][$i]); - } - - return $arr; - } - elseif($kind == 'struct') - { - reset($param->me['struct']); - - $arr = array(); - - while(list($key,$value) = each($param->me['struct'])) - { - $arr[$key] = $this->decode_message($value); - } - - return $arr; - } - } - -} // End XML_RPC_Messages class - - - -/** - * XML-RPC Values class - * - * @category XML-RPC - * @author Paul Burdick - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html - */ -class XML_RPC_Values extends CI_Xmlrpc -{ - var $me = array(); - var $mytype = 0; - - function XML_RPC_Values($val=-1, $type='') - { - parent::CI_Xmlrpc(); - - if ($val != -1 || $type != '') - { - $type = $type == '' ? 'string' : $type; - - if ($this->xmlrpcTypes[$type] == 1) - { - $this->addScalar($val,$type); - } - elseif ($this->xmlrpcTypes[$type] == 2) - { - $this->addArray($val); - } - elseif ($this->xmlrpcTypes[$type] == 3) - { - $this->addStruct($val); - } - } - } - - function addScalar($val, $type='string') - { - $typeof = $this->xmlrpcTypes[$type]; - - if ($this->mytype==1) - { - echo 'XML_RPC_Values: scalar can have only one value
                '; - return 0; - } - - if ($typeof != 1) - { - echo 'XML_RPC_Values: not a scalar type (${typeof})
                '; - return 0; - } - - if ($type == $this->xmlrpcBoolean) - { - if (strcasecmp($val,'true')==0 || $val==1 || ($val==true && strcasecmp($val,'false'))) - { - $val = 1; - } - else - { - $val=0; - } - } - - if ($this->mytype == 2) - { - // adding to an array here - $ar = $this->me['array']; - $ar[] = new XML_RPC_Values($val, $type); - $this->me['array'] = $ar; - } - else - { - // a scalar, so set the value and remember we're scalar - $this->me[$type] = $val; - $this->mytype = $typeof; - } - return 1; - } - - function addArray($vals) - { - if ($this->mytype != 0) - { - echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
                '; - return 0; - } - - $this->mytype = $this->xmlrpcTypes['array']; - $this->me['array'] = $vals; - return 1; - } - - function addStruct($vals) - { - if ($this->mytype != 0) - { - echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
                '; - return 0; - } - $this->mytype = $this->xmlrpcTypes['struct']; - $this->me['struct'] = $vals; - return 1; - } - - function kindOf() - { - switch($this->mytype) - { - case 3: - return 'struct'; - break; - case 2: - return 'array'; - break; - case 1: - return 'scalar'; - break; - default: - return 'undef'; - } - } - - function serializedata($typ, $val) - { - $rs = ''; - - switch($this->xmlrpcTypes[$typ]) - { - case 3: - // struct - $rs .= "\n"; - reset($val); - while(list($key2, $val2) = each($val)) - { - $rs .= "\n{$key2}\n"; - $rs .= $this->serializeval($val2); - $rs .= "\n"; - } - $rs .= ''; - break; - case 2: - // array - $rs .= "\n\n"; - for($i=0; $i < sizeof($val); $i++) - { - $rs .= $this->serializeval($val[$i]); - } - $rs.="\n\n"; - break; - case 1: - // others - switch ($typ) - { - case $this->xmlrpcBase64: - $rs .= "<{$typ}>" . base64_encode($val) . "\n"; - break; - case $this->xmlrpcBoolean: - $rs .= "<{$typ}>" . ($val ? '1' : '0') . "\n"; - break; - case $this->xmlrpcString: - $rs .= "<{$typ}>" . htmlspecialchars($val). "\n"; - break; - default: - $rs .= "<{$typ}>{$val}\n"; - break; - } - default: - break; - } - return $rs; - } - - function serialize_class() - { - return $this->serializeval($this); - } - - function serializeval($o) - { - - $ar = $o->me; - reset($ar); - - list($typ, $val) = each($ar); - $rs = "\n".$this->serializedata($typ, $val)."\n"; - return $rs; - } - - function scalarval() - { - reset($this->me); - list($a,$b) = each($this->me); - return $b; - } - - - //------------------------------------- - // Encode time in ISO-8601 form. - //------------------------------------- - - // Useful for sending time in XML-RPC - - function iso8601_encode($time, $utc=0) - { - if ($utc == 1) - { - $t = strftime("%Y%m%dT%H:%M:%S", $time); - } - else - { - if (function_exists('gmstrftime')) - $t = gmstrftime("%Y%m%dT%H:%M:%S", $time); - else - $t = strftime("%Y%m%dT%H:%M:%S", $time - date('Z')); - } - return $t; - } - -} -// END XML_RPC_Values Class +xmlrpcName = $this->xmlrpcName; + $this->xmlrpc_backslash = chr(92).chr(92); + + // Types for info sent back and forth + $this->xmlrpcTypes = array( + $this->xmlrpcI4 => '1', + $this->xmlrpcInt => '1', + $this->xmlrpcBoolean => '1', + $this->xmlrpcString => '1', + $this->xmlrpcDouble => '1', + $this->xmlrpcDateTime => '1', + $this->xmlrpcBase64 => '1', + $this->xmlrpcArray => '2', + $this->xmlrpcStruct => '3' + ); + + // Array of Valid Parents for Various XML-RPC elements + $this->valid_parents = array('BOOLEAN' => array('VALUE'), + 'I4' => array('VALUE'), + 'INT' => array('VALUE'), + 'STRING' => array('VALUE'), + 'DOUBLE' => array('VALUE'), + 'DATETIME.ISO8601' => array('VALUE'), + 'BASE64' => array('VALUE'), + 'ARRAY' => array('VALUE'), + 'STRUCT' => array('VALUE'), + 'PARAM' => array('PARAMS'), + 'METHODNAME' => array('METHODCALL'), + 'PARAMS' => array('METHODCALL', 'METHODRESPONSE'), + 'MEMBER' => array('STRUCT'), + 'NAME' => array('MEMBER'), + 'DATA' => array('ARRAY'), + 'FAULT' => array('METHODRESPONSE'), + 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT') + ); + + + // XML-RPC Responses + $this->xmlrpcerr['unknown_method'] = '1'; + $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; + $this->xmlrpcerr['invalid_return'] = '2'; + $this->xmlrpcstr['invalid_return'] = 'The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; + $this->xmlrpcerr['incorrect_params'] = '3'; + $this->xmlrpcstr['incorrect_params'] = 'Incorrect parameters were passed to method'; + $this->xmlrpcerr['introspect_unknown'] = '4'; + $this->xmlrpcstr['introspect_unknown'] = "Cannot inspect signature for request: method unknown"; + $this->xmlrpcerr['http_error'] = '5'; + $this->xmlrpcstr['http_error'] = "Did not receive a '200 OK' response from remote server."; + $this->xmlrpcerr['no_data'] = '6'; + $this->xmlrpcstr['no_data'] ='No data received from server.'; + + $this->initialize($config); + + log_message('debug', "XML-RPC Class Initialized"); + } + + + //------------------------------------- + // Initialize Prefs + //------------------------------------- + + function initialize($config = array()) + { + if (sizeof($config) > 0) + { + foreach ($config as $key => $val) + { + if (isset($this->$key)) + { + $this->$key = $val; + } + } + } + } + // END + + //------------------------------------- + // Take URL and parse it + //------------------------------------- + + function server($url, $port=80) + { + if (substr($url, 0, 4) != "http") + { + $url = "http://".$url; + } + + $parts = parse_url($url); + + $path = (!isset($parts['path'])) ? '/' : $parts['path']; + + if (isset($parts['query']) && $parts['query'] != '') + { + $path .= '?'.$parts['query']; + } + + $this->client = new XML_RPC_Client($path, $parts['host'], $port); + } + // END + + //------------------------------------- + // Set Timeout + //------------------------------------- + + function timeout($seconds=5) + { + if ( ! is_null($this->client) && is_int($seconds)) + { + $this->client->timeout = $seconds; + } + } + // END + + //------------------------------------- + // Set Methods + //------------------------------------- + + function method($function) + { + $this->method = $function; + } + // END + + //------------------------------------- + // Take Array of Data and Create Objects + //------------------------------------- + + function request($incoming) + { + if ( ! is_array($incoming)) + { + // Send Error + } + + foreach($incoming as $key => $value) + { + $this->data[$key] = $this->values_parsing($value); + } + } + // END + + + //------------------------------------- + // Set Debug + //------------------------------------- + + function set_debug($flag = TRUE) + { + $this->debug = ($flag == TRUE) ? TRUE : FALSE; + } + + //------------------------------------- + // Values Parsing + //------------------------------------- + + function values_parsing($value, $return = FALSE) + { + if (is_array($value) && isset($value['0'])) + { + if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])])) + { + $temp = new XML_RPC_Values($value['0'], 'string'); + } + elseif(is_array($value['0']) && ($value['1'] == 'struct' OR $value['1'] == 'array')) + { + while (list($k) = each($value['0'])) + { + $value['0'][$k] = $this->values_parsing($value['0'][$k], TRUE); + } + + $temp = new XML_RPC_Values($value['0'], $value['1']); + } + else + { + $temp = new XML_RPC_Values($value['0'], $value['1']); + } + } + else + { + $temp = new XML_RPC_Values($value, 'string'); + } + + return $temp; + } + // END + + + //------------------------------------- + // Sends XML-RPC Request + //------------------------------------- + + function send_request() + { + $this->message = new XML_RPC_Message($this->method,$this->data); + $this->message->debug = $this->debug; + + if ( ! $this->result = $this->client->send($this->message)) + { + $this->error = $this->result->errstr; + return FALSE; + } + elseif( ! is_object($this->result->val)) + { + $this->error = $this->result->errstr; + return FALSE; + } + + $this->response = $this->result->decode(); + + return TRUE; + } + // END + + //------------------------------------- + // Returns Error + //------------------------------------- + + function display_error() + { + return $this->error; + } + // END + + //------------------------------------- + // Returns Remote Server Response + //------------------------------------- + + function display_response() + { + return $this->response; + } + // END + + //------------------------------------- + // Sends an Error Message for Server Request + //------------------------------------- + + function send_error_message($number, $message) + { + return new XML_RPC_Response('0',$number, $message); + } + // END + + + //------------------------------------- + // Send Response for Server Request + //------------------------------------- + + function send_response($response) + { + // $response should be array of values, which will be parsed + // based on their data and type into a valid group of XML-RPC values + + $response = $this->values_parsing($response); + + return new XML_RPC_Response($response); + } + // END + +} // END XML_RPC Class + + + +/** + * XML-RPC Client class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Client extends CI_Xmlrpc +{ + var $path = ''; + var $server = ''; + var $port = 80; + var $errno = ''; + var $errstring = ''; + var $timeout = 5; + var $no_multicall = false; + + function XML_RPC_Client($path, $server, $port=80) + { + parent::CI_Xmlrpc(); + + $this->port = $port; + $this->server = $server; + $this->path = $path; + } + + function send($msg) + { + if (is_array($msg)) + { + // Multi-call disabled + $r = new XML_RPC_Response(0, $this->xmlrpcerr['multicall_recursion'],$this->xmlrpcstr['multicall_recursion']); + return $r; + } + + return $this->sendPayload($msg); + } + + function sendPayload($msg) + { + $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout); + + if (! is_resource($fp)) + { + error_log($this->xmlrpcstr['http_error']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']); + return $r; + } + + if(empty($msg->payload)) + { + // $msg = XML_RPC_Messages + $msg->createPayload(); + } + + $r = "\r\n"; + $op = "POST {$this->path} HTTP/1.0$r"; + $op .= "Host: {$this->server}$r"; + $op .= "Content-Type: text/xml$r"; + $op .= "User-Agent: {$this->xmlrpcName}$r"; + $op .= "Content-Length: ".strlen($msg->payload). "$r$r"; + $op .= $msg->payload; + + + if (!fputs($fp, $op, strlen($op))) + { + error_log($this->xmlrpcstr['http_error']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']); + return $r; + } + $resp = $msg->parseResponse($fp); + fclose($fp); + return $resp; + } + +} // end class XML_RPC_Client + + +/** + * XML-RPC Response class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Response +{ + var $val = 0; + var $errno = 0; + var $errstr = ''; + var $headers = array(); + + function XML_RPC_Response($val, $code = 0, $fstr = '') + { + if ($code != 0) + { + // error + $this->errno = $code; + $this->errstr = htmlentities($fstr); + } + else if (!is_object($val)) + { + // programmer error, not an object + error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); + $this->val = new XML_RPC_Values(); + } + else + { + $this->val = $val; + } + } + + function faultCode() + { + return $this->errno; + } + + function faultString() + { + return $this->errstr; + } + + function value() + { + return $this->val; + } + + function prepare_response() + { + $result = "\n"; + if ($this->errno) + { + $result .= ' + + + + faultCode + ' . $this->errno . ' + + + faultString + ' . $this->errstr . ' + + + +'; + } + else + { + $result .= "\n\n" . + $this->val->serialize_class() . + "\n"; + } + $result .= "\n"; + return $result; + } + + function decode($array=FALSE) + { + $CI =& get_instance(); + + if ($array !== FALSE && is_array($array)) + { + while (list($key) = each($array)) + { + if (is_array($array[$key])) + { + $array[$key] = $this->decode($array[$key]); + } + else + { + $array[$key] = $CI->input->xss_clean($array[$key]); + } + } + + $result = $array; + } + else + { + $result = $this->xmlrpc_decoder($this->val); + + if (is_array($result)) + { + $result = $this->decode($result); + } + else + { + $result = $CI->input->xss_clean($result); + } + } + + return $result; + } + + + + //------------------------------------- + // XML-RPC Object to PHP Types + //------------------------------------- + + function xmlrpc_decoder($xmlrpc_val) + { + $kind = $xmlrpc_val->kindOf(); + + if($kind == 'scalar') + { + return $xmlrpc_val->scalarval(); + } + elseif($kind == 'array') + { + reset($xmlrpc_val->me); + list($a,$b) = each($xmlrpc_val->me); + $size = sizeof($b); + + $arr = array(); + + for($i = 0; $i < $size; $i++) + { + $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]); + } + return $arr; + } + elseif($kind == 'struct') + { + reset($xmlrpc_val->me['struct']); + $arr = array(); + + while(list($key,$value) = each($xmlrpc_val->me['struct'])) + { + $arr[$key] = $this->xmlrpc_decoder($value); + } + return $arr; + } + } + + + //------------------------------------- + // ISO-8601 time to server or UTC time + //------------------------------------- + + function iso8601_decode($time, $utc=0) + { + // return a timet in the localtime, or UTC + $t = 0; + if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})", $time, $regs)) + { + if ($utc == 1) + $t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + else + $t = mktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); + } + return $t; + } + +} // End Response Class + + + +/** + * XML-RPC Message class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Message extends CI_Xmlrpc +{ + var $payload; + var $method_name; + var $params = array(); + var $xh = array(); + + function XML_RPC_Message($method, $pars=0) + { + parent::CI_Xmlrpc(); + + $this->method_name = $method; + if (is_array($pars) && sizeof($pars) > 0) + { + for($i=0; $iparams[] = $pars[$i]; + } + } + } + + //------------------------------------- + // Create Payload to Send + //------------------------------------- + + function createPayload() + { + $this->payload = "\r\n\r\n"; + $this->payload .= '' . $this->method_name . "\r\n"; + $this->payload .= "\r\n"; + + for($i=0; $iparams); $i++) + { + // $p = XML_RPC_Values + $p = $this->params[$i]; + $this->payload .= "\r\n".$p->serialize_class()."\r\n"; + } + + $this->payload .= "\r\n\r\n"; + } + + //------------------------------------- + // Parse External XML-RPC Server's Response + //------------------------------------- + + function parseResponse($fp) + { + $data = ''; + + while($datum = fread($fp, 4096)) + { + $data .= $datum; + } + + //------------------------------------- + // DISPLAY HTTP CONTENT for DEBUGGING + //------------------------------------- + + if ($this->debug === TRUE) + { + echo "
                ";
                +			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
                +			echo "
                "; + } + + //------------------------------------- + // Check for data + //------------------------------------- + + if($data == "") + { + error_log($this->xmlrpcstr['no_data']); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']); + return $r; + } + + + //------------------------------------- + // Check for HTTP 200 Response + //------------------------------------- + + if(ereg("^HTTP",$data) && !ereg("^HTTP/[0-9\.]+ 200 ", $data)) + { + $errstr= substr($data, 0, strpos($data, "\n")-1); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')'); + return $r; + } + + //------------------------------------- + // Create and Set Up XML Parser + //------------------------------------- + + $parser = xml_parser_create($this->xmlrpc_defencoding); + + $this->xh[$parser] = array(); + $this->xh[$parser]['isf'] = 0; + $this->xh[$parser]['ac'] = ''; + $this->xh[$parser]['headers'] = array(); + $this->xh[$parser]['stack'] = array(); + $this->xh[$parser]['valuestack'] = array(); + $this->xh[$parser]['isf_reason'] = 0; + + xml_set_object($parser, $this); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_set_element_handler($parser, 'open_tag', 'closing_tag'); + xml_set_character_data_handler($parser, 'character_data'); + //xml_set_default_handler($parser, 'default_handler'); + + + //------------------------------------- + // GET HEADERS + //------------------------------------- + + $lines = explode("\r\n", $data); + while (($line = array_shift($lines))) + { + if (strlen($line) < 1) + { + break; + } + $this->xh[$parser]['headers'][] = $line; + } + $data = implode("\r\n", $lines); + + + //------------------------------------- + // PARSE XML DATA + //------------------------------------- + + if (!xml_parse($parser, $data, sizeof($data))) + { + $errstr = sprintf('XML error: %s at line %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser)); + //error_log($errstr); + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); + xml_parser_free($parser); + return $r; + } + xml_parser_free($parser); + + // --------------------------------------- + // Got Ourselves Some Badness, It Seems + // --------------------------------------- + + if ($this->xh[$parser]['isf'] > 1) + { + if ($this->debug === TRUE) + { + echo "---Invalid Return---\n"; + echo $this->xh[$parser]['isf_reason']; + echo "---Invalid Return---\n\n"; + } + + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); + return $r; + } + elseif ( ! is_object($this->xh[$parser]['value'])) + { + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); + return $r; + } + + //------------------------------------- + // DISPLAY XML CONTENT for DEBUGGING + //------------------------------------- + + if ($this->debug === TRUE) + { + echo "
                ";
                +			
                +			if (count($this->xh[$parser]['headers'] > 0))
                +			{
                +				echo "---HEADERS---\n";
                +				foreach ($this->xh[$parser]['headers'] as $header)
                +				{
                +					echo "$header\n";
                +				}
                +				echo "---END HEADERS---\n\n";
                +			}
                +			
                +			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
                +			
                +			echo "---PARSED---\n" ;
                +			var_dump($this->xh[$parser]['value']);
                +			echo "\n---END PARSED---
                "; + } + + //------------------------------------- + // SEND RESPONSE + //------------------------------------- + + $v = $this->xh[$parser]['value']; + + if ($this->xh[$parser]['isf']) + { + $errno_v = $v->me['struct']['faultCode']; + $errstr_v = $v->me['struct']['faultString']; + $errno = $errno_v->scalarval(); + + if ($errno == 0) + { + // FAULT returned, errno needs to reflect that + $errno = -1; + } + + $r = new XML_RPC_Response($v, $errno, $errstr_v->scalarval()); + } + else + { + $r = new XML_RPC_Response($v); + } + + $r->headers = $this->xh[$parser]['headers']; + return $r; + } + + // ------------------------------------ + // Begin Return Message Parsing section + // ------------------------------------ + + // quick explanation of components: + // ac - used to accumulate values + // isf - used to indicate a fault + // lv - used to indicate "looking for a value": implements + // the logic to allow values with no types to be strings + // params - used to store parameters in method calls + // method - used to store method name + // stack - array with parent tree of the xml element, + // used to validate the nesting of elements + + //------------------------------------- + // Start Element Handler + //------------------------------------- + + function open_tag($the_parser, $name, $attrs) + { + // If invalid nesting, then return + if ($this->xh[$the_parser]['isf'] > 1) return; + + // Evaluate and check for correct nesting of XML elements + + if (count($this->xh[$the_parser]['stack']) == 0) + { + if ($name != 'METHODRESPONSE' && $name != 'METHODCALL') + { + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = 'Top level XML-RPC element is missing'; + return; + } + } + else + { + // not top level element: see if parent is OK + if (!in_array($this->xh[$the_parser]['stack'][0], $this->valid_parents[$name], TRUE)) + { + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "XML-RPC element $name cannot be child of ".$this->xh[$the_parser]['stack'][0]; + return; + } + } + + switch($name) + { + case 'STRUCT': + case 'ARRAY': + // Creates array for child elements + + $cur_val = array('value' => array(), + 'type' => $name); + + array_unshift($this->xh[$the_parser]['valuestack'], $cur_val); + break; + case 'METHODNAME': + case 'NAME': + $this->xh[$the_parser]['ac'] = ''; + break; + case 'FAULT': + $this->xh[$the_parser]['isf'] = 1; + break; + case 'PARAM': + $this->xh[$the_parser]['value'] = null; + break; + case 'VALUE': + $this->xh[$the_parser]['vt'] = 'value'; + $this->xh[$the_parser]['ac'] = ''; + $this->xh[$the_parser]['lv'] = 1; + break; + case 'I4': + case 'INT': + case 'STRING': + case 'BOOLEAN': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + if ($this->xh[$the_parser]['vt'] != 'value') + { + //two data elements inside a value: an error occurred! + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "'Twas a $name element following a ".$this->xh[$the_parser]['vt']." element inside a single value"; + return; + } + + $this->xh[$the_parser]['ac'] = ''; + break; + case 'MEMBER': + // Set name of to nothing to prevent errors later if no is found + $this->xh[$the_parser]['valuestack'][0]['name'] = ''; + + // Set NULL value to check to see if value passed for this param/member + $this->xh[$the_parser]['value'] = null; + break; + case 'DATA': + case 'METHODCALL': + case 'METHODRESPONSE': + case 'PARAMS': + // valid elements that add little to processing + break; + default: + /// An Invalid Element is Found, so we have trouble + $this->xh[$the_parser]['isf'] = 2; + $this->xh[$the_parser]['isf_reason'] = "Invalid XML-RPC element found: $name"; + break; + } + + // Add current element name to stack, to allow validation of nesting + array_unshift($this->xh[$the_parser]['stack'], $name); + + if ($name != 'VALUE') $this->xh[$the_parser]['lv'] = 0; + } + // END + + + //------------------------------------- + // End Element Handler + //------------------------------------- + + function closing_tag($the_parser, $name) + { + if ($this->xh[$the_parser]['isf'] > 1) return; + + // Remove current element from stack and set variable + // NOTE: If the XML validates, then we do not have to worry about + // the opening and closing of elements. Nesting is checked on the opening + // tag so we be safe there as well. + + $curr_elem = array_shift($this->xh[$the_parser]['stack']); + + switch($name) + { + case 'STRUCT': + case 'ARRAY': + $cur_val = array_shift($this->xh[$the_parser]['valuestack']); + $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values']; + $this->xh[$the_parser]['vt'] = strtolower($name); + break; + case 'NAME': + $this->xh[$the_parser]['valuestack'][0]['name'] = $this->xh[$the_parser]['ac']; + break; + case 'BOOLEAN': + case 'I4': + case 'INT': + case 'STRING': + case 'DOUBLE': + case 'DATETIME.ISO8601': + case 'BASE64': + $this->xh[$the_parser]['vt'] = strtolower($name); + + if ($name == 'STRING') + { + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + } + elseif ($name=='DATETIME.ISO8601') + { + $this->xh[$the_parser]['vt'] = $this->xmlrpcDateTime; + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + } + elseif ($name=='BASE64') + { + $this->xh[$the_parser]['value'] = base64_decode($this->xh[$the_parser]['ac']); + } + elseif ($name=='BOOLEAN') + { + // Translated BOOLEAN values to TRUE AND FALSE + if ($this->xh[$the_parser]['ac'] == '1') + { + $this->xh[$the_parser]['value'] = TRUE; + } + else + { + $this->xh[$the_parser]['value'] = FALSE; + } + } + elseif ($name=='DOUBLE') + { + // we have a DOUBLE + // we must check that only 0123456789-. are characters here + if (!ereg("^[+-]?[eE0123456789 \\t\\.]+$", $this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; + } + else + { + $this->xh[$the_parser]['value'] = (double)$this->xh[$the_parser]['ac']; + } + } + else + { + // we have an I4/INT + // we must check that only 0123456789- are characters here + if (!ereg("^[+-]?[0123456789 \\t]+$", $this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['value'] = 'ERROR_NON_NUMERIC_FOUND'; + } + else + { + $this->xh[$the_parser]['value'] = (int)$this->xh[$the_parser]['ac']; + } + } + $this->xh[$the_parser]['ac'] = ''; + $this->xh[$the_parser]['lv'] = 3; // indicate we've found a value + break; + case 'VALUE': + // This if() detects if no scalar was inside + if ($this->xh[$the_parser]['vt']=='value') + { + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; + $this->xh[$the_parser]['vt'] = $this->xmlrpcString; + } + + // build the XML-RPC value out of the data received, and substitute it + $temp = new XML_RPC_Values($this->xh[$the_parser]['value'], $this->xh[$the_parser]['vt']); + + if (count($this->xh[$the_parser]['valuestack']) && $this->xh[$the_parser]['valuestack'][0]['type'] == 'ARRAY') + { + // Array + $this->xh[$the_parser]['valuestack'][0]['values'][] = $temp; + } + else + { + // Struct + $this->xh[$the_parser]['value'] = $temp; + } + break; + case 'MEMBER': + $this->xh[$the_parser]['ac']=''; + + // If value add to array in the stack for the last element built + if ($this->xh[$the_parser]['value']) + { + $this->xh[$the_parser]['valuestack'][0]['values'][$this->xh[$the_parser]['valuestack'][0]['name']] = $this->xh[$the_parser]['value']; + } + break; + case 'DATA': + $this->xh[$the_parser]['ac']=''; + break; + case 'PARAM': + if ($this->xh[$the_parser]['value']) + { + $this->xh[$the_parser]['params'][] = $this->xh[$the_parser]['value']; + } + break; + case 'METHODNAME': + $this->xh[$the_parser]['method'] = ereg_replace("^[\n\r\t ]+", '', $this->xh[$the_parser]['ac']); + break; + case 'PARAMS': + case 'FAULT': + case 'METHODCALL': + case 'METHORESPONSE': + // We're all good kids with nuthin' to do + break; + default: + // End of an Invalid Element. Taken care of during the opening tag though + break; + } + } + + //------------------------------------- + // Parses Character Data + //------------------------------------- + + function character_data($the_parser, $data) + { + if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already + + // If a value has not been found + if ($this->xh[$the_parser]['lv'] != 3) + { + if ($this->xh[$the_parser]['lv'] == 1) + { + $this->xh[$the_parser]['lv'] = 2; // Found a value + } + + if( ! @isset($this->xh[$the_parser]['ac'])) + { + $this->xh[$the_parser]['ac'] = ''; + } + + $this->xh[$the_parser]['ac'] .= $data; + } + } + + + function addParam($par) { $this->params[]=$par; } + + function output_parameters($array=FALSE) + { + $CI =& get_instance(); + + if ($array !== FALSE && is_array($array)) + { + while (list($key) = each($array)) + { + if (is_array($array[$key])) + { + $array[$key] = $this->output_parameters($array[$key]); + } + else + { + $array[$key] = $CI->input->xss_clean($array[$key]); + } + } + + $parameters = $array; + } + else + { + $parameters = array(); + + for ($i = 0; $i < sizeof($this->params); $i++) + { + $a_param = $this->decode_message($this->params[$i]); + + if (is_array($a_param)) + { + $parameters[] = $this->output_parameters($a_param); + } + else + { + $parameters[] = $CI->input->xss_clean($a_param); + } + } + } + + return $parameters; + } + + + function decode_message($param) + { + $kind = $param->kindOf(); + + if($kind == 'scalar') + { + return $param->scalarval(); + } + elseif($kind == 'array') + { + reset($param->me); + list($a,$b) = each($param->me); + + $arr = array(); + + for($i = 0; $i < sizeof($b); $i++) + { + $arr[] = $this->decode_message($param->me['array'][$i]); + } + + return $arr; + } + elseif($kind == 'struct') + { + reset($param->me['struct']); + + $arr = array(); + + while(list($key,$value) = each($param->me['struct'])) + { + $arr[$key] = $this->decode_message($value); + } + + return $arr; + } + } + +} // End XML_RPC_Messages class + + + +/** + * XML-RPC Values class + * + * @category XML-RPC + * @author Paul Burdick + * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + */ +class XML_RPC_Values extends CI_Xmlrpc +{ + var $me = array(); + var $mytype = 0; + + function XML_RPC_Values($val=-1, $type='') + { + parent::CI_Xmlrpc(); + + if ($val != -1 || $type != '') + { + $type = $type == '' ? 'string' : $type; + + if ($this->xmlrpcTypes[$type] == 1) + { + $this->addScalar($val,$type); + } + elseif ($this->xmlrpcTypes[$type] == 2) + { + $this->addArray($val); + } + elseif ($this->xmlrpcTypes[$type] == 3) + { + $this->addStruct($val); + } + } + } + + function addScalar($val, $type='string') + { + $typeof = $this->xmlrpcTypes[$type]; + + if ($this->mytype==1) + { + echo 'XML_RPC_Values: scalar can have only one value
                '; + return 0; + } + + if ($typeof != 1) + { + echo 'XML_RPC_Values: not a scalar type (${typeof})
                '; + return 0; + } + + if ($type == $this->xmlrpcBoolean) + { + if (strcasecmp($val,'true')==0 || $val==1 || ($val==true && strcasecmp($val,'false'))) + { + $val = 1; + } + else + { + $val=0; + } + } + + if ($this->mytype == 2) + { + // adding to an array here + $ar = $this->me['array']; + $ar[] = new XML_RPC_Values($val, $type); + $this->me['array'] = $ar; + } + else + { + // a scalar, so set the value and remember we're scalar + $this->me[$type] = $val; + $this->mytype = $typeof; + } + return 1; + } + + function addArray($vals) + { + if ($this->mytype != 0) + { + echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
                '; + return 0; + } + + $this->mytype = $this->xmlrpcTypes['array']; + $this->me['array'] = $vals; + return 1; + } + + function addStruct($vals) + { + if ($this->mytype != 0) + { + echo 'XML_RPC_Values: already initialized as a [' . $this->kindOf() . ']
                '; + return 0; + } + $this->mytype = $this->xmlrpcTypes['struct']; + $this->me['struct'] = $vals; + return 1; + } + + function kindOf() + { + switch($this->mytype) + { + case 3: + return 'struct'; + break; + case 2: + return 'array'; + break; + case 1: + return 'scalar'; + break; + default: + return 'undef'; + } + } + + function serializedata($typ, $val) + { + $rs = ''; + + switch($this->xmlrpcTypes[$typ]) + { + case 3: + // struct + $rs .= "\n"; + reset($val); + while(list($key2, $val2) = each($val)) + { + $rs .= "\n{$key2}\n"; + $rs .= $this->serializeval($val2); + $rs .= "\n"; + } + $rs .= ''; + break; + case 2: + // array + $rs .= "\n\n"; + for($i=0; $i < sizeof($val); $i++) + { + $rs .= $this->serializeval($val[$i]); + } + $rs.="\n\n"; + break; + case 1: + // others + switch ($typ) + { + case $this->xmlrpcBase64: + $rs .= "<{$typ}>" . base64_encode($val) . "\n"; + break; + case $this->xmlrpcBoolean: + $rs .= "<{$typ}>" . ($val ? '1' : '0') . "\n"; + break; + case $this->xmlrpcString: + $rs .= "<{$typ}>" . htmlspecialchars($val). "\n"; + break; + default: + $rs .= "<{$typ}>{$val}\n"; + break; + } + default: + break; + } + return $rs; + } + + function serialize_class() + { + return $this->serializeval($this); + } + + function serializeval($o) + { + + $ar = $o->me; + reset($ar); + + list($typ, $val) = each($ar); + $rs = "\n".$this->serializedata($typ, $val)."\n"; + return $rs; + } + + function scalarval() + { + reset($this->me); + list($a,$b) = each($this->me); + return $b; + } + + + //------------------------------------- + // Encode time in ISO-8601 form. + //------------------------------------- + + // Useful for sending time in XML-RPC + + function iso8601_encode($time, $utc=0) + { + if ($utc == 1) + { + $t = strftime("%Y%m%dT%H:%M:%S", $time); + } + else + { + if (function_exists('gmstrftime')) + $t = gmstrftime("%Y%m%dT%H:%M:%S", $time); + else + $t = strftime("%Y%m%dT%H:%M:%S", $time - date('Z')); + } + return $t; + } + +} +// END XML_RPC_Values Class ?> \ No newline at end of file diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index bdb058e8..fe55e36d 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -1,503 +1,503 @@ -set_system_methods(); - - if (isset($config['functions']) && is_array($config['functions'])) - { - $this->methods = $config['functions']; - } - - log_message('debug', "XML-RPC Server Class Initialized"); - } - - //------------------------------------- - // Initialize Prefs and Serve - //------------------------------------- - - function initialize($config=array()) - { - if (isset($config['functions']) && is_array($config['functions'])) - { - $this->methods = $config['functions']; - } - - if (isset($config['debug'])) - { - $this->debug = $config['debug']; - } - } - - //------------------------------------- - // Setting of System Methods - //------------------------------------- - - function set_system_methods () - { - $system_methods = array( - 'system.listMethods' => array( - 'function' => 'this.listMethods', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)), - 'docstring' => 'Returns an array of available methods on this server'), - 'system.methodHelp' => array( - 'function' => 'this.methodHelp', - 'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)), - 'docstring' => 'Returns a documentation string for the specified method'), - 'system.methodSignature' => array( - 'function' => 'this.methodSignature', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)), - 'docstring' => 'Returns an array describing the return type and required parameters of a method'), - 'system.multicall' => array( - 'function' => 'this.multicall', - 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)), - 'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details') - ); - } - - - //------------------------------------- - // Main Server Function - //------------------------------------- - - function serve() - { - $r = $this->parseRequest(); - $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; - $payload .= $this->debug_msg; - $payload .= $r->prepare_response(); - - header("Content-Type: text/xml"); - header("Content-Length: ".strlen($payload)); - echo $payload; - } - - //------------------------------------- - // Add Method to Class - //------------------------------------- - - function add_to_map($methodname,$function,$sig,$doc) - { - $this->methods[$methodname] = array( - 'function' => $function, - 'signature' => $sig, - 'docstring' => $doc - ); - } - - - //------------------------------------- - // Parse Server Request - //------------------------------------- - - function parseRequest($data='') - { - global $HTTP_RAW_POST_DATA; - - //------------------------------------- - // Get Data - //------------------------------------- - - if ($data == '') - { - $data = $HTTP_RAW_POST_DATA; - } - - - //------------------------------------- - // Set up XML Parser - //------------------------------------- - - $parser = xml_parser_create($this->xmlrpc_defencoding); - $parser_object = new XML_RPC_Message("filler"); - - $parser_object->xh[$parser] = array(); - $parser_object->xh[$parser]['isf'] = 0; - $parser_object->xh[$parser]['isf_reason'] = ''; - $parser_object->xh[$parser]['params'] = array(); - $parser_object->xh[$parser]['stack'] = array(); - $parser_object->xh[$parser]['valuestack'] = array(); - $parser_object->xh[$parser]['method'] = ''; - - xml_set_object($parser, $parser_object); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); - xml_set_element_handler($parser, 'open_tag', 'closing_tag'); - xml_set_character_data_handler($parser, 'character_data'); - //xml_set_default_handler($parser, 'default_handler'); - - - //------------------------------------- - // PARSE + PROCESS XML DATA - //------------------------------------- - - if ( ! xml_parse($parser, $data, 1)) - { - // return XML error as a faultCode - $r = new XML_RPC_Response(0, - $this->xmlrpcerrxml + xml_get_error_code($parser), - sprintf('XML error: %s at line %d', - xml_error_string(xml_get_error_code($parser)), - xml_get_current_line_number($parser))); - xml_parser_free($parser); - } - elseif($parser_object->xh[$parser]['isf']) - { - return new XML_RPC_Response(0, - $this->xmlrpcerr['invalid_return'], - $this->xmlrpcstr['invalid_retrun']); - } - else - { - xml_parser_free($parser); - - $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); - $plist=''; - - for($i=0; $i < sizeof($parser_object->xh[$parser]['params']); $i++) - { - $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; - - $m->addParam($parser_object->xh[$parser]['params'][$i]); - } - - if ($this->debug === TRUE) - { - echo "
                ";
                -				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
                -				echo "
                "; - } - - $r = $this->_execute($m); - } - - //------------------------------------- - // SET DEBUGGING MESSAGE - //------------------------------------- - - if ($this->debug === TRUE) - { - $this->debug_msg = "\n"; - } - - return $r; - } - - //------------------------------------- - // Executes the Method - //------------------------------------- - - function _execute($m) - { - $methName = $m->method_name; - - // Check to see if it is a system call - // If so, load the system_methods - $sysCall = ereg("^system\.", $methName); - $methods = $sysCall ? $this->system_methods : $this->methods; - - //------------------------------------- - // Check for Function - //------------------------------------- - - if (!isset($methods[$methName]['function'])) - { - return new XML_RPC_Response(0, - $this->xmlrpcerr['unknown_method'], - $this->xmlrpcstr['unknown_method']); - } - else - { - // See if we are calling function in an object - - $method_parts = explode(".",$methods[$methName]['function']); - $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? true : false; - - if ($objectCall && !is_callable(array($method_parts['0'],$method_parts['1']))) - { - return new XML_RPC_Response(0, - $this->xmlrpcerr['unknown_method'], - $this->xmlrpcstr['unknown_method']); - } - elseif (!$objectCall && !is_callable($methods[$methName]['function'])) - { - return new XML_RPC_Response(0, - $this->xmlrpcerr['unknown_method'], - $this->xmlrpcstr['unknown_method']); - } - } - - //------------------------------------- - // Checking Methods Signature - //------------------------------------- - - if (isset($methods[$methName]['signature'])) - { - $sig = $methods[$methName]['signature']; - for($i=0; $iparams)+1) - { - for($n=0; $n < sizeof($m->params); $n++) - { - $p = $m->params[$n]; - $pt = ($p->kindOf() == 'scalar') ? $p->scalartyp() : $p->kindOf(); - - if ($pt != $current_sig[$n+1]) - { - $pno = $n+1; - $wanted = $current_sig[$n+1]; - - return new XML_RPC_Response(0, - $this->xmlrpcerr['incorrect_params'], - $this->xmlrpcstr['incorrect_params'] . - ": Wanted {$wanted}, got {$pt} at param {$pno})"); - } - } - } - } - } - - //------------------------------------- - // Calls the Function - //------------------------------------- - - if ($objectCall) - { - if ($method_parts['1'] == "this") - { - return call_user_func(array($this, $method_parts['0']), $m); - } - else - { - $CI =& get_instance(); - return $CI->$method_parts['1']($m); - //$class = new $method_parts['0']; - //return $class->$method_parts['1']($m); - //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); - } - } - else - { - return call_user_func($methods[$methName]['function'], $m); - } - } - - - //------------------------------------- - // Server Function: List Methods - //------------------------------------- - - function listMethods($m) - { - $v = new XML_RPC_Values(); - $output = array(); - foreach($this->$methods as $key => $value) - { - $output[] = new XML_RPC_Values($key, 'string'); - } - - foreach($this->system_methods as $key => $value) - { - $output[]= new XML_RPC_Values($key, 'string'); - } - - $v->addArray($output); - return new XML_RPC_Response($v); - } - - //------------------------------------- - // Server Function: Return Signature for Method - //------------------------------------- - - function methodSignature($m) - { - $methName = $m->getParam(0); - $method_name = $methName->scalarval(); - - $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; - - if (isset($methods[$method_name])) - { - if ($methods[$method_name]['signature']) - { - $sigs = array(); - $signature = $methods[$method_name]['signature']; - - for($i=0; $i < sizeof($signature); $i++) - { - $cursig = array(); - $inSig = $signature[$i]; - for($j=0; $jxmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); - } - return $r; - } - - //------------------------------------- - // Server Function: Doc String for Method - //------------------------------------- - - function methodHelp($m) - { - $methName = $m->getParam(0); - $method_name = $methName->scalarval(); - - $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; - - if (isset($methods[$methName])) - { - $docstring = isset($methods[$method_name]['docstring']) ? $methods[$method_name]['docstring'] : ''; - $r = new XML_RPC_Response(new XML_RPC_Values($docstring, 'string')); - } - else - { - $r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); - } - return $r; - } - - //------------------------------------- - // Server Function: Multi-call - //------------------------------------- - - function multicall($m) - { - $calls = $m->getParam(0); - list($a,$b)=each($calls->me); - $result = array(); - - for ($i = 0; $i < sizeof($b); $i++) - { - $call = $calls->me['array'][$i]; - $result[$i] = $this->do_multicall($call); - } - - return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); - } - - - //------------------------------------- - // Multi-call Function: Error Handling - //------------------------------------- - - function multicall_error($err) - { - $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); - $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); - - $struct['faultCode'] = new XML_RPC_Values($code, 'int'); - $struct['faultString'] = new XML_RPC_Values($str, 'string'); - - return new XML_RPC_Values($struct, 'struct'); - } - - - //------------------------------------- - // Multi-call Function: Processes method - //------------------------------------- - - function do_multicall($call) - { - if ($call->kindOf() != 'struct') - return $this->multicall_error('notstruct'); - elseif (!$methName = $call->me['struct']['methodName']) - return $this->multicall_error('nomethod'); - - list($scalar_type,$scalar_value)=each($methName->me); - $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; - - if ($methName->kindOf() != 'scalar' || $scalar_type != 'string') - return $this->multicall_error('notstring'); - elseif ($scalar_value == 'system.multicall') - return $this->multicall_error('recursion'); - elseif (!$params = $call->me['struct']['params']) - return $this->multicall_error('noparams'); - elseif ($params->kindOf() != 'array') - return $this->multicall_error('notarray'); - - list($a,$b)=each($params->me); - $numParams = sizeof($b); - - $msg = new XML_RPC_Message($scalar_value); - for ($i = 0; $i < $numParams; $i++) - { - $msg->params[] = $params->me['array'][$i]; - } - - $result = $this->_execute($msg); - - if ($result->faultCode() != 0) - { - return $this->multicall_error($result); - } - - return new XML_RPC_Values(array($result->value()), 'array'); - } - -} -// END XML_RPC_Server class - +set_system_methods(); + + if (isset($config['functions']) && is_array($config['functions'])) + { + $this->methods = $config['functions']; + } + + log_message('debug', "XML-RPC Server Class Initialized"); + } + + //------------------------------------- + // Initialize Prefs and Serve + //------------------------------------- + + function initialize($config=array()) + { + if (isset($config['functions']) && is_array($config['functions'])) + { + $this->methods = $config['functions']; + } + + if (isset($config['debug'])) + { + $this->debug = $config['debug']; + } + } + + //------------------------------------- + // Setting of System Methods + //------------------------------------- + + function set_system_methods () + { + $system_methods = array( + 'system.listMethods' => array( + 'function' => 'this.listMethods', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString), array($this->xmlrpcArray)), + 'docstring' => 'Returns an array of available methods on this server'), + 'system.methodHelp' => array( + 'function' => 'this.methodHelp', + 'signature' => array(array($this->xmlrpcString, $this->xmlrpcString)), + 'docstring' => 'Returns a documentation string for the specified method'), + 'system.methodSignature' => array( + 'function' => 'this.methodSignature', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcString)), + 'docstring' => 'Returns an array describing the return type and required parameters of a method'), + 'system.multicall' => array( + 'function' => 'this.multicall', + 'signature' => array(array($this->xmlrpcArray, $this->xmlrpcArray)), + 'docstring' => 'Combine multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details') + ); + } + + + //------------------------------------- + // Main Server Function + //------------------------------------- + + function serve() + { + $r = $this->parseRequest(); + $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; + $payload .= $this->debug_msg; + $payload .= $r->prepare_response(); + + header("Content-Type: text/xml"); + header("Content-Length: ".strlen($payload)); + echo $payload; + } + + //------------------------------------- + // Add Method to Class + //------------------------------------- + + function add_to_map($methodname,$function,$sig,$doc) + { + $this->methods[$methodname] = array( + 'function' => $function, + 'signature' => $sig, + 'docstring' => $doc + ); + } + + + //------------------------------------- + // Parse Server Request + //------------------------------------- + + function parseRequest($data='') + { + global $HTTP_RAW_POST_DATA; + + //------------------------------------- + // Get Data + //------------------------------------- + + if ($data == '') + { + $data = $HTTP_RAW_POST_DATA; + } + + + //------------------------------------- + // Set up XML Parser + //------------------------------------- + + $parser = xml_parser_create($this->xmlrpc_defencoding); + $parser_object = new XML_RPC_Message("filler"); + + $parser_object->xh[$parser] = array(); + $parser_object->xh[$parser]['isf'] = 0; + $parser_object->xh[$parser]['isf_reason'] = ''; + $parser_object->xh[$parser]['params'] = array(); + $parser_object->xh[$parser]['stack'] = array(); + $parser_object->xh[$parser]['valuestack'] = array(); + $parser_object->xh[$parser]['method'] = ''; + + xml_set_object($parser, $parser_object); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); + xml_set_element_handler($parser, 'open_tag', 'closing_tag'); + xml_set_character_data_handler($parser, 'character_data'); + //xml_set_default_handler($parser, 'default_handler'); + + + //------------------------------------- + // PARSE + PROCESS XML DATA + //------------------------------------- + + if ( ! xml_parse($parser, $data, 1)) + { + // return XML error as a faultCode + $r = new XML_RPC_Response(0, + $this->xmlrpcerrxml + xml_get_error_code($parser), + sprintf('XML error: %s at line %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser))); + xml_parser_free($parser); + } + elseif($parser_object->xh[$parser]['isf']) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['invalid_return'], + $this->xmlrpcstr['invalid_retrun']); + } + else + { + xml_parser_free($parser); + + $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); + $plist=''; + + for($i=0; $i < sizeof($parser_object->xh[$parser]['params']); $i++) + { + $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; + + $m->addParam($parser_object->xh[$parser]['params'][$i]); + } + + if ($this->debug === TRUE) + { + echo "
                ";
                +				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
                +				echo "
                "; + } + + $r = $this->_execute($m); + } + + //------------------------------------- + // SET DEBUGGING MESSAGE + //------------------------------------- + + if ($this->debug === TRUE) + { + $this->debug_msg = "\n"; + } + + return $r; + } + + //------------------------------------- + // Executes the Method + //------------------------------------- + + function _execute($m) + { + $methName = $m->method_name; + + // Check to see if it is a system call + // If so, load the system_methods + $sysCall = ereg("^system\.", $methName); + $methods = $sysCall ? $this->system_methods : $this->methods; + + //------------------------------------- + // Check for Function + //------------------------------------- + + if (!isset($methods[$methName]['function'])) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + else + { + // See if we are calling function in an object + + $method_parts = explode(".",$methods[$methName]['function']); + $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? true : false; + + if ($objectCall && !is_callable(array($method_parts['0'],$method_parts['1']))) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + elseif (!$objectCall && !is_callable($methods[$methName]['function'])) + { + return new XML_RPC_Response(0, + $this->xmlrpcerr['unknown_method'], + $this->xmlrpcstr['unknown_method']); + } + } + + //------------------------------------- + // Checking Methods Signature + //------------------------------------- + + if (isset($methods[$methName]['signature'])) + { + $sig = $methods[$methName]['signature']; + for($i=0; $iparams)+1) + { + for($n=0; $n < sizeof($m->params); $n++) + { + $p = $m->params[$n]; + $pt = ($p->kindOf() == 'scalar') ? $p->scalartyp() : $p->kindOf(); + + if ($pt != $current_sig[$n+1]) + { + $pno = $n+1; + $wanted = $current_sig[$n+1]; + + return new XML_RPC_Response(0, + $this->xmlrpcerr['incorrect_params'], + $this->xmlrpcstr['incorrect_params'] . + ": Wanted {$wanted}, got {$pt} at param {$pno})"); + } + } + } + } + } + + //------------------------------------- + // Calls the Function + //------------------------------------- + + if ($objectCall) + { + if ($method_parts['1'] == "this") + { + return call_user_func(array($this, $method_parts['0']), $m); + } + else + { + $CI =& get_instance(); + return $CI->$method_parts['1']($m); + //$class = new $method_parts['0']; + //return $class->$method_parts['1']($m); + //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); + } + } + else + { + return call_user_func($methods[$methName]['function'], $m); + } + } + + + //------------------------------------- + // Server Function: List Methods + //------------------------------------- + + function listMethods($m) + { + $v = new XML_RPC_Values(); + $output = array(); + foreach($this->$methods as $key => $value) + { + $output[] = new XML_RPC_Values($key, 'string'); + } + + foreach($this->system_methods as $key => $value) + { + $output[]= new XML_RPC_Values($key, 'string'); + } + + $v->addArray($output); + return new XML_RPC_Response($v); + } + + //------------------------------------- + // Server Function: Return Signature for Method + //------------------------------------- + + function methodSignature($m) + { + $methName = $m->getParam(0); + $method_name = $methName->scalarval(); + + $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; + + if (isset($methods[$method_name])) + { + if ($methods[$method_name]['signature']) + { + $sigs = array(); + $signature = $methods[$method_name]['signature']; + + for($i=0; $i < sizeof($signature); $i++) + { + $cursig = array(); + $inSig = $signature[$i]; + for($j=0; $jxmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); + } + return $r; + } + + //------------------------------------- + // Server Function: Doc String for Method + //------------------------------------- + + function methodHelp($m) + { + $methName = $m->getParam(0); + $method_name = $methName->scalarval(); + + $methods = ereg("^system\.", $method_name) ? $this->system_methods : $this->methods; + + if (isset($methods[$methName])) + { + $docstring = isset($methods[$method_name]['docstring']) ? $methods[$method_name]['docstring'] : ''; + $r = new XML_RPC_Response(new XML_RPC_Values($docstring, 'string')); + } + else + { + $r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); + } + return $r; + } + + //------------------------------------- + // Server Function: Multi-call + //------------------------------------- + + function multicall($m) + { + $calls = $m->getParam(0); + list($a,$b)=each($calls->me); + $result = array(); + + for ($i = 0; $i < sizeof($b); $i++) + { + $call = $calls->me['array'][$i]; + $result[$i] = $this->do_multicall($call); + } + + return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); + } + + + //------------------------------------- + // Multi-call Function: Error Handling + //------------------------------------- + + function multicall_error($err) + { + $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); + $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); + + $struct['faultCode'] = new XML_RPC_Values($code, 'int'); + $struct['faultString'] = new XML_RPC_Values($str, 'string'); + + return new XML_RPC_Values($struct, 'struct'); + } + + + //------------------------------------- + // Multi-call Function: Processes method + //------------------------------------- + + function do_multicall($call) + { + if ($call->kindOf() != 'struct') + return $this->multicall_error('notstruct'); + elseif (!$methName = $call->me['struct']['methodName']) + return $this->multicall_error('nomethod'); + + list($scalar_type,$scalar_value)=each($methName->me); + $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; + + if ($methName->kindOf() != 'scalar' || $scalar_type != 'string') + return $this->multicall_error('notstring'); + elseif ($scalar_value == 'system.multicall') + return $this->multicall_error('recursion'); + elseif (!$params = $call->me['struct']['params']) + return $this->multicall_error('noparams'); + elseif ($params->kindOf() != 'array') + return $this->multicall_error('notarray'); + + list($a,$b)=each($params->me); + $numParams = sizeof($b); + + $msg = new XML_RPC_Message($scalar_value); + for ($i = 0; $i < $numParams; $i++) + { + $msg->params[] = $params->me['array'][$i]; + } + + $result = $this->_execute($msg); + + if ($result->faultCode() != 0) + { + return $this->multicall_error($result); + } + + return new XML_RPC_Values(array($result->value()), 'array'); + } + +} +// END XML_RPC_Server class + ?> \ No newline at end of file diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 1ff175fe..377c3874 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -1,380 +1,380 @@ -_add_dir($dir); - } - } - - // -------------------------------------------------------------------- - - /** - * Add Directory - * - * @access private - * @param string the directory name - * @return void - */ - function _add_dir($dir) - { - $dir = str_replace("\\", "/", $dir); - - $this->zipdata[] = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" - .pack('V', 0) - .pack('V', 0) - .pack('V', 0) - .pack('v', strlen($dir)) - .pack('v', 0) - .$dir - .pack('V', 0) - .pack('V', 0) - .pack('V', 0); - - $newoffset = strlen(implode('', $this->zipdata)); - - $record = "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" - .pack('V',0) - .pack('V',0) - .pack('V',0) - .pack('v', strlen($dir)) - .pack('v', 0) - .pack('v', 0) - .pack('v', 0) - .pack('v', 0) - .pack('V', 16) - .pack('V', $this->offset) - .$dir; - - $this->offset = $newoffset; - $this->directory[] = $record; - } - - // -------------------------------------------------------------------- - - /** - * Add Data to Zip - * - * Lets you add files to the archive. If the path is included - * in the filename it will be placed within a directory. Make - * sure you use add_dir() first to create the folder. - * - * @access public - * @param mixed - * @param string - * @return void - */ - function add_data($filepath, $data = NULL) - { - if (is_array($filepath)) - { - foreach ($filepath as $path => $data) - { - $this->_add_data($path, $data); - } - } - else - { - $this->_add_data($filepath, $data); - } - } - - // -------------------------------------------------------------------- - - /** - * Add Data to Zip - * - * @access private - * @param string the file name/path - * @param string the data to be encoded - * @return void - */ - function _add_data($filepath, $data) - { - $filepath = str_replace("\\", "/", $filepath); - - $oldlen = strlen($data); - $crc32 = crc32($data); - - $gzdata = gzcompress($data); - $gzdata = substr(substr($gzdata, 0, strlen($gzdata) - 4), 2); - $newlen = strlen($gzdata); - - $this->zipdata[] = "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" - .pack('V', $crc32) - .pack('V', $newlen) - .pack('V', $oldlen) - .pack('v', strlen($filepath)) - .pack('v', 0) - .$filepath - .$gzdata - .pack('V', $crc32) - .pack('V', $newlen) - .pack('V', $oldlen); - - $newoffset = strlen(implode("", $this->zipdata)); - - $record = "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" - .pack('V', $crc32) - .pack('V', $newlen) - .pack('V', $oldlen) - .pack('v', strlen($filepath)) - .pack('v', 0) - .pack('v', 0) - .pack('v', 0) - .pack('v', 0) - .pack('V', 32) - .pack('V', $this->offset); - - $this->offset = $newoffset; - $this->directory[] = $record.$filepath; - } - - // -------------------------------------------------------------------- - - /** - * Read the contents of a file and add it to the zip - * - * @access public - * @return bool - */ - function read_file($path, $preserve_filepath = FALSE) - { - if ( ! file_exists($path)) - { - return FALSE; - } - - if (FALSE !== ($data = file_get_contents($path))) - { - $name = str_replace("\\", "/", $path); - - if ($preserve_filepath === FALSE) - { - $name = preg_replace("|.*/(.+)|", "\\1", $name); - } - - $this->add_data($name, $data); - return TRUE; - } - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Read a directory and add it to the zip. - * - * This function recursively reads a folder and everything it contains (including - * sub-folders) and creates a zip based on it. Whatever directory structure - * is in the original file path will be recreated in the zip file. - * - * @access public - * @param string path to source - * @return bool - */ - function read_dir($path) - { - if ($fp = @opendir($path)) - { - while (FALSE !== ($file = readdir($fp))) - { - if (@is_dir($path.$file) && substr($file, 0, 1) != '.') - { - $this->read_dir($path.$file."/"); - } - elseif (substr($file, 0, 1) != ".") - { - if (FALSE !== ($data = file_get_contents($path.$file))) - { - $this->add_data(str_replace("\\", "/", $path).$file, $data); - } - } - } - return TRUE; - } - } - - // -------------------------------------------------------------------- - - /** - * Get the Zip file - * - * @access public - * @return binary string - */ - function get_zip() - { - // We cache the zip data so multiple calls - // do not require recompiling - if ($this->zipfile != '') - { - return $this->zipfile; - } - - // Is there any data to return? - if (count($this->zipdata) == 0) - { - return FALSE; - } - - $data = implode('', $this->zipdata); - $dir = implode('', $this->directory); - - $this->zipfile = $data.$dir."\x50\x4b\x05\x06\x00\x00\x00\x00" - .pack('v', sizeof($this->directory)) - .pack('v', sizeof($this->directory)) - .pack('V', strlen($dir)) - .pack('V', strlen($data)) - ."\x00\x00"; - - return $this->zipfile; - } - - // -------------------------------------------------------------------- - - /** - * Write File to the specified directory - * - * Lets you write a file - * - * @access public - * @param string the file name - * @param string the data to be encoded - * @return bool - */ - function archive($filepath) - { - if ( ! ($fp = @fopen($filepath, "wb"))) - { - return FALSE; - } - - flock($fp, LOCK_EX); - fwrite($fp, $this->get_zip()); - flock($fp, LOCK_UN); - fclose($fp); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Download - * - * @access public - * @param string the file name - * @param string the data to be encoded - * @return bool - */ - function download($filename = 'backup.zip') - { - if ( ! preg_match("|.+?\.zip$|", $filename)) - { - $filename .= '.zip'; - } - - if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) - { - header('Content-Type: application/x-zip'); - header('Content-Disposition: inline; filename="'.$filename.'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header("Content-Transfer-Encoding: binary"); - header('Pragma: public'); - header("Content-Length: ".strlen($this->get_zip())); - } - else - { - header('Content-Type: application/x-zip'); - header('Content-Disposition: attachment; filename="'.$filename.'"'); - header("Content-Transfer-Encoding: binary"); - header('Expires: 0'); - header('Pragma: no-cache'); - header("Content-Length: ".strlen($this->get_zip())); - } - - echo $this->get_zip(); - } - - // -------------------------------------------------------------------- - - /** - * Initialize Data - * - * Lets you clear current zip data. Useful if you need to create - * multiple zips with different data. - * - * @access public - * @return void - */ - function clear_data() - { - $this->zipfile = ''; - $this->zipdata = array(); - $this->directory = array(); - $this->offset = array(); - } - -} +_add_dir($dir); + } + } + + // -------------------------------------------------------------------- + + /** + * Add Directory + * + * @access private + * @param string the directory name + * @return void + */ + function _add_dir($dir) + { + $dir = str_replace("\\", "/", $dir); + + $this->zipdata[] = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" + .pack('V', 0) + .pack('V', 0) + .pack('V', 0) + .pack('v', strlen($dir)) + .pack('v', 0) + .$dir + .pack('V', 0) + .pack('V', 0) + .pack('V', 0); + + $newoffset = strlen(implode('', $this->zipdata)); + + $record = "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" + .pack('V',0) + .pack('V',0) + .pack('V',0) + .pack('v', strlen($dir)) + .pack('v', 0) + .pack('v', 0) + .pack('v', 0) + .pack('v', 0) + .pack('V', 16) + .pack('V', $this->offset) + .$dir; + + $this->offset = $newoffset; + $this->directory[] = $record; + } + + // -------------------------------------------------------------------- + + /** + * Add Data to Zip + * + * Lets you add files to the archive. If the path is included + * in the filename it will be placed within a directory. Make + * sure you use add_dir() first to create the folder. + * + * @access public + * @param mixed + * @param string + * @return void + */ + function add_data($filepath, $data = NULL) + { + if (is_array($filepath)) + { + foreach ($filepath as $path => $data) + { + $this->_add_data($path, $data); + } + } + else + { + $this->_add_data($filepath, $data); + } + } + + // -------------------------------------------------------------------- + + /** + * Add Data to Zip + * + * @access private + * @param string the file name/path + * @param string the data to be encoded + * @return void + */ + function _add_data($filepath, $data) + { + $filepath = str_replace("\\", "/", $filepath); + + $oldlen = strlen($data); + $crc32 = crc32($data); + + $gzdata = gzcompress($data); + $gzdata = substr(substr($gzdata, 0, strlen($gzdata) - 4), 2); + $newlen = strlen($gzdata); + + $this->zipdata[] = "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" + .pack('V', $crc32) + .pack('V', $newlen) + .pack('V', $oldlen) + .pack('v', strlen($filepath)) + .pack('v', 0) + .$filepath + .$gzdata + .pack('V', $crc32) + .pack('V', $newlen) + .pack('V', $oldlen); + + $newoffset = strlen(implode("", $this->zipdata)); + + $record = "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" + .pack('V', $crc32) + .pack('V', $newlen) + .pack('V', $oldlen) + .pack('v', strlen($filepath)) + .pack('v', 0) + .pack('v', 0) + .pack('v', 0) + .pack('v', 0) + .pack('V', 32) + .pack('V', $this->offset); + + $this->offset = $newoffset; + $this->directory[] = $record.$filepath; + } + + // -------------------------------------------------------------------- + + /** + * Read the contents of a file and add it to the zip + * + * @access public + * @return bool + */ + function read_file($path, $preserve_filepath = FALSE) + { + if ( ! file_exists($path)) + { + return FALSE; + } + + if (FALSE !== ($data = file_get_contents($path))) + { + $name = str_replace("\\", "/", $path); + + if ($preserve_filepath === FALSE) + { + $name = preg_replace("|.*/(.+)|", "\\1", $name); + } + + $this->add_data($name, $data); + return TRUE; + } + return FALSE; + } + + // ------------------------------------------------------------------------ + + /** + * Read a directory and add it to the zip. + * + * This function recursively reads a folder and everything it contains (including + * sub-folders) and creates a zip based on it. Whatever directory structure + * is in the original file path will be recreated in the zip file. + * + * @access public + * @param string path to source + * @return bool + */ + function read_dir($path) + { + if ($fp = @opendir($path)) + { + while (FALSE !== ($file = readdir($fp))) + { + if (@is_dir($path.$file) && substr($file, 0, 1) != '.') + { + $this->read_dir($path.$file."/"); + } + elseif (substr($file, 0, 1) != ".") + { + if (FALSE !== ($data = file_get_contents($path.$file))) + { + $this->add_data(str_replace("\\", "/", $path).$file, $data); + } + } + } + return TRUE; + } + } + + // -------------------------------------------------------------------- + + /** + * Get the Zip file + * + * @access public + * @return binary string + */ + function get_zip() + { + // We cache the zip data so multiple calls + // do not require recompiling + if ($this->zipfile != '') + { + return $this->zipfile; + } + + // Is there any data to return? + if (count($this->zipdata) == 0) + { + return FALSE; + } + + $data = implode('', $this->zipdata); + $dir = implode('', $this->directory); + + $this->zipfile = $data.$dir."\x50\x4b\x05\x06\x00\x00\x00\x00" + .pack('v', sizeof($this->directory)) + .pack('v', sizeof($this->directory)) + .pack('V', strlen($dir)) + .pack('V', strlen($data)) + ."\x00\x00"; + + return $this->zipfile; + } + + // -------------------------------------------------------------------- + + /** + * Write File to the specified directory + * + * Lets you write a file + * + * @access public + * @param string the file name + * @param string the data to be encoded + * @return bool + */ + function archive($filepath) + { + if ( ! ($fp = @fopen($filepath, "wb"))) + { + return FALSE; + } + + flock($fp, LOCK_EX); + fwrite($fp, $this->get_zip()); + flock($fp, LOCK_UN); + fclose($fp); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Download + * + * @access public + * @param string the file name + * @param string the data to be encoded + * @return bool + */ + function download($filename = 'backup.zip') + { + if ( ! preg_match("|.+?\.zip$|", $filename)) + { + $filename .= '.zip'; + } + + if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + { + header('Content-Type: application/x-zip'); + header('Content-Disposition: inline; filename="'.$filename.'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header("Content-Transfer-Encoding: binary"); + header('Pragma: public'); + header("Content-Length: ".strlen($this->get_zip())); + } + else + { + header('Content-Type: application/x-zip'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + header("Content-Transfer-Encoding: binary"); + header('Expires: 0'); + header('Pragma: no-cache'); + header("Content-Length: ".strlen($this->get_zip())); + } + + echo $this->get_zip(); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Data + * + * Lets you clear current zip data. Useful if you need to create + * multiple zips with different data. + * + * @access public + * @return void + */ + function clear_data() + { + $this->zipfile = ''; + $this->zipdata = array(); + $this->directory = array(); + $this->offset = array(); + } + +} ?> \ No newline at end of file diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index b3c22f09..e16a214b 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -1,346 +1,346 @@ -load->plugin('captcha'); - -Once loaded you can generate a captcha like this: - - $vals = array( - 'word' => 'Random word', - 'img_path' => './captcha/', - 'img_url' => 'http://www.your-site.com/captcha/', - 'font_path' => './system/texb.ttf', - 'img_width' => '150', - 'img_height' => 30, - 'expiration' => 7200 - ); - - $cap = create_captcha($vals); - echo $cap['image']; - - -NOTES: - - The captcha function requires the GD image library. - - Only the img_path and img_url are required. - - If a "word" is not supplied, the function will generate a random - ASCII string. You might put together your own word library that - you can draw randomly from. - - If you do not specify a path to a TRUE TYPE font, the native ugly GD - font will be used. - - The "captcha" folder must be writable (666, or 777) - - The "expiration" (in seconds) signifies how long an image will - remain in the captcha folder before it will be deleted. The default - is two hours. - -RETURNED DATA - -The create_captcha() function returns an associative array with this data: - - [array] - ( - 'image' => IMAGE TAG - 'time' => TIMESTAMP (in microtime) - 'word' => CAPTCHA WORD - ) - -The "image" is the actual image tag: - - -The "time" is the micro timestamp used as the image name without the file -extension. It will be a number like this: 1139612155.3422 - -The "word" is the word that appears in the captcha image, which if not -supplied to the function, will be a random string. - - -ADDING A DATABASE - -In order for the captcha function to prevent someone from posting, you will need -to add the information returned from create_captcha() function to your database. -Then, when the data from the form is submitted by the user you will need to verify -that the data exists in the database and has not expired. - -Here is a table prototype: - - CREATE TABLE captcha ( - captcha_id bigint(13) unsigned NOT NULL auto_increment, - captcha_time int(10) unsigned NOT NULL, - ip_address varchar(16) default '0' NOT NULL, - word varchar(20) NOT NULL, - PRIMARY KEY (captcha_id), - KEY (word) - ) - - -Here is an example of usage with a DB. - -On the page where the captcha will be shown you'll have something like this: - - $this->load->plugin('captcha'); - $vals = array( - 'img_path' => './captcha/', - 'img_url' => 'http://www.your-site.com/captcha/' - ); - - $cap = create_captcha($vals); - - $data = array( - 'captcha_id' => '', - 'captcha_time' => $cap['time'], - 'ip_address' => $this->input->ip_address(), - 'word' => $cap['word'] - ); - - $query = $this->db->insert_string('captcha', $data); - $this->db->query($query); - - echo 'Submit the word you see below:'; - echo $cap['image']; - echo ''; - - -Then, on the page that accepts the submission you'll have something like this: - - // First, delete old captchas - $expiration = time()-7200; // Two hour limit - $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); - - // Then see if a captcha exists: - $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; - $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); - $query = $this->db->query($sql, $binds); - $row = $query->row(); - - if ($row->count == 0) - { - echo "You must submit the word that appears in the image"; - } - -*/ - - - -/** -|========================================================== -| Create Captcha -|========================================================== -| -*/ -function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') -{ - $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); - - foreach ($defaults as $key => $val) - { - if ( ! is_array($data)) - { - if ( ! isset($$key) OR $$key == '') - { - $$key = $val; - } - } - else - { - $$key = ( ! isset($data[$key])) ? $val : $data[$key]; - } - } - - if ($img_path == '' OR $img_url == '') - { - return FALSE; - } - - if ( ! @is_dir($img_path)) - { - return FALSE; - } - - if ( ! is_writable($img_path)) - { - return FALSE; - } - - if ( ! extension_loaded('gd')) - { - return FALSE; - } - - // ----------------------------------- - // Remove old images - // ----------------------------------- - - list($usec, $sec) = explode(" ", microtime()); - $now = ((float)$usec + (float)$sec); - - $current_dir = @opendir($img_path); - - while($filename = @readdir($current_dir)) - { - if ($filename != "." and $filename != ".." and $filename != "index.html") - { - $name = str_replace(".jpg", "", $filename); - - if (($name + $expiration) < $now) - { - @unlink($img_path.$filename); - } - } - } - - @closedir($current_dir); - - // ----------------------------------- - // Do we have a "word" yet? - // ----------------------------------- - - if ($word == '') - { - $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $str = ''; - for ($i = 0; $i < 8; $i++) - { - $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); - } - - $word = $str; - } - - // ----------------------------------- - // Determine angle and position - // ----------------------------------- - - $length = strlen($word); - $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; - $x_axis = rand(6, (360/$length)-16); - $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); - - // ----------------------------------- - // Create image - // ----------------------------------- - - $im = ImageCreate($img_width, $img_height); - - // ----------------------------------- - // Assign colors - // ----------------------------------- - - $bg_color = ImageColorAllocate($im, 255, 255, 255); - $border_color = ImageColorAllocate($im, 153, 102, 102); - $text_color = ImageColorAllocate($im, 204, 153, 153); - $grid_color = imagecolorallocate($im, 255, 182, 182); - $shadow_color = imagecolorallocate($im, 255, 240, 240); - - // ----------------------------------- - // Create the rectangle - // ----------------------------------- - - ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); - - // ----------------------------------- - // Create the spiral pattern - // ----------------------------------- - - $theta = 1; - $thetac = 7; - $radius = 16; - $circles = 20; - $points = 32; - - for ($i = 0; $i < ($circles * $points) - 1; $i++) - { - $theta = $theta + $thetac; - $rad = $radius * ($i / $points ); - $x = ($rad * cos($theta)) + $x_axis; - $y = ($rad * sin($theta)) + $y_axis; - $theta = $theta + $thetac; - $rad1 = $radius * (($i + 1) / $points); - $x1 = ($rad1 * cos($theta)) + $x_axis; - $y1 = ($rad1 * sin($theta )) + $y_axis; - imageline($im, $x, $y, $x1, $y1, $grid_color); - $theta = $theta - $thetac; - } - - // ----------------------------------- - // Write the text - // ----------------------------------- - - $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; - - if ($use_font == FALSE) - { - $font_size = 5; - $x = rand(0, $img_width/($length/3)); - $y = 0; - } - else - { - $font_size = 16; - $x = rand(0, $img_width/($length/1.5)); - $y = $font_size+2; - } - - for ($i = 0; $i < strlen($word); $i++) - { - if ($use_font == FALSE) - { - $y = rand(0 , $img_height/2); - imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); - $x += ($font_size*2); - } - else - { - $y = rand($img_height/2, $img_height-3); - imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); - $x += $font_size; - } - } - - - // ----------------------------------- - // Create the border - // ----------------------------------- - - imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); - - // ----------------------------------- - // Generate the image - // ----------------------------------- - - $img_name = $now.'.jpg'; - - ImageJPEG($im, $img_path.$img_name); - - $img = "\""; - - ImageDestroy($im); - - return array('word' => $word, 'time' => $now, 'image' => $img); -} - +load->plugin('captcha'); + +Once loaded you can generate a captcha like this: + + $vals = array( + 'word' => 'Random word', + 'img_path' => './captcha/', + 'img_url' => 'http://www.your-site.com/captcha/', + 'font_path' => './system/texb.ttf', + 'img_width' => '150', + 'img_height' => 30, + 'expiration' => 7200 + ); + + $cap = create_captcha($vals); + echo $cap['image']; + + +NOTES: + + The captcha function requires the GD image library. + + Only the img_path and img_url are required. + + If a "word" is not supplied, the function will generate a random + ASCII string. You might put together your own word library that + you can draw randomly from. + + If you do not specify a path to a TRUE TYPE font, the native ugly GD + font will be used. + + The "captcha" folder must be writable (666, or 777) + + The "expiration" (in seconds) signifies how long an image will + remain in the captcha folder before it will be deleted. The default + is two hours. + +RETURNED DATA + +The create_captcha() function returns an associative array with this data: + + [array] + ( + 'image' => IMAGE TAG + 'time' => TIMESTAMP (in microtime) + 'word' => CAPTCHA WORD + ) + +The "image" is the actual image tag: + + +The "time" is the micro timestamp used as the image name without the file +extension. It will be a number like this: 1139612155.3422 + +The "word" is the word that appears in the captcha image, which if not +supplied to the function, will be a random string. + + +ADDING A DATABASE + +In order for the captcha function to prevent someone from posting, you will need +to add the information returned from create_captcha() function to your database. +Then, when the data from the form is submitted by the user you will need to verify +that the data exists in the database and has not expired. + +Here is a table prototype: + + CREATE TABLE captcha ( + captcha_id bigint(13) unsigned NOT NULL auto_increment, + captcha_time int(10) unsigned NOT NULL, + ip_address varchar(16) default '0' NOT NULL, + word varchar(20) NOT NULL, + PRIMARY KEY (captcha_id), + KEY (word) + ) + + +Here is an example of usage with a DB. + +On the page where the captcha will be shown you'll have something like this: + + $this->load->plugin('captcha'); + $vals = array( + 'img_path' => './captcha/', + 'img_url' => 'http://www.your-site.com/captcha/' + ); + + $cap = create_captcha($vals); + + $data = array( + 'captcha_id' => '', + 'captcha_time' => $cap['time'], + 'ip_address' => $this->input->ip_address(), + 'word' => $cap['word'] + ); + + $query = $this->db->insert_string('captcha', $data); + $this->db->query($query); + + echo 'Submit the word you see below:'; + echo $cap['image']; + echo ''; + + +Then, on the page that accepts the submission you'll have something like this: + + // First, delete old captchas + $expiration = time()-7200; // Two hour limit + $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); + + // Then see if a captcha exists: + $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; + $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); + $query = $this->db->query($sql, $binds); + $row = $query->row(); + + if ($row->count == 0) + { + echo "You must submit the word that appears in the image"; + } + +*/ + + + +/** +|========================================================== +| Create Captcha +|========================================================== +| +*/ +function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') +{ + $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); + + foreach ($defaults as $key => $val) + { + if ( ! is_array($data)) + { + if ( ! isset($$key) OR $$key == '') + { + $$key = $val; + } + } + else + { + $$key = ( ! isset($data[$key])) ? $val : $data[$key]; + } + } + + if ($img_path == '' OR $img_url == '') + { + return FALSE; + } + + if ( ! @is_dir($img_path)) + { + return FALSE; + } + + if ( ! is_writable($img_path)) + { + return FALSE; + } + + if ( ! extension_loaded('gd')) + { + return FALSE; + } + + // ----------------------------------- + // Remove old images + // ----------------------------------- + + list($usec, $sec) = explode(" ", microtime()); + $now = ((float)$usec + (float)$sec); + + $current_dir = @opendir($img_path); + + while($filename = @readdir($current_dir)) + { + if ($filename != "." and $filename != ".." and $filename != "index.html") + { + $name = str_replace(".jpg", "", $filename); + + if (($name + $expiration) < $now) + { + @unlink($img_path.$filename); + } + } + } + + @closedir($current_dir); + + // ----------------------------------- + // Do we have a "word" yet? + // ----------------------------------- + + if ($word == '') + { + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + $str = ''; + for ($i = 0; $i < 8; $i++) + { + $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); + } + + $word = $str; + } + + // ----------------------------------- + // Determine angle and position + // ----------------------------------- + + $length = strlen($word); + $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; + $x_axis = rand(6, (360/$length)-16); + $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); + + // ----------------------------------- + // Create image + // ----------------------------------- + + $im = ImageCreate($img_width, $img_height); + + // ----------------------------------- + // Assign colors + // ----------------------------------- + + $bg_color = ImageColorAllocate($im, 255, 255, 255); + $border_color = ImageColorAllocate($im, 153, 102, 102); + $text_color = ImageColorAllocate($im, 204, 153, 153); + $grid_color = imagecolorallocate($im, 255, 182, 182); + $shadow_color = imagecolorallocate($im, 255, 240, 240); + + // ----------------------------------- + // Create the rectangle + // ----------------------------------- + + ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); + + // ----------------------------------- + // Create the spiral pattern + // ----------------------------------- + + $theta = 1; + $thetac = 7; + $radius = 16; + $circles = 20; + $points = 32; + + for ($i = 0; $i < ($circles * $points) - 1; $i++) + { + $theta = $theta + $thetac; + $rad = $radius * ($i / $points ); + $x = ($rad * cos($theta)) + $x_axis; + $y = ($rad * sin($theta)) + $y_axis; + $theta = $theta + $thetac; + $rad1 = $radius * (($i + 1) / $points); + $x1 = ($rad1 * cos($theta)) + $x_axis; + $y1 = ($rad1 * sin($theta )) + $y_axis; + imageline($im, $x, $y, $x1, $y1, $grid_color); + $theta = $theta - $thetac; + } + + // ----------------------------------- + // Write the text + // ----------------------------------- + + $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; + + if ($use_font == FALSE) + { + $font_size = 5; + $x = rand(0, $img_width/($length/3)); + $y = 0; + } + else + { + $font_size = 16; + $x = rand(0, $img_width/($length/1.5)); + $y = $font_size+2; + } + + for ($i = 0; $i < strlen($word); $i++) + { + if ($use_font == FALSE) + { + $y = rand(0 , $img_height/2); + imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); + $x += ($font_size*2); + } + else + { + $y = rand($img_height/2, $img_height-3); + imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); + $x += $font_size; + } + } + + + // ----------------------------------- + // Create the border + // ----------------------------------- + + imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); + + // ----------------------------------- + // Generate the image + // ----------------------------------- + + $img_name = $now.'.jpg'; + + ImageJPEG($im, $img_path.$img_name); + + $img = "\""; + + ImageDestroy($im); + + return array('word' => $word, 'time' => $now, 'image' => $img); +} + ?> \ No newline at end of file diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php index 987bd49e..a461e34a 100644 --- a/system/plugins/js_calendar_pi.php +++ b/system/plugins/js_calendar_pi.php @@ -1,604 +1,604 @@ -load->plugin('js_calendar'); - -Once loaded you'll add the calendar script to the of your page like this: - - - -The above function will be passed the name of your form. - -Then to show the actual calendar you'll do this: - - -
                - -

                Today

                -
                - - -Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, -and the third tells the calendar whether to highlight the current day or not. - -Lastly, you'll need some CSS for your calendar: - -.calendar { - border: 1px #6975A3 solid; - background-color: transparent; -} -.calheading { - background-color: #7C8BC0; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; -} -.calnavleft { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - padding: 4px; - cursor: pointer; -} -.calnavright { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - text-align: right; - padding: 4px; - cursor: pointer; -} -.caldayheading { - background-color: #000; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - text-align: center; - padding: 6px 2px 6px 2px; -} -.caldaycells{ - color: #000; - background-color: #D1D7E6; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #E0E5F1 solid; - cursor: pointer; -} -.caldaycellhover{ - color: #fff; - background-color: #B3BCD4; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #B3BCD4 solid; - cursor: pointer; -} -.caldayselected{ - background-color: #737FAC; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; - border: 1px #566188 solid; - padding: 3px; - cursor: pointer; -} -.calblanktop { - background-color: #fff; - padding: 4px; -} -.calblankbot { - background-color: #fff; - padding: 4px; -} - - -*/ - -function js_calendar_script($form_name = 'entryform') -{ - -ob_start(); -?> - - - var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); - document.write('.$field_id.'.write()); - '; -} - +load->plugin('js_calendar'); + +Once loaded you'll add the calendar script to the of your page like this: + + + +The above function will be passed the name of your form. + +Then to show the actual calendar you'll do this: + + +
                + +

                Today

                +
                + + +Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, +and the third tells the calendar whether to highlight the current day or not. + +Lastly, you'll need some CSS for your calendar: + +.calendar { + border: 1px #6975A3 solid; + background-color: transparent; +} +.calheading { + background-color: #7C8BC0; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; +} +.calnavleft { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + padding: 4px; + cursor: pointer; +} +.calnavright { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + text-align: right; + padding: 4px; + cursor: pointer; +} +.caldayheading { + background-color: #000; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + text-align: center; + padding: 6px 2px 6px 2px; +} +.caldaycells{ + color: #000; + background-color: #D1D7E6; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #E0E5F1 solid; + cursor: pointer; +} +.caldaycellhover{ + color: #fff; + background-color: #B3BCD4; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #B3BCD4 solid; + cursor: pointer; +} +.caldayselected{ + background-color: #737FAC; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; + border: 1px #566188 solid; + padding: 3px; + cursor: pointer; +} +.calblanktop { + background-color: #fff; + padding: 4px; +} +.calblankbot { + background-color: #fff; + padding: 4px; +} + + +*/ + +function js_calendar_script($form_name = 'entryform') +{ + +ob_start(); +?> + + + var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); + document.write('.$field_id.'.write()); + '; +} + ?> \ No newline at end of file diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index d42b5686..fe2744e7 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -1,289 +1,289 @@ -CI =& get_instance(); - - $this->CI->load->database("", FALSE, TRUE); - $this->CI->load->library('pagination'); - - // Turn off caching - $this->CI->db->cache_off(); - - /** - * Set the current table name - * This is done when initializing scaffolding: - * $this->load->scaffolding('table_name') - * - */ - $this->current_table = $db_table; - - /** - * Set the path to the "view" files - * We'll manually override the "view" path so that - * the load->view function knows where to look. - */ - - $this->CI->load->_ci_view_path = BASEPATH.'scaffolding/views/'; - - // Set the base URL - $this->base_url = $this->CI->config->site_url().'/'.$this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'both'); - $this->base_uri = $this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'leading'); - - // Set a few globals - $data = array( - 'image_url' => $this->CI->config->system_url().'scaffolding/images/', - 'base_uri' => $this->base_uri, - 'base_url' => $this->base_url, - 'title' => $this->current_table - ); - - $this->CI->load->vars($data); - - // Load the language file and create variables - $this->lang = $this->CI->load->language('scaffolding', '', TRUE); - $this->CI->load->vars($this->lang); - - // Load the helper files we plan to use - $this->CI->load->helper(array('url', 'form')); - - - log_message('debug', 'Scaffolding Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * "Add" Page - * - * Shows a form representing the currently selected DB - * so that data can be inserted - * - * @access public - * @return string the HTML "add" page - */ - function add() - { - $data = array( - 'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'], - 'fields' => $this->CI->db->field_data($this->current_table), - 'action' => $this->base_uri.'/insert' - ); - - $this->CI->load->view('add', $data); - } - - // -------------------------------------------------------------------- - - /** - * Insert the data - * - * @access public - * @return void redirects to the view page - */ - function insert() - { - if ($this->CI->db->insert($this->current_table, $_POST) === FALSE) - { - $this->add(); - } - else - { - redirect($this->base_uri.'/view/'); - } - } - - // -------------------------------------------------------------------- - - /** - * "View" Page - * - * Shows a table containing the data in the currently - * selected DB - * - * @access public - * @return string the HTML "view" page - */ - function view() - { - // Fetch the total number of DB rows - $total_rows = $this->CI->db->count_all($this->current_table); - - if ($total_rows < 1) - { - return $this->CI->load->view('no_data'); - } - - // Set the query limit/offset - $per_page = 20; - $offset = $this->CI->uri->segment(4, 0); - - // Run the query - $query = $this->CI->db->get($this->current_table, $per_page, $offset); - - // Now let's get the field names - $fields = $this->CI->db->list_fields($this->current_table); - - // We assume that the column in the first position is the primary field. - $primary = current($fields); - - // Pagination! - $this->CI->pagination->initialize( - array( - 'base_url' => $this->base_url.'/view', - 'total_rows' => $total_rows, - 'per_page' => $per_page, - 'uri_segment' => 4, - 'full_tag_open' => '

                ', - 'full_tag_close' => '

                ' - ) - ); - - $data = array( - 'title' => ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'], - 'query' => $query, - 'fields' => $fields, - 'primary' => $primary, - 'paginate' => $this->CI->pagination->create_links() - ); - - $this->CI->load->view('view', $data); - } - - // -------------------------------------------------------------------- - - /** - * "Edit" Page - * - * Shows a form representing the currently selected DB - * so that data can be edited - * - * @access public - * @return string the HTML "edit" page - */ - function edit() - { - if (FALSE === ($id = $this->CI->uri->segment(4))) - { - return $this->view(); - } - - // Fetch the primary field name - $primary = $this->CI->db->primary($this->current_table); - - // Run the query - $query = $this->CI->db->getwhere($this->current_table, array($primary => $id)); - - $data = array( - 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], - 'fields' => $query->field_data(), - 'query' => $query->row(), - 'action' => $this->base_uri.'/update/'.$this->CI->uri->segment(4) - ); - - $this->CI->load->view('edit', $data); - } - - // -------------------------------------------------------------------- - - /** - * Update - * - * @access public - * @return void redirects to the view page - */ - function update() - { - // Fetch the primary key - $primary = $this->CI->db->primary($this->current_table); - - // Now do the query - $this->CI->db->update($this->current_table, $_POST, array($primary => $this->CI->uri->segment(4))); - - redirect($this->base_uri.'/view/'); - } - - // -------------------------------------------------------------------- - - /** - * Delete Confirmation - * - * @access public - * @return string the HTML "delete confirm" page - */ - function delete() - { - if ( ! isset($this->lang['scaff_del_confirm'])) - { - $message = 'Are you sure you want to delete the following row: '.$this->CI->uri->segment(4); - } - else - { - $message = $this->lang['scaff_del_confirm'].' '.$this->CI->uri->segment(4); - } - - $data = array( - 'title' => ( ! isset($this->lang['scaff_delete'])) ? 'Delete Data' : $this->lang['scaff_delete'], - 'message' => $message, - 'no' => anchor(array($this->base_uri, 'view'), ( ! isset($this->lang['scaff_no'])) ? 'No' : $this->lang['scaff_no']), - 'yes' => anchor(array($this->base_uri, 'do_delete', $this->CI->uri->segment(4)), ( ! isset($this->lang['scaff_yes'])) ? 'Yes' : $this->lang['scaff_yes']) - ); - - $this->CI->load->view('delete', $data); - } - - // -------------------------------------------------------------------- - - /** - * Delete - * - * @access public - * @return void redirects to the view page - */ - function do_delete() - { - // Fetch the primary key - $primary = $this->CI->db->primary($this->current_table); - - // Now do the query - $this->CI->db->where($primary, $this->CI->uri->segment(4)); - $this->CI->db->delete($this->current_table); - - header("Refresh:0;url=".site_url(array($this->base_uri, 'view'))); - exit; - } - -} +CI =& get_instance(); + + $this->CI->load->database("", FALSE, TRUE); + $this->CI->load->library('pagination'); + + // Turn off caching + $this->CI->db->cache_off(); + + /** + * Set the current table name + * This is done when initializing scaffolding: + * $this->load->scaffolding('table_name') + * + */ + $this->current_table = $db_table; + + /** + * Set the path to the "view" files + * We'll manually override the "view" path so that + * the load->view function knows where to look. + */ + + $this->CI->load->_ci_view_path = BASEPATH.'scaffolding/views/'; + + // Set the base URL + $this->base_url = $this->CI->config->site_url().'/'.$this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'both'); + $this->base_uri = $this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'leading'); + + // Set a few globals + $data = array( + 'image_url' => $this->CI->config->system_url().'scaffolding/images/', + 'base_uri' => $this->base_uri, + 'base_url' => $this->base_url, + 'title' => $this->current_table + ); + + $this->CI->load->vars($data); + + // Load the language file and create variables + $this->lang = $this->CI->load->language('scaffolding', '', TRUE); + $this->CI->load->vars($this->lang); + + // Load the helper files we plan to use + $this->CI->load->helper(array('url', 'form')); + + + log_message('debug', 'Scaffolding Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * "Add" Page + * + * Shows a form representing the currently selected DB + * so that data can be inserted + * + * @access public + * @return string the HTML "add" page + */ + function add() + { + $data = array( + 'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'], + 'fields' => $this->CI->db->field_data($this->current_table), + 'action' => $this->base_uri.'/insert' + ); + + $this->CI->load->view('add', $data); + } + + // -------------------------------------------------------------------- + + /** + * Insert the data + * + * @access public + * @return void redirects to the view page + */ + function insert() + { + if ($this->CI->db->insert($this->current_table, $_POST) === FALSE) + { + $this->add(); + } + else + { + redirect($this->base_uri.'/view/'); + } + } + + // -------------------------------------------------------------------- + + /** + * "View" Page + * + * Shows a table containing the data in the currently + * selected DB + * + * @access public + * @return string the HTML "view" page + */ + function view() + { + // Fetch the total number of DB rows + $total_rows = $this->CI->db->count_all($this->current_table); + + if ($total_rows < 1) + { + return $this->CI->load->view('no_data'); + } + + // Set the query limit/offset + $per_page = 20; + $offset = $this->CI->uri->segment(4, 0); + + // Run the query + $query = $this->CI->db->get($this->current_table, $per_page, $offset); + + // Now let's get the field names + $fields = $this->CI->db->list_fields($this->current_table); + + // We assume that the column in the first position is the primary field. + $primary = current($fields); + + // Pagination! + $this->CI->pagination->initialize( + array( + 'base_url' => $this->base_url.'/view', + 'total_rows' => $total_rows, + 'per_page' => $per_page, + 'uri_segment' => 4, + 'full_tag_open' => '

                ', + 'full_tag_close' => '

                ' + ) + ); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'], + 'query' => $query, + 'fields' => $fields, + 'primary' => $primary, + 'paginate' => $this->CI->pagination->create_links() + ); + + $this->CI->load->view('view', $data); + } + + // -------------------------------------------------------------------- + + /** + * "Edit" Page + * + * Shows a form representing the currently selected DB + * so that data can be edited + * + * @access public + * @return string the HTML "edit" page + */ + function edit() + { + if (FALSE === ($id = $this->CI->uri->segment(4))) + { + return $this->view(); + } + + // Fetch the primary field name + $primary = $this->CI->db->primary($this->current_table); + + // Run the query + $query = $this->CI->db->getwhere($this->current_table, array($primary => $id)); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], + 'fields' => $query->field_data(), + 'query' => $query->row(), + 'action' => $this->base_uri.'/update/'.$this->CI->uri->segment(4) + ); + + $this->CI->load->view('edit', $data); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * @access public + * @return void redirects to the view page + */ + function update() + { + // Fetch the primary key + $primary = $this->CI->db->primary($this->current_table); + + // Now do the query + $this->CI->db->update($this->current_table, $_POST, array($primary => $this->CI->uri->segment(4))); + + redirect($this->base_uri.'/view/'); + } + + // -------------------------------------------------------------------- + + /** + * Delete Confirmation + * + * @access public + * @return string the HTML "delete confirm" page + */ + function delete() + { + if ( ! isset($this->lang['scaff_del_confirm'])) + { + $message = 'Are you sure you want to delete the following row: '.$this->CI->uri->segment(4); + } + else + { + $message = $this->lang['scaff_del_confirm'].' '.$this->CI->uri->segment(4); + } + + $data = array( + 'title' => ( ! isset($this->lang['scaff_delete'])) ? 'Delete Data' : $this->lang['scaff_delete'], + 'message' => $message, + 'no' => anchor(array($this->base_uri, 'view'), ( ! isset($this->lang['scaff_no'])) ? 'No' : $this->lang['scaff_no']), + 'yes' => anchor(array($this->base_uri, 'do_delete', $this->CI->uri->segment(4)), ( ! isset($this->lang['scaff_yes'])) ? 'Yes' : $this->lang['scaff_yes']) + ); + + $this->CI->load->view('delete', $data); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * @access public + * @return void redirects to the view page + */ + function do_delete() + { + // Fetch the primary key + $primary = $this->CI->db->primary($this->current_table); + + // Now do the query + $this->CI->db->where($primary, $this->CI->uri->segment(4)); + $this->CI->db->delete($this->current_table); + + header("Refresh:0;url=".site_url(array($this->base_uri, 'view'))); + exit; + } + +} ?> \ No newline at end of file diff --git a/system/scaffolding/views/footer.php b/system/scaffolding/views/footer.php index 36b29d1c..60b0a53e 100644 --- a/system/scaffolding/views/footer.php +++ b/system/scaffolding/views/footer.php @@ -1,10 +1,10 @@ - -
                - - - - + +
                + + + + \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 318dae7e..df667b95 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -2,7 +2,7 @@ -Code Igniter User Guide +CodeIgniter User Guide @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.2

                CodeIgniter User Guide Version 1.5.3

                @@ -45,7 +45,7 @@ @@ -63,10 +63,17 @@

                Change Log

                Version 1.5.3

                -

                Release Date:

                +

                Release Date: April 15, 2007

                  +
                • Added Array to string into the profiler
                • +
                • Added CodeIgniter references updated to CodeIgniter
                • +
                • Added EllisLab references updated to EllisLab
                • +
                • Fixed a bug in the repeater function of string helper.
                • +
                • Fixed a bug in ODBC driver
                • +
                • Fixed a bug in result_array() that was returning an empty array when no result is produced.
                • +
                • Fixed a bug in the redirect function of the url helper.
                • +
                • Fixed an undefined variable in Loader
                • Fixed a version but in the Postgre driver
                • -
                • Array to string now supported in profiler
                • Fixed a bug in the textarea function of the form helper for use with strings
                • Fixed doc typos.
                @@ -322,7 +329,7 @@

                Version 1.3

              • Added "alternator" function in the string helpers.

              • Removed slashing from the input class. After much debate we decided to kill this feature.
              • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
              • -
              • Added better class and function name-spacing to avoid collisions with user developed classes. All Code Igniter classes are now prefixed with CI_ and +
              • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
              • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
              • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
              • @@ -345,7 +352,7 @@

                Version 1.2

                • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
                • -
                • Added a global function named get_instance() allowing the main Code Igniter object to be accessible throughout your own classes.
                • +
                • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
                • Added new File Helper: delete_files()
                • Added new URL Helpers: base_url(), index_page()
                • Added the ability to create your own core libraries and store them in your local application directory.
                • @@ -368,7 +375,7 @@

                  Version Beta 1.1

                  • Added a Calendaring class.
                  • -
                  • Added support for running multiple applications that share a common Code Igniter backend.
                  • +
                  • Added support for running multiple applications that share a common CodeIgniter backend.
                  • Moved the "uri protocol" variable from the index.php file into the config.php file
                  • Fixed a problem that was preventing certain function calls from working within constructors.
                  • Fixed a problem that was preventing the $this->load->library function from working in constructors.
                  • @@ -403,7 +410,7 @@

                    Version Beta 1.0

                    Next Topic:  Credits

                    -

                    Code Igniter  ·  Copyright © 2006  ·  Ellislab, Inc.

                    +

                    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                    diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 915df1c3..fa3e2665 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -2,7 +2,7 @@ -Code Igniter User Guide +CodeIgniter User Guide @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@
                - +

                Code Igniter User Guide Version 1.5.2

                CodeIgniter User Guide Version 1.5.3

                @@ -45,7 +45,7 @@ - +
                diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 64323105..a7601e85 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -50,7 +50,7 @@ Database Library  ›  Database Utility Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index ef846f36..2b088919 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -49,7 +49,7 @@ User Guide Home  ›  Alternate PHP Syntax -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index f4961618..f6ae7ffa 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -49,7 +49,7 @@ User Guide Home  ›  Creating Ancillary Classes -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 7ac2253e..f3d474f2 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -49,7 +49,7 @@ User Guide Home  ›  Auto-loading Resources -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 0cec441e..8756f7c1 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -49,7 +49,7 @@ User Guide Home  ›  Page Caching -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index f80325ea..c61660d3 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -49,7 +49,7 @@ User Guide Home  ›  Controllers -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 84aa5502..2b476e58 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -49,7 +49,7 @@ User Guide Home  ›  Creating Core System Classes -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 64300929..020f7bed 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -49,7 +49,7 @@ User Guide Home  ›  Creating Libraries -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index e1bd8c37..9ac1618d 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -49,7 +49,7 @@ User Guide Home  ›  Credits -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index e19af059..65000811 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -49,7 +49,7 @@ User Guide Home  ›  Error Handling -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 7f51e305..0aba208a 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -49,7 +49,7 @@ User Guide Home  ›  Helper Functions -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index b0e15f12..c864c1ed 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -49,7 +49,7 @@ User Guide Home  ›  Hooks - Extending the Framework Core -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/index.html b/user_guide/general/index.html index a5334685..bf9b4ddc 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -49,7 +49,7 @@ User Guide Home  ›  Getting Started -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index aaa4d694..38c9987b 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -49,7 +49,7 @@ User Guide Home  ›  Using CodeIgniter Libraries -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 28e00f06..103127fb 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -49,7 +49,7 @@ User Guide Home  ›  Managing your Applications -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/models.html b/user_guide/general/models.html index cf663428..c1832cca 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -49,7 +49,7 @@ User Guide Home  ›  Models -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index b811abdc..ef299aa1 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -49,7 +49,7 @@ User Guide Home  ›  Plugins -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 4e306648..71950133 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -49,7 +49,7 @@ User Guide Home  ›  Profiling Your Application -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 2a01dd04..963f6b05 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -49,7 +49,7 @@ User Guide Home  ›  Quick Reference Chart -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 689aad55..e92b5196 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -49,7 +49,7 @@ User Guide Home  ›  Server Requirements -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index fe4efa3a..c4af428a 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -49,7 +49,7 @@ User Guide Home  ›  URI Routing -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index aee72f7c..4f23d3fe 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -49,7 +49,7 @@ User Guide Home  ›  Scaffolding -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 5dd00ec1..fdba2dfc 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -49,7 +49,7 @@ User Guide Home  ›  Security -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 4d29b730..4df37eeb 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -49,7 +49,7 @@ User Guide Home  ›  URLS -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/general/views.html b/user_guide/general/views.html index f97a003c..8adfc673 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -49,7 +49,7 @@ User Guide Home  ›  Views -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index e226e2cf..893dcaf9 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Array Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 64d572a2..bee6f3e0 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Cookie Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index f55cdeda..b9c48aa5 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Directory Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 8ba1b3a8..d0be8f6f 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -50,7 +50,7 @@ User Guide Home  ›  Directory Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 570a209a..3a0e2526 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -50,7 +50,7 @@ User Guide Home  ›  Download Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index b1df4a48..bebcc90b 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  File Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 0fde06db..d1eef8d8 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Form Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 0dd4b134..2b419605 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Directory Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index b02cf4df..ba067df9 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -49,7 +49,7 @@ User Guide Home  ›  Helper Functions -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index ab9f062d..8c7a26d4 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Inflector Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 79b44698..2e603afe 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Security Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 50b459b9..d690749e 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Smiley Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 5989a43d..c5be715a 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  String Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index de393dbe..e20a07cc 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Text Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index c6e68d53..5bcd2e3f 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  Typography Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index fbfc8414..7d54867e 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  URL Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 17d18565..35dd8868 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -49,7 +49,7 @@ User Guide Home  ›  XML Helper -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/index.html b/user_guide/index.html index a3ad5b55..15ecf1ea 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -46,7 +46,7 @@ CodeIgniter Home  ›  CodeIgniter User Guide -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index a3c5525d..58eefac0 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -49,7 +49,7 @@ User Guide Home  ›  Downloading CodeIgniter -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 9abc283e..edfa8b53 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -49,7 +49,7 @@ User Guide Home  ›  Installation Instructions -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 6f73f755..9813ef2a 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -49,7 +49,7 @@ User Guide Home  ›  Installation Instructions -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 6d39ebb9..a3f554c4 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from Beta 1.1 to Final 1.2 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 1a89df03..f08c8a11 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.2 to 1.3 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 6ae18228..812f5e41 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.3 to 1.3.1 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 6d29e1a4..3ae6a83a 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.3.1 to 1.3.2 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 3fe58a70..3c0cea6d 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.3.2 to 1.3.3 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 5b215bd6..0a515898 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.3.3 to 1.4.0 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 40ba9246..0324508a 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.3.3 to 1.4.0 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 65bf1e53..13948655 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.4.1 to 1.5.0 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 5820ce1b..853e5ce3 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.5.0 to 1.5.2 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index bc8fd576..2e999579 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from 1.5.0 to 1.5.2 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 9b45a990..793cd2e7 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from Beta 1.0 to Beta 1.1 -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index a55922e8..2efa1151 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -49,7 +49,7 @@ User Guide Home  ›  Upgrading from a Previous Version -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index fb0930c6..d92f0730 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -49,7 +49,7 @@ User Guide Home  ›  Benchmarking Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index ce48acc5..c9779081 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -49,7 +49,7 @@ User Guide Home  ›  Calendaring Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 79f064c2..350831e0 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -49,7 +49,7 @@ User Guide Home  ›  Config Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index af243db8..190dadbd 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -49,7 +49,7 @@ User Guide Home  ›  Email Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 7c6f909b..e3a9762b 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -49,7 +49,7 @@ User Guide Home  ›  Encryption Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 80ec869a..21fd2a6b 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -49,7 +49,7 @@ User Guide Home  ›  File Uploading Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 5c092857..9db0021a 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -49,7 +49,7 @@ User Guide Home  ›  FTP Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 98fcc944..04bd46f8 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -49,7 +49,7 @@ User Guide Home  ›  Image Manipulation Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 0e056b27..f810029a 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -49,7 +49,7 @@ User Guide Home  ›  Input and Security Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 75f0ba28..71dc0b97 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -49,7 +49,7 @@ User Guide Home  ›  Language Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 9e13d394..98bfd1b0 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -49,7 +49,7 @@ User Guide Home  ›  Loader Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index e4e30032..40858751 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -49,7 +49,7 @@ User Guide Home  ›  Output Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index fd300dbe..fafeb6cf 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -49,7 +49,7 @@ User Guide Home  ›  Pagination Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 0bc05886..24bb89ff 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -49,7 +49,7 @@ User Guide Home  ›  Template Parser Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 688f1aac..5a3c4ae2 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -49,7 +49,7 @@ User Guide Home  ›  Session Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 791cc21c..28fc76d2 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -49,7 +49,7 @@ User Guide Home  ›  HTML Table Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 99baa3e2..c54417c8 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -49,7 +49,7 @@ User Guide Home  ›  Trackback Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 02f8c063..bdd64d04 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -49,7 +49,7 @@ User Guide Home  ›  Unit Testing Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 53357d4c..ec777057 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -49,7 +49,7 @@ User Guide Home  ›  URI Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 75ec06b3..e9f6b715 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -49,7 +49,7 @@ User Guide Home  ›  User Agent Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index d5ad263a..8ba45ba4 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -49,7 +49,7 @@ User Guide Home  ›  Form Validation -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 541e8965..5d9b9ee6 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -49,7 +49,7 @@ User Guide Home  ›  XML-RPC and XML-RPC Server Classes -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index af4baa0b..e1692234 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -49,7 +49,7 @@ User Guide Home  ›  Zip Encoding Class -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/license.html b/user_guide/license.html index fb00e200..f938c2cf 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -50,7 +50,7 @@ User Guide Home  ›  License Agreement -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index affcd661..d10d038a 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -49,7 +49,7 @@ User Guide Home  ›  Appflow -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 47362e00..aadfe558 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -49,7 +49,7 @@ User Guide Home  ›  What is CodeIgniter? -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index d63821c0..7033681f 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -49,7 +49,7 @@ User Guide Home  ›  Features -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index b531515f..fba6f61a 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -49,7 +49,7 @@ User Guide Home  ›  Goals -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index edd22930..133503fa 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -49,7 +49,7 @@ User Guide Home  ›  Introduction -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index f1ca19a5..baac03da 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -49,7 +49,7 @@ User Guide Home  ›  MVC -
                Search User Guide   
                +
                Search User Guide   
                diff --git a/user_guide/toc.html b/user_guide/toc.html index e16a3692..12c16183 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -50,7 +50,7 @@ User Guide Home  ›  Table of Contents -
                Search User Guide   
                +
                Search User Guide   
                From 3c5e373a2c95ba06b8d5b9820f53a72bea2f5681 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Sun, 24 Jun 2007 20:27:42 +0000 Subject: [PATCH 0606/2544] Fixed the do_xss_clean() method so that if file_get_contents returns FALSE, then we return FALSE... Previously, if it did NOT return FALSE we returned FALSE and that is simply idiotic. --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index dc3fd4a1..9d2bae2a 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -709,7 +709,7 @@ function do_xss_clean() return FALSE; } - if (($data = @file_get_contents($file)) !== FALSE) + if (($data = @file_get_contents($file)) === FALSE) { return FALSE; } From 2f35c4b91526d2d813601401a3e6563255f2b639 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Sun, 24 Jun 2007 20:29:09 +0000 Subject: [PATCH 0607/2544] Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs --- system/libraries/Upload.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 9d2bae2a..fa1cf1e7 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -477,17 +477,28 @@ function set_xss_clean($flag = FALSE) */ function is_image() { + // IE will sometimes return odd mime-types during upload, so here we just standardize all + // jpegs or pngs to the same file type. + + $png_mimes = array('image/x-png'); + $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg'); + + if (in_array($this->file_type, $png_mimes)) + { + $this->file_type = 'image/png'; + } + + if (in_array($this->file_type, $jpeg_mimes)) + { + $this->file_type = 'image/jpeg'; + } + $img_mimes = array( 'image/gif', - 'image/jpg', - 'image/jpe', 'image/jpeg', - 'image/pjpeg', 'image/png', - 'image/x-png' ); - return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE; } From 85d9f0c9960188aa9916c499466c32279178be41 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Sun, 24 Jun 2007 20:30:12 +0000 Subject: [PATCH 0608/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a44c22be..0cbdab06 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@

                Version 1.5.4

              • Fixed a typo in the Calendar library
              • Fixed a typo in rpcs.php library
              • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
              • +
              • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
              • Added array to string into the profiler
              • Added some additional mime types in application/config/mimes.php
              • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
              • From 033ef02392d70dbc873deacc50ee76a800d0d228 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Tue, 26 Jun 2007 21:52:52 +0000 Subject: [PATCH 0609/2544] *Updated the XSS Filtering to take into account the IE expression() ability --- system/libraries/Input.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 1ff72877..dc4e605b 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -528,9 +528,12 @@ function xss_clean($str, $charset = 'ISO-8859-1') */ $bad = array( 'document.cookie' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', 'document.write' => '[removed]', 'window.location' => '[removed]', "javascript\s*:" => '[removed]', + "expression\s*\(" => '[removed]', // CSS and IE "Redirect\s+302" => '[removed]', '' => '-->' @@ -626,7 +629,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * Becomes: eval('some code') * */ - $str = preg_replace('#(alert|cmd|passthru|eval|exec|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); /* * Final clean up @@ -637,9 +640,12 @@ function xss_clean($str, $charset = 'ISO-8859-1') */ $bad = array( 'document.cookie' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', 'document.write' => '[removed]', 'window.location' => '[removed]', "javascript\s*:" => '[removed]', + "expression\s*\(" => '[removed]', // CSS and IE "Redirect\s+302" => '[removed]', '' => '-->' From ca2cf80a98c76afb586659ebd2859d1438748745 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Tue, 26 Jun 2007 21:53:26 +0000 Subject: [PATCH 0610/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0cbdab06..b9cd5939 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@

                Version 1.5.4

              • Fixed a typo in the Calendar library
              • Fixed a typo in rpcs.php library
              • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
              • +
              • Updated the XSS Filtering to take into account the IE expression() ability
              • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
              • Added array to string into the profiler
              • Added some additional mime types in application/config/mimes.php
              • From b614d392ccafd1decadbdc11afd7c0dcc4baec34 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Tue, 26 Jun 2007 21:58:56 +0000 Subject: [PATCH 0611/2544] --- system/libraries/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index dc4e605b..51d4ed28 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -572,7 +572,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * These words are compacted back to their correct state. * */ - $words = array('javascript', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); + $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); foreach ($words as $word) { $temp = ''; From 391eb03004deee85b9b0e978982950723b9742b5 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 22:58:24 +0000 Subject: [PATCH 0612/2544] Improved XSS clean to not allowing this: xss_clean("ss ipt a='>'>alert/**/('!');//*/>"); --- system/libraries/Input.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 51d4ed28..f9d23ae7 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -588,10 +588,18 @@ function xss_clean($str, $charset = 'ISO-8859-1') /* * Remove disallowed Javascript in links or img tags - */ - $str = preg_replace_callback("##si", array($this, '_js_link_removal'), $str); - $str = preg_replace_callback("##si", array($this, '_js_img_removal'), $str); - $str = preg_replace("#<(script|xss).*?\>#si", "", $str); + */ + do + { + $original = $str; + + $str = preg_replace_callback("##si", array($this, '_js_link_removal'), $str); + $str = preg_replace_callback("##si", array($this, '_js_img_removal'), $str); + $str = preg_replace("##si", "", $str); + } + while($original != $str); + + unset($original); /* * Remove JavaScript Event Handlers From 8816aaab7ac21d4e3ccd1eedd86462bc94aff2c1 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:07:36 +0000 Subject: [PATCH 0613/2544] --- system/libraries/Input.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index f9d23ae7..9a73ab9b 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -68,21 +68,30 @@ function CI_Input() */ function _sanitize_globals() { + // Would kind of be "wrong" to unset any of these GLOBALS. + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA'); + // Unset globals for securiy. // This is effectively the same as register_globals = off foreach (array($_GET, $_POST, $_COOKIE) as $global) { if ( ! is_array($global)) { - global $global; - $$global = NULL; + if ( ! in_array($global, $protected)) + { + global $global; + $$global = NULL; + } } else { foreach ($global as $key => $val) { - global $$key; - $$key = NULL; + if ( ! in_array($key, $protected)) + { + global $$key; + $$key = NULL; + } } } } From 3541313e896794514b7d44a5f0aab1e47b340ef7 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:25:19 +0000 Subject: [PATCH 0614/2544] *Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security. --- system/libraries/Router.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 6c3062c0..e2a14800 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -49,6 +49,7 @@ class CI_Router { function CI_Router() { $this->config =& load_class('Config'); + $this->input =& load_class('Input'); $this->_set_route_mapping(); log_message('debug', "Router Class Initialized"); } @@ -482,7 +483,7 @@ function _parse_routes() */ function set_class($class) { - $this->class = $class; + $this->class = $this->input->filename_security($class); } // -------------------------------------------------------------------- @@ -509,7 +510,7 @@ function fetch_class() */ function set_method($method) { - $this->method = $method; + $this->method = $this->input->filename_security($method); } // -------------------------------------------------------------------- @@ -541,7 +542,7 @@ function fetch_method() */ function set_directory($dir) { - $this->directory = $dir.'/'; + $this->directory = $this->input->filename_security($dir).'/'; } // -------------------------------------------------------------------- From 763064b8661f92953497d6ca094d687e9078903f Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:25:55 +0000 Subject: [PATCH 0615/2544] *Added filename_security() method to Input library *Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security. --- system/libraries/Input.php | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 9a73ab9b..337eeff3 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -444,6 +444,56 @@ function user_agent() // -------------------------------------------------------------------- + /** + * Filename Security + * + * @access public + * @param string + * @return string + */ + function filename_security($str) + { + $bad = array( + "../", + "./", + "", + "<", + ">", + "'", + '"', + '&', + '$', + '#', + '{', + '}', + '[', + ']', + '=', + ';', + '?', + '/', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + return stripslashes(str_replace($bad, '', $str)); + } + + // -------------------------------------------------------------------- + /** * XSS Clean * From fed96b698011d3d464a4caf9d75b6b1e71d175d1 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:26:35 +0000 Subject: [PATCH 0616/2544] --- user_guide/changelog.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b9cd5939..32afd51a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,9 @@

                Version 1.5.4

                Release Date: -- Still under development

                • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
                • +
                • Added array to string into the profiler
                • +
                • Added some additional mime types in application/config/mimes.php
                • +
                • Added filename_security() method to Input library
                • Fixed MSSQL insert_id().
                • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
                • Fixed a bug that was allowing multiple load attempts on extended classes.
                • @@ -74,16 +77,16 @@

                  Version 1.5.4

                • Fixed a typo in the Calendar library
                • Fixed a typo in rpcs.php library
                • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
                • -
                • Updated the XSS Filtering to take into account the IE expression() ability
                • -
                • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
                • -
                • Added array to string into the profiler
                • -
                • Added some additional mime types in application/config/mimes.php
                • -
                • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
                • Fixed a bug in router that was ignoring the scaffolding route for optimization
                • Fixed an IP validation bug.
                • +
                • Fixed various doc typos.
                • +
                • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
                • +
                • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
                • +
                • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
                • +
                • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
                • +
                • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
                • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
                • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
                • -
                • Fixed various doc typos.
                From 8b1c3874d61d2c05f6368c9cad82aa533ad42b03 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:30:41 +0000 Subject: [PATCH 0617/2544] Modified the include so that there is a bit of filename security --- system/codeigniter/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 987478f9..8b067ff7 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -132,7 +132,7 @@ // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +if ( ! include(APPPATH.'controllers/'.$IN->filename_security($RTR->fetch_directory()).$IN->filename_security($RTR->fetch_class()).EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } From 01f0888f7d574b92104f8aedf77ab5426d753fd3 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Wed, 27 Jun 2007 23:47:39 +0000 Subject: [PATCH 0618/2544] --- system/codeigniter/CodeIgniter.php | 2 +- system/libraries/Input.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 8b067ff7..987478f9 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -132,7 +132,7 @@ // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! include(APPPATH.'controllers/'.$IN->filename_security($RTR->fetch_directory()).$IN->filename_security($RTR->fetch_class()).EXT)) +if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 337eeff3..33f28868 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -472,7 +472,6 @@ function filename_security($str) '=', ';', '?', - '/', "%20", "%22", "%3c", // < From 691010e72ec7fb4a05740332a10b5f046a82c666 Mon Sep 17 00:00:00 2001 From: paulburdick Date: Thu, 28 Jun 2007 00:02:30 +0000 Subject: [PATCH 0619/2544] Instead of doing file name security for Enable Query Strings, I am using the already existin _filter_uri() --- system/libraries/Router.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index e2a14800..6af6ad38 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -49,7 +49,6 @@ class CI_Router { function CI_Router() { $this->config =& load_class('Config'); - $this->input =& load_class('Input'); $this->_set_route_mapping(); log_message('debug', "Router Class Initialized"); } @@ -71,11 +70,11 @@ function _set_route_mapping() // If so, we're done since segment based URIs are not used with query strings. if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) { - $this->set_class($_GET[$this->config->item('controller_trigger')]); + $this->set_class(trim($this->_filter_uri($_GET[$this->config->item('controller_trigger')]))); if (isset($_GET[$this->config->item('function_trigger')])) { - $this->set_method($_GET[$this->config->item('function_trigger')]); + $this->set_method(trim($this->_filter_uri($_GET[$this->config->item('function_trigger')]))); } return; @@ -483,7 +482,7 @@ function _parse_routes() */ function set_class($class) { - $this->class = $this->input->filename_security($class); + $this->class = $class; } // -------------------------------------------------------------------- @@ -510,7 +509,7 @@ function fetch_class() */ function set_method($method) { - $this->method = $this->input->filename_security($method); + $this->method = $method; } // -------------------------------------------------------------------- @@ -542,7 +541,7 @@ function fetch_method() */ function set_directory($dir) { - $this->directory = $this->input->filename_security($dir).'/'; + $this->directory = $dir.'/'; } // -------------------------------------------------------------------- From c644128fdd49a47d791240e0e38b54cd22412bc5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jul 2007 23:54:32 +0000 Subject: [PATCH 0620/2544] fixed validation errors... about a zillion of em. --- user_guide/changelog.html | 7 +- user_guide/database/active_record.html | 6 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 4 +- user_guide/database/connecting.html | 8 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 8 +- user_guide/database/results.html | 8 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 6 +- user_guide/database/utilities.html | 4 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 8 +- user_guide/general/controllers.html | 15 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 6 +- user_guide/general/credits.html | 3 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 4 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 5 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 5 +- user_guide/general/requirements.html | 3 +- user_guide/general/routing.html | 4 +- user_guide/general/scaffolding.html | 4 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 6 +- user_guide/general/views.html | 62 ++++----- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 4 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 4 +- user_guide/helpers/form_helper.html | 14 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 24 ++-- user_guide/helpers/string_helper.html | 4 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 3 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 3 +- user_guide/installation/upgrade_120.html | 3 +- user_guide/installation/upgrade_130.html | 3 +- user_guide/installation/upgrade_131.html | 3 +- user_guide/installation/upgrade_132.html | 3 +- user_guide/installation/upgrade_133.html | 5 +- user_guide/installation/upgrade_140.html | 3 +- user_guide/installation/upgrade_141.html | 3 +- user_guide/installation/upgrade_150.html | 5 +- user_guide/installation/upgrade_152.html | 5 +- user_guide/installation/upgrade_153.html | 5 +- user_guide/installation/upgrade_b11.html | 3 +- user_guide/installation/upgrading.html | 3 +- user_guide/libraries/benchmark.html | 4 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 10 +- user_guide/libraries/email.html | 6 +- user_guide/libraries/encryption.html | 6 +- user_guide/libraries/file_uploading.html | 57 ++++---- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 6 +- user_guide/libraries/input.html | 6 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 4 +- user_guide/libraries/output.html | 8 +- user_guide/libraries/pagination.html | 4 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 4 +- user_guide/libraries/trackback.html | 4 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 13 +- user_guide/libraries/user_agent.html | 11 +- user_guide/libraries/validation.html | 138 ++++++++++--------- user_guide/libraries/xmlrpc.html | 10 +- user_guide/libraries/zip.html | 4 +- user_guide/license.html | 3 +- user_guide/overview/appflow.html | 3 +- user_guide/overview/at_a_glance.html | 3 +- user_guide/overview/features.html | 3 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 103 files changed, 318 insertions(+), 351 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 32afd51a..c19c3cd6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -242,7 +242,7 @@

                Version 1.4.0

              • Added support for changing the port number in the Postgre driver.
              • Moved the list of "allowed URI characters" out of the Router class and into the config file.
              • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
              • -
              • Updated the Upload class to allow the upload field name to be set when calling do_upload().
              • +
              • Updated the Upload class to allow the upload field name to be set when calling do_upload().
              • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
              • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
              • Updated the form_open() helper to allow the GET method to be used.
              • @@ -288,7 +288,7 @@

                Version 1.3.3

                  -
                • Models do not connect automatically to the database as of this version. More info here. +
                • Models do not connect automatically to the database as of this version. More info here.
                • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
                • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
                • Fixed a bug in the active record "having" function.
                • @@ -436,8 +436,7 @@

                  Version Beta 1.0

                  Top of Page   ·   User Guide Home   ·   Next Topic:  Credits -

                  - +

                  CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 5d58f6bd..573c6740 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -369,7 +369,7 @@

                $this->db->orderby();

                $this->db->limit();

                -

                Lets you limit the number of rows you would like returned by the query: +

                Lets you limit the number of rows you would like returned by the query:

                $this->db->limit(10);
                @@ -565,7 +565,7 @@

                $this->db->delete();

                // WHERE id = $id

                The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing -the data to the second parameter of the function: +the data to the second parameter of the function:

                $this->db->where('id', $id);
                @@ -603,7 +603,7 @@

                Method Chaining

                Top of Page   ·   User Guide Home   ·   Next Topic:  Transactions -

                +

                CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index da1e08ed..2e4d16e4 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -217,7 +217,7 @@

                $this->db->cache_delete_all()

                Top of Page   ·   User Guide Home   ·   Next Topic:  Database Utilities Class -

                +

                CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 1e80ea54..b439d446 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -115,7 +115,7 @@

                $this->db->call_function();

                Top of Page   ·   User Guide Home   ·   Next Topic:  Query Caching -

                +

                CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b33f2b70..774790c6 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -66,7 +66,7 @@

                Database Configuration

                CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). -The config file is located at: +The config file is located at:

                application/config/database.php

                @@ -137,7 +137,7 @@

                Explanation of Values:

                Top of Page   ·   User Guide Home   ·   Next Topic:  Connecting to your Database -

                +

                CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

                diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index aebca25b..e44c145e 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -111,9 +111,9 @@

                Manually Connecting


                $this->load->database($config);
                -

                For information on each of these values please see the configuration page. +

                For information on each of these values please see the configuration page.

                -

                Or you can submit your database values as a Data Source Name. DSNs must have this prototype: +

                Or you can submit your database values as a Data Source Name. DSNs must have this prototype:

                $dsn = 'dbdriver://username:password@hostname/database';

                @@ -122,8 +122,6 @@

                Manually Connecting

                Note that if you use a DSN you will not be able to specify some of the default values like you can if you use a connection array.

                - -

                Connecting to Multiple Databases

                If you need to connect to more than one database simultaneously you can do so as follows:

                @@ -164,7 +162,7 @@

                Connecting to Multiple Databases

                Top of Page   ·   User Guide Home   ·   Next Topic:  Queries -

                +

                CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

              diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 7a8ec92d..0d8faf3c 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -214,7 +214,7 @@

              Active Record Insert

              Top of Page   ·   User Guide Home   ·   Next Topic:  Database Configuration -

              +

              CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 8d9d7b5d..c01caae9 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -165,7 +165,7 @@

        $this->db->field_data()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Custom Function Calls -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 4742569d..e6d0e461 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -148,7 +148,7 @@

        $this->db->update_string();

        Top of Page   ·   User Guide Home   ·   Next Topic:  Active Record Pattern -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 2a57ebc1..c2523329 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -95,7 +95,7 @@

        The Database Class

        Top of Page   ·   User Guide Home   ·   Next Topic:  Quick Start: Usage Examples -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index e55a5328..013d64f3 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -95,15 +95,13 @@

        Escaping Queries

      • $this->db->escape() This function determines the data type so that it can escape only string data. It also automatically adds single quotes around the data so you don't have to: -$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")"; +$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
      • $this->db->escape_str() This function escapes the data passed to it, regardless of type. Most of the time you'll use the above function rather then this one. Use the function like this: -$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')"; - -
      • +$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')"; @@ -134,7 +132,7 @@

        Query Bindings

        Top of Page   ·   User Guide Home   ·   Next Topic:  Query Results -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 5b25015b..f6c1be12 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -134,7 +134,7 @@

        row()

        }
        -

        If you want a specific row returned you can submit the row number as a digit in the first parameter: +

        If you want a specific row returned you can submit the row number as a digit in the first parameter:

        $row = $query->row(5); @@ -157,7 +157,7 @@

        row_array()

        -

        If you want a specific row returned you can submit the row number as a digit in the first parameter: +

        If you want a specific row returned you can submit the row number as a digit in the first parameter:

        $row = $query->row_array(5); @@ -181,7 +181,7 @@

        row_array()

        -
        +

        Result Helper Functions

        @@ -235,7 +235,7 @@

        $query->free_result()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Query Helper Functions -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 6792e356..13b96681 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -110,7 +110,7 @@

        $this->db->table_exists();

        Top of Page   ·   User Guide Home   ·   Next Topic:   Field Metadata -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index ecc5164d..75aa4e88 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -122,7 +122,7 @@

        Managing Errors

        Enabling Transactions

        Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you -can do so using $this->db->trans_off(): +can do so using $this->db->trans_off():

        $this->db->trans_off()

        @@ -138,7 +138,7 @@

        Enabling Transactions

        Test Mode

        You can optionally put the transaction system into "test mode", which will cause your queries to be rolled back -- even if the queries produce a valid result. -To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE: +To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE:

        $this->db->trans_start(TRUE); // Query will be rolled back
        @@ -190,7 +190,7 @@

        Running Transactions Manually

        Top of Page   ·   User Guide Home   ·   Next Topic:  Table Metadata -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index a7601e85..7de0ea3e 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -205,7 +205,7 @@

        $this->dbutil->csv_from_result($db_result)

        The second and third parameters allows you to -set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example: +set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:

        $delimiter = ",";
        @@ -330,7 +330,7 @@

        Description of Backup Preferences

        Top of Page   ·   User Guide Home   ·   Next Topic:   Email Class -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 2b088919..7498587c 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -144,7 +144,7 @@

        Alternative Control Structures

        Top of Page   ·   User Guide Home   ·   Next Topic:  Security -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index f6ae7ffa..58f2b06a 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -114,7 +114,7 @@

        get_instance()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Auto-loading Resources -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index f3d474f2..39a0ce65 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -97,7 +97,7 @@

        Auto-loading Resources

        Top of Page   ·   User Guide Home   ·   Next Topic:  Scaffolding -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 8756f7c1..a881f2d4 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -63,11 +63,11 @@

        Web Page Caching

        -

        CodeIgniter lets you cache your pages in order to achieve maximum performance. +

        CodeIgniter lets you cache your pages in order to achieve maximum performance.

        -Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the +

        Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. -By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages. +By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

        How Does Caching Work?

        @@ -111,7 +111,7 @@

        Deleting Caches

        Top of Page   ·   User Guide Home   ·   Next Topic:  Profiling Your Application -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index c61660d3..5d83edcd 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -121,7 +121,7 @@

        Let's try it:  Hello World!

        If you did it right, you should see Hello World!.

        -

        Note: Class names must start with an uppercase letter. In other words, this is valid: +

        Note: Class names must start with an uppercase letter. In other words, this is valid:

        <?php
        class Blog extends Controller {
        @@ -182,7 +182,7 @@

        Passing URI Segments to your Functions

        If your URI contains more then two segments they will be passed to your function as parameters.

        -

        For example, lets say you have a URI like this: +

        For example, lets say you have a URI like this:

        www.your-site.com/index.php/products/shoes/sandals/123 @@ -258,7 +258,7 @@

        Processing Output

        CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this can be found in the Views and Output class pages. In some cases, however, you might want to post-process the finalized data in some way and send it to the browser yourself. CodeIgniter permits you to -add a function named _output() to your controller that will receive the finalized output data. +add a function named _output() to your controller that will receive the finalized output data.

        Important:  If your controller contains a function named _output(), it will always be called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.

        @@ -317,12 +317,10 @@

        Organizing Your Controllers into Sub-folders

        application/config/routes.php file

        -

        CodeIgniter also permits you to remap your URIs using its URI Routing feature. +

        CodeIgniter also permits you to remap your URIs using its URI Routing feature.

        - - -

        Class Constructors

        +

        Class Constructors

        If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:

        @@ -426,8 +424,7 @@

        That's it!

        Top of Page   ·   User Guide Home   ·   Next Topic:  Views -

        - +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 2b476e58..fa467cb2 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -166,7 +166,7 @@

        Setting Your Own Prefix

        Top of Page   ·   User Guide Home   ·   Next Topic:  Hooks - Extending the Core -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 020f7bed..b3eaf3d7 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -68,7 +68,7 @@

        Creating Libraries

        and the global framework resources.

        As an added bonus, CodeIgniter permits your libraries to extend native classes if you simply need to add some functionality -to an existing library. Or you can even replace native libraries just by placing identically named versions in your application/libraries folder. +to an existing library. Or you can even replace native libraries just by placing identically named versions in your application/libraries folder.

        In summary:

        @@ -266,7 +266,7 @@

        Loading Your Sub-class

        $this->load->library('email');

        Once loaded you will use the class variable as you normally would for the class you are extending. In the case of -the email class all calls will use: +the email class all calls will use:

        $this->email->some_function(); @@ -293,7 +293,7 @@

        Setting Your Own Prefix

        Top of Page   ·   User Guide Home   ·   Next Topic:  Creating Core System Classes -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 9ac1618d..97aef01b 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -87,8 +87,7 @@

        Credits

        Top of Page   ·   User Guide Home   ·   Next Topic:  Downloading CodeIgniter -

        - +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 65000811..d78dd494 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -134,7 +134,7 @@

        log_message('level', 'message')

        Top of Page   ·   User Guide Home   ·   Next Topic:  Page Caching -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 0aba208a..a91c8c21 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -138,7 +138,7 @@

        Now What?

        Top of Page   ·   User Guide Home   ·   Next Topic:  Plugins -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index c864c1ed..0776e32c 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -104,7 +104,7 @@

        Defining a Hook

        Multiple Calls to the Same Hook

        -

        If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this: +

        If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this:

        $hook['pre_controller'][] = array(
        @@ -185,7 +185,7 @@

        Hook Points

        Top of Page   ·   User Guide Home   ·   Next Topic:  Auto-loading Resources -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/index.html b/user_guide/general/index.html index bf9b4ddc..2d5148b3 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -91,7 +91,7 @@

        Getting Started With CodeIgniter

        Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter URLs -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 38c9987b..4efd5eef 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -91,7 +91,7 @@

        Creating Your Own Libraries

        Top of Page   ·   User Guide Home   ·   Next Topic:  Creating Libraries -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 103127fb..836f0c86 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -89,7 +89,7 @@

        Running Multiple Applications with one CodeIgniter Installation

        own sub-folder.

        For example, let's say you want to create two applications, "foo" and "bar". You will structure your -application folder like this: +application folder like this:

        system/application/foo/
        system/application/foo/config/
        @@ -130,8 +130,7 @@

        Running Multiple Applications with one CodeIgniter Installation

        Top of Page   ·   User Guide Home   ·   Next Topic:  Alternative PHP Syntax -

        - +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/models.html b/user_guide/general/models.html index c1832cca..6758ceb8 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -251,7 +251,7 @@

        Connecting to your Database

        Top of Page   ·   User Guide Home   ·   Next Topic:  Helpers -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index ef299aa1..2fde9272 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -124,7 +124,7 @@

        Using a Plugin

        Top of Page   ·   User Guide Home   ·   Next Topic:  Using Libraries -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 71950133..a73f0098 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -111,7 +111,7 @@

        Setting Benchmark Points

        Top of Page   ·   User Guide Home   ·   Next Topic:  Managing Applications -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 963f6b05..9680cbd5 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -62,7 +62,7 @@

        Quick Reference Chart

        -

        For a PDF version of this chart, click here. +

        For a PDF version of this chart, click here.

        @@ -74,8 +74,7 @@

        Quick Reference Chart

        Top of Page   ·   User Guide Home -

        - +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index e92b5196..1aa0d78a 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -79,8 +79,7 @@

        Server Requirements

        Top of Page   ·   User Guide Home   ·   Next Topic:  License Agreement -

        - +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index c4af428a..2cd0d2f4 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -86,7 +86,7 @@

        URI Routing

        Setting your own routing rules

        Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that -permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions +permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions

        Wildcards

        @@ -172,7 +172,7 @@

        Reserved Routes

        Top of Page   ·   User Guide Home   ·   Next Topic:  Error Handling -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 4f23d3fe..125732e8 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -116,7 +116,7 @@

        Enabling Scaffolding

        Where table_name is the name of the table (table, not database) you wish to work with.

        -

        Once you've initialized scaffolding, you will access it with this URL prototype: +

        Once you've initialized scaffolding, you will access it with this URL prototype:

        www.your-site.com/index.php/class/secret_word/ @@ -145,7 +145,7 @@

        A Final Note:

        Top of Page   ·   User Guide Home   ·   Next Topic:  URI Routing -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/security.html b/user_guide/general/security.html index fdba2dfc..24bfe1c4 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -151,7 +151,7 @@

        Best Practices

        Top of Page   ·   User Guide Home   ·   Next Topic:  Benchmarking Class -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 4df37eeb..21031aff 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -90,7 +90,7 @@

        URI Segments

        Removing the index.php file

        -

        By default, the index.php file will be included in your URLs: +

        By default, the index.php file will be included in your URLs:

        www.your-site.com/index.php/news/article/my_article @@ -108,7 +108,7 @@

        Removing the index.php file

        Adding a URL Suffix

        In your config/config.php file you can specify a suffix that will be added to all URLs generated -by CodeIgniter. For example, if a URL is this: +by CodeIgniter. For example, if a URL is this:

        www.your-site.com/index.php/products/view/shoes @@ -151,7 +151,7 @@

        Enabling Query Strings

        Top of Page   ·   User Guide Home   ·   Next Topic:  Controllers -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 8adfc673..737146db 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -77,14 +77,14 @@

        Creating a View

        Using your text editor, create a file called blogview.php, and put this in it:

        Then save the file in your application/views/ folder.

        @@ -169,14 +169,14 @@

        Adding Dynamic Data to the View

        Then load the page at the URL you've been using and you should see the variables replaced.

        @@ -214,26 +214,26 @@

        Creating Loops

        @@ -249,7 +249,7 @@

        My Todo List

        Top of Page   ·   User Guide Home   ·   Next Topic:  Models -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 893dcaf9..7057c336 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -117,7 +117,7 @@

        random_element()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Cookie Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index bee6f3e0..a81a498d 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -149,7 +149,7 @@

        delete_cookie()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Date Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index b9c48aa5..00f00ad7 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -172,7 +172,7 @@

        unix_to_human()

        This can be useful if you need to display a date in a form field for submission.

        The time can be formatted with or without seconds, and it can be set to European or US format. If only -the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples: +the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:

        $now = time();

        @@ -363,7 +363,7 @@

        Timezone Reference

        Top of Page   ·   User Guide Home   ·   Next Topic:  Directory Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index d0be8f6f..8f1027a8 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -137,7 +137,7 @@

        directory_map('source directory')

        Top of Page   ·   User Guide Home   ·   Next Topic:  Download Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 3a0e2526..bd5b7483 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -110,7 +110,7 @@

        force_download('filename', 'data')

        Top of Page   ·   User Guide Home   ·   Next Topic:  File Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index bebcc90b..3139569a 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -103,7 +103,7 @@

        write_file('path', $data)

             echo 'File written!';
        }
        -

        You can optionally set the write mode via the third parameter: +

        You can optionally set the write mode via the third parameter:

        write_file('./path/to/file.php', $data, 'r+'); @@ -146,7 +146,7 @@

        get_filenames('path/to/directory/')

        Top of Page   ·   User Guide Home   ·   Next Topic:  Form Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index d1eef8d8..572f2a20 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -155,7 +155,7 @@

        form_hidden()

        form_input()

        Lets you generate a standard text input field. You can minimally pass the field name and value in the first -and second parameter: +and second parameter:

        echo form_input('username', 'johndoe'); @@ -176,7 +176,7 @@

        form_input()

        <input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />

        If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the -third parameter: +third parameter:

        $js = 'onClick="some_function()"';

        @@ -203,7 +203,7 @@

        form_dropdown()

        Lets you create a standard drop-down field. The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. Example: +value you wish to be selected. Example:

        $options = array(
                          'small'  => 'Small Shirt',
        @@ -225,7 +225,7 @@

        form_dropdown()

        If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter: +fourth parameter:

        $js = 'onChange="some_function()"';

        @@ -234,7 +234,7 @@

        form_dropdown()

        form_checkbox()

        -

        Lets you generate a checkbox field. Simple example: +

        Lets you generate a checkbox field. Simple example:

        echo form_checkbox('newsletter', 'accept', TRUE);
        @@ -261,7 +261,7 @@

        form_checkbox()

        <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />

        As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter: +fourth parameter:

        $js = 'onClick="some_function()"';

        @@ -335,7 +335,7 @@

        form_prep()

        Top of Page   ·   User Guide Home   ·   Next Topic:  HTML Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 2b419605..620cb104 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -227,7 +227,7 @@

        br()

        Top of Page   ·   User Guide Home   ·   Next Topic:   Inflector Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index ba067df9..1c8935d2 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -123,7 +123,7 @@

        Now What?

        diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 8c7a26d4..2a4ee559 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -145,7 +145,7 @@

        humanize()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Security Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

        diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 2e603afe..7ba8a83c 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -123,7 +123,7 @@

        encode_php_tags()

        Top of Page   ·   User Guide Home   ·   Next Topic:  Smiley Helper -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index d690749e..1603e165 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -132,25 +132,25 @@

      The Controller

      @@ -200,7 +200,7 @@

      parse_smileys()

      Top of Page   ·   User Guide Home   ·   Next Topic:  String Helper -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index c5be715a..0858b78e 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -95,7 +95,7 @@

      random_string()

      alternator()

      -

      Allows two or more items to be alternated between, when cycling through a loop. Example: +

      Allows two or more items to be alternated between, when cycling through a loop. Example:

      for ($i = 0; $i < 10; $i++)
      {
      @@ -136,7 +136,7 @@

      repeater()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Text Helper -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index e20a07cc..260fad4a 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -189,7 +189,7 @@

      word_wrap()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Typography Helper -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 5bcd2e3f..48cae2d3 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -121,7 +121,7 @@

      nl2br_except_pre()

      Top of Page   ·   User Guide Home   ·   Next Topic:  URL Helper -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 7d54867e..f2dc765b 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -263,7 +263,7 @@

      redirect()

      Top of Page   ·   User Guide Home   ·   Next Topic:  XML Helper -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 35dd8868..5fdd631f 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -102,7 +102,7 @@

      xml_convert('string')

         ·   Top of Page   ·   User Guide Home -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/index.html b/user_guide/index.html index 15ecf1ea..6c61d126 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -97,7 +97,7 @@

      Who is CodeIgniter For?

      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 58eefac0..83037a94 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -93,8 +93,7 @@

      Subversion Server

      Top of Page   ·   User Guide Home   ·   Next Topic:  Installation Instructions -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index edfa8b53..ba4579b9 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -93,7 +93,7 @@

      Installation Instructions

      Top of Page   ·   User Guide Home   ·   Next Topic:  Upgrading from a Previous Version -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 9813ef2a..cde190b7 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -87,8 +87,7 @@

      Troubleshooting

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index a3f554c4..04871698 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -89,8 +89,7 @@

      Upgrading From Beta 1.0 to Final 1.2

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index f08c8a11..db59e714 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -200,8 +200,7 @@

      Step 6: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 812f5e41..d8dbcef6 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -99,8 +99,7 @@

      Step 2: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 3ae6a83a..1e9aa0a0 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -97,8 +97,7 @@

      Step 2: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 3c0cea6d..654b6415 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -91,7 +91,7 @@

      Step 2: Update your Models

      As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting to your database prior to a model being loaded you will have to update your code. There are several options for connecting, -as described here. +as described here.

      Step 3: Update your user guide

      @@ -109,8 +109,7 @@

      Step 3: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 0a515898..ea8f5a03 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -142,8 +142,7 @@

      Step 3: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 0324508a..614f7278 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -146,8 +146,7 @@

      Step 4: Update your user guide

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 13948655..fcfdf4c6 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -71,7 +71,7 @@

      Upgrading from 1.4.1 to 1.5.0

      Step 1: Update your CodeIgniter files

      -

      Replace these files and directories in your "system" folder with the new versions: +

      Replace these files and directories in your "system" folder with the new versions:

      diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 853e5ce3..b65aebe3 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -71,7 +71,7 @@

      Upgrading from 1.5.0 to 1.5.2

      Step 1: Update your CodeIgniter files

      -

      Replace these files and directories in your "system" folder with the new versions: +

      Replace these files and directories in your "system" folder with the new versions:

      diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 2e999579..1e6d1483 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -68,7 +68,7 @@

      Upgrading from 1.5.2 to 1.5.3

      Step 1: Update your CodeIgniter files

      -

      Replace these files and directories in your "system" folder with the new versions: +

      Replace these files and directories in your "system" folder with the new versions:

      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 793cd2e7..9d2a0c62 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -141,8 +141,7 @@

      Step 5: Edit your config file

      Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter at a Glance -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 2efa1151..ffe9bf89 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -90,8 +90,7 @@

      Upgrading From a Previous Version

      Top of Page   ·   User Guide Home   ·   Next Topic:  Troubleshooting -

      - +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index d92f0730..3568f772 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -88,7 +88,7 @@

      Table of Contents

      Using the Benchmark Class

      -

      The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this: +

      The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this:

      1. Mark a start point
      2. @@ -194,7 +194,7 @@

        Displaying Memory Consumption

        Top of Page   ·   User Guide Home   ·   Next Topic:  Calendaring Class -

        +

        CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index c9779081..01b90fbd 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -246,7 +246,7 @@

      Creating a Calendar Template

      Top of Page   ·   User Guide Home   ·   Next Topic:  Config Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 350831e0..5ab85cc1 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -99,7 +99,7 @@

      Loading a Config File

      If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE -and each config file will be stored in an array index corresponding to the name of the config file. Example: +and each config file will be stored in an array index corresponding to the name of the config file. Example:

      // Stored in an array with this prototype: $this->config['blog_settings'] = $config
      @@ -111,10 +111,8 @@

      Loading a Config File

      $this->config->load('blog_settings', FALSE, TRUE); - - -
    • Auto-loading
    • +
    • Auto-loading

      If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, open the autoload.php file, located at application/config/autoload.php, and add your config file as @@ -136,7 +134,7 @@

      Fetching Config Items

      The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

      If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index -you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example: +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

      // Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
      @@ -180,7 +178,7 @@

      $this->config->system_url();

      Top of Page   ·   User Guide Home   ·   Next Topic:  Database Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    • diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 190dadbd..cd163c63 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -271,7 +271,7 @@

      Overriding Word Wrapping

      If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override -word wrapping within part of your message like this: +word wrapping within part of your message like this:

      The text of your email that
      gets wrapped normally.
      @@ -281,7 +281,7 @@

      Overriding Word Wrapping

      More text that will be
      wrapped normally.
      -

      Place the item you do not want word-wrapped between: {unwrap} {/unwrap} +

      Place the item you do not want word-wrapped between: {unwrap} {/unwrap}

      @@ -295,7 +295,7 @@

      Overriding Word Wrapping

      Top of Page   ·   User Guide Home   ·   Next Topic:  Encryption Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index e3a9762b..c197dc5d 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -140,7 +140,7 @@

      $this->encrypt->decode()

      $this->encrypt->set_cipher();

      -

      Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example: +

      Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

      $this->encrypt->set_cipher(MCRYPT_BLOWFISH);

      Please visit php.net for a list of available ciphers.

      @@ -150,7 +150,7 @@

      $this->encrypt->set_cipher();

      $this->encrypt->set_mode();

      -

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example: +

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example:

      $this->encrypt->set_mode(MCRYPT_MODE_CFB);

      Please visit php.net for a list of available modes.

      @@ -179,7 +179,7 @@

      $this->encrypt->sha1();

      Top of Page   ·   User Guide Home   ·   Next Topic:  File Uploading Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 21fd2a6b..d9a993a7 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -89,26 +89,27 @@

      Creating the Upload Form

      folder:

      - +</body> +</html>

      You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event @@ -120,24 +121,24 @@

      The Success Page

      Using a text editor, create a form called upload_success.php. In it, place this code and save it to your applications/views/ folder:

      - +</body> +</html>

      The Controller

      @@ -428,7 +429,7 @@

      Explanation

      Top of Page   ·   User Guide Home   ·   Next Topic:  FTP Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 9db0021a..c9d1888a 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -300,7 +300,7 @@

      $this->ftp->close();

      Top of Page   ·   User Guide Home   ·   Next Topic:  HTML Table Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 04bd46f8..d3fbe27a 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -288,14 +288,14 @@

      Preferences

      X - + x_axis None None Sets the X coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the left. C - + y_axis None None @@ -661,7 +661,7 @@

      Overlay Preferences

      Top of Page   ·   User Guide Home   ·   Next Topic:  Input Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index f810029a..b6747135 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -108,7 +108,7 @@

      $this->input->xss_clean()

      $data = $this->input->xss_clean($data);

      If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your -application/config/config.php file and setting this: +application/config/config.php file and setting this:

      $config['global_xss_filtering'] = TRUE; @@ -122,7 +122,7 @@

      Using POST, COOKIE, or SERVER Data

      CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather then fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. -In other words, normally you might do something like this: +In other words, normally you might do something like this:

      if ( ! isset($_POST['something']))
      @@ -211,7 +211,7 @@

      $this->input->user_agent()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Loader Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 71dc0b97..6a74cc96 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -132,7 +132,7 @@

      Fetching a Line of Text

      Top of Page   ·   User Guide Home   ·   Next Topic:  Output Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 98bfd1b0..4b4ec4ce 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -85,7 +85,7 @@

      $this->load->library('class_name')

      Each library is described in detail in its own page, so please read the information regarding each one you would like to use.

      -

      Parameters can be passed to the library via an array in the second parameter. +

      Parameters can be passed to the library via an array in the second parameter.

      $this->load->view('file_name', $data, true/false)

      @@ -164,7 +164,7 @@

      $this->load->config('file_name')

      Top of Page   ·   User Guide Home   ·   Next Topic:  Language Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 40858751..10d59026 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -75,7 +75,7 @@

      Output Class

      $this->output->set_output();

      -

      Permits you to manually set the final output string. Usage example:

      +

      Permits you to manually set the final output string. Usage example:

      $this->output->set_output($data); @@ -85,7 +85,7 @@

      $this->output->set_output();

      $this->output->get_output();

      -

      Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

      +

      Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

      $string = $this->output->get_output();

      Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the @@ -94,7 +94,7 @@

      $this->output->get_output();

      $this->output->set_header();

      -

      Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

      +

      Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

      $this->output->set_header("HTTP/1.0 200 OK");
      @@ -131,7 +131,7 @@

      $this->output->enable_profiler();

      Top of Page   ·   User Guide Home   ·   Next Topic:  Pagination Class -

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index fafeb6cf..edb112d3 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -99,7 +99,7 @@

      Notes:

    • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
    -

    The create_links() function returns an empty string when there is no pagination to show. +

    The create_links() function returns an empty string when there is no pagination to show.

    Setting preferences in a config file

    @@ -210,7 +210,7 @@

    $config['num_tag_close'] = '</div>';

    Top of Page   ·   User Guide Home   ·   Next Topic:  Session Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 24bb89ff..e7b7add1 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -207,7 +207,7 @@

    Variable Pairs

    Top of Page   ·   User Guide Home   ·   Next Topic:  Unit Testing Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5a3c4ae2..30e26263 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -286,7 +286,7 @@

    Session Preferences

    Top of Page   ·   User Guide Home   ·   Next Topic:  Trackback Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 28fc76d2..330a3da2 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -119,7 +119,7 @@

    Examples

    echo $this->table->generate();
    -

    Here is the same example, except instead of individual parameters, arrays are used: +

    Here is the same example, except instead of individual parameters, arrays are used:

    $this->load->library('table');
    @@ -289,7 +289,7 @@

    $this->table->clear()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Image Manipulation Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index c54417c8..3dfb2037 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -78,7 +78,7 @@

    Initializing the Class

    Sending Trackbacks

    -

    A Trackback can be sent from any of your controller functions using code similar to this example: +

    A Trackback can be sent from any of your controller functions using code similar to this example:

    $this->load->library('trackback');

    @@ -243,7 +243,7 @@

    Notes:

    Top of Page   ·   User Guide Home   ·   Next Topic:  Template Parser Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index bdd64d04..568bf6c6 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -202,7 +202,7 @@

    Creating a Template

    Top of Page   ·   User Guide Home   ·   Next Topic:  URI Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index ec777057..7efca6dd 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -105,7 +105,7 @@

    $this->uri->segment(n)

    $this->uri->rsegment(n)

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature. +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->slash_segment(n)

    @@ -129,7 +129,7 @@

    $this->uri->slash_segment(n)

    $this->uri->slash_rsegment(n)

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature. +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    @@ -173,8 +173,7 @@

    $this->uri->uri_to_assoc(n)

    $this->uri->ruri_to_assoc(n)

    This function is identical to the previous one, except that it creates an associative array using the -re-routed URI in the event you are using CodeIgniter's URI Routing feature. - +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->assoc_to_uri()

    @@ -203,7 +202,7 @@

    $this->uri->uri_string()

    $this->uri->ruri_string(n)

    This function is identical to the previous one, except that it returns the -re-routed URI in the event you are using CodeIgniter's URI Routing feature. +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    @@ -215,7 +214,7 @@

    $this->uri->total_segments()

    $this->uri->total_rsegments(n)

    This function is identical to the previous one, except that it returns the total number of segments in your -re-routed URI in the event you are using CodeIgniter's URI Routing feature. +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    @@ -250,7 +249,7 @@

    $this->uri->rsegment_array(n)

    Top of Page   ·   User Guide Home   ·   Next Topic:  User Agent Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index e9f6b715..5bb87a76 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -81,7 +81,7 @@

    User Agent Definitions

    Example

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is -a web browser, a mobile device, or a robot. It will also gather the platform information if it is available. +a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    @@ -110,9 +110,6 @@

    Example

    - - -

    Function Reference

    @@ -170,7 +167,7 @@

    $this->agent->accept_lang()

    if ($this->agent->accept_lang('en'))
    {
        echo 'You accept English!';
    -} +}

    Note: This function is not typically very reliable since some browsers do not provide language info, and even among those that do, it is not always accurate.

    @@ -183,7 +180,7 @@

    $this->agent->accept_charset()

    if ($this->agent->accept_charset('utf-8'))
    {
        echo 'You browser supports UTF-8!';
    -} +}

    Note: This function is not typically very reliable since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    @@ -201,7 +198,7 @@

    $this->agent->accept_charset()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Validation Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 8ba45ba4..cd239ea4 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -77,7 +77,7 @@

    Form Validation

  • Check for required data.
  • Verify that the data is of the correct type, and meets the correct criteria. (For example, if a username is submitted it must be validated to contain only permitted characters. It must be of a minimum length, -and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.) +and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.)
  • Sanitize the data for security.
  • Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
  • Prep the data for insertion in the database.
  • @@ -109,34 +109,35 @@

    The Form

    folder:

    - +</body> +</html> +

    The Success Page

    @@ -146,18 +147,20 @@

    The Success Page

    folder:

    - +</body> +</html> +

    The Controller

    @@ -166,7 +169,7 @@

    The Controller

    folder:

    - +</body> +</html> +

    Now reload your page and submit the form so that it triggers an error. Your form fields should be populated @@ -491,22 +496,22 @@

    Showing Errors Individually

    If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

    - +<h5>Email Address</h5> +<?=$this->validation->email_error; ?> +<input type="text" name="email" value="<?=$this->validation->email;?>" size="50" /></textarea>

    If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you have set (<p> tags by default).

    @@ -589,16 +594,13 @@

    Rule Reference

    Returns FALSE if the form element does not contain a valid email address.   - + valid_ip No Returns FALSE if the supplied IP is not valid.   - - -

    Note: These rules can also be called as discreet functions. For example:

    @@ -714,7 +716,7 @@

    set_radio()

    Top of Page   ·   User Guide Home   ·   Next Topic:  XML-RPC Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5d9b9ee6..ba70e11a 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -88,11 +88,11 @@

    Initializing the Class

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    -

    To load the XML-RPC class you will use: +

    To load the XML-RPC class you will use:

    $this->load->library('xmlrpc');

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    -

    To load the XML-RPC Server class you will use: +

    To load the XML-RPC Server class you will use:

    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs'); @@ -193,7 +193,7 @@

    Creating an XML-RPC Server

    $this->xmlrpcs->serve();

    The above example contains an array specifying two method requests that the Server allows. -The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right. +The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    In other words, if an XML-RPC Client sends a request for the new_post method, your server will load the My_blog class and call the new_entry function. @@ -223,7 +223,7 @@

    Processing Server Requests

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. Using this object you will have access to the request parameters enabling you to process the request. When -you are done you will send a Response back to the Client.

    +you are done you will send a Response back to the Client.

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends @@ -486,7 +486,7 @@

    Data Types

    Top of Page   ·   User Guide Home   ·   Next Topic:  Zip Encoding Class -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index e1692234..f92443b5 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -165,7 +165,7 @@

    $this->zip->read_file()

    If you would like the Zip archive to maintain the directory structure the file is in, pass TRUE (boolean) in the -second parameter. Example: +second parameter. Example:

    @@ -275,7 +275,7 @@

    $this->zip->clear_data()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Array Helper -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/license.html b/user_guide/license.html index f938c2cf..d89cce5e 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -104,8 +104,7 @@

    Limitations of Liability

    Top of Page   ·   User Guide Home   ·   Next Topic:  Change Log -

    - +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index d10d038a..ac0f0673 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -92,8 +92,7 @@

    Application Flow Chart

    Top of Page   ·   User Guide Home   ·   Next Topic:  Model-View-Controller -

    - +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index aadfe558..2082b025 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -169,8 +169,7 @@

    CodeIgniter has a Friendly Community of Users

    Top of Page   ·   User Guide Home   ·   Next Topic:  CodeIgniter Features -

    - +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 7033681f..93c9e2f9 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -117,8 +117,7 @@

    CodeIgniter Features

    Top of Page   ·   User Guide Home   ·   Next Topic:  Application Flow Chart -

    - +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index fba6f61a..a596cab5 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -95,7 +95,7 @@

    Design and Architectural Goals

    Top of Page   ·   User Guide Home   ·   Next Topic:  Getting Started -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 133503fa..87316a63 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -81,7 +81,7 @@

    CodeIgniter Overview

    diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index baac03da..fe8d8639 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -97,7 +97,7 @@

    Model-View-Controller

    Top of Page   ·   User Guide Home   ·   Next Topic:  Architectural Goals -

    +

    CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/toc.html b/user_guide/toc.html index 12c16183..88ccaafa 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -193,7 +193,7 @@

    Additional Resources

    From e8256b638a10197b3b4e673a4066db8dedef1581 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 8 Jul 2007 17:05:09 +0000 Subject: [PATCH 0621/2544] typo fix --- user_guide/libraries/image_lib.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index d3fbe27a..7c950f36 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -451,7 +451,7 @@

    Watermarking an Image

    $config['wm_type'] = 'text';
    $config['wm_font_path'] = './system/fonts/texb.ttf';
    $config['wm_font_size'] = '16';
    -$config['wm_text_color'] = 'ffffff';
    +$config['wm_font_color'] = 'ffffff';
    $config['wm_vrt_alignment'] = 'bottom';
    $config['wm_hor_alignment'] = 'center';
    $config['wm_padding'] = '20';
    From 8c51560f3bd5b8dbf291825fc8fe2e2b33936bfa Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 8 Jul 2007 17:06:02 +0000 Subject: [PATCH 0622/2544] --- user_guide/changelog.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c19c3cd6..c8ad1a9b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

    Version 1.5.4

  • Fixed a bug in router that was ignoring the scaffolding route for optimization
  • Fixed an IP validation bug.
  • Fixed various doc typos.
  • +
  • Docs now validate to XHTML 1 transitional
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
  • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
  • @@ -87,8 +88,6 @@

    Version 1.5.4

  • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
  • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
  • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
  • - -

    Version 1.5.3

    Release Date: April 15, 2007

    From c39a41f4615378b9b7b112a1b6cd37f358533493 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 11 Jul 2007 17:26:21 +0000 Subject: [PATCH 0623/2544] fixed log message typo --- system/libraries/User_agent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index b93bd340..ea5db4d7 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -71,7 +71,7 @@ function CI_User_agent() } } - log_message('debug', "Table Class Initialized"); + log_message('debug', "User Agent Class Initialized"); } // -------------------------------------------------------------------- From f5a519822db2201b98f822ad4f8659bad2ce9bcd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 11 Jul 2007 19:35:09 +0000 Subject: [PATCH 0624/2544] inflector helper changes to account for words ending in "s" --- system/helpers/inflector_helper.php | 78 ++++++++++++++---------- user_guide/changelog.html | 3 +- user_guide/helpers/inflector_helper.html | 5 +- 3 files changed, 52 insertions(+), 34 deletions(-) diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index fbe851f3..28ecf520 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -39,26 +39,31 @@ */ function singular($str) { - $str = strtolower(trim($str)); - $end = substr($str, -3); - - if ($end == 'ies') - { - $str = substr($str, 0, strlen($str)-3).'y'; - } - else - { - $end = substr($str, -1); - - if ($end == 's') - { - $str = substr($str, 0, strlen($str)-1); - } - } - - return $str; + $str = strtolower(trim($str)); + $end = substr($str, -3); + + if ($end == 'ies') + { + $str = substr($str, 0, strlen($str)-3).'y'; + } + elseif ($end == 'ses') + { + $str = substr($str, 0, strlen($str)-2); + } + else + { + $end = substr($str, -1); + + if ($end == 's') + { + $str = substr($str, 0, strlen($str)-1); + } + } + + return $str; } + // -------------------------------------------------------------------- /** @@ -68,25 +73,34 @@ function singular($str) * * @access public * @param string + * @param bool * @return str */ -function plural($str) +function plural($str, $force = FALSE) { - $str = strtolower(trim($str)); - $end = substr($str, -1); - - if ($end == 'y') - { - $str = substr($str, 0, strlen($str)-1).'ies'; - } - elseif ($end != 's') - { - $str .= 's'; - } - - return $str; + $str = strtolower(trim($str)); + $end = substr($str, -1); + + if ($end == 'y') + { + $str = substr($str, 0, strlen($str)-1).'ies'; + } + elseif ($end == 's') + { + if ($force == TRUE) + { + $str .= 'es'; + } + } + else + { + $str .= 's'; + } + + return $str; } + // -------------------------------------------------------------------- /** diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c8ad1a9b..5435864d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

    Version 1.5.4

  • Added array to string into the profiler
  • Added some additional mime types in application/config/mimes.php
  • Added filename_security() method to Input library
  • +
  • Added some additional arguements to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize()
  • Fixed MSSQL insert_id().
  • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
  • Fixed a bug that was allowing multiple load attempts on extended classes.
  • @@ -80,7 +81,7 @@

    Version 1.5.4

  • Fixed a bug in router that was ignoring the scaffolding route for optimization
  • Fixed an IP validation bug.
  • Fixed various doc typos.
  • -
  • Docs now validate to XHTML 1 transitional
  • +
  • Docs now validate to XHTML 1 transitional
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
  • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
  • diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 2a4ee559..91de2e20 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -94,8 +94,11 @@

    plural()

    -

    camelize()

    +

    To force a word to end with "es" use a second "true" argument.

    + $word = "pass";
    +echo plural($word); // Returns "passes"
    +

    camelize()

    Changes a string of words separated by spaces or underscores to camel case. Example:

    From 4b7d19d373236d84a493b3b99eccf2f1f71f735b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 11 Jul 2007 19:44:50 +0000 Subject: [PATCH 0625/2544] typo Output vs output --- user_guide/general/controllers.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 5d83edcd..157ce403 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -272,10 +272,10 @@

    Processing Output

    }

    Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered, -cache files written (if you have caching enabled), and headers will be sent (if you use that feature) +cache files written (if you have caching enabled), and headers will be sent (if you use that feature) before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate since they will not take into acccount any further processing you do. For an alternate way to control output before any of the final processing is done, please see -the available methods in the Output Class.

    +the available methods in the Output Class.

    Private Functions

    From 9687c493de92eb71a91ed89723abd4ede977bb3d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Jul 2007 21:43:23 +0000 Subject: [PATCH 0626/2544] bugfix for profiler output: POST keys were not being displayed properly, and queries needed htmlspecialchars() --- system/libraries/Profiler.php | 4 ++-- user_guide/changelog.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ffd664a8..6b1d5ea7 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -123,7 +123,7 @@ function _compile_queries() foreach ($this->CI->db->queries as $val) { $output .= '
    '; - $output .= $val; + $output .= htmlspecialchars($val, ENT_QUOTES); $output .= "
    \n"; } } @@ -166,7 +166,7 @@ function _compile_post() } // $output .= "$_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."\n"; - $output .= "".$_POST[$key]." "; + $output .= "$_POST[".$key."]   "; if (is_array($val)) { $output .= "
    " . htmlspecialchars(stripslashes(print_r($val, true))) . "
    "; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5435864d..eb57d487 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,7 +69,7 @@

    Version 1.5.4

  • Added array to string into the profiler
  • Added some additional mime types in application/config/mimes.php
  • Added filename_security() method to Input library
  • -
  • Added some additional arguements to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize()
  • +
  • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize()
  • Fixed MSSQL insert_id().
  • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
  • Fixed a bug that was allowing multiple load attempts on extended classes.
  • @@ -80,6 +80,8 @@

    Version 1.5.4

  • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
  • Fixed a bug in router that was ignoring the scaffolding route for optimization
  • Fixed an IP validation bug.
  • +
  • Fixed a bug in display of POST keys in the Profiler output
  • +
  • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
  • Fixed various doc typos.
  • Docs now validate to XHTML 1 transitional
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • From 1f2fd2d5db0ff9e91388cec079a9ff58392ab654 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Jul 2007 21:59:12 +0000 Subject: [PATCH 0627/2544] adding type casting of $title argument in URL helper functions to a string. A numeric 0 sent to these functions would evaluate if ($title == '') as TRUE, and type casting seems the more appropriate fix than simply using $title === '', since we're expecting and treating $title as a string. --- system/helpers/url_helper.php | 8 ++++++++ user_guide/changelog.html | 1 + 2 files changed, 9 insertions(+) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index c05bc208..01cd3458 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -90,6 +90,8 @@ function index_page() */ function anchor($uri = '', $title = '', $attributes = '') { + $title = (string) $title; + if ( ! is_array($uri)) { $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; @@ -132,6 +134,8 @@ function anchor($uri = '', $title = '', $attributes = '') */ function anchor_popup($uri = '', $title = '', $attributes = FALSE) { + $title = (string) $title; + $site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri; if ($title == '') @@ -170,6 +174,8 @@ function anchor_popup($uri = '', $title = '', $attributes = FALSE) */ function mailto($email, $title = '', $attributes = '') { + $title = (string) $title; + if ($title == "") { $title = $email; @@ -195,6 +201,8 @@ function mailto($email, $title = '', $attributes = '') */ function safe_mailto($email, $title = '', $attributes = '') { + $title = (string) $title; + if ($title == "") { $title = $email; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index eb57d487..67baae43 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,6 +89,7 @@

    Version 1.5.4

  • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
  • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
  • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
  • +
  • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
  • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
  • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
  • From eea2bdaaffcbee1a9efb56e60ae5712e30873f87 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Jul 2007 22:09:45 +0000 Subject: [PATCH 0628/2544] fixed the plural() and singular() function comments --- system/helpers/inflector_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 28ecf520..49143913 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -31,7 +31,7 @@ /** * Singular * - * Takes a singular word and makes it plural + * Takes a plural word and makes it singular * * @access public * @param string @@ -69,7 +69,7 @@ function singular($str) /** * Plural * - * Takes a plural word and makes it singular + * Takes a singular word and makes it plural * * @access public * @param string From c80593c537117b11e2f75287fc9a18e0d0d2bf5a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Jul 2007 23:40:14 +0000 Subject: [PATCH 0629/2544] type cast $key => $val pair in $options array as strings for friendlier handling of setting options as 'selected' --- system/helpers/form_helper.php | 3 +++ user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 531ab66c..263dc0f1 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -229,6 +229,9 @@ function form_dropdown($name = '', $options = array(), $selected = '', $extra = foreach ($options as $key => $val) { + $key = (string) $key; + $val = (string) $val; + $sel = ($selected != $key) ? '' : ' selected="selected"'; $form .= '\n"; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 67baae43..fbcbc544 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

    Version 1.5.4

  • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
  • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
  • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
  • +
  • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
  • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
  • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
  • From 55c880f6c22fb31b48108b9dacce598f2ee3dbbf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 11 Jul 2007 23:50:33 +0000 Subject: [PATCH 0630/2544] typo --- user_guide/libraries/xmlrpc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index ba70e11a..8e7100e2 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -99,7 +99,7 @@

    Initializing the Class

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    -

    Note:  When using the XML-RPC Sever class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    +

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    From f99f00a5b12f827525f1d280e572515809dc904d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 00:06:01 +0000 Subject: [PATCH 0631/2544] added a missing option --- user_guide/libraries/image_lib.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 7c950f36..5dd7a3bf 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -233,7 +233,7 @@

    Preferences

    None None Sets the width you would like the image set to. -R +R, C @@ -241,7 +241,7 @@

    Preferences

    None None Sets the height you would like the image set to. -R +R, C From 2d2437edf10edf2669dd85e5943bd4061216eef0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 11:32:37 +0000 Subject: [PATCH 0632/2544] fixed quoted-printable in HTML emails, and added htmlspecialchars() to email debugging output --- system/libraries/Email.php | 104 +++++++++++++++++++++++++++++++++++-- user_guide/changelog.html | 2 + 2 files changed, 102 insertions(+), 4 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 7b7dc091..c7aeb33c 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -45,6 +45,11 @@ class CI_Email { 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, + // 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 $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 $_subject = ""; @@ -924,7 +929,7 @@ function _build_message() break; case 'html' : - + $hdr .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline; $hdr .= $this->_get_mime_message() . $this->newline . $this->newline; $hdr .= "--" . $this->_alt_boundary . $this->newline; @@ -934,7 +939,9 @@ function _build_message() $hdr .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline; $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; - $hdr .= "Content-Transfer-Encoding: quoted/printable"; + $hdr .= "Content-Transfer-Encoding: quoted-printable"; + + $this->_body = $this->_prep_quoted_printable($this->_body); if ($this->_get_protocol() == 'mail') { @@ -985,7 +992,9 @@ function _build_message() $hdr .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline; $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; - $hdr .= "Content-Transfer-Encoding: quoted/printable"; + $hdr .= "Content-Transfer-Encoding: quoted-printable"; + + $this->_body = $this->_prep_quoted_printable($this->_body); if ($this->_get_protocol() == 'mail') { @@ -1050,7 +1059,94 @@ function _build_message() } // -------------------------------------------------------------------- + + /** + * Prep Quoted Printable + * + * Prepares string for Quoted-Printable Content-Transfer-Encoding + * Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt + * + * @access public + * @param string + * @param integer + * @return string + */ + function _prep_quoted_printable($str, $charlim = '') + { + // 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') + { + $charlim = '76'; + } + + // Reduce multiple spaces + $str = preg_replace("| +|", " ", $str); + + // Standardize newlines + $str = preg_replace("/\r\n|\r/", "\n", $str); + + // We are intentionally wrapping so mail servers will encode characters + // properly and MUAs will behave, so {unwrap} must go! + $str = str_replace(array('{unwrap}', '{/unwrap}'), '', $str); + + // Break into an array of lines + $lines = preg_split("/\n/", $str); + $escape = '='; + $output = ''; + + foreach ($lines as $line) + { + $length = strlen($line); + $temp = ''; + + // Loop through each character in the line to add soft-wrap + // characters at the end of a line " =\r\n" and add the newly + // processed line(s) to the output (see comment on $crlf class property) + for ($i = 0; $i < $length; $i++) + { + // Grab the next character + $char = substr($line, $i, 1); + $ascii = ord($char); + + // Convert spaces and tabs but only if it's the end of the line + if ($i == ($length - 1)) + { + $char = ($ascii == '32' OR $ascii == '9') ? $escape.sprintf('%02s', dechex($char)) : $char; + } + + // encode = signs + if ($ascii == '61') + { + $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D + } + + // If we're at the character limit, add the line to the output, + // reset our temp variable, and keep on chuggin' + if ((strlen($temp) + strlen($char)) >= $charlim) + { + $output .= $temp.$escape.$this->crlf; + $temp = ''; + } + + // Add the character to our temporary line + $temp .= $char; + } + + // Add our completed line to the output + $output .= $temp.$this->crlf; + } + + // get rid of extra CRLF tacked onto the end + $output = substr($output, 0, strlen($this->crlf) * -1); + + return $output; + } + + // -------------------------------------------------------------------- + /** * Send Email * @@ -1583,7 +1679,7 @@ function print_debugger() } } - $msg .= "
    ".$this->_header_str."\n".$this->_subject."\n".$this->_finalbody.'
    '; + $msg .= "
    ".$this->_header_str."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).'
    '; return $msg; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index fbcbc544..d8ffd8b1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,6 +82,8 @@

    Version 1.5.4

  • Fixed an IP validation bug.
  • Fixed a bug in display of POST keys in the Profiler output
  • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
  • +
  • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
  • +
  • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
  • Fixed various doc typos.
  • Docs now validate to XHTML 1 transitional
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • From c9e2b10f08a3c718e52e287e2dd14b880e4e3057 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 12:14:45 +0000 Subject: [PATCH 0633/2544] added language files to autoload --- system/application/config/autoload.php | 15 +++++++++++++++ system/libraries/Language.php | 5 ----- system/libraries/Loader.php | 25 ++++++++++++++++++------- user_guide/changelog.html | 15 ++++++++------- user_guide/general/autoloader.html | 1 + user_guide/libraries/language.html | 9 +++------ 6 files changed, 45 insertions(+), 25 deletions(-) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index 26e71f74..85b65aa7 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -80,6 +80,21 @@ $autoload['config'] = array(); +/* +| ------------------------------------------------------------------- +| Auto-load Language files +| ------------------------------------------------------------------- +| Prototype: +| +| $autoload['language'] = array('lang1', 'lang2'); +| +| NOTE: Do not include the "_lang" part of your file. For example +| "codeigniter_lang.php" would be referenced as array('codeigniter'); +| +*/ + +$autoload['language'] = array(''); + /* | ------------------------------------------------------------------- | Auto-load Core Libraries diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 26775ec7..94923a3e 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -89,11 +89,6 @@ function load($langfile = '', $idiom = '', $return = FALSE) return; } - if ($return == TRUE) - { - return $lang; - } - $this->is_loaded[] = $langfile; $this->language = array_merge($this->language, $lang); unset($lang); diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index abe3a1c3..7fa46c3a 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -481,13 +481,24 @@ function script($scripts = array()) * Loads a language file * * @access public + * @param array * @param string + * @param bool * @return void */ - function language($file = '', $lang = '', $return = FALSE) + function language($file = array(), $lang = '') { $CI =& get_instance(); - return $CI->lang->load($file, $lang, $return); + + if ( ! is_array($file)) + { + $file = array($file); + } + + foreach ($file as $langfile) + { + $CI->lang->load($langfile, $lang); + } } // -------------------------------------------------------------------- @@ -813,7 +824,7 @@ function _ci_autoloader() return FALSE; } - // Load any custome config file + // Load any custom config file if (count($autoload['config']) > 0) { $CI =& get_instance(); @@ -823,15 +834,15 @@ function _ci_autoloader() } } - // Load plugins, helpers, and scripts - foreach (array('helper', 'plugin', 'script') as $type) - { + // Autoload plugins, helpers, scripts and languages + foreach (array('helper', 'plugin', 'script', 'language') as $type) + { if (isset($autoload[$type]) AND count($autoload[$type]) > 0) { $this->$type($autoload[$type]); } } - + // A little tweak to remain backward compatible // The $autoload['core'] item was deprecated if ( ! isset($autoload['libraries'])) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d8ffd8b1..0456be34 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,11 +65,12 @@

    Change Log

    Version 1.5.4

    Release Date: -- Still under development

      -
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • -
    • Added array to string into the profiler
    • -
    • Added some additional mime types in application/config/mimes.php
    • -
    • Added filename_security() method to Input library
    • -
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize()
    • +
    • Added custom Language files to the autoload options.
    • +
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • +
    • Added array to string into the profiler.
    • +
    • Added some additional mime types in application/config/mimes.php.
    • +
    • Added filename_security() method to Input library.
    • +
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • @@ -80,7 +81,7 @@

      Version 1.5.4

    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • -
    • Fixed a bug in display of POST keys in the Profiler output
    • +
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • @@ -91,7 +92,7 @@

      Version 1.5.4

    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • -
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • +
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 39a0ce65..5ee58dac 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -73,6 +73,7 @@

      Auto-loading Resources

    • Helper files found in the "helpers" folder
    • Plugins found in the "plugins" folder
    • Custom config files found in the "config" folder
    • +
    • Language files found in the "system/language" folder

    To autoload resources, open the application/config/autoload.php file and add the item you want diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 6a74cc96..7cc74b61 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -115,12 +115,9 @@

    Fetching a Line of Text

    Where language_key is the array key corresponding to the line you wish to show.

    Note: This function simply returns the line. It does not echo it for you.

    - - - - - - +

    Auto-loading Languages

    +

    If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

    +

     

    From 7dcd7a3aa4b145fc8a040c16e7c4de9ea35fd5cf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 12:36:50 +0000 Subject: [PATCH 0634/2544] csv_from_result() move robust against data with "," in it. --- system/database/DB_utility.php | 54 ++++++++++++++++++++++------------ user_guide/changelog.html | 1 + 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index d48425d7..8ce19b17 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -236,35 +236,51 @@ function drop_table($table_name) * @param string The newline character - \n by default * @return string */ - function csv_from_result($query, $delim = "\t", $newline = "\n") + function csv_from_result($query, $delim = ',', $newline = '', $enclosure = '"') { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } + if (!is_a($query, 'CI_DB_result')) { + show_error('CI_DB_utility::csv_from_result - You must submit a valid result object'); + } + + if ($delim === '') { + show_error('CI_DB_utility::csv_from_result - Empty delimiters are not permitted'); + } + + if ($newline === '') { + $newline = (stripos(getenv('HTTP_USER_AGENT'), 'win') !== false) ? "\r\n" : "\n"; + } + if ((strpos($enclosure, $newline) !== false) or (($enclosure !== '') and (strpos($newline, $enclosure) !== false))) { + show_error('CI_DB_utility::csv_from_result - Field enclosure must not be contained within delimiter (or vice versa)'); + } + $out = ''; // First generate the headings from the table column names - foreach ($query->list_fields() as $name) - { - $out .= $name.$delim; + foreach ($query->list_fields() as $name) { + // there's no point enclosing strings that do not require it + if (strpos($name, $delim) !== false) { + $out .= $enclosure . $name . $enclosure . $delim; + } else { + $out .= $name . $delim; + } } - $out = rtrim($out); - $out .= $newline; - + $out = rtrim($out, $delim) . $newline; + // Next blast through the result array and build out the rows - foreach ($query->result_array() as $row) - { - foreach ($row as $item) - { - $out .= $item.$delim; + foreach ($query->result_array() as $row) { + foreach ($row as $item) { + // there's no point enclosing strings that do not require it + if (strpos($item, $delim) !== false) { + $out .= $enclosure . $item . $enclosure . $delim; + } else { + $out .= $item . $delim; + } } - $out = rtrim($out); - $out .= $newline; + $out = rtrim($out, $delim) . $newline; } - + return $out; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0456be34..e598e7c6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

    Version 1.5.4

  • Added some additional mime types in application/config/mimes.php.
  • Added filename_security() method to Input library.
  • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
  • +
  • Fiixed a bug in csv_from_result() function that resulted in inproper output.
  • Fixed MSSQL insert_id().
  • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
  • Fixed a bug that was allowing multiple load attempts on extended classes.
  • From 0851530669824b8d5375dc24d5579b9cc5d746ef Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 12:49:54 +0000 Subject: [PATCH 0635/2544] added reduce_double_slashes() and trim_slashes() to docs --- user_guide/helpers/string_helper.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 0858b78e..df7e02ff 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -121,10 +121,15 @@

    repeater()

    echo repeater($string, 30);

    The above would generate 30 newlines.

    - - - - +

    reduce_double_slashes()

    +

    onverts double slashes in a string to a single slash, except those found in http://. Example:

    +$string = "http://www.some-site.com//index.php";
    +echo reduce_double_slashes($string); // results in "http://www.some-site.com/index.php"
    +

    trim_slashes()

    +

    Removes any leading/traling slashes from a string. Example:
    +
    + $string = "/this/that/theother/";
    +echo trim_slashes($string); // results in this/that/theother

    From 178b0a68edd3bcd66ae8ba81a149848f0c196a87 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 12:51:48 +0000 Subject: [PATCH 0636/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e598e7c6..04328f69 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -87,6 +87,7 @@

    Version 1.5.4

  • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
  • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
  • Fixed various doc typos.
  • +
  • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
  • Docs now validate to XHTML 1 transitional
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
  • From 48bb32aece18e9dce381602e242609adfc71b0d0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:10:42 +0000 Subject: [PATCH 0637/2544] further xss_clean() enhancements --- system/libraries/Input.php | 97 ++++++++++++++++++++++++++------------ 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 33f28868..fcca722b 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -538,15 +538,15 @@ function xss_clean($str, $charset = 'ISO-8859-1') * the conversion of entities to ASCII later. * */ - $str = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u',"\\1;",$str); + $str = preg_replace('#(&\#?[0-9a-z]+)[\x00-\x20]*;?#i', "\\1;", $str); /* - * Validate UTF16 two byte encoding (x00) + * Validate UTF16 two byte encoding (x00) * * Just as above, adds a semicolon if missing. * */ - $str = preg_replace('#(&\#x*)([0-9A-F]+);*#iu',"\\1\\2;",$str); + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); /* * URL Decode @@ -580,37 +580,50 @@ function xss_clean($str, $charset = 'ISO-8859-1') $str); } } - + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * NOTE: we deal with spaces between characters later. + * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, + * so we use str_replace. + * + */ + + $str = str_replace("\t", " ", $str); + /* * Not Allowed Under Any Conditions */ $bad = array( 'document.cookie' => '[removed]', + 'document.write' => '[removed]', '.parentNode' => '[removed]', '.innerHTML' => '[removed]', - 'document.write' => '[removed]', 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '' => '-->', + ' '<![CDATA[' + ); + + foreach ($bad as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + $bad = array( "javascript\s*:" => '[removed]', "expression\s*\(" => '[removed]', // CSS and IE - "Redirect\s+302" => '[removed]', - '' => '-->' + "Redirect\s+302" => '[removed]' ); - + foreach ($bad as $key => $val) { $str = preg_replace("#".$key."#i", $val, $str); } - /* - * Convert all tabs to spaces - * - * This prevents strings like this: ja vascript - * Note: we deal with spaces between characters later. - * - */ - $str = preg_replace("#\t+#", " ", $str); - /* * Makes PHP tags safe * @@ -621,7 +634,7 @@ function xss_clean($str, $charset = 'ISO-8859-1') * But it doesn't seem to pose a problem. * */ - $str = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + $str = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); /* * Compact any exploded words @@ -650,10 +663,24 @@ function xss_clean($str, $charset = 'ISO-8859-1') do { $original = $str; - - $str = preg_replace_callback("##si", array($this, '_js_link_removal'), $str); - $str = preg_replace_callback("##si", array($this, '_js_img_removal'), $str); - $str = preg_replace("##si", "", $str); + + if ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && stripos($str, '') !== FALSE) OR + preg_match("/<\/a>/i", $str)) + { + $str = preg_replace_callback("##si", array($this, '_js_link_removal'), $str); + } + + if ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && stripos($str, '#si", array($this, '_js_img_removal'), $str); + } + + if ((version_compare(PHP_VERSION, '5.0', '>=') === TRUE && (stripos($str, 'script') !== FALSE OR stripos($str, 'xss') !== FALSE)) OR + preg_match("/(script|xss)/i", $str)) + { + $str = preg_replace("##si", "", $str); + } } while($original != $str); @@ -706,20 +733,30 @@ function xss_clean($str, $charset = 'ISO-8859-1') */ $bad = array( 'document.cookie' => '[removed]', + 'document.write' => '[removed]', '.parentNode' => '[removed]', '.innerHTML' => '[removed]', - 'document.write' => '[removed]', 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '' => '-->', + ' '<![CDATA[' + ); + + foreach ($bad as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + $bad = array( "javascript\s*:" => '[removed]', "expression\s*\(" => '[removed]', // CSS and IE - "Redirect\s+302" => '[removed]', - '' => '-->' + "Redirect\s+302" => '[removed]' ); - + foreach ($bad as $key => $val) { - $str = preg_replace("#".$key."#i", $val, $str); + $str = preg_replace("#".$key."#i", $val, $str); } @@ -764,7 +801,7 @@ function _js_img_removal($match) } // -------------------------------------------------------------------- - + /** * HTML Entities Decode * From e5808cf64d1177127cc9f26e6f681b412a192339 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:36:56 +0000 Subject: [PATCH 0638/2544] removed $return argument from load() --- system/libraries/Language.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 94923a3e..bcf84cf6 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -49,7 +49,7 @@ function CI_Language() * @param string the language (english, etc.) * @return void */ - function load($langfile = '', $idiom = '', $return = FALSE) + function load($langfile = '', $idiom = '') { $langfile = str_replace(EXT, '', str_replace('_lang.', '', $langfile)).'_lang'.EXT; @@ -82,7 +82,6 @@ function load($langfile = '', $idiom = '', $return = FALSE) } } - if ( ! isset($lang)) { log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); From 3f2fc0d5a9aa13209dd4ec1175a4ee2bc4172408 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:38:18 +0000 Subject: [PATCH 0639/2544] removed empty string element from default $autoload['language'] array --- system/application/config/autoload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index 85b65aa7..90ff6fed 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -93,7 +93,7 @@ | */ -$autoload['language'] = array(''); +$autoload['language'] = array(); /* | ------------------------------------------------------------------- From aa8dc3c191318f261bc43a99e01540231b15e11b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:45:36 +0000 Subject: [PATCH 0640/2544] spelling corrections --- user_guide/helpers/string_helper.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index df7e02ff..9c3adf9a 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -122,11 +122,11 @@

    repeater()

    The above would generate 30 newlines.

    reduce_double_slashes()

    -

    onverts double slashes in a string to a single slash, except those found in http://. Example:

    +

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    $string = "http://www.some-site.com//index.php";
    echo reduce_double_slashes($string); // results in "http://www.some-site.com/index.php"

    trim_slashes()

    -

    Removes any leading/traling slashes from a string. Example:
    +

    Removes any leading/trailing slashes from a string. Example:

    $string = "/this/that/theother/";
    echo trim_slashes($string); // results in this/that/theother

    From 4cf29dd28c1b2d54f9b76d77b6a75afbb8b27854 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:47:28 +0000 Subject: [PATCH 0641/2544] added link to autoloader docs --- user_guide/libraries/language.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 7cc74b61..af56a018 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -116,7 +116,7 @@

    Fetching a Line of Text

    Note: This function simply returns the line. It does not echo it for you.

    Auto-loading Languages

    -

    If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

    +

    If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

     

    From f9a4e9e04589df8dcf808519c95703f16c318384 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 13:56:21 +0000 Subject: [PATCH 0642/2544] fixed undefined function in insert_id() of PostgreSQL driver --- system/database/drivers/postgre/postgre_driver.php | 2 +- user_guide/changelog.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index bfb212cf..79890512 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -230,7 +230,7 @@ function affected_rows() */ function insert_id() { - $v = version($this->conn_id); + $v = $this->_version(); $v = $v['server']; $table = func_num_args() > 0 ? func_get_arg(0) : null; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 04328f69..1d0f3b6b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -83,13 +83,14 @@

    Version 1.5.4

  • Fixed a bug in router that was ignoring the scaffolding route for optimization
  • Fixed an IP validation bug.
  • Fixed a bug in display of POST keys in the Profiler output
  • -
  • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
  • +
  • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
  • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
  • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
  • +
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • +
  • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
  • Fixed various doc typos.
  • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
  • Docs now validate to XHTML 1 transitional
  • -
  • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
  • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
  • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
  • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
  • From 476b87150809861e6963eb26be083086f8ea0464 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 18:22:05 +0000 Subject: [PATCH 0643/2544] csv_from_result buggy. revert to old function until rewrite --- system/database/DB_utility.php | 924 ++++++++++++++++----------------- user_guide/changelog.html | 1 - 2 files changed, 454 insertions(+), 471 deletions(-) diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 8ce19b17..9533ec60 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,471 +1,455 @@ -db - $CI =& get_instance(); - $this->db =& $CI->db; - - log_message('debug', "Database Utility Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function create_database($db_name) - { - $sql = $this->_create_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access public - * @param string the database name - * @return bool - */ - function drop_database($db_name) - { - $sql = $this->_drop_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access public - * @return bool - */ - function list_databases() - { - // Is there a cached result? - if (isset($this->data_cache['db_names'])) - { - return $this->data_cache['db_names']; - } - - $query = $this->db->query($this->_list_databases()); - $dbs = array(); - if ($query->num_rows() > 0) - { - foreach ($query->result_array() as $row) - { - $dbs[] = current($row); - } - } - - $this->data_cache['db_names'] = $dbs; - return $this->data_cache['db_names']; - } - - // -------------------------------------------------------------------- - - /** - * Optimize Table - * - * @access public - * @param string the table name - * @return bool - */ - function optimize_table($table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - $res = $query->result_array(); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Optimize Database - * - * @access public - * @return array - */ - function optimize_database() - { - $result = array(); - foreach ($this->db->list_tables() as $table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Build the result array... - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - $res = current($res); - $key = str_replace($this->db->database.'.', '', current($res)); - $keys = array_keys($res); - unset($res[$keys[0]]); - - $result[$key] = $res; - } - - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Optimize Table - * - * @access public - * @param string the table name - * @return bool - */ - - function repair_table($table_name) - { - $sql = $this->_repair_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access public - * @param string the table name - * @return bool - */ - function drop_table($table_name) - { - $sql = $this->_drop_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Generate CSV from a query result object - * - * @access public - * @param object The query result object - * @param string The delimiter - tab by default - * @param string The newline character - \n by default - * @return string - */ - function csv_from_result($query, $delim = ',', $newline = '', $enclosure = '"') - { - if (!is_a($query, 'CI_DB_result')) { - show_error('CI_DB_utility::csv_from_result - You must submit a valid result object'); - } - - if ($delim === '') { - show_error('CI_DB_utility::csv_from_result - Empty delimiters are not permitted'); - } - - if ($newline === '') { - $newline = (stripos(getenv('HTTP_USER_AGENT'), 'win') !== false) ? "\r\n" : "\n"; - } - - if ((strpos($enclosure, $newline) !== false) or (($enclosure !== '') and (strpos($newline, $enclosure) !== false))) { - show_error('CI_DB_utility::csv_from_result - Field enclosure must not be contained within delimiter (or vice versa)'); - } - - $out = ''; - - // First generate the headings from the table column names - foreach ($query->list_fields() as $name) { - // there's no point enclosing strings that do not require it - if (strpos($name, $delim) !== false) { - $out .= $enclosure . $name . $enclosure . $delim; - } else { - $out .= $name . $delim; - } - } - - $out = rtrim($out, $delim) . $newline; - - // Next blast through the result array and build out the rows - foreach ($query->result_array() as $row) { - foreach ($row as $item) { - // there's no point enclosing strings that do not require it - if (strpos($item, $delim) !== false) { - $out .= $enclosure . $item . $enclosure . $delim; - } else { - $out .= $item . $delim; - } - } - $out = rtrim($out, $delim) . $newline; - } - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Generate XML data from a query result object - * - * @access public - * @param object The query result object - * @param array Any preferences - * @return string - */ - function xml_from_result($query, $params = array()) - { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } - - // Set our default values - foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) - { - if ( ! isset($params[$key])) - { - $params[$key] = $val; - } - } - - // Create variables for convenience - extract($params); - - // Load the xml helper - $CI =& get_instance(); - $CI->load->helper('xml'); - - // Generate the result - $xml = "<{$root}>".$newline; - foreach ($query->result_array() as $row) - { - $xml .= $tab."<{$element}>".$newline; - - foreach ($row as $key => $val) - { - $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; - } - $xml .= $tab."".$newline; - } - $xml .= "".$newline; - - return $xml; - } - - // -------------------------------------------------------------------- - - /** - * Database Backup - * - * @access public - * @return void - */ - function backup($params = array()) - { - // If the parameters have not been submitted as an - // array then we know that it is simply the table - // name, which is a valid short cut. - if (is_string($params)) - { - $params = array('tables' => $params); - } - - // ------------------------------------------------------ - - // Set up our default preferences - $prefs = array( - 'tables' => array(), - 'ignore' => array(), - 'filename' => '', - 'format' => 'gzip', // gzip, zip, txt - 'add_drop' => TRUE, - 'add_insert' => TRUE, - 'newline' => "\n" - ); - - // Did the user submit any preferences? If so set them.... - if (count($params) > 0) - { - foreach ($prefs as $key => $val) - { - if (isset($params[$key])) - { - $prefs[$key] = $params[$key]; - } - } - } - - // ------------------------------------------------------ - - // Are we backing up a complete database or individual tables? - // If no table names were submitted we'll fetch the entire table list - if (count($prefs['tables']) == 0) - { - $prefs['tables'] = $this->db->list_tables(); - } - - // ------------------------------------------------------ - - // Validate the format - if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) - { - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Is the encoder supported? If not, we'll either issue an - // error or use plain text depending on the debug settings - if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) - OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_compression'); - } - - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Set the filename if not provided - Only needed with Zip files - if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') - { - $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; - $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); - } - - // ------------------------------------------------------ - - // Was a Gzip file requested? - if ($prefs['format'] == 'gzip') - { - return gzencode($this->_backup($prefs)); - } - - // ------------------------------------------------------ - - // Was a text file requested? - if ($prefs['format'] == 'txt') - { - return $this->_backup($prefs); - } - - // ------------------------------------------------------ - - // Was a Zip file requested? - if ($prefs['format'] == 'zip') - { - // If they included the .zip file extension we'll remove it - if (preg_match("|.+?\.zip$|", $prefs['filename'])) - { - $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); - } - - // Tack on the ".sql" file extension if needed - if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) - { - $prefs['filename'] .= '.sql'; - } - - // Load the Zip class and output it - - $CI =& get_instance(); - $CI->load->library('zip'); - $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); - return $CI->zip->get_zip(); - } - - } - - - - - - -} - +db + $CI =& get_instance(); + $this->db =& $CI->db; + + log_message('debug', "Database Utility Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Create database + * + * @access public + * @param string the database name + * @return bool + */ + function create_database($db_name) + { + $sql = $this->_create_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access public + * @param string the database name + * @return bool + */ + function drop_database($db_name) + { + $sql = $this->_drop_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access public + * @return bool + */ + function list_databases() + { + // Is there a cached result? + if (isset($this->data_cache['db_names'])) + { + return $this->data_cache['db_names']; + } + + $query = $this->db->query($this->_list_databases()); + $dbs = array(); + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $dbs[] = current($row); + } + } + + $this->data_cache['db_names'] = $dbs; + return $this->data_cache['db_names']; + } + + // -------------------------------------------------------------------- + + /** + * Optimize Table + * + * @access public + * @param string the table name + * @return bool + */ + function optimize_table($table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + $res = $query->result_array(); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Optimize Database + * + * @access public + * @return array + */ + function optimize_database() + { + $result = array(); + foreach ($this->db->list_tables() as $table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Build the result array... + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + $res = current($res); + $key = str_replace($this->db->database.'.', '', current($res)); + $keys = array_keys($res); + unset($res[$keys[0]]); + + $result[$key] = $res; + } + + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Optimize Table + * + * @access public + * @param string the table name + * @return bool + */ + + function repair_table($table_name) + { + $sql = $this->_repair_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access public + * @param string the table name + * @return bool + */ + function drop_table($table_name) + { + $sql = $this->_drop_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Generate CSV from a query result object + * + * @access public + * @param object The query result object + * @param string The delimiter - tab by default + * @param string The newline character - \n by default + * @return string + */ + function csv_from_result($query, $delim = "\t", $newline = "\n") + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + $out = ''; + + // First generate the headings from the table column names + foreach ($query->list_fields() as $name) + { + $out .= $name.$delim; + } + + $out = rtrim($out); + $out .= $newline; + + // Next blast through the result array and build out the rows + foreach ($query->result_array() as $row) + { + foreach ($row as $item) + { + $out .= $item.$delim; + } + $out = rtrim($out); + $out .= $newline; + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Generate XML data from a query result object + * + * @access public + * @param object The query result object + * @param array Any preferences + * @return string + */ + function xml_from_result($query, $params = array()) + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + // Set our default values + foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) + { + if ( ! isset($params[$key])) + { + $params[$key] = $val; + } + } + + // Create variables for convenience + extract($params); + + // Load the xml helper + $CI =& get_instance(); + $CI->load->helper('xml'); + + // Generate the result + $xml = "<{$root}>".$newline; + foreach ($query->result_array() as $row) + { + $xml .= $tab."<{$element}>".$newline; + + foreach ($row as $key => $val) + { + $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; + } + $xml .= $tab."".$newline; + } + $xml .= "".$newline; + + return $xml; + } + + // -------------------------------------------------------------------- + + /** + * Database Backup + * + * @access public + * @return void + */ + function backup($params = array()) + { + // If the parameters have not been submitted as an + // array then we know that it is simply the table + // name, which is a valid short cut. + if (is_string($params)) + { + $params = array('tables' => $params); + } + + // ------------------------------------------------------ + + // Set up our default preferences + $prefs = array( + 'tables' => array(), + 'ignore' => array(), + 'filename' => '', + 'format' => 'gzip', // gzip, zip, txt + 'add_drop' => TRUE, + 'add_insert' => TRUE, + 'newline' => "\n" + ); + + // Did the user submit any preferences? If so set them.... + if (count($params) > 0) + { + foreach ($prefs as $key => $val) + { + if (isset($params[$key])) + { + $prefs[$key] = $params[$key]; + } + } + } + + // ------------------------------------------------------ + + // Are we backing up a complete database or individual tables? + // If no table names were submitted we'll fetch the entire table list + if (count($prefs['tables']) == 0) + { + $prefs['tables'] = $this->db->list_tables(); + } + + // ------------------------------------------------------ + + // Validate the format + if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) + { + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Is the encoder supported? If not, we'll either issue an + // error or use plain text depending on the debug settings + if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) + OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_compression'); + } + + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Set the filename if not provided - Only needed with Zip files + if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') + { + $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; + $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); + } + + // ------------------------------------------------------ + + // Was a Gzip file requested? + if ($prefs['format'] == 'gzip') + { + return gzencode($this->_backup($prefs)); + } + + // ------------------------------------------------------ + + // Was a text file requested? + if ($prefs['format'] == 'txt') + { + return $this->_backup($prefs); + } + + // ------------------------------------------------------ + + // Was a Zip file requested? + if ($prefs['format'] == 'zip') + { + // If they included the .zip file extension we'll remove it + if (preg_match("|.+?\.zip$|", $prefs['filename'])) + { + $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); + } + + // Tack on the ".sql" file extension if needed + if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) + { + $prefs['filename'] .= '.sql'; + } + + // Load the Zip class and output it + + $CI =& get_instance(); + $CI->load->library('zip'); + $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); + return $CI->zip->get_zip(); + } + + } + + + + + + +} + ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 1d0f3b6b..468f42c0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,7 +71,6 @@

    Version 1.5.4

  • Added some additional mime types in application/config/mimes.php.
  • Added filename_security() method to Input library.
  • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
  • -
  • Fiixed a bug in csv_from_result() function that resulted in inproper output.
  • Fixed MSSQL insert_id().
  • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
  • Fixed a bug that was allowing multiple load attempts on extended classes.
  • From 33d1056c454eeb5e4484ff4454f78da9dc2a3ec5 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 18:44:13 +0000 Subject: [PATCH 0644/2544] sacked duplicate and incorrect version of _version()! --- system/database/drivers/mssql/mssql_driver.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index aef8da92..e4a2960e 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -69,19 +69,6 @@ function db_select() // -------------------------------------------------------------------- - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - /** * Execute the query * From 303c9cb958a52ef2d13e985da397cb49590113b0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 19:12:37 +0000 Subject: [PATCH 0645/2544] added attribute and html entity decode callbacks to xss_clean() --- system/libraries/Input.php | 80 ++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 11 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index fcca722b..ba94d854 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -519,7 +519,7 @@ function filename_security($str) * @param string * @return string */ - function xss_clean($str, $charset = 'ISO-8859-1') + function xss_clean($str) { /* * Remove Null Characters @@ -564,23 +564,46 @@ function xss_clean($str, $charset = 'ISO-8859-1') $str = str_replace('9u3iovBnRThju941s89rKozm', "%20", $str); /* - * Convert character entities to ASCII + * Convert character entities to ASCII * * This permits our tests below to work reliably. * We only convert entities that are within tags since * these are the ones that will pose security problems. * */ - if (preg_match_all("/<(.+?)>/si", $str, $matches)) - { - for ($i = 0; $i < count($matches['0']); $i++) + + $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_attribute_conversion'), $str); + + $str = preg_replace_callback("/<([\w]+)[^>]*>/si", array($this, '_html_entity_decode_callback'), $str); + + /* + + Old Code that when modified to use preg_replace()'s above became more efficient memory-wise + + if (preg_match_all("/[a-z]+=([\'\"]).*?\\1/si", $str, $matches)) + { + for ($i = 0; $i < count($matches[0]); $i++) + { + if (stristr($matches[0][$i], '>')) + { + $str = str_replace( $matches['0'][$i], + str_replace('>', '<', $matches[0][$i]), + $str); + } + } + } + + if (preg_match_all("/<([\w]+)[^>]*>/si", $str, $matches)) + { + for ($i = 0; $i < count($matches[0]); $i++) { - $str = str_replace($matches['1'][$i], - $this->_html_entity_decode($matches['1'][$i], $charset), + $str = str_replace($matches[0][$i], + $this->_html_entity_decode($matches[0][$i], $charset), $str); } } - + */ + /* * Convert all tabs to spaces * @@ -801,7 +824,42 @@ function _js_img_removal($match) } // -------------------------------------------------------------------- - + + /** + * Attribute Conversion + * + * Used as a callback for XSS Clean + * + * @access public + * @param array + * @return string + */ + function _attribute_conversion($match) + { + return str_replace('>', '<', $match[0]); + } + + // -------------------------------------------------------------------- + + /** + * HTML Entity Decode Callback + * + * Used as a callback for XSS Clean + * + * @access public + * @param array + * @return string + */ + function _html_entity_decode_callback($match) + { + $CI =& get_instance(); + $charset = $CI->config->item('charset'); + + return $this->_html_entity_decode($match[0], strtoupper($charset)); + } + + // -------------------------------------------------------------------- + /** * HTML Entities Decode * @@ -826,10 +884,10 @@ function _js_img_removal($match) character set, and the PHP developers said they were not back porting the fix to versions other than PHP 5.x. */ - function _html_entity_decode($str, $charset='ISO-8859-1') + function _html_entity_decode($str, $charset='UTF-8') { if (stristr($str, '&') === FALSE) return $str; - + // 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 From b940ebc2d8f7b830c877777a14259da4927ce3fe Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 12 Jul 2007 19:15:09 +0000 Subject: [PATCH 0646/2544] added $config['charset'] --- system/application/config/config.php | 10 ++++++++++ user_guide/changelog.html | 1 + 2 files changed, 11 insertions(+) diff --git a/system/application/config/config.php b/system/application/config/config.php index 941d9c30..f0ba241f 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -68,6 +68,16 @@ */ $config['language'] = "english"; +/* +|-------------------------------------------------------------------------- +| Default Character Set +|-------------------------------------------------------------------------- +| +| This determines which character set is used by default in various methods +| that require a character set to be provided. +| +*/ +$config['charset'] = "UTF-8"; /* |-------------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 468f42c0..8113f378 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

    Version 1.5.4

  • Added some additional mime types in application/config/mimes.php.
  • Added filename_security() method to Input library.
  • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
  • +
  • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
  • Fixed MSSQL insert_id().
  • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
  • Fixed a bug that was allowing multiple load attempts on extended classes.
  • From 60ca9b7c03d576eb8b83759ca04eaf21e25e1d9c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 19:53:27 +0000 Subject: [PATCH 0647/2544] moved version number up in docs and CI_VERSION --- system/codeigniter/CodeIgniter.php | 2 +- user_guide/changelog.html | 4 ++-- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 104 files changed, 105 insertions(+), 105 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 987478f9..1cd66a18 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -28,7 +28,7 @@ */ // CI Version -define('CI_VERSION', '1.5.3'); +define('CI_VERSION', '1.5.4'); /* * ------------------------------------------------------ diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8113f378..bea7e5dc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -33,7 +33,7 @@
    - +

    CodeIgniter User Guide Version 1.5.3

    CodeIgniter User Guide Version 1.5.4

    @@ -63,7 +63,7 @@

    Change Log

    Version 1.5.4

    -

    Release Date: -- Still under development

    +

    Release Date: -- July 12

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 573c6740..59a80050 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 2e4d16e4..fa67a52f 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index b439d446..1e891d1e 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 774790c6..c97e93fd 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index e44c145e..0586c5d3 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 0d8faf3c..31893e4e 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index c01caae9..3b4978db 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index e6d0e461..e9bc4a2e 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/index.html b/user_guide/database/index.html index c2523329..39bd6055 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 013d64f3..6c94f4c7 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index f6c1be12..fedbc112 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 13b96681..e848372d 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 75aa4e88..cf41f95b 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 7de0ea3e..801dc2db 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 7498587c..579ae4cc 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 58f2b06a..e13f0216 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 5ee58dac..4c910a86 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index a881f2d4..c8e5f589 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 157ce403..9e2ec0ab 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index fa467cb2..20641cf8 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index b3eaf3d7..b2c66321 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 97aef01b..87f058ac 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index d78dd494..9e78bfdd 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index a91c8c21..50bd34c6 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 0776e32c..daf99e87 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 2d5148b3..525db5bd 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 4efd5eef..5f59e730 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 836f0c86..80567a1b 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 6758ceb8..901862ab 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 2fde9272..51b5192f 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index a73f0098..5e874f4d 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 9680cbd5..a1e2b513 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 1aa0d78a..a7181997 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 2cd0d2f4..0ae2e4ce 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 125732e8..c9325b91 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 24bfe1c4..942fb73f 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 21031aff..4bacfa4d 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 737146db..03fc7a45 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 7057c336..adf532e9 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index a81a498d..0f5411a7 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 00f00ad7..7850fafb 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 8f1027a8..3f89fd39 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index bd5b7483..e19ad1a2 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 3139569a..f3654ed6 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 572f2a20..599d86c2 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 620cb104..e7affb0e 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 1c8935d2..5814e62e 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 91de2e20..0888299c 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 7ba8a83c..08264919 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 1603e165..528c91c2 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 9c3adf9a..1fb5514c 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 260fad4a..190352d2 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 48cae2d3..388e4cea 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index f2dc765b..7606c7a9 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 5fdd631f..78fa2bcd 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/index.html b/user_guide/index.html index 6c61d126..ab1f85f6 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 83037a94..4c55adeb 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index ba4579b9..4d543333 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index cde190b7..d7858aff 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 04871698..e0f7e07b 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index db59e714..906154ae 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index d8dbcef6..de9d3427 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 1e9aa0a0..e07b06f6 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 654b6415..86074f05 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index ea8f5a03..eead224b 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 614f7278..d8b95a0b 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index fcfdf4c6..7d469274 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index b65aebe3..9aa58326 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 1e6d1483..0bc3a00e 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 9d2a0c62..4ba53c34 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index ffe9bf89..b8008d0f 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 3568f772..6365c1cf 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 01b90fbd..275d7509 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 5ab85cc1..e0ba05f0 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index cd163c63..9583de2f 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index c197dc5d..0504ac8c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index d9a993a7..2c0e4ec6 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index c9d1888a..5520b512 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 5dd7a3bf..4a0e5d07 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index b6747135..480cb6b5 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index af56a018..99b5078b 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 4b4ec4ce..28f9564a 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 10d59026..634ae85f 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index edb112d3..e7ca83e9 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index e7b7add1..7715fe38 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 30e26263..8349bd45 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 330a3da2..e6b6b994 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 3dfb2037..799c5668 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 568bf6c6..3ead5663 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7efca6dd..bc831a21 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 5bb87a76..8c770885 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index cd239ea4..f5ef9cef 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 8e7100e2..5d54ecae 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index f92443b5..8b7e6aa8 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/license.html b/user_guide/license.html index d89cce5e..0b777dda 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index ac0f0673..b2327f95 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 2082b025..04763629 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 93c9e2f9..8ee7895d 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index a596cab5..8b564640 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 87316a63..03b6ed0c 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index fe8d8639..fe960f6e 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -33,7 +33,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      diff --git a/user_guide/toc.html b/user_guide/toc.html index 88ccaafa..b3b1b27d 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -34,7 +34,7 @@
      - +

      CodeIgniter User Guide Version 1.5.3

      CodeIgniter User Guide Version 1.5.4

      From 593712b25007d78c87a76221ffa186b72dd52095 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 20:01:19 +0000 Subject: [PATCH 0648/2544] added a comment re: autoloading languages --- system/application/config/autoload.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index 90ff6fed..8bb4181b 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -22,6 +22,7 @@ | 2. Helper files | 3. Plugins | 4. Custom config files +| 5. Language files | */ From 5ec4c15b47756f9291dcb67913bf0776b95e6f2e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Jul 2007 20:14:36 +0000 Subject: [PATCH 0649/2544] added update instructions --- user_guide/installation/upgrade_154.html | 121 +++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 user_guide/installation/upgrade_154.html diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html new file mode 100644 index 00000000..5028ad61 --- /dev/null +++ b/user_guide/installation/upgrade_154.html @@ -0,0 +1,121 @@ + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 1.5.4

      +
      + + + + + + + + + +
      + + +
      + + + +
      + +

      Upgrading from 1.5.3 to 1.5.4

      + +

      Before performing an update you should take your site offline by replacing the index.php file with a static one.

      + + + +

      Step 1: Update your CodeIgniter files

      + +

      Replace these files and directories in your "system" folder with the new versions:

      + +
        + +
      • system/application/config/mimes.php
      • +
      • system/codeigniter
      • +
      • system/database
      • +
      • system/helpers
      • +
      • system/libraries
      • +
      • system/plugins
      • +
      + +

      Note: If you have any custom developed files in these folders please make copies of them first.

      + +

      Step 2: Add charset to your config.php

      +

      Add the following to system/application/config/config.php

      +/*
      + |--------------------------------------------------------------------------
      + | Default Character Set
      + |--------------------------------------------------------------------------
      + |
      + | This determines which character set is used by default in various methods
      + | that require a character set to be provided.
      + |
      + */
      + $config['charset'] = "UTF-8";
      + +

      Step 3: Autoloading language files

      +

      If you want to autoload any language files, add this line to system/application/config/autoload.php

      +$autoload['language'] = array(); + +

      Step 4: Update your user guide

      +

      Please also replace your local copy of the user guide with the new version.

      + +
      + + + + + + + \ No newline at end of file From 3a31d6ca5bd2cfd4fc86b3d2fefe43f20f39a315 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 12 Jul 2007 22:39:15 +0000 Subject: [PATCH 0650/2544] --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bea7e5dc..b34c4a80 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,7 +63,7 @@

      Change Log

      Version 1.5.4

      -

      Release Date: -- July 12

      +

      Release Date: July 12, 2007

      • Added custom Language files to the autoload options.
      • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
      • From 90fc544b30d3d9ecb3e8106af20cd79ced924d61 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 12 Jul 2007 22:57:44 +0000 Subject: [PATCH 0651/2544] --- user_guide/installation/upgrading.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index b8008d0f..182953cc 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -65,6 +65,7 @@

        Upgrading From a Previous Version

        Please read the upgrade notes corresponding to the version you are upgrading from.

          +
        • Upgrading from 1.5.3 to 1.5.4
        • Upgrading from 1.5.2 to 1.5.3
        • Upgrading from 1.5.0 or 1.5.1 to 1.5.2
        • Upgrading from 1.4.1 to 1.5.0
        • From 01864da61dce14397571a0e80774824f346c19fd Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 12 Jul 2007 22:58:12 +0000 Subject: [PATCH 0652/2544] --- user_guide/installation/downloads.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 4c55adeb..983bf982 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -63,7 +63,8 @@

          Downloading CodeIgniter

            -
          • CodeIgniter V 1.5.3 (Current version)
          • +
          • CodeIgniter V 1.5.4 (Current version)
          • +
          • CodeIgniter V 1.5.3
          • CodeIgniter V 1.5.2
          • CodeIgniter V 1.5.1
          • CodeIgniter V 1.4.1
          • From 6afaff2233a39736ff79a24dc3ce9d0972e11e52 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 12 Jul 2007 23:07:48 +0000 Subject: [PATCH 0653/2544] --- user_guide/libraries/zip.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 8b7e6aa8..f3ce2006 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -184,7 +184,7 @@

            $this->zip->read_dir()

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encodes, as will any sub-folders contained within it. Example:

            +supplied path will be encoded, as will any sub-folders contained within it. Example:

            $path = '/path/to/your/directory/';

            From 9a6e40fc2b34a03d9727012e7ec69a5f12242e6f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 14 Jul 2007 13:46:59 +0000 Subject: [PATCH 0654/2544] corrected version numbers --- user_guide/installation/upgrade_141.html | 3 +-- user_guide/installation/upgrade_153.html | 3 +-- user_guide/installation/upgrade_154.html | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index d8b95a0b..29103e4a 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -47,8 +47,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Upgrading from 1.3.3 to 1.4.0 - +Upgrading from 1.4.0 to 1.4.1
            Search User Guide   
            diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 0bc3a00e..5bc3fd29 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -46,8 +46,7 @@ CodeIgniter Home  ›  -User Guide Home  ›  -Upgrading from 1.5.0 to 1.5.2 +User Guide Home  › Upgrading from 1.5.2 to 1.5.3
            Search User Guide   
            diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 5028ad61..3d8d1ba0 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -47,7 +47,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Upgrading from 1.5.0 to 1.5.2 +Upgrading from 1.5.3 to 1.5.4
            Search User Guide   
            From 060052de1f91b9b1fc533d0957eb18dab9057bfe Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 14 Jul 2007 14:26:13 +0000 Subject: [PATCH 0655/2544] Fixed a bug in database driver where num_rows property wasn't getting updated --- system/database/DB_driver.php | 3 ++- user_guide/changelog.html | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 8f238fc5..381b70f4 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -325,7 +325,8 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $RES = new $driver(); $RES->conn_id = $this->conn_id; $RES->result_id = $this->result_id; - + $RES->num_rows = $RES->num_rows(); + if ($this->dbdriver == 'oci8') { $RES->stmt_id = $this->stmt_id; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b34c4a80..3e9db57c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,11 +62,17 @@

            Change Log

            +

            Version 1.5.5

            +

            Release Date: -- still in development

            +
              +
            • Fixed a bug in database driver where num_rows property wasn't getting updated
            • +

            Version 1.5.4

            Release Date: July 12, 2007

            +
            • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
            • Added array to string into the profiler.
            • Added some additional mime types in application/config/mimes.php.
            • Added filename_security() method to Input library.
            • From 88c6bba4e6f5184a8a7349728b8250b8030d0706 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 15:06:08 +0000 Subject: [PATCH 0656/2544] changed ImageColorAllocate to imagecolorallocate --- system/plugins/captcha_pi.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index e16a214b..7d1694f2 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -250,9 +250,9 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = // Assign colors // ----------------------------------- - $bg_color = ImageColorAllocate($im, 255, 255, 255); - $border_color = ImageColorAllocate($im, 153, 102, 102); - $text_color = ImageColorAllocate($im, 204, 153, 153); + $bg_color = imagecolorallocate ($im, 255, 255, 255); + $border_color = imagecolorallocate ($im, 153, 102, 102); + $text_color = imagecolorallocate ($im, 204, 153, 153); $grid_color = imagecolorallocate($im, 255, 182, 182); $shadow_color = imagecolorallocate($im, 255, 240, 240); From ce5055fd782dcc79c2aff2e0bfa016f41909506e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 15:08:22 +0000 Subject: [PATCH 0657/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3e9db57c..6f21a27b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

              Version 1.5.5

              Release Date: -- still in development

              • Fixed a bug in database driver where num_rows property wasn't getting updated
              • +
              • Fixed a bug in captcha calling an invalid PHP function

              Version 1.5.4

              Release Date: July 12, 2007

              From 669f999dcd1002c941066c83f89d856bcf057f2b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 15:21:36 +0000 Subject: [PATCH 0658/2544] Fixed a typo ("cal_mayl") in English calendar language file --- system/language/english/calendar_lang.php | 97 ++++++++++++----------- user_guide/changelog.html | 3 +- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php index 02475e1f..f044606b 100644 --- a/system/language/english/calendar_lang.php +++ b/system/language/english/calendar_lang.php @@ -1,49 +1,50 @@ - \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6f21a27b..915ce262 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,7 +66,8 @@

              Version 1.5.5

              Release Date: -- still in development

              • Fixed a bug in database driver where num_rows property wasn't getting updated
              • -
              • Fixed a bug in captcha calling an invalid PHP function
              • +
              • Fixed a bug in captcha calling an invalid PHP function
              • +
              • Fixed a typo ("cal_mayl") in English calendar language file

              Version 1.5.4

              Release Date: July 12, 2007

              From 5f41eddda985b85763c0b275a411b2503ca51496 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 17:45:36 +0000 Subject: [PATCH 0659/2544] revert calendar change... I'm an idiot --- system/language/english/calendar_lang.php | 3 +-- user_guide/changelog.html | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php index f044606b..9ee4a5e6 100644 --- a/system/language/english/calendar_lang.php +++ b/system/language/english/calendar_lang.php @@ -37,8 +37,7 @@ $lang['cal_february'] = "February"; $lang['cal_march'] = "March"; $lang['cal_april'] = "April"; -$lang['cal_mayl'] = "May"; // typo, left in for backwards compatibility -$lang['cal_may'] = "May"; // fix typo +$lang['cal_mayl'] = "May"; $lang['cal_june'] = "June"; $lang['cal_july'] = "July"; $lang['cal_august'] = "August"; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 915ce262..0206bc50 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,7 +67,6 @@

              Version 1.5.5

              • Fixed a bug in database driver where num_rows property wasn't getting updated
              • Fixed a bug in captcha calling an invalid PHP function
              • -
              • Fixed a typo ("cal_mayl") in English calendar language file

              Version 1.5.4

              Release Date: July 12, 2007

              From 79ecefd0ec2cc7e2bcf35fad4f80e22d9ac70e16 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 22:49:07 +0000 Subject: [PATCH 0660/2544] fix for scaffolding --- system/libraries/Language.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/libraries/Language.php b/system/libraries/Language.php index bcf84cf6..26775ec7 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -49,7 +49,7 @@ function CI_Language() * @param string the language (english, etc.) * @return void */ - function load($langfile = '', $idiom = '') + function load($langfile = '', $idiom = '', $return = FALSE) { $langfile = str_replace(EXT, '', str_replace('_lang.', '', $langfile)).'_lang'.EXT; @@ -82,12 +82,18 @@ function load($langfile = '', $idiom = '') } } + if ( ! isset($lang)) { log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); return; } + if ($return == TRUE) + { + return $lang; + } + $this->is_loaded[] = $langfile; $this->language = array_merge($this->language, $lang); unset($lang); From 873c722774f8cc43c737b5ee0befd8e6a0796bc8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 23:03:05 +0000 Subject: [PATCH 0661/2544] further scaffolding language fixes --- system/libraries/Loader.php | 13 +++++++++++++ system/scaffolding/Scaffolding.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 7fa46c3a..ee99696a 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -500,6 +500,19 @@ function language($file = array(), $lang = '') $CI->lang->load($langfile, $lang); } } + + /** + * Loads a language file + * + * @access public + * @param string + * @return void + */ + function scaffold_language($file = '', $lang = '', $return = FALSE) + { + $CI =& get_instance(); + return $CI->lang->load($file, $lang, $return); + } // -------------------------------------------------------------------- diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index fe2744e7..6f4babd9 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -73,7 +73,7 @@ function Scaffolding($db_table) $this->CI->load->vars($data); // Load the language file and create variables - $this->lang = $this->CI->load->language('scaffolding', '', TRUE); + $this->lang = $this->CI->load->scaffold_language('scaffolding', '', TRUE); $this->CI->load->vars($this->lang); // Load the helper files we plan to use From 5808a11cedc9bc825450dc3d652e0a4a45b02b4f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jul 2007 23:19:08 +0000 Subject: [PATCH 0662/2544] comment clean up --- system/libraries/Loader.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index ee99696a..2e762e9f 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -483,7 +483,6 @@ function script($scripts = array()) * @access public * @param array * @param string - * @param bool * @return void */ function language($file = array(), $lang = '') @@ -502,11 +501,11 @@ function language($file = array(), $lang = '') } /** - * Loads a language file + * Loads language files for scaffolding * * @access public * @param string - * @return void + * @return arra */ function scaffold_language($file = '', $lang = '', $return = FALSE) { From 329c17081025c11432dac0c9be6296c1c3808817 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 16 Jul 2007 00:02:28 +0000 Subject: [PATCH 0663/2544] --- user_guide/changelog.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0206bc50..c3bc9aed 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,8 +72,7 @@

              Version 1.5.4

              Release Date: July 12, 2007

              -
              • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
              • +
              • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
              • Added array to string into the profiler.
              • Added some additional mime types in application/config/mimes.php.
              • Added filename_security() method to Input library.
              • From 9e91094b9eaa9155781b6c87f69aa8d1efb7fe7d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 16 Jul 2007 00:02:38 +0000 Subject: [PATCH 0664/2544] --- user_guide/changelog.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c3bc9aed..1864c798 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,11 @@

                Version 1.5.5

              • Fixed a bug in database driver where num_rows property wasn't getting updated
              • Fixed a bug in captcha calling an invalid PHP function
              + + + + +

              Version 1.5.4

              Release Date: July 12, 2007

                From 6159d1dd0945490d1425ae3269dc3172680a3c91 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 16 Jul 2007 13:04:46 +0000 Subject: [PATCH 0665/2544] Switched from CI super object to $CFG to fetch charset --- system/libraries/Input.php | 4 ++-- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index ba94d854..b41dcfb2 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -852,8 +852,8 @@ function _attribute_conversion($match) */ function _html_entity_decode_callback($match) { - $CI =& get_instance(); - $charset = $CI->config->item('charset'); + global $CFG; + $charset = $CFG->item('charset'); return $this->_html_entity_decode($match[0], strtoupper($charset)); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 1864c798..568448fc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

                Version 1.5.5

                • Fixed a bug in database driver where num_rows property wasn't getting updated
                • Fixed a bug in captcha calling an invalid PHP function
                • +
                • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
                From 409904637cd661be6ceccb59af1046468da09802 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Jul 2007 21:40:44 +0000 Subject: [PATCH 0666/2544] --- system/database/DB_driver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 381b70f4..ee965b74 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -44,6 +44,7 @@ class CI_DB_driver { var $benchmark = 0; var $query_count = 0; var $bind_marker = '?'; + var $save_queries = TRUE; var $queries = array(); var $data_cache = array(); var $trans_enabled = TRUE; @@ -264,7 +265,10 @@ function query($sql, $binds = FALSE, $return_object = TRUE) } // Save the query for debugging - $this->queries[] = $sql; + if ($this->save_queries == TRUE) + { + $this->queries[] = $sql; + } // Start the Query Timer $time_start = list($sm, $ss) = explode(' ', microtime()); From ce542a298ebfc8088024cfc32bbf971286c59cd2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Jul 2007 21:42:05 +0000 Subject: [PATCH 0667/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 568448fc..729b3572 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,6 +65,7 @@

                Change Log

                Version 1.5.5

                Release Date: -- still in development

                  +
                • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
                • Fixed a bug in database driver where num_rows property wasn't getting updated
                • Fixed a bug in captcha calling an invalid PHP function
                • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
                • From 7aa1809e775bddfa08e17d8424a3532fcf06d6ae Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 19 Jul 2007 00:13:13 +0000 Subject: [PATCH 0668/2544] --- system/helpers/cookie_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 9dc5df9b..4fb30bd5 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -60,15 +60,15 @@ function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = if ($prefix == '' AND $CI->config->item('cookie_prefix') != '') { - $CI->config->item('cookie_prefix'); + $prefix = $CI->config->item('cookie_prefix'); } if ($domain == '' AND $CI->config->item('cookie_domain') != '') { - $CI->config->item('cookie_domain'); + $domain = $CI->config->item('cookie_domain'); } - if ($prefix == '/' AND $CI->config->item('cookie_path') != '/') + if ($path == '/' AND $CI->config->item('cookie_path') != '/') { - $CI->config->item('cookie_path'); + $path = $CI->config->item('cookie_path'); } if ( ! is_numeric($expire)) From eb528b2272442245e657f92adfeb3979665a903b Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 19 Jul 2007 00:14:22 +0000 Subject: [PATCH 0669/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 729b3572..2ede587c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

                  Version 1.5.5

                • Fixed a bug in database driver where num_rows property wasn't getting updated
                • Fixed a bug in captcha calling an invalid PHP function
                • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
                • +
                • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
                From c2c256143d99a0e6695cb2f16d968e27ef9e9036 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 19 Jul 2007 23:12:49 +0000 Subject: [PATCH 0670/2544] example fix --- user_guide/libraries/validation.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index f5ef9cef..3532282d 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -496,7 +496,7 @@

                Showing Errors Individually

                If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

                -<textarea class="textarea" style="width:100%" cols="50" rows="20"> +

                If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you have set (<p> tags by default).

                From 30b40153739419d50c64e2dce338166a5c58ab58 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 20 Jul 2007 00:01:13 +0000 Subject: [PATCH 0671/2544] --- system/codeigniter/CodeIgniter.php | 4 +- system/libraries/Output.php | 4 +- system/libraries/Router.php | 247 +++-------------------------- system/libraries/URI.php | 244 ++++++++++++++++++++++++++-- system/libraries/Xmlrpc.php | 1 - 5 files changed, 264 insertions(+), 236 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 1cd66a18..160d86c8 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -77,6 +77,7 @@ */ $CFG =& load_class('Config'); +$URI =& load_class('URI'); $RTR =& load_class('Router'); $OUT =& load_class('Output'); @@ -101,7 +102,6 @@ */ $IN =& load_class('Input'); -$URI =& load_class('URI'); $LANG =& load_class('Language'); /* @@ -213,7 +213,7 @@ // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience - call_user_func_array(array(&$CI, $method), array_slice($RTR->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); + call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); } } diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 756d4b4c..53003f18 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -301,7 +301,7 @@ function _write_cache($output) function _display_cache(&$CFG, &$RTR) { $CFG =& load_class('Config'); - $RTR =& load_class('Router'); + $URI =& load_class('URI'); $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); @@ -313,7 +313,7 @@ function _display_cache(&$CFG, &$RTR) // Build the file path. The file name is an MD5 hash of the full URI $uri = $CFG->item('base_url'). $CFG->item('index_page'). - $RTR->uri_string; + $URI->uri_string; $filepath = $cache_path.md5($uri); diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 6af6ad38..6fca4522 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -28,10 +28,7 @@ */ class CI_Router { - var $config; - var $uri_string = ''; - var $segments = array(); - var $rsegments = array(); + var $config; var $routes = array(); var $error_routes = array(); var $class = ''; @@ -49,7 +46,8 @@ class CI_Router { function CI_Router() { $this->config =& load_class('Config'); - $this->_set_route_mapping(); + $this->uri =& load_class('URI'); + $this->_set_routing(); log_message('debug', "Router Class Initialized"); } @@ -64,17 +62,17 @@ function CI_Router() * @access private * @return void */ - function _set_route_mapping() + function _set_routing() { // Are query strings enabled in the config file? // If so, we're done since segment based URIs are not used with query strings. if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) { - $this->set_class(trim($this->_filter_uri($_GET[$this->config->item('controller_trigger')]))); + $this->set_class(trim($this->uri->_filter_uri($_GET[$this->config->item('controller_trigger')]))); if (isset($_GET[$this->config->item('function_trigger')])) { - $this->set_method(trim($this->_filter_uri($_GET[$this->config->item('function_trigger')]))); + $this->set_method(trim($this->uri->_filter_uri($_GET[$this->config->item('function_trigger')]))); } return; @@ -90,16 +88,10 @@ function _set_route_mapping() $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']); // Fetch the complete URI string - $this->uri_string = $this->_get_uri_string(); - - // If the URI contains only a slash we'll kill it - if ($this->uri_string == '/') - { - $this->uri_string = ''; - } + $this->uri->_fetch_uri_string(); // Is there a URI string? If not, the default controller specified in the "routes" file will be shown. - if ($this->uri_string == '') + if ($this->uri->uri_string == '') { if ($this->default_controller === FALSE) { @@ -114,47 +106,35 @@ function _set_route_mapping() } unset($this->routes['default_controller']); - // Do we need to remove the suffix specified in the config file? - if ($this->config->item('url_suffix') != "") - { - $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); - } + // Do we need to remove the URL suffix? + $this->uri->_remove_url_suffix(); - // Explode the URI Segments. The individual segments will - // be stored in the $this->segments array. - foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) - { - // Filter segments for security - $val = trim($this->_filter_uri($val)); - - if ($val != '') - $this->segments[] = $val; - } + // Compile the segments into an array + $this->uri->_explode_segments(); // Parse any custom routing that may exist $this->_parse_routes(); // Re-index the segment array so that it starts with 1 rather than 0 - $this->_reindex_segments(); + $this->uri->_reindex_segments(); } // -------------------------------------------------------------------- /** - * Compile Segments + * Set the Route * * This function takes an array of URI segments as - * input, and puts it into the $this->segments array. - * It also sets the current class/method + * input, and sets the current class/method * * @access private * @param array * @param bool * @return void */ - function _compile_segments($segments = array()) + function _set_request($segments = array()) { - $segments = $this->_validate_segments($segments); + $segments = $this->_validate_request($segments); if (count($segments) == 0) { @@ -180,8 +160,8 @@ function _compile_segments($segments = array()) // Update our "routed" segment array to contain the segments. // Note: If there is no custom routing, this array will be - // identical to $this->segments - $this->rsegments = $segments; + // identical to $this->uri->segments + $this->uri->rsegments = $segments; } // -------------------------------------------------------------------- @@ -194,7 +174,7 @@ function _compile_segments($segments = array()) * @param array * @return array */ - function _validate_segments($segments) + function _validate_request($segments) { // Does the requested controller exist in the root folder? if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) @@ -237,182 +217,7 @@ function _validate_segments($segments) // Can't find the requested controller... show_404(); } - - // -------------------------------------------------------------------- - /** - * Re-index Segments - * - * This function re-indexes the $this->segment array so that it - * starts at 1 rather then 0. Doing so makes it simpler to - * use functions like $this->uri->segment(n) since there is - * a 1:1 relationship between the segment array and the actual segments. - * - * @access private - * @return void - */ - function _reindex_segments() - { - // Is the routed segment array different then the main segment array? - $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; - - $i = 1; - foreach ($this->segments as $val) - { - $this->segments[$i++] = $val; - } - unset($this->segments[0]); - if ($diff == FALSE) - { - $this->rsegments = $this->segments; - } - else - { - $i = 1; - foreach ($this->rsegments as $val) - { - $this->rsegments[$i++] = $val; - } - unset($this->rsegments[0]); - } - } - - // -------------------------------------------------------------------- - - /** - * Get the URI String - * - * @access private - * @return string - */ - function _get_uri_string() - { - if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') - { - // If the URL has a question mark then it's simplest to just - // build the URI string from the zero index of the $_GET array. - // This avoids having to deal with $_SERVER variables, which - // can be unreliable in some environments - if (is_array($_GET) AND count($_GET) == 1) - { - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $keys = array_keys($_GET); - return current($keys); - } - - // Is there a PATH_INFO variable? - // Note: some servers seem to have trouble with getenv() so we'll test it two ways - $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - if ($path != '' AND $path != "/".SELF) - { - return $path; - } - - // No PATH_INFO?... What about QUERY_STRING? - $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - if ($path != '') - { - return $path; - } - - // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if ($path != '' AND $path != "/".SELF) - { - return $path; - } - - // We've exhausted all our options... - return ''; - } - else - { - $uri = strtoupper($this->config->item('uri_protocol')); - - if ($uri == 'REQUEST_URI') - { - return $this->_parse_request_uri(); - } - - return (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); - } - } - - // -------------------------------------------------------------------- - - /** - * Parse the REQUEST_URI - * - * Due to the way REQUEST_URI works it usually contains path info - * that makes it unusable as URI data. We'll trim off the unnecessary - * data, hopefully arriving at a valid URI that we can use. - * - * @access private - * @return string - */ - function _parse_request_uri() - { - if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') - { - return ''; - } - - $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - - if ($request_uri == '' OR $request_uri == SELF) - { - return ''; - } - - $fc_path = FCPATH; - if (strpos($request_uri, '?') !== FALSE) - { - $fc_path .= '?'; - } - - $parsed_uri = explode("/", $request_uri); - - $i = 0; - foreach(explode("/", $fc_path) as $segment) - { - if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) - { - $i++; - } - } - - $parsed_uri = implode("/", array_slice($parsed_uri, $i)); - - if ($parsed_uri != '') - { - $parsed_uri = '/'.$parsed_uri; - } - - return $parsed_uri; - } - - // -------------------------------------------------------------------- - - /** - * Filter segments for malicious characters - * - * @access private - * @param string - * @return string - */ - function _filter_uri($str) - { - if ($this->config->item('permitted_uri_chars') != '') - { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) - { - exit('The URI you submitted has disallowed characters.'); - } - } - return $str; - } - // -------------------------------------------------------------------- /** @@ -431,18 +236,18 @@ function _parse_routes() // There is a default scaffolding trigger, so we'll look just for 1 if (count($this->routes) == 1) { - $this->_compile_segments($this->segments); + $this->_set_request($this->uri->segments); return; } // Turn the segment array into a URI string - $uri = implode('/', $this->segments); - $num = count($this->segments); + $uri = implode('/', $this->uri->segments); + $num = count($this->uri->segments); // Is there a literal match? If so we're done if (isset($this->routes[$uri])) { - $this->_compile_segments(explode('/', $this->routes[$uri])); + $this->_set_request(explode('/', $this->routes[$uri])); return; } @@ -461,14 +266,14 @@ function _parse_routes() $val = preg_replace('#^'.$key.'$#', $val, $uri); } - $this->_compile_segments(explode('/', $val)); + $this->_set_request(explode('/', $val)); return; } } // If we got this far it means we didn't encounter a // matching route so we'll set the site default route - $this->_compile_segments($this->segments); + $this->_set_request($this->uri->segments); } // -------------------------------------------------------------------- diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 5cedd8e0..2777e2f1 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -28,8 +28,10 @@ */ class CI_URI { - var $router; var $keyval = array(); + var $uri_string; + var $segments = array(); + var $rsegments = array(); /** * Constructor @@ -42,10 +44,229 @@ class CI_URI { */ function CI_URI() { - $this->router =& load_class('Router'); + $this->config =& load_class('Config'); log_message('debug', "URI Class Initialized"); } + + // -------------------------------------------------------------------- + + /** + * Get the URI String + * + * @access private + * @return string + */ + function _fetch_uri_string() + { + if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') + { + // If the URL has a question mark then it's simplest to just + // build the URI string from the zero index of the $_GET array. + // This avoids having to deal with $_SERVER variables, which + // can be unreliable in some environments + if (is_array($_GET) AND count($_GET) == 1) + { + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $keys = array_keys($_GET); + $this->uri_string = current($keys); + } + + // Is there a PATH_INFO variable? + // Note: some servers seem to have trouble with getenv() so we'll test it two ways + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if ($path != '' AND $path != "/".SELF) + { + $this->uri_string = $path; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if ($path != '') + { + $this->uri_string = $path; + } + + // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? + $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + if ($path != '' AND $path != "/".SELF) + { + $this->uri_string = $path; + } + + // We've exhausted all our options... + $this->uri_string = ''; + } + else + { + $uri = strtoupper($this->config->item('uri_protocol')); + + if ($uri == 'REQUEST_URI') + { + $this->uri_string = $this->_parse_request_uri(); + } + + $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); + } + + // If the URI contains only a slash we'll kill it + if ($this->uri_string == '/') + { + $this->uri_string = ''; + } + } + + // -------------------------------------------------------------------- + + /** + * Parse the REQUEST_URI + * + * Due to the way REQUEST_URI works it usually contains path info + * that makes it unusable as URI data. We'll trim off the unnecessary + * data, hopefully arriving at a valid URI that we can use. + * + * @access private + * @return string + */ + function _parse_request_uri() + { + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') + { + return ''; + } + + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '' OR $request_uri == SELF) + { + return ''; + } + + $fc_path = FCPATH; + if (strpos($request_uri, '?') !== FALSE) + { + $fc_path .= '?'; + } + + $parsed_uri = explode("/", $request_uri); + + $i = 0; + foreach(explode("/", $fc_path) as $segment) + { + if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) + { + $i++; + } + } + + $parsed_uri = implode("/", array_slice($parsed_uri, $i)); + + if ($parsed_uri != '') + { + $parsed_uri = '/'.$parsed_uri; + } + + return $parsed_uri; + } + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ($this->config->item('permitted_uri_chars') != '') + { + if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + { + exit('The URI you submitted has disallowed characters.'); + } + } + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Remove the suffix from the URL if needed + * + * @access private + * @return void + */ + function _remove_url_suffix() + { + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + } + + // -------------------------------------------------------------------- + + /** + * Explode the URI Segments. The individual segments will + * be stored in the $this->segments array. + * + * @access private + * @return void + */ + function _explode_segments() + { + foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + $this->segments[] = $val; + } + } + + // -------------------------------------------------------------------- + /** + * Re-index Segments + * + * This function re-indexes the $this->segment array so that it + * starts at 1 rather then 0. Doing so makes it simpler to + * use functions like $this->uri->segment(n) since there is + * a 1:1 relationship between the segment array and the actual segments. + * + * @access private + * @return void + */ + function _reindex_segments() + { + // Is the routed segment array different then the main segment array? + $diff = (count(array_diff($this->rsegments, $this->segments)) == 0) ? FALSE : TRUE; + + $i = 1; + foreach ($this->segments as $val) + { + $this->segments[$i++] = $val; + } + unset($this->segments[0]); + + if ($diff == FALSE) + { + $this->rsegments = $this->segments; + } + else + { + $i = 1; + foreach ($this->rsegments as $val) + { + $this->rsegments[$i++] = $val; + } + unset($this->rsegments[0]); + } + } + // -------------------------------------------------------------------- /** @@ -60,7 +281,7 @@ function CI_URI() */ function segment($n, $no_result = FALSE) { - return ( ! isset($this->router->segments[$n])) ? $no_result : $this->router->segments[$n]; + return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; } // -------------------------------------------------------------------- @@ -79,7 +300,7 @@ function segment($n, $no_result = FALSE) */ function rsegment($n, $no_result = FALSE) { - return ( ! isset($this->router->rsegments[$n])) ? $no_result : $this->router->rsegments[$n]; + return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; } // -------------------------------------------------------------------- @@ -203,6 +424,8 @@ function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') return $retval; } + // -------------------------------------------------------------------- + /** * Generate a URI string from an associative array * @@ -210,7 +433,8 @@ function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') * @access public * @param array an associative array of key/values * @return array - */ function assoc_to_uri($array) + */ + function assoc_to_uri($array) { $temp = array(); foreach ((array)$array as $key => $val) @@ -293,7 +517,7 @@ function _slash_segment($n, $where = 'trailing', $which = 'segment') */ function segment_array() { - return $this->router->segments; + return $this->segments; } // -------------------------------------------------------------------- @@ -306,7 +530,7 @@ function segment_array() */ function rsegment_array() { - return $this->router->rsegments; + return $this->rsegments; } // -------------------------------------------------------------------- @@ -319,7 +543,7 @@ function rsegment_array() */ function total_segments() { - return count($this->router->segments); + return count($this->segments); } // -------------------------------------------------------------------- @@ -332,7 +556,7 @@ function total_segments() */ function total_rsegments() { - return count($this->router->rsegments); + return count($this->rsegments); } // -------------------------------------------------------------------- @@ -345,7 +569,7 @@ function total_rsegments() */ function uri_string() { - return $this->router->uri_string; + return $this->uri_string; } diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 49747e48..fc6208e9 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -70,7 +70,6 @@ class CI_Xmlrpc { function CI_Xmlrpc ($config = array()) { - $this->xmlrpcName = $this->xmlrpcName; $this->xmlrpc_backslash = chr(92).chr(92); From 55ccb39f9e73779750d1f5b07ad9527469e0805c Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 20 Jul 2007 00:01:54 +0000 Subject: [PATCH 0672/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2ede587c..4d313106 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

                Version 1.5.5

                Release Date: -- still in development

                • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
                • +
                • Reorganized the URI and Routes classes for better clarity.
                • Fixed a bug in database driver where num_rows property wasn't getting updated
                • Fixed a bug in captcha calling an invalid PHP function
                • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
                • From 6a47c119215219813f6c53b854f104d9fa16f62c Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 21 Jul 2007 17:42:35 +0000 Subject: [PATCH 0673/2544] --- system/codeigniter/CodeIgniter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 160d86c8..b5f21a1b 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -132,11 +132,13 @@ // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } +include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); + // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); From de2623c7a748e2e40ce4f6d64161915ed5141c4e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 21 Jul 2007 18:28:24 +0000 Subject: [PATCH 0674/2544] --- system/libraries/URI.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 2777e2f1..254a8a6e 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -58,7 +58,7 @@ function CI_URI() * @return string */ function _fetch_uri_string() - { + { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // If the URL has a question mark then it's simplest to just @@ -71,6 +71,7 @@ function _fetch_uri_string() // of PHP we can not pass function call directly into it $keys = array_keys($_GET); $this->uri_string = current($keys); + return; } // Is there a PATH_INFO variable? @@ -79,6 +80,7 @@ function _fetch_uri_string() if ($path != '' AND $path != "/".SELF) { $this->uri_string = $path; + return; } // No PATH_INFO?... What about QUERY_STRING? @@ -86,6 +88,7 @@ function _fetch_uri_string() if ($path != '') { $this->uri_string = $path; + return; } // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? @@ -93,6 +96,7 @@ function _fetch_uri_string() if ($path != '' AND $path != "/".SELF) { $this->uri_string = $path; + return; } // We've exhausted all our options... @@ -105,6 +109,7 @@ function _fetch_uri_string() if ($uri == 'REQUEST_URI') { $this->uri_string = $this->_parse_request_uri(); + return; } $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); @@ -116,7 +121,7 @@ function _fetch_uri_string() $this->uri_string = ''; } } - + // -------------------------------------------------------------------- /** From 183fe844a99da30c4bc2b4b8d881f6b94310dbc5 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 02:09:13 +0000 Subject: [PATCH 0675/2544] --- system/libraries/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 6fca4522..501a8ee8 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -252,7 +252,7 @@ function _parse_routes() } // Loop through the route array looking for wild-cards - foreach (array_slice($this->routes, 1) as $key => $val) + foreach ($this->routes as $key => $val) { // Convert wild-cards to RegEx $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key)); From e0a4cc035b39622a035d5de2c4ea69655d3aaae6 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:14:32 +0000 Subject: [PATCH 0676/2544] --- system/codeigniter/CodeIgniter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index b5f21a1b..16fe97ac 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -181,8 +181,10 @@ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); -// Instantiate the Controller -$CI = new $class(); +// Instantiate the Controller and pass any global data that might exist +$global_data = ( ! isset($global_data)) ? NULL : $global_data; + +$CI = new $class($global_data); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) From 268c26c5bc2e218ae4aa3a91cf292e179dab04ed Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:14:41 +0000 Subject: [PATCH 0677/2544] --- index.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.php b/index.php index b7fdfff1..9a4d5336 100644 --- a/index.php +++ b/index.php @@ -44,6 +44,19 @@ $application_folder = "application"; +/* +|--------------------------------------------------------------- +| Dynamic Global Data Assignment +|--------------------------------------------------------------- +| +| If you need any data passed by default to your controllers you +| can use this variable. When a controller class is instantiated +| this data will be passed to the constructor. +| +*/ + $global_data = NULL; + + /* |=============================================================== | END OF USER CONFIGURABLE SETTINGS From 27842ada690fab499ec9502d3ebcf03a9d12c313 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:21:04 +0000 Subject: [PATCH 0678/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4d313106..4220c6e0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

                  Version 1.5.5

                  Release Date: -- still in development

                  • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
                  • +
                  • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
                  • Reorganized the URI and Routes classes for better clarity.
                  • Fixed a bug in database driver where num_rows property wasn't getting updated
                  • Fixed a bug in captcha calling an invalid PHP function
                  • From 03717d28b76c0ff3ab30da9d93ebe1a9b8b1be37 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:22:22 +0000 Subject: [PATCH 0679/2544] --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 9a4d5336..7b47d081 100644 --- a/index.php +++ b/index.php @@ -46,15 +46,15 @@ /* |--------------------------------------------------------------- -| Dynamic Global Data Assignment +| Default Controller Data Assignment |--------------------------------------------------------------- | | If you need any data passed by default to your controllers you | can use this variable. When a controller class is instantiated -| this data will be passed to the constructor. +| this data will be passed to the controller constructor. | */ - $global_data = NULL; + $assign_to_controller = NULL; /* From f66c71b114653f3a2a418950b258a45428871410 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:22:56 +0000 Subject: [PATCH 0680/2544] --- system/codeigniter/CodeIgniter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 16fe97ac..54f37c92 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -182,9 +182,9 @@ $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); // Instantiate the Controller and pass any global data that might exist -$global_data = ( ! isset($global_data)) ? NULL : $global_data; +$assign_to_controller = ( ! isset($assign_to_controller)) ? NULL : $assign_to_controller; -$CI = new $class($global_data); +$CI = new $class($assign_to_controller); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) From d8de26ea04a83d5d138e8771c69ae790b4cc6a78 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 22 Jul 2007 18:24:25 +0000 Subject: [PATCH 0681/2544] --- system/codeigniter/CodeIgniter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 54f37c92..00032fa0 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -186,6 +186,8 @@ $CI = new $class($assign_to_controller); +unset($assign_to_controller); + // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) { From 5fbffd780bb24c0fb925ffb26a9036f008d9b664 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 25 Jul 2007 18:47:11 +0000 Subject: [PATCH 0682/2544] --- system/libraries/URI.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 254a8a6e..e3cf9c55 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -69,8 +69,9 @@ function _fetch_uri_string() { // Note: Due to a bug in current() that affects some versions // of PHP we can not pass function call directly into it - $keys = array_keys($_GET); - $this->uri_string = current($keys); + $key = array_keys($_GET); + $index = current($key); + $this->uri_string = $_GET[$index]; return; } From c2ce7dfa7e16b2eac7e6c0e6ddaef9cb5e2a6952 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 30 Jul 2007 12:13:26 +0000 Subject: [PATCH 0683/2544] changed so day and month names are derived from calendar lang file instead of being hard-coded. --- system/plugins/js_calendar_pi.php | 37 +++++++++++++++++++++++++------ user_guide/changelog.html | 1 + 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php index a461e34a..686dcdf7 100644 --- a/system/plugins/js_calendar_pi.php +++ b/system/plugins/js_calendar_pi.php @@ -30,10 +30,10 @@ Then to show the actual calendar you'll do this: - +
                    -

                    Today

                    +

                    Today

                    @@ -126,15 +126,37 @@ function js_calendar_script($form_name = 'entryform') { - +$CI =& get_instance(); +$CI->load->language('calendar'); ob_start(); ?>
      + +
      + + + + + +

      CodeIgniter User Guide Version 1.5.4

      +
      + + + + + + + + + +
      + + +
      + + + +
      + +

      Upgrading from 1.5.4 to 1.5.5

      + +

      Before performing an update you should take your site offline by replacing the index.php file with a static one.

      + + + +

      Step 1: Update your CodeIgniter files

      + +

      Replace these files and directories in your "system" folder with the new versions:

      + +
        + +
      • system/codeigniter
      • +
      • system/database
      • +
      • system/helpers
      • +
      • system/libraries
      • +
      • system/plugins
      • +
      + +

      Note: If you have any custom developed files in these folders please make copies of them first.

      + +

      Step 2: Add time_to_update to your config.php

      +

      Add the following to system/application/config/config.php with the other

      +$config['sess_time_to_update'] = 300; +

      Step 3: Update your user guide

      +

      Please also replace your local copy of the user guide with the new version.

      + +
      + + + + + + + \ No newline at end of file From 34bc8f82221d7b2ea331728a1527658c36e39c89 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 10 Aug 2007 03:26:42 +0000 Subject: [PATCH 0693/2544] typo --- system/libraries/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 57106ea2..819c3f5e 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -36,7 +36,7 @@ class CI_Session { var $userdata = array(); var $gc_probability = 5; var $flashdata_key = 'flash'; - var $time_to_update = 300; // 5 mintues, not accessible from config settings + var $time_to_update = 300; /** * Session Constructor From 91948fb49e1c6d28e5c06f4e8f8ec8906aa7bb50 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 10 Aug 2007 03:33:40 +0000 Subject: [PATCH 0694/2544] typos again --- user_guide/changelog.html | 2 +- user_guide/libraries/sessions.html | 598 +++++++++++++++-------------- 2 files changed, 303 insertions(+), 297 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0433e71e..730bfa34 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,7 +65,7 @@

      Change Log

      Version 1.5.5

      Release Date: -- still in development

        -
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class
      • +
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
      • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
      • Reorganized the URI and Routes classes for better clarity.
      • diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 0a50b433..a6ade694 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -1,297 +1,303 @@ - - - - -CodeIgniter User Guide : Session Class - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - -

        CodeIgniter User Guide Version 1.5.4

        -
        - - - - - - - - - -
        - - -
        - - - -
        - - -

        Session Class

        - -

        The Session class permits you maintain a user's "state" and track their activity while they browse your site. -The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. -It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to -use the database option you'll need to create the session table as indicated below. -

        - -

        Note: The Session class does not utilize native PHP sessions. It -generates its own session data, offering more flexibility for developers.

        - -

        Initializing a Session

        - -

        Sessions will typically run globally with each page load, so the session class must either be -initialized in your -controller constructors, or it can be -auto-loaded by the system. -For the most part the session class will run unattended in the background, so simply initializing the class -will cause it to read, create, and update sessions.

        - - -

        To initialize the Session class manually in your controller constructor, use the $this->load->library function:

        - -$this->load->library('session'); -

        Once loaded, the Sessions library object will be available using: $this->session

        - - -

        How do Sessions work?

        - -

        When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. -If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. -If a session does exist, its information will be updated and the cookie will be updated.

        - -

        It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or -even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

        - - -

        What is Session Data?

        - -

        A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

        - -
          -
        • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability)
        • -
        • The user's IP Address
        • -
        • The user's User Agent data (the first 50 characters of the browser data string)
        • -
        • The "last activity" and "last visit" time stamps.
        • -
        - -

        The above data is stored in a cookie as a serialized array with this prototype:

        - -[array]
        -(
        -     'session_id'    => random hash,
        -     'ip_address'    => 'string - user IP address',
        -     'user_agent'    => 'string - user agent data',
        -     'last_activity' => timestamp,
        -     'last_visit'    => timestamp
        -)
        - -

        If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, -making the data highly secure and impervious to being read or altered by someone. More info regarding encryption -can be found here, although the Session class will take care of initializing -and encrypting the data automatically.

        - -

        Note: Session cookies are only updated every five minutes to reduce processor load. If you repeatedly reload a page -you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time -the cookie was written.

        - -

        Retrieving Session Data

        - -

        Any piece of information from the session array is available using the following function:

        - -$this->session->userdata('item'); - -

        Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you -will do this:

        - -$session_id = $this->session->userdata('session_id'); - -

        Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

        - - -

        Adding Custom Session Data

        - -

        A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

        - -

        Let's say a particular user logs into your site. Once authenticated, -you could add their username and email address to the session cookie, making that data globally available to you without -having to run a database query when you need it.

        - -

        To add your data to the session array involves passing an array containing your new data to this function:

        - -$this->session->set_userdata($array); - -

        Where $array is an associative array containing your new data. Here's an example:

        - - -

        $newdata = array(
        -                    'username'  => 'johndoe',
        -                    'email'     => 'johndoe@example.com',
        -                    'logged_in' => TRUE
        -                );
        -
        - $this->session->set_userdata($newdata);

        -

        If you want to add userdata one value at a time, set_userdata() also supports this syntax.

        -

        $this->session->set_userdata('some_name', 'some_value');

        -

        Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The -encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

        - -

        Saving Session Data to a Database

        - -

        While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

        - -

        When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never -be updated, they can only be generated when a new session is created.

        - -

        In order to store sessions, you must first create a database table for this purpose. Here is the basic -prototype (for MySQL) required by the session class:

        - - - -

        Note: By default the table is called ci_sessions, but you can name it anything you want -as long as you update the application/config/config.php file so that it contains the name you have chosen. -Once you have created your database table you can enable the database option in your config.php file as follows:

        - -$config['sess_use_database'] = TRUE; - -

        Once enabled, the Session class will store session data in the DB.

        - -

        Make sure you've specified the table name in your config file as well:

        - -$config['sess_table_name'] = 'ci_sessions"; - -

        Note: The Session class has built-in garbage collection which clears out expired sessions so you -do not need to write your own routine to do it.

        - - -

        Removing Session Data

        -

        To remove a single item from the session

        -

        $this->session->unset_userdata('item');

        -

        Destroying a Session

        -

        To clear the current session:

        -$this->session->sess_destroy(); -

        Session Preferences

        -

        You'll find the following Session related preferences in your application/config/config.php file:

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        PreferenceDefaultOptionsDescription
        sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
        sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). -If you would like a non-expiring session set the value to zero: 0
        sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
        sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
        sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
        sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically -changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
        sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
        - - -
        - - - - - - + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +

        CodeIgniter User Guide Version 1.5.3

        +
        + + + + + + + + + +
        + + +
        + + + +
        + + +

        Session Class

        + +

        The Session class permits you maintain a user's "state" and track their activity while they browse your site. +The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. +It can also store the session data in a database table for added security, as this permits the session ID in the +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +use the database option you'll need to create the session table as indicated below. +

        + +

        Note: The Session class does not utilize native PHP sessions. It +generates its own session data, offering more flexibility for developers.

        + +

        Initializing a Session

        + +

        Sessions will typically run globally with each page load, so the session class must either be +initialized in your +controller constructors, or it can be +auto-loaded by the system. +For the most part the session class will run unattended in the background, so simply initializing the class +will cause it to read, create, and update sessions.

        + + +

        To initialize the Session class manually in your controller constructor, use the $this->load->library function:

        + +$this->load->library('session'); +

        Once loaded, the Sessions library object will be available using: $this->session

        + + +

        How do Sessions work?

        + +

        When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. +If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. +If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

        + +

        It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

        + + +

        What is Session Data?

        + +

        A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

        + +
          +
        • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
        • +
        • The user's IP Address
        • +
        • The user's User Agent data (the first 50 characters of the browser data string)
        • +
        • The "last activity" and "last visit" time stamps.
        • +
        + +

        The above data is stored in a cookie as a serialized array with this prototype:

        + +[array]
        +(
        +     'session_id'    => random hash,
        +     'ip_address'    => 'string - user IP address',
        +     'user_agent'    => 'string - user agent data',
        +     'last_activity' => timestamp,
        +     'last_visit'    => timestamp
        +)
        + +

        If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, +making the data highly secure and impervious to being read or altered by someone. More info regarding encryption +can be found here, although the Session class will take care of initializing +and encrypting the data automatically.

        + +

        Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time +the cookie was written. This time is configurable my changing the $config['time_to_update'] line in your system/config/config.php file.

        + +

        Retrieving Session Data

        + +

        Any piece of information from the session array is available using the following function:

        + +$this->session->userdata('item'); + +

        Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +will do this:

        + +$session_id = $this->session->userdata('session_id'); + +

        Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

        + + +

        Adding Custom Session Data

        + +

        A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. +Why would you want to do this? Here's one example:

        + +

        Let's say a particular user logs into your site. Once authenticated, +you could add their username and email address to the session cookie, making that data globally available to you without +having to run a database query when you need it.

        + +

        To add your data to the session array involves passing an array containing your new data to this function:

        + +$this->session->set_userdata($array); + +

        Where $array is an associative array containing your new data. Here's an example:

        + + +

        $newdata = array(
        +                    'username'  => 'johndoe',
        +                    'email'     => 'johndoe@some-site.com',
        +                    'logged_in' => TRUE
        +                );
        +
        + $this->session->set_userdata($newdata);

        +

        If you want to add userdata one value at a time, set_userdata() also supports this syntax.

        +

        $this->session->set_userdata('some_name', 'some_value');

        +

        Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

        + +

        Flashdata

        +

        CodeIgniter supports "flashdata", or session data that will only ba available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

        +

        Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

        +

        To add flashdata:

        +

        $this->session->set_flashdata('item', 'value');

        +

        You can also pass an array to set_flashdata(), in the same manner as set_userdata().

        +

        To read a flashdata variable:

        +

        $this->session->flashdata('item');

        +

        If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.

        +

        $this->session->keep_flashdata('item');

        +

        Saving Session Data to a Database

        +

        While the session data array stored in the user's cookie contains a Session ID, +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

        + +

        When session data is available in a database, every time a valid session is found in the user's cookie, a database +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +be updated, they can only be generated when a new session is created.

        + +

        In order to store sessions, you must first create a database table for this purpose. Here is the basic +prototype (for MySQL) required by the session class:

        + + + +

        Note: By default the table is called ci_sessions, but you can name it anything you want +as long as you update the application/config/config.php file so that it contains the name you have chosen. +Once you have created your database table you can enable the database option in your config.php file as follows:

        + +$config['sess_use_database'] = TRUE; + +

        Once enabled, the Session class will store session data in the DB.

        + +

        Make sure you've specified the table name in your config file as well:

        + +$config['sess_table_name'] = 'ci_sessions"; + +

        Note: The Session class has built-in garbage collection which clears out expired sessions so you +do not need to write your own routine to do it.

        + + +

        Destroying a Session

        +

        To clear the current session:

        +$this->session->sess_destroy(); +

        Session Preferences

        +

        You'll find the following Session related preferences in your application/config/config.php file:

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        PreferenceDefaultOptionsDescription
        sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
        sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). +If you would like a non-expiring session set the value to zero: 0
        sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
        sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
        sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
        sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically +changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
        sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
        + + +
        + + + + + + \ No newline at end of file From 9278249cd356411dc949dd5a6dacc5b07fd4be81 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 10 Aug 2007 11:26:01 +0000 Subject: [PATCH 0695/2544] Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only. --- system/database/DB_active_rec.php | 2 +- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index d79a068e..82d5b63b 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -405,7 +405,7 @@ function orderby($orderby, $direction = '') { if (trim($direction) != '') { - $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC', 'RAND()'), TRUE)) ? ' '.$direction : ' ASC'; + $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; } $this->ar_orderby[] = $orderby.$direction; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 730bfa34..d03fab5c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@

        Version 1.5.5

      • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
      • Reorganized the URI and Routes classes for better clarity.
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it
      • +
      • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
      • Added titles to all user manual pages
      • Fixed a bug in database driver where num_rows property wasn't getting updated
      • Fixed a bug in captcha calling an invalid PHP function
      • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 37629ae1..504f1831 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -354,7 +354,7 @@

        $this->db->having();

        $this->db->orderby();

        Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc or RAND()

        +The second parameter lets you set the direction of the result. Options are asc or desc

        $this->db->orderby("title", "desc");

        // Produces: ORDER BY title DESC From 89bf50f992b97772acb4028bbd7c9faf81899148 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 14 Aug 2007 02:39:04 +0000 Subject: [PATCH 0696/2544] fixed an extraneous ; --- system/libraries/Validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 6b6ec0c6..10773b21 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -317,7 +317,7 @@ function run() } else { - $line = $this->_error_messages[$rule];; + $line = $this->_error_messages[$rule]; } // Build the error message From fc40afda438195ec3d6f2a4c61477f7c09ec5e1a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 14 Aug 2007 11:41:16 +0000 Subject: [PATCH 0697/2544] Documented the timezones() function in the Date Helper --- user_guide/changelog.html | 3 ++- user_guide/helpers/date_helper.html | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d03fab5c..e11bdc7d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,7 +71,8 @@

        Version 1.5.5

      • Reorganized the URI and Routes classes for better clarity.
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it
      • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
      • -
      • Added titles to all user manual pages
      • +
      • Added titles to all user manual pages
      • +
      • Documented the timezones() function in the Date Helper
      • Fixed a bug in database driver where num_rows property wasn't getting updated
      • Fixed a bug in captcha calling an invalid PHP function
      • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
      • diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index d703801a..2353ff84 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -223,11 +223,11 @@

        days_in_month()

        echo days_in_month(06, 2005);

        If the second parameter is empty, the current year will be used.

        - - - +

        timezones()

        +

        Takes a timezone reference (for a list of valid timezones, see the "Timezone Reference" below) and returns the number of hours offset from UTC.

        +

        echo timezones('UM5');

        +

        This function is useful when used with timezone_menu().

        timezone_menu()

        -

        Generates a pull-down menu of timezones, like this one:

        From 309d63fa5c011c5cf0fbe0c78ab5f294aaae6752 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 17 Aug 2007 11:49:29 +0000 Subject: [PATCH 0698/2544] Documented unset_userdata in the Session class. --- user_guide/changelog.html | 19 +- user_guide/libraries/sessions.html | 611 +++++++++++++++-------------- 2 files changed, 319 insertions(+), 311 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e11bdc7d..e96e18ee 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,20 +65,21 @@

        Change Log

        Version 1.5.5

        Release Date: -- still in development

          -
        • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class
        • +
        • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
        • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
        • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
        • Reorganized the URI and Routes classes for better clarity.
        • -
        • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it
        • +
        • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
        • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
        • -
        • Added titles to all user manual pages
        • -
        • Documented the timezones() function in the Date Helper
        • -
        • Fixed a bug in database driver where num_rows property wasn't getting updated
        • -
        • Fixed a bug in captcha calling an invalid PHP function
        • -
        • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
        • +
        • Added titles to all user manual pages.
        • +
        • Documented the timezones() function in the Date Helper.
        • +
        • Documented unset_userdata in the Session class.
        • +
        • Fixed a bug in database driver where num_rows property wasn't getting updated.
        • +
        • Fixed a bug in captcha calling an invalid PHP function.
        • +
        • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
        • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
        • -
        • Fixed an example of comma-separated emails in the email library documentation
        • -
        • Fixed a typo in the DocBlock comment for unset_userdata() in Session
        • +
        • Fixed an example of comma-separated emails in the email library documentation.
        • +
        • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
        diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index a6ade694..22d46e66 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -1,303 +1,310 @@ - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
        - - - - - -

        CodeIgniter User Guide Version 1.5.3

        -
        - - - - - - - - - -
        - - -
        - - - -
        - - -

        Session Class

        - -

        The Session class permits you maintain a user's "state" and track their activity while they browse your site. -The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. -It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to -use the database option you'll need to create the session table as indicated below. -

        - -

        Note: The Session class does not utilize native PHP sessions. It -generates its own session data, offering more flexibility for developers.

        - -

        Initializing a Session

        - -

        Sessions will typically run globally with each page load, so the session class must either be -initialized in your -controller constructors, or it can be -auto-loaded by the system. -For the most part the session class will run unattended in the background, so simply initializing the class -will cause it to read, create, and update sessions.

        - - -

        To initialize the Session class manually in your controller constructor, use the $this->load->library function:

        - -$this->load->library('session'); -

        Once loaded, the Sessions library object will be available using: $this->session

        - - -

        How do Sessions work?

        - -

        When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. -If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. -If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

        - -

        It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or -even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

        - - -

        What is Session Data?

        - -

        A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

        - -
          -
        • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
        • -
        • The user's IP Address
        • -
        • The user's User Agent data (the first 50 characters of the browser data string)
        • -
        • The "last activity" and "last visit" time stamps.
        • -
        - -

        The above data is stored in a cookie as a serialized array with this prototype:

        - -[array]
        -(
        -     'session_id'    => random hash,
        -     'ip_address'    => 'string - user IP address',
        -     'user_agent'    => 'string - user agent data',
        -     'last_activity' => timestamp,
        -     'last_visit'    => timestamp
        -)
        - -

        If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, -making the data highly secure and impervious to being read or altered by someone. More info regarding encryption -can be found here, although the Session class will take care of initializing -and encrypting the data automatically.

        - -

        Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page -you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time -the cookie was written. This time is configurable my changing the $config['time_to_update'] line in your system/config/config.php file.

        - -

        Retrieving Session Data

        - -

        Any piece of information from the session array is available using the following function:

        - -$this->session->userdata('item'); - -

        Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you -will do this:

        - -$session_id = $this->session->userdata('session_id'); - -

        Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

        - - -

        Adding Custom Session Data

        - -

        A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

        - -

        Let's say a particular user logs into your site. Once authenticated, -you could add their username and email address to the session cookie, making that data globally available to you without -having to run a database query when you need it.

        - -

        To add your data to the session array involves passing an array containing your new data to this function:

        - -$this->session->set_userdata($array); - -

        Where $array is an associative array containing your new data. Here's an example:

        - - -

        $newdata = array(
        -                    'username'  => 'johndoe',
        -                    'email'     => 'johndoe@some-site.com',
        -                    'logged_in' => TRUE
        -                );
        -
        - $this->session->set_userdata($newdata);

        -

        If you want to add userdata one value at a time, set_userdata() also supports this syntax.

        -

        $this->session->set_userdata('some_name', 'some_value');

        -

        Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The -encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

        - -

        Flashdata

        -

        CodeIgniter supports "flashdata", or session data that will only ba available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

        -

        Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

        -

        To add flashdata:

        -

        $this->session->set_flashdata('item', 'value');

        -

        You can also pass an array to set_flashdata(), in the same manner as set_userdata().

        -

        To read a flashdata variable:

        -

        $this->session->flashdata('item');

        -

        If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.

        -

        $this->session->keep_flashdata('item');

        -

        Saving Session Data to a Database

        -

        While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

        - -

        When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never -be updated, they can only be generated when a new session is created.

        - -

        In order to store sessions, you must first create a database table for this purpose. Here is the basic -prototype (for MySQL) required by the session class:

        - - - -

        Note: By default the table is called ci_sessions, but you can name it anything you want -as long as you update the application/config/config.php file so that it contains the name you have chosen. -Once you have created your database table you can enable the database option in your config.php file as follows:

        - -$config['sess_use_database'] = TRUE; - -

        Once enabled, the Session class will store session data in the DB.

        - -

        Make sure you've specified the table name in your config file as well:

        - -$config['sess_table_name'] = 'ci_sessions"; - -

        Note: The Session class has built-in garbage collection which clears out expired sessions so you -do not need to write your own routine to do it.

        - - -

        Destroying a Session

        -

        To clear the current session:

        -$this->session->sess_destroy(); -

        Session Preferences

        -

        You'll find the following Session related preferences in your application/config/config.php file:

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        PreferenceDefaultOptionsDescription
        sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
        sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). -If you would like a non-expiring session set the value to zero: 0
        sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
        sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
        sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
        sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically -changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
        sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
        - - -
        - - - - - - + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +

        CodeIgniter User Guide Version 1.5.3

        +
        + + + + + + + + + +
        + + +
        + + + +
        + + +

        Session Class

        + +

        The Session class permits you maintain a user's "state" and track their activity while they browse your site. +The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. +It can also store the session data in a database table for added security, as this permits the session ID in the +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +use the database option you'll need to create the session table as indicated below. +

        + +

        Note: The Session class does not utilize native PHP sessions. It +generates its own session data, offering more flexibility for developers.

        + +

        Initializing a Session

        + +

        Sessions will typically run globally with each page load, so the session class must either be +initialized in your +controller constructors, or it can be +auto-loaded by the system. +For the most part the session class will run unattended in the background, so simply initializing the class +will cause it to read, create, and update sessions.

        + + +

        To initialize the Session class manually in your controller constructor, use the $this->load->library function:

        + +$this->load->library('session'); +

        Once loaded, the Sessions library object will be available using: $this->session

        + + +

        How do Sessions work?

        + +

        When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. +If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. +If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

        + +

        It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

        + + +

        What is Session Data?

        + +

        A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

        + +
          +
        • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
        • +
        • The user's IP Address
        • +
        • The user's User Agent data (the first 50 characters of the browser data string)
        • +
        • The "last activity" and "last visit" time stamps.
        • +
        + +

        The above data is stored in a cookie as a serialized array with this prototype:

        + +[array]
        +(
        +     'session_id'    => random hash,
        +     'ip_address'    => 'string - user IP address',
        +     'user_agent'    => 'string - user agent data',
        +     'last_activity' => timestamp,
        +     'last_visit'    => timestamp
        +)
        + +

        If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, +making the data highly secure and impervious to being read or altered by someone. More info regarding encryption +can be found here, although the Session class will take care of initializing +and encrypting the data automatically.

        + +

        Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time +the cookie was written. This time is configurable my changing the $config['time_to_update'] line in your system/config/config.php file.

        + +

        Retrieving Session Data

        + +

        Any piece of information from the session array is available using the following function:

        + +$this->session->userdata('item'); + +

        Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +will do this:

        + +$session_id = $this->session->userdata('session_id'); + +

        Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

        + + +

        Adding Custom Session Data

        + +

        A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. +Why would you want to do this? Here's one example:

        + +

        Let's say a particular user logs into your site. Once authenticated, +you could add their username and email address to the session cookie, making that data globally available to you without +having to run a database query when you need it.

        + +

        To add your data to the session array involves passing an array containing your new data to this function:

        + +$this->session->set_userdata($array); + +

        Where $array is an associative array containing your new data. Here's an example:

        + + +

        $newdata = array(
        +                    'username'  => 'johndoe',
        +                    'email'     => 'johndoe@some-site.com',
        +                    'logged_in' => TRUE
        +                );
        +
        + $this->session->set_userdata($newdata);

        +

        If you want to add userdata one value at a time, set_userdata() also supports this syntax.

        +

        $this->session->set_userdata('some_name', 'some_value');

        +

        Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

        + +

        Removing Session Data

        +

        Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

        +

        $this->session->unset_userdata('some_name');

        +

        This function can also be passed an array of items to unset.

        +

        $array_items = array('username', 'email');
        +
        +$this->session->set_userdata($array_items);

        +

        Flashdata

        +

        CodeIgniter supports "flashdata", or session data that will only ba available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

        +

        Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

        +

        To add flashdata:

        +

        $this->session->set_flashdata('item', 'value');

        +

        You can also pass an array to set_flashdata(), in the same manner as set_userdata().

        +

        To read a flashdata variable:

        +

        $this->session->flashdata('item');

        +

        If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.

        +

        $this->session->keep_flashdata('item');

        +

        Saving Session Data to a Database

        +

        While the session data array stored in the user's cookie contains a Session ID, +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

        + +

        When session data is available in a database, every time a valid session is found in the user's cookie, a database +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +be updated, they can only be generated when a new session is created.

        + +

        In order to store sessions, you must first create a database table for this purpose. Here is the basic +prototype (for MySQL) required by the session class:

        + + + +

        Note: By default the table is called ci_sessions, but you can name it anything you want +as long as you update the application/config/config.php file so that it contains the name you have chosen. +Once you have created your database table you can enable the database option in your config.php file as follows:

        + +$config['sess_use_database'] = TRUE; + +

        Once enabled, the Session class will store session data in the DB.

        + +

        Make sure you've specified the table name in your config file as well:

        + +$config['sess_table_name'] = 'ci_sessions"; + +

        Note: The Session class has built-in garbage collection which clears out expired sessions so you +do not need to write your own routine to do it.

        + + +

        Destroying a Session

        +

        To clear the current session:

        +$this->session->sess_destroy(); +

        Session Preferences

        +

        You'll find the following Session related preferences in your application/config/config.php file:

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        PreferenceDefaultOptionsDescription
        sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
        sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). +If you would like a non-expiring session set the value to zero: 0
        sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
        sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
        sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
        sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically +changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
        sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
        + + +
        + + + + + + \ No newline at end of file From 08e6b0cca401fdcdafddf652c9d3727428e62772 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 23 Aug 2007 01:04:53 +0000 Subject: [PATCH 0699/2544] Fixed an example in the Calendar library for Showing Next/Previous Month Links. --- user_guide/changelog.html | 1 + user_guide/libraries/calendar.html | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e96e18ee..6273afea 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,7 @@

        Version 1.5.5

      • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
      • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
      • Fixed an example of comma-separated emails in the email library documentation.
      • +
      • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
      • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 2880887c..4731d507 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -171,14 +171,14 @@

      Showing Next/Previous Month Links

      code similar to this example:

      -$this->load->library('calendar');
      -
      -$prefs = array (
      +$prefs = array (
                     'show_next_prev'  => TRUE,
                     'next_prev_url'   => 'http://www.your-site.com/index.php/calendar/show/'
                   );

      -echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $prefs);
      +$this->load->library('calendar', $prefs);
      +
      +echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));

      You'll notice a few things about the above example:

      From 2189f2a5974c5fc9fe6016d7340c0205a570b9c9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 23 Aug 2007 18:35:14 +0000 Subject: [PATCH 0700/2544] Fixed a typo in the database language file. --- system/language/english/db_lang.php | 46 ++++++++++++++--------------- user_guide/changelog.html | 1 + 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php index a17bb71f..57897263 100644 --- a/system/language/english/db_lang.php +++ b/system/language/english/db_lang.php @@ -1,24 +1,24 @@ - \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6273afea..e8f783ea 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

      Version 1.5.5

    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • +
    • Fixed a typo in the database language file.
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    From 4f95353d295455ee740aec7ee1b5060195bff987 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 10 Sep 2007 16:37:12 +0000 Subject: [PATCH 0701/2544] fixed docs for unset_userdata() --- user_guide/libraries/sessions.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 22d46e66..94eb3ca8 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -176,10 +176,10 @@

    Adding Custom Session Data

    Removing Session Data

    Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

    $this->session->unset_userdata('some_name');

    -

    This function can also be passed an array of items to unset.

    -

    $array_items = array('username', 'email');
    +

    This function can also be passed an associative array of items to unset.

    +

    $array_items = array('username' => '', 'email' => '');

    -$this->session->set_userdata($array_items);

    +$this->session->unset_userdata($array_items);

    Flashdata

    CodeIgniter supports "flashdata", or session data that will only ba available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

    Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

    From 2005ffe2fb3cff05fd5e8cd7e73a4c7053328574 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 15 Sep 2007 20:11:54 +0000 Subject: [PATCH 0702/2544] changed Creating Loops - -

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    - - - - - -

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    - -

    Function Reference

    - - -

    get_clickable_smileys()

    - -

    Returns an array containing your smiley images wrapped in a cliackable link. You must supply the URL to your smiley folder -via the first parameter:

    - -$image_array = get_clickable_smileys("http://www.your-site.com/images/smileys/"); - - -

    js_insert_smiley()

    - -

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. -The first parameter must contain the name of your form, the second parameter must contain the name of the -form field. This function is designed to be placed into the <head> area of your web page.

    - -<?php echo js_insert_smiley('blog', 'comments'); ?> - - -

    parse_smileys()

    - -

    Takes a string of text as input and replaces any contained plain text smileys into the image -equivalent. The first parameter must contain your string, the second must contain the the URL to your smiley folder:

    - - - -$str = 'Here are some simileys: :-) ;-)'; - -$str = parse_smileys($str, "http://www.your-site.com/images/smileys/"); - -echo $str; - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : Smiley Helper

    CodeIgniter User Guide Version 1.5.4


    Smiley Helper

    The Smiley Helper file contains functions that let you manage smileys (emoticons).

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('smiley');

    Overview

    The Smiley helper has a renderer that takes plain text simileys, like :-) and turns them into a image representation, like smile!

    It also lets you display a set of smiley images that when clicked will be inserted into a form field. For example, if you have a blog that allows user commenting you can show the smileys next to the comment form. Your users can click a desired smiley and with the help of some JavaScript it will be placed into the form field.

    Clickable Smileys Tutorial

    Here is an example demonstrating how you might create a set of clickable smileys next to a form field. This example requires that you first download and install the smiley images, then create a controller and the View as described.

    Important: Before you begin, please download the smiley images and put them in a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at application/config/smileys.php

    The Controller

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    Important: Change the URL in the get_clickable_smileys() function below so that it points to your smiley folder.

    You'll notice that in addition to the smiley helper we are using the Table Class.

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    Function Reference

    get_clickable_smileys()

    Returns an array containing your smiley images wrapped in a cliackable link. You must supply the URL to your smiley folder via the first parameter:

    $image_array = get_clickable_smileys("http://www.your-site.com/images/smileys/");

    js_insert_smiley()

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. The first parameter must contain the name of your form, the second parameter must contain the name of the form field. This function is designed to be placed into the <head> area of your web page.

    <?php echo js_insert_smiley('blog', 'comments'); ?>

    parse_smileys()

    Takes a string of text as input and replaces any contained plain text smileys into the image equivalent. The first parameter must contain your string, the second must contain the the URL to your smiley folder:

    $str = 'Here are some simileys: :-) ;-)'; $str = parse_smileys($str, "http://www.your-site.com/images/smileys/"); echo $str;
    \ No newline at end of file diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 77cabe43..cd2f9e30 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -1,488 +1 @@ - - - - -CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    XML-RPC and XML-RPC Server Classes

    - - -

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up -your own XML-RPC server to receive requests.

    - - -

    What is XML-RPC?

    - -

    Quite simply it is a way for two computers to communicate over the internet using XML. -One computer, which we will call the client, sends an XML-RPC request to -another computer, which we will call the server. Once the server receives and processes the request it -will send back a response to the client.

    - -

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will -send a request to an XML-RPC Server running on your site. This request might be a new weblog entry -being sent for publication, or it could be a request for an existing entry for editing. - -When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. -Once processed, the server will then send back a response message.

    - -

    For detailed specifications, you can visit the XML-RPC site.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    - -

    To load the XML-RPC class you will use:

    -$this->load->library('xmlrpc'); -

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    - -

    To load the XML-RPC Server class you will use:

    - -$this->load->library('xmlrpc');
    -$this->load->library('xmlrpcs'); -
    -

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    - -

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    - - - -

    Sending XML-RPC Requests

    - -

    To send a request to an XML-RPC server you must specify the following information:

    - -
      -
    • The URL of the server
    • -
    • The method on the server you wish to call
    • -
    • The request data (explained below).
    • -
    - -

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    - - -$this->load->library('xmlrpc');
    -
    -$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    -$this->xmlrpc->method('weblogUpdates.ping');
    - -
    -$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    -$this->xmlrpc->request($request);
    -
    -if ( ! $this->xmlrpc->send_request())
    -{
    -    echo $xmlrpc->display_error();
    -} -
    - -

    Explanation

    - -

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The -request (in this case, the title and URL of your site) is placed into an array for transportation, and -compiled using the request() function. -Lastly, the full request is sent. If the send_request() method returns false we will display the error message -sent back from the XML-RPC Server.

    - -

    Anatomy of a Request

    - -

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request -is referred to as a request parameter. The above example has two parameters: -The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    - -

    Request parameters must be placed into an array for transportation, and each parameter can be one -of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings -you will have to include the data type in the request array.

    - -

    Here is an example of a simple array with three parameters:

    - -$request = array('John', 'Doe', 'www.some-site.com');
    -$this->xmlrpc->request($request);
    - -

    If you use data types other than strings, or if you have several different data types, you will place -each parameter into its own array, with the data type in the second position:

    - - -$request = array (
    -                   array('John', 'string'),
    -                   array('Doe', 'string'),
    -                   array(FALSE, 'boolean'),
    -                   array(12345, 'int')
    -                 ); -
    -$this->xmlrpc->request($request);
    - -The Data Types section below has a full list of data types.

    - - - -

    Creating an XML-RPC Server

    - -

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the -appropriate functions for processing.

    - -

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming -request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate -class and method for processing.

    - -

    Here is an example to illustrate:

    - - -$this->load->library('xmlrpc');
    -$this->load->library('xmlrpcs');
    -
    -$config['functions']['new_post']  = array('function' => 'My_blog.new_entry');
    -$config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
    -
    -$this->xmlrpcs->initialize($config);
    -$this->xmlrpcs->serve();
    - -

    The above example contains an array specifying two method requests that the Server allows. -The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    - -

    In other words, if an XML-RPC Client sends a request for the new_post method, your -server will load the My_blog class and call the new_entry function. -If the request is for the update_post method, your -server will load the My_blog class and call the update_entry function.

    - -

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, -or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    - - -

    Processing Server Requests

    - -

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass -an object to that method containing the data sent by the client.

    - -

    Using the above example, if the new_post method is requested, the server will expect a class -to exist with this prototype:

    - -class My_blog extends Controller {
    -
    -    function new_post($request)
    -    {
    -
    -    }
    -} -
    - -

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. -Using this object you will have access to the request parameters enabling you to process the request. When -you are done you will send a Response back to the Client.

    - -

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). -Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends -back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing -function might look:

    - - -class My_blog extends Controller {
    -
    -    function getUserInfo($request)
    -    {
    - -        $username = 'smitty';
    -        $password = 'secretsmittypass';

    - -        $this->load->library('xmlrpc');
    -    
    -        $parameters = $request->output_parameters();
    -    
    -        if ($parameters['1'] != $username AND $parameters['2'] != $password)
    -        {
    -            return $this->xmlrpc->send_error_message('100', 'Invalid Access');
    -        }
    -    
    -        $response = array(array('nickname'  => array('Smitty','string'),
    -                                'userid'    => array('99','string'),
    -                                'url'       => array('http://yoursite.com','string'),
    -                                'email'     => array('jsmith@yoursite.com','string'),
    -                                'lastname'  => array('Smith','string'),
    -                                'firstname' => array('John','string')
    -                                ),
    -                         'struct');
    -
    -        return $this->xmlrpc->send_response($response);
    -    }
    -} -
    - -

    Notes:

    -

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. -In the above example, the output parameters will be the username and password.

    - -

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    - -

    If the operation was successful, the client will be sent back a response array containing the user's info.

    - - -

    Formatting a Response

    - -

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array -that contains a single item. This item can be an array with several additional arrays, but there -can be only one primary array index. In other words, the basic prototype is this:

    - -$response = array('Response data', 'array'); - -

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own -array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    - - -$response = array (
    -                   array(
    -                         'first_name' => array('John', 'string'),
    -                         'last_name' => array('Doe', 'string'),
    -                         'member_id' => array(123435, 'int'),
    -                         'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
    -                        ),
    -                 'struct'
    -                 ); -
    - -

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    - -

    As with Requests, a response can be on of the seven data types listed in the Data Types section.

    - - -

    Sending an Error Response

    - -

    If you need to send the client an error response you will use the following:

    - -return $this->xmlrpc->send_error_message('123', 'Requested data not available'); - -

    The first parameter is the error number while the second parameter is the error message.

    - - - - - - -

    Creating Your Own Client and Server

    - -

    To help you understand everything we've covered thus far, let's create a couple controllers that act as -XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    - -

    The Client

    - -

    Using a text editor, create a controller called xmlrpc_client.php. -In it, place this code and save it to your applications/controllers/ folder:

    - - - -

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    - -

    The Server

    - -

    Using a text editor, create a controller called xmlrpc_server.php. -In it, place this code and save it to your applications/controllers/ folder:

    - - - -

    Try it!

    - -

    Now visit the your site using a URL similar to this:

    -www.your-site.com/index.php/xmlrpc_client/ - -

    You should now see the message you sent to the server, and its response back to you.

    - -

    The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. -The Server receives the request and maps it to the "process" function, where a response is sent back.

    - - - -

     

    -

    XML-RPC Function Reference

    - -

    $this->xmlrpc->server()

    -

    Sets the URL and port number of the server to which a request is to be sent:

    -$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80); - -

    $this->xmlrpc->timeout()

    -

    Set a time out period (in seconds) after which the request will be canceled:

    -$this->xmlrpc->timeout(6); - -

    $this->xmlrpc->method()

    -

    Sets the method that will be requested from the XML-RPC server:

    -$this->xmlrpc->method('method'); - -

    Where method is the name of the method.

    - -

    $this->xmlrpc->request()

    -

    Takes an array of data and builds request to be sent to XML-RPC server:

    -$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    -$this->xmlrpc->request($request);
    - -

    $this->xmlrpc->send_request()

    -

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    - -

    $this->xmlrpc->set_debug(TRUE);

    -

    Enables debugging, which will display a variety of information and error data helpful during development.

    - - -

    $this->xmlrpc->display_error()

    -

    Returns an error message as a string if your request failed for some reason.

    -echo $this->xmlrpc->display_error(); - -

    $this->xmlrpc->display_response()

    -

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    -$this->xmlrpc->display_response(); - -

    $this->xmlrpc->send_error_message()

    -

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter -is the error message.

    -return $this->xmlrpc->send_error_message('123', 'Requested data not available'); - -

    $this->xmlrpc->send_response()

    -

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    -$response = array(
    -                 array(
    -                        'flerror' => array(FALSE, 'boolean'),
    -                        'message' => "Thanks for the ping!")
    -                     )
    -                 'struct');
    -return $this->xmlrpc->send_response($response);
    - - - -

    Data Types

    - -

    According to the XML-RPC spec there are seven types -of values that you can send via XML-RPC:

    - -
      -
    • int or i4
    • -
    • boolean
    • -
    • string
    • -
    • double
    • -
    • dateTime.iso8601
    • -
    • base64
    • -
    • struct (contains array of values)
    • -
    • array (contains array of values)
    • -
    - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes

    CodeIgniter User Guide Version 1.5.4


    XML-RPC and XML-RPC Server Classes

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up your own XML-RPC server to receive requests.

    What is XML-RPC?

    Quite simply it is a way for two computers to communicate over the internet using XML. One computer, which we will call the client, sends an XML-RPC request to another computer, which we will call the server. Once the server receives and processes the request it will send back a response to the client.

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will send a request to an XML-RPC Server running on your site. This request might be a new weblog entry being sent for publication, or it could be a request for an existing entry for editing. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. Once processed, the server will then send back a response message.

    For detailed specifications, you can visit the XML-RPC site.

    Initializing the Class

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    To load the XML-RPC class you will use:

    $this->load->library('xmlrpc');

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    To load the XML-RPC Server class you will use:

    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs');

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    Sending XML-RPC Requests

    To send a request to an XML-RPC server you must specify the following information:

    • The URL of the server
    • The method on the server you wish to call
    • The request data (explained below).

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    $this->load->library('xmlrpc');

    $this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    $this->xmlrpc->method('weblogUpdates.ping');

    $request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    $this->xmlrpc->request($request);

    if ( ! $this->xmlrpc->send_request())
    {
        echo $this->xmlrpc->display_error();
    }

    Explanation

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The request (in this case, the title and URL of your site) is placed into an array for transportation, and compiled using the request() function. Lastly, the full request is sent. If the send_request() method returns false we will display the error message sent back from the XML-RPC Server.

    Anatomy of a Request

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request is referred to as a request parameter. The above example has two parameters: The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    Request parameters must be placed into an array for transportation, and each parameter can be one of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings you will have to include the data type in the request array.

    Here is an example of a simple array with three parameters:

    $request = array('John', 'Doe', 'www.some-site.com');
    $this->xmlrpc->request($request);

    If you use data types other than strings, or if you have several different data types, you will place each parameter into its own array, with the data type in the second position:

    $request = array (
                       array('John', 'string'),
                       array('Doe', 'string'),
                       array(FALSE, 'boolean'),
                       array(12345, 'int')
                     );
    $this->xmlrpc->request($request);
    The Data Types section below has a full list of data types.

    Creating an XML-RPC Server

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the appropriate functions for processing.

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate class and method for processing.

    Here is an example to illustrate:

    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs');

    $config['functions']['new_post']  = array('function' => 'My_blog.new_entry');
    $config['functions']['update_post'] = array('function' => 'My_blog.update_entry');

    $this->xmlrpcs->initialize($config);
    $this->xmlrpcs->serve();

    The above example contains an array specifying two method requests that the Server allows. The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    In other words, if an XML-RPC Client sends a request for the new_post method, your server will load the My_blog class and call the new_entry function. If the request is for the update_post method, your server will load the My_blog class and call the update_entry function.

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    Processing Server Requests

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass an object to that method containing the data sent by the client.

    Using the above example, if the new_post method is requested, the server will expect a class to exist with this prototype:

    class My_blog extends Controller {

        function new_post($request)
        {

        }
    }

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. Using this object you will have access to the request parameters enabling you to process the request. When you are done you will send a Response back to the Client.

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing function might look:

    class My_blog extends Controller {

        function getUserInfo($request)
        {
            $username = 'smitty';
            $password = 'secretsmittypass';

            $this->load->library('xmlrpc');
        
            $parameters = $request->output_parameters();
        
            if ($parameters['1'] != $username AND $parameters['2'] != $password)
            {
                return $this->xmlrpc->send_error_message('100', 'Invalid Access');
            }
        
            $response = array(array('nickname'  => array('Smitty','string'),
                                    'userid'    => array('99','string'),
                                    'url'       => array('http://yoursite.com','string'),
                                    'email'     => array('jsmith@yoursite.com','string'),
                                    'lastname'  => array('Smith','string'),
                                    'firstname' => array('John','string')
                                    ),
                             'struct');

            return $this->xmlrpc->send_response($response);
        }
    }

    Notes:

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. In the above example, the output parameters will be the username and password.

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    If the operation was successful, the client will be sent back a response array containing the user's info.

    Formatting a Response

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array that contains a single item. This item can be an array with several additional arrays, but there can be only one primary array index. In other words, the basic prototype is this:

    $response = array('Response data', 'array');

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    $response = array (
                       array(
                             'first_name' => array('John', 'string'),
                             'last_name' => array('Doe', 'string'),
                             'member_id' => array(123435, 'int'),
                             'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
                            ),
                     'struct'
                     );

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    As with Requests, a response can be on of the seven data types listed in the Data Types section.

    Sending an Error Response

    If you need to send the client an error response you will use the following:

    return $this->xmlrpc->send_error_message('123', 'Requested data not available');

    The first parameter is the error number while the second parameter is the error message.

    Creating Your Own Client and Server

    To help you understand everything we've covered thus far, let's create a couple controllers that act as XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    The Client

    Using a text editor, create a controller called xmlrpc_client.php. In it, place this code and save it to your applications/controllers/ folder:

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    The Server

    Using a text editor, create a controller called xmlrpc_server.php. In it, place this code and save it to your applications/controllers/ folder:

    Try it!

    Now visit the your site using a URL similar to this:

    www.your-site.com/index.php/xmlrpc_client/

    You should now see the message you sent to the server, and its response back to you.

    The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. The Server receives the request and maps it to the "process" function, where a response is sent back.

     

    XML-RPC Function Reference

    $this->xmlrpc->server()

    Sets the URL and port number of the server to which a request is to be sent:

    $this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);

    $this->xmlrpc->timeout()

    Set a time out period (in seconds) after which the request will be canceled:

    $this->xmlrpc->timeout(6);

    $this->xmlrpc->method()

    Sets the method that will be requested from the XML-RPC server:

    $this->xmlrpc->method('method');

    Where method is the name of the method.

    $this->xmlrpc->request()

    Takes an array of data and builds request to be sent to XML-RPC server:

    $request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    $this->xmlrpc->request($request);

    $this->xmlrpc->send_request()

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    $this->xmlrpc->set_debug(TRUE);

    Enables debugging, which will display a variety of information and error data helpful during development.

    $this->xmlrpc->display_error()

    Returns an error message as a string if your request failed for some reason.

    echo $this->xmlrpc->display_error();

    $this->xmlrpc->display_response()

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    $this->xmlrpc->display_response();

    $this->xmlrpc->send_error_message()

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter is the error message.

    return $this->xmlrpc->send_error_message('123', 'Requested data not available');

    $this->xmlrpc->send_response()

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    $response = array(
                     array(
                            'flerror' => array(FALSE, 'boolean'),
                            'message' => "Thanks for the ping!")
                         )
                     'struct');
    return $this->xmlrpc->send_response($response);

    Data Types

    According to the XML-RPC spec there are seven types of values that you can send via XML-RPC:

    • int or i4
    • boolean
    • string
    • double
    • dateTime.iso8601
    • base64
    • struct (contains array of values)
    • array (contains array of values)
    \ No newline at end of file From d34c95b0554e8d43f3d3c96cc84a754e8f1e2372 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 6 Dec 2007 13:54:54 +0000 Subject: [PATCH 0732/2544] added strip_quotes(), quotes_to_entities(), reduce_multiples() to string helper --- system/helpers/string_helper.php | 155 +------------------------------ user_guide/changelog.html | 2 +- 2 files changed, 2 insertions(+), 155 deletions(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 8ef71595..879ae2f8 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1,154 +1 @@ - 0) ? str_repeat($data, $num) : ''); -} - - -?> \ No newline at end of file + $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\""), array("'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = preg_replace("#".$character."+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4014822b..760238e3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing ?> in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file From 3755fc67fe28ae88061a13e5b78bb91fe836fcb1 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 9 Dec 2007 18:22:51 +0000 Subject: [PATCH 0733/2544] fix up of regular expression in reduce multiples --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 879ae2f8..1ca25e33 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1 +1 @@ - $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\""), array("'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = preg_replace("#".$character."+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file + $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\""), array("'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $preg_chars = preg_quote($character, '#') . preg_quote($character, '#'); $str = preg_replace("#$preg_chars+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file From 375d9bac3453e309900b475cb4a1efb836f97440 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 9 Dec 2007 18:25:55 +0000 Subject: [PATCH 0734/2544] quotes to entities now takes escaped and non-escaped quotes --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 1ca25e33..470bce2e 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1 +1 @@ - $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\""), array("'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $preg_chars = preg_quote($character, '#') . preg_quote($character, '#'); $str = preg_replace("#$preg_chars+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file + $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\"","'",'"'), array("'",""","'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $preg_chars = preg_quote($character, '#') . preg_quote($character, '#'); $str = preg_replace("#$preg_chars+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file From c112453356bb3c49c9adaecb3fda1ccd04a92be6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 9 Dec 2007 19:26:17 +0000 Subject: [PATCH 0735/2544] documented strip_quotes(), quotes_to_entities(), reduce_multiples() --- user_guide/helpers/string_helper.html | 145 +------------------------- 1 file changed, 1 insertion(+), 144 deletions(-) diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 37902177..554afc82 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -1,144 +1 @@ - - - - -CodeIgniter User Guide : String Helper - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    String Helper

    - -

    The String Helper file contains functions that assist in working with strings.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('string'); - -

    The following functions are available:

    - -

    random_string()

    - -

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    - -

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    - - -
      -
    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • -
    • numeric:  Numeric string.
    • -
    • nozero:  Numeric string with no zeros.
    • -
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. -Returns a fixed length 33 character string.
    • -
    - -

    Usage example:

    - -echo random_string('alnum', 16); - - -

    alternator()

    - -

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    - -for ($i = 0; $i < 10; $i++)
    -{
    -    echo alternator('string one', 'string two');
    -}
    -
    - -

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    - -for ($i = 0; $i < 10; $i++)
    -{
    -    echo alternator('one', 'two', 'three', 'four', 'five');
    -}
    -
    - -

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    - - - -

    repeater()

    -

    Generates repeating copies of the data you submit. Example:

    -$string = "\n";
    -echo repeater($string, 30);
    - -

    The above would generate 30 newlines.

    -

    reduce_double_slashes()

    -

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    -$string = "http://www.example.com//index.php";
    -echo reduce_double_slashes($string); // results in "http://www.example.com/index.php"
    -

    trim_slashes()

    -

    Removes any leading/trailing slashes from a string. Example:
    -
    - $string = "/this/that/theother/";
    -echo trim_slashes($string); // results in this/that/theother

    -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : String Helper

    CodeIgniter User Guide Version 1.5.4


    String Helper

    The String Helper file contains functions that assist in working with strings.

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('string');

    The following functions are available:

    random_string()

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • numeric:  Numeric string.
    • nozero:  Numeric string with no zeros.
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. Returns a fixed length 33 character string.

    Usage example:

    echo random_string('alnum', 16);

    alternator()

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    for ($i = 0; $i < 10; $i++)
    {
        echo alternator('string one', 'string two');
    }

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    for ($i = 0; $i < 10; $i++)
    {
        echo alternator('one', 'two', 'three', 'four', 'five');
    }

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    repeater()

    Generates repeating copies of the data you submit. Example:

    $string = "\n";
    echo repeater($string, 30);

    The above would generate 30 newlines.

    reduce_double_slashes()

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    $string = "http://www.example.com//index.php";
    echo reduce_double_slashes($string); // results in "http://www.example.com/index.php"

    trim_slashes()

    Removes any leading/trailing slashes from a string. Example:

    $string = "/this/that/theother/";
    echo trim_slashes($string); // results in this/that/theother

    reduce_multiples()

    Reduces multiple instances of a particular character occuring directly after each other. Example:

    $string="Fred, Bill,, Joe, Jimmy";
    $string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"

    The function accepts the following parameters: reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string) The first parameter contrains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced. The third parameter is False by default. If it it's to true it will remove occurences of the character at the beginning and the end of the string. Example: $string=",Fred, Bill,, Joe, Jimmy,";
    $string=reduce_multiples($string,",",true); //results in "Fred, Bill, Joe, Jimmy"

    quotes_to_entities()

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    $string="Joe's \"dinner\"";
    $string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;"

    strip_quotes()

    Removes single and double quotes from a string. Example:

    $string="Joe's \"dinner\"";
    $string=strip_quotes($string); //results in "Joes dinner"
    \ No newline at end of file From 0a581e06e39daafeb0e161f67f2598432a6a8168 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 9 Dec 2007 19:36:03 +0000 Subject: [PATCH 0736/2544] added a space after the -f flag for server compatibility --- system/libraries/Email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 9c512117..c0593df0 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1 +1 @@ - 0) { $this->initialize($config); } log_message('debug', "Email Class Initialized"); } // -------------------------------------------------------------------- /** * Initialize preferences * * @access public * @param array * @return void */ function initialize($config = array()) { $this->clear(); foreach ($config as $key => $val) { if (isset($this->$key)) { $method = 'set_'.$key; if (method_exists($this, $method)) { $this->$method($val); } else { $this->$key = $val; } } } $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; } // -------------------------------------------------------------------- /** * Initialize the Email Data * * @access public * @return void */ function clear($clear_attachments = FALSE) { $this->_subject = ""; $this->_body = ""; $this->_finalbody = ""; $this->_header_str = ""; $this->_replyto_flag = FALSE; $this->_recipients = array(); $this->_headers = array(); $this->_debug_msg = array(); $this->_set_header('User-Agent', $this->useragent); $this->_set_header('Date', $this->_set_date()); if ($clear_attachments !== FALSE) { $this->_attach_name = array(); $this->_attach_type = array(); $this->_attach_disp = array(); } } // -------------------------------------------------------------------- /** * Set FROM * * @access public * @param string * @param string * @return void */ function from($from, $name = '') { if (preg_match( '/\<(.*)\>/', $from, $match)) $from = $match['1']; if ($this->validate) $this->validate_email($this->_str_to_array($from)); if ($name != '' && substr($name, 0, 1) != '"') { $name = '"'.$name.'"'; } $this->_set_header('From', $name.' <'.$from.'>'); $this->_set_header('Return-Path', '<'.$from.'>'); } // -------------------------------------------------------------------- /** * Set Reply-to * * @access public * @param string * @param string * @return void */ function reply_to($replyto, $name = '') { if (preg_match( '/\<(.*)\>/', $replyto, $match)) $replyto = $match['1']; if ($this->validate) $this->validate_email($this->_str_to_array($replyto)); if ($name == '') { $name = $replyto; } if (substr($name, 0, 1) != '"') { $name = '"'.$name.'"'; } $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); $this->_replyto_flag = TRUE; } // -------------------------------------------------------------------- /** * Set Recipients * * @access public * @param string * @return void */ function to($to) { $to = $this->_str_to_array($to); $to = $this->clean_email($to); if ($this->validate) $this->validate_email($to); if ($this->_get_protocol() != 'mail') $this->_set_header('To', implode(", ", $to)); switch ($this->_get_protocol()) { case 'smtp' : $this->_recipients = $to; break; case 'sendmail' : $this->_recipients = implode(", ", $to); break; case 'mail' : $this->_recipients = implode(", ", $to); break; } } // -------------------------------------------------------------------- /** * Set CC * * @access public * @param string * @return void */ function cc($cc) { $cc = $this->_str_to_array($cc); $cc = $this->clean_email($cc); if ($this->validate) $this->validate_email($cc); $this->_set_header('Cc', implode(", ", $cc)); if ($this->_get_protocol() == "smtp") $this->_cc_array = $cc; } // -------------------------------------------------------------------- /** * Set BCC * * @access public * @param string * @param string * @return void */ function bcc($bcc, $limit = '') { if ($limit != '' && is_numeric($limit)) { $this->bcc_batch_mode = true; $this->bcc_batch_size = $limit; } $bcc = $this->_str_to_array($bcc); $bcc = $this->clean_email($bcc); if ($this->validate) $this->validate_email($bcc); if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) $this->_bcc_array = $bcc; else $this->_set_header('Bcc', implode(", ", $bcc)); } // -------------------------------------------------------------------- /** * Set Email Subject * * @access public * @param string * @return void */ function subject($subject) { $subject = preg_replace("/(\r\n)|(\r)|(\n)/", "", $subject); $subject = preg_replace("/(\t)/", " ", $subject); $this->_set_header('Subject', trim($subject)); } // -------------------------------------------------------------------- /** * Set Body * * @access public * @param string * @return void */ function message($body) { $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); } // -------------------------------------------------------------------- /** * Assign file attachments * * @access public * @param string * @return string */ function attach($filename, $disposition = 'attachment') { $this->_attach_name[] = $filename; $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters } // -------------------------------------------------------------------- /** * Add a Header Item * * @access public * @param string * @param string * @return void */ function _set_header($header, $value) { $this->_headers[$header] = $value; } // -------------------------------------------------------------------- /** * Convert a String to an Array * * @access public * @param string * @return array */ function _str_to_array($email) { if ( ! is_array($email)) { if (ereg(',$', $email)) $email = substr($email, 0, -1); if (ereg('^,', $email)) $email = substr($email, 1); if (ereg(',', $email)) { $x = explode(',', $email); $email = array(); for ($i = 0; $i < count($x); $i ++) $email[] = trim($x[$i]); } else { $email = trim($email); settype($email, "array"); } } return $email; } // -------------------------------------------------------------------- /** * Set Multipart Value * * @access public * @param string * @return void */ function set_alt_message($str = '') { $this->alt_message = ($str == '') ? '' : $str; } // -------------------------------------------------------------------- /** * Set Mailtype * * @access public * @param string * @return void */ function set_mailtype($type = 'text') { $this->mailtype = ($type == 'html') ? 'html' : 'text'; } // -------------------------------------------------------------------- /** * Set Wordwrap * * @access public * @param string * @return void */ function set_wordwrap($wordwrap = TRUE) { $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; } // -------------------------------------------------------------------- /** * Set Protocol * * @access public * @param string * @return void */ function set_protocol($protocol = 'mail') { $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); } // -------------------------------------------------------------------- /** * Set Priority * * @access public * @param integer * @return void */ function set_priority($n = 3) { if ( ! is_numeric($n)) { $this->priority = 3; return; } if ($n < 1 OR $n > 5) { $this->priority = 3; return; } $this->priority = $n; } // -------------------------------------------------------------------- /** * Set Newline Character * * @access public * @param string * @return void */ function set_newline($newline = "\n") { if ($newline != "\n" AND $newline != "\r\n" AND $newline != "\r") { $this->newline = "\n"; return; } $this->newline = $newline; } // -------------------------------------------------------------------- /** * Set Message Boundary * * @access private * @return void */ function _set_boundaries() { $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary } // -------------------------------------------------------------------- /** * Get the Message ID * * @access private * @return string */ function _get_message_id() { $from = $this->_headers['Return-Path']; $from = str_replace(">", "", $from); $from = str_replace("<", "", $from); return "<".uniqid('').strstr($from, '@').">"; } // -------------------------------------------------------------------- /** * Get Mail Protocol * * @access private * @param bool * @return string */ function _get_protocol($return = true) { $this->protocol = strtolower($this->protocol); $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol; if ($return == true) return $this->protocol; } // -------------------------------------------------------------------- /** * Get Mail Encoding * * @access private * @param bool * @return string */ function _get_encoding($return = true) { $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '7bit' : $this->_encoding; if ( ! in_array($this->charset, $this->_base_charsets, TRUE)) $this->_encoding = "8bit"; if ($return == true) return $this->_encoding; } // -------------------------------------------------------------------- /** * Get content type (text/html/attachment) * * @access private * @return string */ function _get_content_type() { if ($this->mailtype == 'html' && count($this->_attach_name) == 0) return 'html'; elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) return 'html-attach'; elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) return 'plain-attach'; else return 'plain'; } // -------------------------------------------------------------------- /** * Set RFC 822 Date * * @access public * @return string */ function _set_date() { $timezone = date("Z"); $operator = (substr($timezone, 0, 1) == '-') ? '-' : '+'; $timezone = abs($timezone); $timezone = floor($timezone/3600) * 100 + ($timezone % 3600 ) / 60; return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); } // -------------------------------------------------------------------- /** * Mime message * * @access private * @return string */ function _get_mime_message() { return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; } // -------------------------------------------------------------------- /** * Validate Email Address * * @access public * @param string * @return bool */ function validate_email($email) { if ( ! is_array($email)) { $this->_set_error_message('email_must_be_array'); return FALSE; } foreach ($email as $val) { if ( ! $this->valid_email($val)) { $this->_set_error_message('email_invalid_address', $val); return FALSE; } } } // -------------------------------------------------------------------- /** * Email Validation * * @access public * @param string * @return bool */ function valid_email($address) { if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) return FALSE; else return TRUE; } // -------------------------------------------------------------------- /** * Clean Extended Email Address: Joe Smith * * @access public * @param string * @return string */ function clean_email($email) { if ( ! is_array($email)) { if (preg_match('/\<(.*)\>/', $email, $match)) return $match['1']; else return $email; } $clean_email = array(); for ($i=0; $i < count($email); $i++) { if (preg_match( '/\<(.*)\>/', $email[$i], $match)) $clean_email[] = $match['1']; else $clean_email[] = $email[$i]; } return $clean_email; } // -------------------------------------------------------------------- /** * Build alternative plain text message * * This function provides the raw message for use * in plain-text headers of HTML-formatted emails. * If the user hasn't specified his own alternative message * it creates one by stripping the HTML * * @access private * @return string */ function _get_alt_message() { if ($this->alt_message != "") { return $this->word_wrap($this->alt_message, '76'); } if (eregi( '\', $this->_body, $match)) { $body = $match['1']; $body = substr($body, strpos($body, ">") + 1); } else { $body = $this->_body; } $body = trim(strip_tags($body)); $body = preg_replace( '# - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Database Configuration

    - -

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). -The config file is located at:

    - -

    application/config/database.php

    - -

    The config settings are stored in a multi-dimensional array with this prototype:

    - -$db['default']['hostname'] = "localhost";
    -$db['default']['username'] = "root";
    -$db['default']['password'] = "";
    -$db['default']['database'] = "database_name";
    -$db['default']['dbdriver'] = "mysql";
    -$db['default']['dbprefix'] = "";
    -$db['default']['pconnect'] = TRUE;
    -$db['default']['db_debug'] = FALSE;
    -$db['default']['active_r'] = TRUE;
    - -

    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, production, test, etc.) -under a single installation, you can set up a connection group for each, then switch between groups as needed. -For example, to set up a "test" environment you would do this:

    - -$db['test']['hostname'] = "localhost";
    -$db['test']['username'] = "root";
    -$db['test']['password'] = "";
    -$db['test']['database'] = "database_name";
    -$db['test']['dbdriver'] = "mysql";
    -$db['test']['dbprefix'] = "";
    -$db['test']['pconnect'] = TRUE;
    -$db['test']['db_debug'] = FALSE;
    -$db['test']['active_r'] = TRUE;
    - - -

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    - -$active_group = "test"; - -

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" -for the primary connection, but it too can be renamed to something more relevant to your project.

    - -

    Explanation of Values:

    - -
      -
    • hostname - The hostname of your database server. Often this is "localhost".
    • -
    • 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, postgre, obdc, etc. Must be specified in lower case.
    • -
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • -
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • -
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • -
    • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources.
    • -
    • port - The database port number. Currently only used with the Postgre driver.
    • -
    - -

    Note: Depending on what database platform you are using (MySQL, Postgre, etc.) -not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and -the database name will be the path to your database file. The information above assumes you are using MySQL.

    - - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : Database Configuration

    CodeIgniter User Guide Version 1.5.4


    Database Configuration

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). The config file is located at:

    application/config/database.php

    The config settings are stored in a multi-dimensional array with this prototype:

    $db['default']['hostname'] = "localhost";
    $db['default']['username'] = "root";
    $db['default']['password'] = "";
    $db['default']['database'] = "database_name";
    $db['default']['dbdriver'] = "mysql";
    $db['default']['dbprefix'] = "";
    $db['default']['pconnect'] = TRUE;
    $db['default']['db_debug'] = FALSE;
    $db['default']['active_r'] = TRUE;

    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, production, test, etc.) under a single installation, you can set up a connection group for each, then switch between groups as needed. For example, to set up a "test" environment you would do this:

    $db['test']['hostname'] = "localhost";
    $db['test']['username'] = "root";
    $db['test']['password'] = "";
    $db['test']['database'] = "database_name";
    $db['test']['dbdriver'] = "mysql";
    $db['test']['dbprefix'] = "";
    $db['test']['pconnect'] = TRUE;
    $db['test']['db_debug'] = FALSE;
    $db['test']['active_r'] = TRUE;

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    $active_group = "test";

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" for the primary connection, but it too can be renamed to something more relevant to your project.

    Explanation of Values:

    • hostname - The hostname of your database server. Often this is "localhost".
    • 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, postgre, obdc, etc. Must be specified in lower case.
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources.

      Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.

    • port - The database port number. Currently only used with the Postgre driver.

    Note: Depending on what database platform you are using (MySQL, Postgre, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL.

    \ No newline at end of file diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index c9a38a96..6da925f9 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -1,115 +1 @@ - - - - -CodeIgniter User Guide : Web Page Caching - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Web Page Caching

    - -

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    - -

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the -server resources, memory, and processing cycles utilized, which affect your page load speeds. -By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    - - -

    How Does Caching Work?

    - -

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. -When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved -and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    - -

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    - -

    Enabling Caching

    - -

    To enable caching, put the following tag in any of your controller functions:

    - -$this->output->cache(n); - -

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    - -

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems -most logical to you. Once the tag is in place, your pages will begin being cached.

    - -

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    -

    Note: Before the cache files can be written you must set the file permissions on your -system/cache folder such that it is writable (666 is usually appropriate).

    - -

    Deleting Caches

    - -

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: -Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you -will need to manually delete it from your cache folder.

    - - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : Web Page Caching

    CodeIgniter User Guide Version 1.5.4


    Web Page Caching

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    How Does Caching Work?

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    Enabling Caching

    To enable caching, put the following tag in any of your controller functions:

    $this->output->cache(n);

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached.

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    Note: Before the cache files can be written you must set the file permissions on your system/cache folder such that it is writable (666 is usually appropriate, some servers require 777).

    Deleting Caches

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

    \ No newline at end of file diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 0205d97e..4b71480b 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -1,252 +1 @@ - - - - -CodeIgniter User Guide : URI Class - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    URI Class

    - -

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can -also retrieve information about the re-routed segments.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - -

    $this->uri->segment(n)

    - -

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. -Segments are numbered from left to right. For example, if your full URL is this:

    - -http://www.your-site.com/index.php/news/local/metro/crime_is_up - -

    The segment numbers would be this:

    - -
      -
    1. news
    2. -
    3. local
    4. -
    5. metro
    6. -
    7. crime_is_up
    8. -
    - -

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that -permits you to set your own default value if the segment is missing. -For example, this would tell the function to return the number zero in the event of failure:

    - -$product_id = $this->uri->segment(3, 0); - -

    It helps avoid having to write code like this:

    - -if ($this->uri->segment(3) === FALSE)
    -{
    -    $product_id = 0;
    -}
    -else
    -{
    -    $product_id = $this->uri->segment(3);
    -}
    -
    - -

    $this->uri->rsegment(n)

    - -

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - -

    $this->uri->slash_segment(n)

    - -

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second -parameter. If the parameter is not used, a trailing slash added. Examples:

    - -$this->uri->slash_segment(3);
    -$this->uri->slash_segment(3, 'leading');
    -$this->uri->slash_segment(3, 'both');
    - -

    Returns:

    - -
      -
    1. segment/
    2. -
    3. /segment
    4. -
    5. /segment/
    6. -
    - - -

    $this->uri->slash_rsegment(n)

    - -

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->uri_to_assoc(n)

    - -

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    - -index.php/user/search/name/joe/location/UK/gender/male - -

    Using this function you can turn the URI into an associative array with this prototype:

    - -[array]
    -(
    -    'name' => 'joe'
    -    'location' => 'UK'
    -    'gender' => 'male'
    -)
    - -

    The first parameter of the function lets you set an offset. By default it is set to 3 since your -URI will normally contain a controller/function in the first and second segments. Example:

    - - -$array = $this->uri->uri_to_assoc(3);
    -
    -echo $array['name']; -
    - - -

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    - - -$default = array('name', 'gender', 'location', 'type', 'sort');
    -
    -$array = $this->uri->uri_to_assoc(3, $default);
    - -

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    - -

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    - - -

    $this->uri->ruri_to_assoc(n)

    - -

    This function is identical to the previous one, except that it creates an associative array using the -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - -

    $this->uri->assoc_to_uri()

    - -

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    - -$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
    -
    -$str = $this->uri->assoc_to_uri($array);
    -
    -// Produces: product/shoes/size/large/color/red -
    - - -

    $this->uri->uri_string()

    - -

    Returns a string with the complete URI. For example, if this is your full URL:

    - -http://www.your-site.com/index.php/news/local/345 - -

    The function would return this:

    - -news/local/345 - - -

    $this->uri->ruri_string(n)

    - -

    This function is identical to the previous one, except that it returns the -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->total_segments()

    - -

    Returns the total number of segments.

    - - -

    $this->uri->total_rsegments(n)

    - -

    This function is identical to the previous one, except that it returns the total number of segments in your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->segment_array()

    - -

    Returns an array containing the URI segments. For example:

    - - -$segs = $this->uri->segment_array();
    -
    -foreach ($segs as $segment)
    -{
    -    echo $segment;
    -    echo '<br />';
    -}
    - -

    $this->uri->rsegment_array(n)

    - -

    This function is identical to the previous one, except that it returns the array of segments in your -re-routed URI in the event you are using CodeIgniter's URI Routing feature. - - - -

    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : URI Class

    CodeIgniter User Guide Version 1.5.4


    URI Class

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can also retrieve information about the re-routed segments.

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    $this->uri->segment(n)

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this:

    http://www.your-site.com/index.php/news/local/metro/crime_is_up

    The segment numbers would be this:

    1. news
    2. local
    3. metro
    4. crime_is_up

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, this would tell the function to return the number zero in the event of failure:

    $product_id = $this->uri->segment(3, 0);

    It helps avoid having to write code like this:

    if ($this->uri->segment(3) === FALSE)
    {
        $product_id = 0;
    }
    else
    {
        $product_id = $this->uri->segment(3);
    }

    $this->uri->rsegment(n)

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->slash_segment(n)

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second parameter. If the parameter is not used, a trailing slash added. Examples:

    $this->uri->slash_segment(3);
    $this->uri->slash_segment(3, 'leading');
    $this->uri->slash_segment(3, 'both');

    Returns:

    1. segment/
    2. /segment
    3. /segment/

    $this->uri->slash_rsegment(n)

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->uri_to_assoc(n)

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    index.php/user/search/name/joe/location/UK/gender/male

    Using this function you can turn the URI into an associative array with this prototype:

    [array]
    (
        'name' => 'joe'
        'location' => 'UK'
        'gender' => 'male'
    )

    The first parameter of the function lets you set an offset. By default it is set to 3 since your URI will normally contain a controller/function in the first and second segments. Example:

    $array = $this->uri->uri_to_assoc(3);

    echo $array['name'];

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    $default = array('name', 'gender', 'location', 'type', 'sort');

    $array = $this->uri->uri_to_assoc(3, $default);

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    $this->uri->ruri_to_assoc(n)

    This function is identical to the previous one, except that it creates an associative array using the re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->assoc_to_uri()

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    $array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');

    $str = $this->uri->assoc_to_uri($array);

    // Produces: product/shoes/size/large/color/red

    $this->uri->uri_string()

    Returns a string with the complete URI. For example, if this is your full URL:

    http://www.your-site.com/index.php/news/local/345

    The function would return this:

    /news/local/345

    $this->uri->ruri_string(n)

    This function is identical to the previous one, except that it returns the re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->total_segments()

    Returns the total number of segments.

    $this->uri->total_rsegments(n)

    This function is identical to the previous one, except that it returns the total number of segments in your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->segment_array()

    Returns an array containing the URI segments. For example:

    $segs = $this->uri->segment_array();

    foreach ($segs as $segment)
    {
        echo $segment;
        echo '<br />';
    }

    $this->uri->rsegment_array(n)

    This function is identical to the previous one, except that it returns the array of segments in your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    \ No newline at end of file diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 0294cef4..8614daed 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -1,172 +1 @@ - - - - -CodeIgniter User Guide : CodeIgniter at a Glance - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    CodeIgniter at a Glance

    - - -

    CodeIgniter is an Application Framework

    - -

    CodeIgniter is a toolkit for people who build web application 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.

    - -

    CodeIgniter is Free

    -

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. -For more information please read the license agreement.

    - - -

    CodeIgniter Runs on PHP 4

    -

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling -in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), -at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our -potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so -we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    - -

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    - -

    CodeIgniter is Light Weight

    -

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. -Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system -is very lean and quite fast. -

    - -

    CodeIgniter is Fast

    -

    Really fast. We challenge you to find a framework that has better performance then CodeIgniter.

    - - -

    CodeIgniter Uses M-V-C

    -

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. -This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    - -

    CodeIgniter Generates Clean URLs

    -

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" -approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    - -www.your-site.com/news/article/345 - -

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    - -

    CodeIgniter Packs a Punch

    -

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, -like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and -much more.

    - -

    CodeIgniter is Extensible

    -

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    - - -

    CodeIgniter Does Not Require a Template Engine

    -

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. - -Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template -engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    - -<ul>
    -
    -<?php foreach ($addressbook as $name):?>
    -
    -<li><?=$name?></li>
    -
    -<?php endforeach; ?>
    -
    -</ul>
    - -

    Contrast this with the pseudo-code used by a template engine:

    - -<ul>
    -
    -{foreach from=$addressbook item="name"}
    -
    -<li>{$name}</li>
    -
    -{/foreach}
    -
    -</ul>
    - -

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted -back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    - - -

    CodeIgniter is Thoroughly Documented

    -

    Programmers love to code and hate to write documentation. We're no different, of course, but -since documentation is as important as the code itself, -we are committed to doing it. Our source code is extremely clean and well commented as well.

    - - -

    CodeIgniter has a Friendly Community of Users

    - -

    Our growing community of users can be seen actively participating in our Community Forums.

    - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : CodeIgniter at a Glance

    CodeIgniter User Guide Version 1.5.4


    CodeIgniter at a Glance

    CodeIgniter is an Application Framework

    CodeIgniter is a toolkit for people who build web application 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.

    CodeIgniter is Free

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. For more information please read the license agreement.

    CodeIgniter Runs on PHP 4

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    CodeIgniter is Light Weight

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system is very lean and quite fast.

    CodeIgniter is Fast

    Really fast. We challenge you to find a framework that has better performance than CodeIgniter.

    CodeIgniter Uses M-V-C

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    CodeIgniter Generates Clean URLs

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    www.your-site.com/news/article/345

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    CodeIgniter Packs a Punch

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

    CodeIgniter is Extensible

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    CodeIgniter Does Not Require a Template Engine

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    <ul>

    <?php foreach ($addressbook as $name):?>

    <li><?=$name?></li>

    <?php endforeach; ?>

    </ul>

    Contrast this with the pseudo-code used by a template engine:

    <ul>

    {foreach from=$addressbook item="name"}

    <li>{$name}</li>

    {/foreach}

    </ul>

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    CodeIgniter is Thoroughly Documented

    Programmers love to code and hate to write documentation. We're no different, of course, but since documentation is as important as the code itself, we are committed to doing it. Our source code is extremely clean and well commented as well.

    CodeIgniter has a Friendly Community of Users

    Our growing community of users can be seen actively participating in our Community Forums.

    \ No newline at end of file From a19b94246799a1b81a478a6de84f02c73eb993bd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 10 Dec 2007 02:22:07 +0000 Subject: [PATCH 0738/2544] modified an example that may cause confusion. --- user_guide/general/caching.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 6da925f9..959994f0 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -1 +1 @@ - CodeIgniter User Guide : Web Page Caching

    CodeIgniter User Guide Version 1.5.4


    Web Page Caching

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    How Does Caching Work?

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    Enabling Caching

    To enable caching, put the following tag in any of your controller functions:

    $this->output->cache(n);

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached.

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    Note: Before the cache files can be written you must set the file permissions on your system/cache folder such that it is writable (666 is usually appropriate, some servers require 777).

    Deleting Caches

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

    \ No newline at end of file + CodeIgniter User Guide : Web Page Caching

    CodeIgniter User Guide Version 1.5.4


    Web Page Caching

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    How Does Caching Work?

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    Enabling Caching

    To enable caching, put the following tag in any of your controller functions:

    $this->output->cache(n);

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached.

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    Note: Before the cache files can be written you must set the file permissions on your system/cache folder such that it is writable.

    Deleting Caches

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

    \ No newline at end of file From b0de4067eca0ebb744bd5b1236cfae8a58c26abf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 10 Dec 2007 13:25:16 +0000 Subject: [PATCH 0739/2544] typo fix in example --- user_guide/database/active_record.html | 613 +------------------------ 1 file changed, 1 insertion(+), 612 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 80af07ca..ee7b245d 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -1,612 +1 @@ - - - - -CodeIgniter User Guide : Active Record - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Active Record Class

    - - -

    CodeIgniter uses a modified version of the Active Record Database Pattern. -This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. -In some cases only one or two lines of code are necessary to perform a database action. -CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    - -

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax -is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    - -

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

    - -
    - - - - - - -  -

    Selecting Data

    - -

    The following functions allow you to build SQL SELECT statements.

    - -

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    - - -

    $this->db->get();

    - -

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    - -$query = $this->db->get('mytable');
    -
    -// Produces: SELECT * FROM mytable
    - -

    The second and third parameters enable you do set a limit and offset clause:

    - -$query = $this->db->get('mytable', 10, 20);
    -
    -// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    - - - -

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    - -$query = $this->db->get('mytable');
    -
    -foreach ($query->result() as $row)
    -{
    -    echo $row->title;
    -}
    - -

    Please visit the result functions page for a full discussion regarding result generation.

    - - -

    $this->db->getwhere();

    - -

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, -instead of using the db->where() function:

    - -$query = $this->db->getwhere('mytable', array('id' => $id), $limit, $offset); - -

    Please read the about the where function below for more information.

    - - -

    $this->db->select();

    - -

    Permits you to write the SELECT portion of your query:

    - - -$this->db->select('title, content, date');
    -
    -$query = $this->db->get('mytable');
    -
    -// Produces: SELECT title, content, date FROM mytable
    - -

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    - - -

    $this->db->from();

    - -

    Permits you to write the FROM portion of your query:

    - - -$this->db->select('title, content, date');
    -$this->db->from('mytable');
    -
    -$query = $this->db->get();
    -
    -// Produces: SELECT title, content, date FROM mytable
    - -

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method -you prefer.

    - -

    $this->db->join();

    - -

    Permits you to write the JOIN portion of your query:

    - - -$this->db->select('*');
    -$this->db->from('blogs');
    -$this->db->join('comments', 'comments.id = blogs.id');
    -
    -$query = $this->db->get();
    -
    -// Produces:
    -// SELECT * FROM blogs
    -// JOIN comments ON comments.id = blogs.id
    -
    - -

    Multiple function calls can be made if you need several joins in one query.

    - -

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. -Options are: left, right, outer, inner, left outer, and right outer.

    - - -$this->db->join('comments', 'comments.id = blogs.id', 'left');
    -
    -// Produces: LEFT JOIN comments ON comments.id = blogs.id
    - - - - - -

    $this->db->where();

    -

    This function enables you to set WHERE clauses using one of four methods:

    - -

    Note: All values passed to this function are escaped automatically, producing safer queries.

    - -
      -
    1. Simple key/value method: - - $this->db->where('name', $name); -

      // Produces: WHERE name = 'Joe' -
      - -

      Notice that the equal sign is added for you.

      - -

      If you use multiple function calls they will be chained together with AND between them:

      - - $this->db->where('name', $name);
      - $this->db->where('title', $title);
      - $this->db->where('status', $status); -

      // WHERE = 'Joe' AND title = 'boss' AND status = 'active' -
      - - -
    2. - -
    3. Custom key/value method: - -

      You can include an operator in the first parameter in order to control the comparison:

      - - $this->db->where('name !=', $name);
      - $this->db->where('id <', $id); -

      // Produces: WHERE name != 'Joe' AND id < 45 -
      - - - -
    4. -
    5. Associative array method: - - - - $array = array('name' => $name, 'title' => $title, 'status' => $status);

      - - $this->db->where($array); -

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' -
      - -

      You can include your own operators using this method as well:

      - - - $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      - - $this->db->where($array);
      - -
    6. -
    7. Custom string: - -

      You can write your own clauses manually:

      - - - $where = "name='Joe' AND status='boss' OR status='active'";

      - $this->db->where($where);
      - -
    8. -
    - - -

    $this->db->orwhere();

    -

    This function is identical to the one above, except that multiple instances are joined by OR:

    - - -$this->db->where('name !=', $name);
    -$this->db->orwhere('id >', $id); -

    // Produces: WHERE name != 'Joe' OR id > 50 -
    - - - - -

    $this->db->like();

    -

    This function enables you to generate LIKE clauses, useful for doing searches.

    - -

    Note: All values passed to this function are escaped automatically.

    - - -
      -
    1. Simple key/value method: - - $this->db->like('title', $match); -

      // Produces: WHERE title LIKE '%match%' -
      - -

      If you use multiple function calls they will be chained together with AND between them:

      - - $this->db->like('title', $match);
      - $this->db->like('body', $match); -

      // WHERE title LIKE '%match%' AND body LIKE '%match%' -
      - -
    2. - -
    3. Associative array method: - - - $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      - - $this->db->like($array); -

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%' -
      - -
    4. -
    - - -

    $this->db->orlike();

    -

    This function is identical to the one above, except that multiple instances are joined by OR:

    - - -$this->db->like('title', $match);
    -$this->db->orlike('body', $match); -

    // WHERE title LIKE '%match%' OR body LIKE '%match%' -
    - - - - -

    $this->db->groupby();

    - -

    Permits you to write the GROUP BY portion of your query:

    - -$this->db->groupby("title"); -

    // Produces: GROUP BY title -
    - -

    You can also pass an array of multiple values as well:

    - -$this->db->groupby(array("title", "date"); -

    // Produces: GROUP BY title, date -
    - - -

    $this->db->having();

    - -

    Permits you to write the HAVING portion of your query:

    - -$this->db->having('user_id = 45'); -

    // Produces: HAVING 'user_id = 45' -
    - -

    You can also pass an array of multiple values as well:

    - - -$this->db->having(array('title =' => 'My Title', 'id <' => $id)); -

    // Produces: HAVING title = 'My Title', 'id < 45' -
    - - - -

    $this->db->orderby();

    -

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc

    - -$this->db->orderby("title", "desc"); -

    // Produces: ORDER BY title DESC -
    - -

    You can also pass your own string in the first parameter:

    - -$this->db->orderby('title desc, name asc'); -

    // Produces: ORDER BY title DESC, name ASC -
    - -

    Or multiple function calls can be made if you need multiple fields.

    - -$this->db->orderby("title", "desc");
    -$this->db->orderby("name", "asc"); -

    // Produces: ORDER BY title DESC, name ASC -
    - - -

    $this->db->limit();

    -

    Lets you limit the number of rows you would like returned by the query:

    - - -$this->db->limit(10);
    -
    -// Produces: LIMIT 10
    - - -

    The second parameter lets you set a result offset.

    - - -$this->db->limit(10, 20);
    -
    -// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    - - -

    $this->db->count_all();

    - -

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    - -echo $this->db->count_all('my_table');
    -
    -// Produces an integer, like 25
    - - - - -  -

    Inserting Data

    - -

    $this->db->insert();

    -

    Generates an insert string based on the data you supply, and runs the query. You can either pass an -array or an object to the function. Here is an example using an array:

    - - -$data = array(
    -               'title' => 'My title' ,
    -               'name' => 'My Name' ,
    -               'date' => 'My date'
    -            );
    -
    -$this->db->insert('mytable', $data); -

    -// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
    - -

    The first parameter will contain the table name, the second is an associative array of values.

    - -

    Here is an example using an object:

    - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->insert('mytable', $object); -

    -// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')
    - -

    The first parameter will contain the table name, the second is an associative array of values.

    - -

    Note: All values are escaped automatically producing safer queries.

    - - - - -

    $this->db->set();

    -

    This function enables you to set values for inserts or updates.

    - -

    It can be used instead of passing a data array directly to the insert or update functions:

    - -$this->db->set('name', $name); -
    -$this->db->insert('mytable'); -

    -// Produces: INSERT INTO mytable (name) VALUES ('{$name}')
    - -

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    - -$this->db->set('name', $name);
    -$this->db->set('title', $title);
    -$this->db->set('status', $status);
    -$this->db->insert('mytable'); -
    - -

    You can also pass an associative array to this function:

    - - -$array = array('name' => $name, 'title' => $title, 'status' => $status);

    - -$this->db->set($array);
    -$this->db->insert('mytable'); -
    - -

    Or an object:

    - - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->set($object);
    -$this->db->insert('mytable'); -
    - - - -  -

    Updating Data

    - -

    $this->db->update();

    -

    Generates an update string and runs the query based on the data you supply. You can pass an -array or an object to the function. Here is an example using -an array:

    - - -$data = array(
    -               'title' => $title,
    -               'name' => $name,
    -               'date' => $date
    -            );
    -
    -$this->db->where('id', $id);
    -$this->db->update('mytable', $data); -

    -// Produces:
    -// UPDATE mytable
    -// SET title = '{$title}', name = '{$name}', date = '{$date}'
    -// WHERE id = $id
    - -

    Or you can supply an object:

    - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->where('id', $id);
    -$this->db->update('mytable', $object); -
    -
    -// Produces:
    -// UPDATE mytable
    -// SET title = '{$title}', name = '{$name}', date = '{$date}'
    -// WHERE id = $id
    - - - -

    Note: All values are escaped automatically producing safer queries.

    - -

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. -You can optionally pass this information directly into the update function as a string:

    - -$this->db->update('mytable', $data, "id = 4"); - -

    Or as an array:

    - -$this->db->update('mytable', $data, array('id' => $id)); - -

    You may also use the $this->db->set() function described above when performing updates.

    - - -  -

    Deleting Data

    - - - -

    $this->db->delete();

    -

    Generates a delete SQL string and runs the query.

    - - -$this->db->delete('mytable', array('id' => $id)); -

    -// Produces:
    -// DELETE FROM mytable
    -// WHERE id = $id
    - -

    The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing -the data to the second parameter of the function:

    - - -$this->db->where('id', $id);
    -$this->db->delete('mytable'); -

    -// Produces:
    -// DELETE FROM mytable
    -// WHERE id = $id
    - -

    Note: All values are escaped automatically producing safer queries.

    - - -  -

    Method Chaining

    - -

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    - - -$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
    -
    -$query = $this->db->get();
    - -

    Note: Method chaining only works with PHP 5.

    - - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : Active Record

    CodeIgniter User Guide Version 1.5.4


    Active Record Class

    CodeIgniter uses a modified version of the Active Record Database Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action. CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.


     

    Selecting Data

    The following functions allow you to build SQL SELECT statements.

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    $this->db->get();

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    $query = $this->db->get('mytable');

    // Produces: SELECT * FROM mytable

    The second and third parameters enable you do set a limit and offset clause:

    $query = $this->db->get('mytable', 10, 20);

    // Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    $query = $this->db->get('mytable');

    foreach ($query->result() as $row)
    {
        echo $row->title;
    }

    Please visit the result functions page for a full discussion regarding result generation.

    $this->db->getwhere();

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, instead of using the db->where() function:

    $query = $this->db->getwhere('mytable', array('id' => $id), $limit, $offset);

    Please read the about the where function below for more information.

    $this->db->select();

    Permits you to write the SELECT portion of your query:

    $this->db->select('title, content, date');

    $query = $this->db->get('mytable');

    // Produces: SELECT title, content, date FROM mytable

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    $this->db->from();

    Permits you to write the FROM portion of your query:

    $this->db->select('title, content, date');
    $this->db->from('mytable');

    $query = $this->db->get();

    // Produces: SELECT title, content, date FROM mytable

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method you prefer.

    $this->db->join();

    Permits you to write the JOIN portion of your query:

    $this->db->select('*');
    $this->db->from('blogs');
    $this->db->join('comments', 'comments.id = blogs.id');

    $query = $this->db->get();

    // Produces:
    // SELECT * FROM blogs
    // JOIN comments ON comments.id = blogs.id

    Multiple function calls can be made if you need several joins in one query.

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. Options are: left, right, outer, inner, left outer, and right outer.

    $this->db->join('comments', 'comments.id = blogs.id', 'left');

    // Produces: LEFT JOIN comments ON comments.id = blogs.id

    $this->db->where();

    This function enables you to set WHERE clauses using one of four methods:

    Note: All values passed to this function are escaped automatically, producing safer queries.

    1. Simple key/value method: $this->db->where('name', $name);

      // Produces: WHERE name = 'Joe'

      Notice that the equal sign is added for you.

      If you use multiple function calls they will be chained together with AND between them:

      $this->db->where('name', $name);
      $this->db->where('title', $title);
      $this->db->where('status', $status);

      // WHERE = 'Joe' AND title = 'boss' AND status = 'active'
    2. Custom key/value method:

      You can include an operator in the first parameter in order to control the comparison:

      $this->db->where('name !=', $name);
      $this->db->where('id <', $id);

      // Produces: WHERE name != 'Joe' AND id < 45
    3. Associative array method: $array = array('name' => $name, 'title' => $title, 'status' => $status);

      $this->db->where($array);

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'

      You can include your own operators using this method as well:

      $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      $this->db->where($array);
    4. Custom string:

      You can write your own clauses manually:

      $where = "name='Joe' AND status='boss' OR status='active'";

      $this->db->where($where);

    $this->db->orwhere();

    This function is identical to the one above, except that multiple instances are joined by OR:

    $this->db->where('name !=', $name);
    $this->db->orwhere('id >', $id);

    // Produces: WHERE name != 'Joe' OR id > 50

    $this->db->like();

    This function enables you to generate LIKE clauses, useful for doing searches.

    Note: All values passed to this function are escaped automatically.

    1. Simple key/value method: $this->db->like('title', $match);

      // Produces: WHERE title LIKE '%match%'

      If you use multiple function calls they will be chained together with AND between them:

      $this->db->like('title', $match);
      $this->db->like('body', $match);

      // WHERE title LIKE '%match%' AND body LIKE '%match%'
    2. Associative array method: $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      $this->db->like($array);

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'

    $this->db->orlike();

    This function is identical to the one above, except that multiple instances are joined by OR:

    $this->db->like('title', $match);
    $this->db->orlike('body', $match);

    // WHERE title LIKE '%match%' OR body LIKE '%match%'

    $this->db->groupby();

    Permits you to write the GROUP BY portion of your query:

    $this->db->groupby("title");

    // Produces: GROUP BY title

    You can also pass an array of multiple values as well:

    $this->db->groupby(array("title", "date"));

    // Produces: GROUP BY title, date

    $this->db->having();

    Permits you to write the HAVING portion of your query:

    $this->db->having('user_id = 45');

    // Produces: HAVING 'user_id = 45'

    You can also pass an array of multiple values as well:

    $this->db->having(array('title =' => 'My Title', 'id <' => $id));

    // Produces: HAVING title = 'My Title', 'id < 45'

    $this->db->orderby();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are asc or desc

    $this->db->orderby("title", "desc");

    // Produces: ORDER BY title DESC

    You can also pass your own string in the first parameter:

    $this->db->orderby('title desc, name asc');

    // Produces: ORDER BY title DESC, name ASC

    Or multiple function calls can be made if you need multiple fields.

    $this->db->orderby("title", "desc");
    $this->db->orderby("name", "asc");

    // Produces: ORDER BY title DESC, name ASC

    $this->db->limit();

    Lets you limit the number of rows you would like returned by the query:

    $this->db->limit(10);

    // Produces: LIMIT 10

    The second parameter lets you set a result offset.

    $this->db->limit(10, 20);

    // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

    $this->db->count_all();

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    echo $this->db->count_all('my_table');

    // Produces an integer, like 25
     

    Inserting Data

    $this->db->insert();

    Generates an insert string based on the data you supply, and runs the query. You can either pass an array or an object to the function. Here is an example using an array:

    $data = array(
                   'title' => 'My title' ,
                   'name' => 'My Name' ,
                   'date' => 'My date'
                );

    $this->db->insert('mytable', $data);

    // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')

    The first parameter will contain the table name, the second is an associative array of values.

    Here is an example using an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->insert('mytable', $object);

    // Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')

    The first parameter will contain the table name, the second is an associative array of values.

    Note: All values are escaped automatically producing safer queries.

    $this->db->set();

    This function enables you to set values for inserts or updates.

    It can be used instead of passing a data array directly to the insert or update functions:

    $this->db->set('name', $name);
    $this->db->insert('mytable');

    // Produces: INSERT INTO mytable (name) VALUES ('{$name}')

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    $this->db->set('name', $name);
    $this->db->set('title', $title);
    $this->db->set('status', $status);
    $this->db->insert('mytable');

    You can also pass an associative array to this function:

    $array = array('name' => $name, 'title' => $title, 'status' => $status);

    $this->db->set($array);
    $this->db->insert('mytable');

    Or an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->set($object);
    $this->db->insert('mytable');
     

    Updating Data

    $this->db->update();

    Generates an update string and runs the query based on the data you supply. You can pass an array or an object to the function. Here is an example using an array:

    $data = array(
                   'title' => $title,
                   'name' => $name,
                   'date' => $date
                );

    $this->db->where('id', $id);
    $this->db->update('mytable', $data);

    // Produces:
    // UPDATE mytable
    // SET title = '{$title}', name = '{$name}', date = '{$date}'
    // WHERE id = $id

    Or you can supply an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->where('id', $id);
    $this->db->update('mytable', $object);

    // Produces:
    // UPDATE mytable
    // SET title = '{$title}', name = '{$name}', date = '{$date}'
    // WHERE id = $id

    Note: All values are escaped automatically producing safer queries.

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. You can optionally pass this information directly into the update function as a string:

    $this->db->update('mytable', $data, "id = 4");

    Or as an array:

    $this->db->update('mytable', $data, array('id' => $id));

    You may also use the $this->db->set() function described above when performing updates.

     

    Deleting Data

    $this->db->delete();

    Generates a delete SQL string and runs the query.

    $this->db->delete('mytable', array('id' => $id));

    // Produces:
    // DELETE FROM mytable
    // WHERE id = $id

    The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing the data to the second parameter of the function:

    $this->db->where('id', $id);
    $this->db->delete('mytable');

    // Produces:
    // DELETE FROM mytable
    // WHERE id = $id

    Note: All values are escaped automatically producing safer queries.

     

    Method Chaining

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    $this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);

    $query = $this->db->get();

    Note: Method chaining only works with PHP 5.

    \ No newline at end of file From fc2f834bf9b134994ef1214e06153f74f8772630 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 11 Dec 2007 13:44:20 +0000 Subject: [PATCH 0740/2544] Fixed a bug in highlight_pharse() that caused an error with slashes. --- system/helpers/text_helper.php | 2 +- user_guide/changelog.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index fb50ba9d..b75cd8f7 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -1 +1 @@ -= $n) { return trim($out).$end_char; } } } // ------------------------------------------------------------------------ /** * High ASCII to Entities * * Converts High ascii text and MS Word special characters to character entities * * @access public * @param string * @return string */ function ascii_to_entities($str) { $count = 1; $out = ''; $temp = array(); for ($i = 0, $s = strlen($str); $i < $s; $i++) { $ordinal = ord($str[$i]); if ($ordinal < 128) { $out .= $str[$i]; } else { if (count($temp) == 0) { $count = ($ordinal < 224) ? 2 : 3; } $temp[] = $ordinal; if (count($temp) == $count) { $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); $out .= '&#'.$number.';'; $count = 1; $temp = array(); } } } return $out; } // ------------------------------------------------------------------------ /** * Entities to ASCII * * Converts character entities back to ASCII * * @access public * @param string * @param bool * @return string */ function entities_to_ascii($str, $all = TRUE) { if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) { for ($i = 0, $s = count($matches['0']); $i < $s; $i++) { $digits = $matches['1'][$i]; $out = ''; if ($digits < 128) { $out .= chr($digits); } elseif ($digits < 2048) { $out .= chr(192 + (($digits - ($digits % 64)) / 64)); $out .= chr(128 + ($digits % 64)); } else { $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)); $out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)); $out .= chr(128 + ($digits % 64)); } $str = str_replace($matches['0'][$i], $out, $str); } } if ($all) { $str = str_replace(array("&", "<", ">", """, "'", "-"), array("&","<",">","\"", "'", "-"), $str); } return $str; } // ------------------------------------------------------------------------ /** * Word Censoring Function * * Supply a string and an array of disallowed words and any * matched words will be converted to #### or to the replacement * word you've submitted. * * @access public * @param string the text string * @param string the array of censoered words * @param string the optional replacement value * @return string */ function word_censor($str, $censored, $replacement = '') { if ( ! is_array($censored)) { return $str; } $str = ' '.$str.' '; foreach ($censored as $badword) { if ($replacement != '') { $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str); } else { $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str); } } return trim($str); } // ------------------------------------------------------------------------ /** * Code Highlighter * * Colorizes code strings * * @access public * @param string the text string * @return string */ function highlight_code($str) { // The highlight string function encodes and highlights // brackets so we need them to start raw $str = str_replace(array('<', '>'), array('<', '>'), $str); // Replace any existing PHP tags to temporary markers so they don't accidentally // break the string out of PHP, and thus, thwart the highlighting. $str = str_replace(array('<?php', '?>', '\\'), array('phptagopen', 'phptagclose', 'backslashtmp'), $str); // The highlight_string function requires that the text be surrounded // by PHP tags. Since we don't know if A) the submitted text has PHP tags, // or B) whether the PHP tags enclose the entire string, we will add our // own PHP tags around the string along with some markers to make replacement easier later $str = ''; // All the magic happens here, baby! $str = highlight_string($str, TRUE); // Prior to PHP 5, the highlight function used icky font tags // so we'll replace them with span tags. if (abs(phpversion()) < 5) { $str = str_replace(array(''), array(''), $str); $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); } // Remove our artificially added PHP $str = preg_replace("#\.+?//tempstart\
    \#is", "\n", $str); $str = preg_replace("#\.+?//tempstart\
    #is", "\n", $str); $str = preg_replace("#//tempend.+#is", "
    \n", $str); // Replace our markers back to PHP tags. $str = str_replace(array('phptagopen', 'phptagclose', 'backslashtmp'), array('<?php', '?>', '\\'), $str); //', $tag_close = '
    ') { if ($str == '') { return ''; } if ($phrase != '') { return preg_replace('/('.preg_quote($phrase).')/i', $tag_open."\\1".$tag_close, $str); } return $str; } // ------------------------------------------------------------------------ /** * Word Wrap * * Wraps text at the specified character. Maintains the integrity of words. * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor * will URLs. * * @access public * @param string the text string * @param integer the number of characters to wrap at * @return string */ function word_wrap($str, $charlim = '76') { // Se the character limit if ( ! is_numeric($charlim)) $charlim = 76; // Reduce multiple spaces $str = preg_replace("| +|", " ", $str); // Standardize newlines $str = preg_replace("/\r\n|\r/", "\n", $str); // If the current word is surrounded by {unwrap} tags we'll // strip the entire chunk and replace it with a marker. $unwrap = array(); if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) { for ($i = 0; $i < count($matches['0']); $i++) { $unwrap[] = $matches['1'][$i]; $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); } } // Use PHP's native function to do the initial wordwrap. // We set the cut flag to FALSE so that any individual words that are // too long get left alone. In the next step we'll deal with them. $str = wordwrap($str, $charlim, "\n", FALSE); // Split the string into individual lines of text and cycle through them $output = ""; foreach (explode("\n", $str) as $line) { // Is the line within the allowed character count? // If so we'll join it to the output and continue if (strlen($line) <= $charlim) { $output .= $line."\n"; continue; } $temp = ''; while((strlen($line)) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) { break; } // Trim the word down $temp .= substr($line, 0, $charlim-1); $line = substr($line, $charlim-1); } // 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 . "\n" . $line; } else { $output .= $line; } $output .= "\n"; } // Put our markers back if (count($unwrap) > 0) { foreach ($unwrap as $key => $val) { $output = str_replace("{{unwrapped".$key."}}", $val, $output); } } // Remove the unwrap tags $output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output); return $output; } ?> \ No newline at end of file += $n) { return trim($out).$end_char; } } } // ------------------------------------------------------------------------ /** * High ASCII to Entities * * Converts High ascii text and MS Word special characters to character entities * * @access public * @param string * @return string */ function ascii_to_entities($str) { $count = 1; $out = ''; $temp = array(); for ($i = 0, $s = strlen($str); $i < $s; $i++) { $ordinal = ord($str[$i]); if ($ordinal < 128) { $out .= $str[$i]; } else { if (count($temp) == 0) { $count = ($ordinal < 224) ? 2 : 3; } $temp[] = $ordinal; if (count($temp) == $count) { $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); $out .= '&#'.$number.';'; $count = 1; $temp = array(); } } } return $out; } // ------------------------------------------------------------------------ /** * Entities to ASCII * * Converts character entities back to ASCII * * @access public * @param string * @param bool * @return string */ function entities_to_ascii($str, $all = TRUE) { if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) { for ($i = 0, $s = count($matches['0']); $i < $s; $i++) { $digits = $matches['1'][$i]; $out = ''; if ($digits < 128) { $out .= chr($digits); } elseif ($digits < 2048) { $out .= chr(192 + (($digits - ($digits % 64)) / 64)); $out .= chr(128 + ($digits % 64)); } else { $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)); $out .= chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)); $out .= chr(128 + ($digits % 64)); } $str = str_replace($matches['0'][$i], $out, $str); } } if ($all) { $str = str_replace(array("&", "<", ">", """, "'", "-"), array("&","<",">","\"", "'", "-"), $str); } return $str; } // ------------------------------------------------------------------------ /** * Word Censoring Function * * Supply a string and an array of disallowed words and any * matched words will be converted to #### or to the replacement * word you've submitted. * * @access public * @param string the text string * @param string the array of censoered words * @param string the optional replacement value * @return string */ function word_censor($str, $censored, $replacement = '') { if ( ! is_array($censored)) { return $str; } $str = ' '.$str.' '; foreach ($censored as $badword) { if ($replacement != '') { $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/i", $replacement, $str); } else { $str = preg_replace("/\b(".str_replace('\*', '\w*?', preg_quote($badword)).")\b/ie", "str_repeat('#', strlen('\\1'))", $str); } } return trim($str); } // ------------------------------------------------------------------------ /** * Code Highlighter * * Colorizes code strings * * @access public * @param string the text string * @return string */ function highlight_code($str) { // The highlight string function encodes and highlights // brackets so we need them to start raw $str = str_replace(array('<', '>'), array('<', '>'), $str); // Replace any existing PHP tags to temporary markers so they don't accidentally // break the string out of PHP, and thus, thwart the highlighting. $str = str_replace(array('<?php', '?>', '\\'), array('phptagopen', 'phptagclose', 'backslashtmp'), $str); // The highlight_string function requires that the text be surrounded // by PHP tags. Since we don't know if A) the submitted text has PHP tags, // or B) whether the PHP tags enclose the entire string, we will add our // own PHP tags around the string along with some markers to make replacement easier later $str = ''; // All the magic happens here, baby! $str = highlight_string($str, TRUE); // Prior to PHP 5, the highlight function used icky font tags // so we'll replace them with span tags. if (abs(phpversion()) < 5) { $str = str_replace(array(''), array(''), $str); $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); } // Remove our artificially added PHP $str = preg_replace("#\.+?//tempstart\
    \#is", "\n", $str); $str = preg_replace("#\.+?//tempstart\
    #is", "\n", $str); $str = preg_replace("#//tempend.+#is", "
    \n", $str); // Replace our markers back to PHP tags. $str = str_replace(array('phptagopen', 'phptagclose', 'backslashtmp'), array('<?php', '?>', '\\'), $str); //', $tag_close = '
    ') { if ($str == '') { return ''; } if ($phrase != '') { return preg_replace('/('.preg_quote($phrase, '/').')/i', $tag_open."\\1".$tag_close, $str); } return $str; } // ------------------------------------------------------------------------ /** * Word Wrap * * Wraps text at the specified character. Maintains the integrity of words. * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor * will URLs. * * @access public * @param string the text string * @param integer the number of characters to wrap at * @return string */ function word_wrap($str, $charlim = '76') { // Se the character limit if ( ! is_numeric($charlim)) $charlim = 76; // Reduce multiple spaces $str = preg_replace("| +|", " ", $str); // Standardize newlines $str = preg_replace("/\r\n|\r/", "\n", $str); // If the current word is surrounded by {unwrap} tags we'll // strip the entire chunk and replace it with a marker. $unwrap = array(); if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) { for ($i = 0; $i < count($matches['0']); $i++) { $unwrap[] = $matches['1'][$i]; $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); } } // Use PHP's native function to do the initial wordwrap. // We set the cut flag to FALSE so that any individual words that are // too long get left alone. In the next step we'll deal with them. $str = wordwrap($str, $charlim, "\n", FALSE); // Split the string into individual lines of text and cycle through them $output = ""; foreach (explode("\n", $str) as $line) { // Is the line within the allowed character count? // If so we'll join it to the output and continue if (strlen($line) <= $charlim) { $output .= $line."\n"; continue; } $temp = ''; while((strlen($line)) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) { break; } // Trim the word down $temp .= substr($line, 0, $charlim-1); $line = substr($line, $charlim-1); } // 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 . "\n" . $line; } else { $output .= $line; } $output .= "\n"; } // Put our markers back if (count($unwrap) > 0) { foreach ($unwrap as $key => $val) { $output = str_replace("{{unwrapped".$key."}}", $val, $output); } } // Remove the unwrap tags $output = str_replace(array('{unwrap}', '{/unwrap}'), '', $output); return $output; } ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 760238e3..6fcdbaad 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file From 49c676be3a786f2699392a9061b228fdf76078ca Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 11 Dec 2007 16:53:36 +0000 Subject: [PATCH 0741/2544] optimized reduce_multiples and strengthened type checking --- system/helpers/string_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 470bce2e..765e1648 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -1 +1 @@ - $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\"","'",'"'), array("'",""","'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $preg_chars = preg_quote($character, '#') . preg_quote($character, '#'); $str = preg_replace("#$preg_chars+#", $character, $str); if ($trim == TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file + $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } // ------------------------------------------------------------------------ /** * Strip Quotes * * Removes single and double quotes from a string * * @access public * @param string * @return string */ function strip_quotes($str) { return str_replace(array('"', "'"), '', $str); } // ------------------------------------------------------------------------ /** * Quotes to Entities * * Converts single and double quotes to entities * * @access public * @param string * @return string */ function quotes_to_entities($str) { return str_replace(array("\'","\"","'",'"'), array("'",""","'","""), $str); } // ------------------------------------------------------------------------ /** * Reduce Double Slashes * * Converts double slashes in a string to a single slash, * except those found in http:// * * http://www.some-site.com//index.php * * becomes: * * http://www.some-site.com/index.php * * @access public * @param string * @return string */ function reduce_double_slashes($str) { return preg_replace("#([^:])//+#", "\\1/", $str); } // ------------------------------------------------------------------------ /** * Reduce Multiples * * Reduces multiple instances of a particular character. Example: * * Fred, Bill,, Joe, Jimmy * * becomes: * * Fred, Bill, Joe, Jimmy * * @access public * @param string * @param string the character you wish to reduce * @param bool TRUE/FALSE - whether to trim the character from the beginning/end * @return string */ function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str); if ($trim === TRUE) { $str = trim($str, $character); } return $str; } // ------------------------------------------------------------------------ /** * Create a Random String * * Useful for generating passwords or hashes. * * @access public * @param string type of random string. Options: alunum, numeric, nozero, unique * @param integer number of characters * @return string */ function random_string($type = 'alnum', $len = 8) { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } // ------------------------------------------------------------------------ /** * Alternator * * Allows strings to be alternated. See docs... * * @access public * @param string (as many parameters as needed) * @return string */ function alternator() { static $i; if (func_num_args() == 0) { $i = 0; return ''; } $args = func_get_args(); return $args[($i++ % count($args))]; } // ------------------------------------------------------------------------ /** * Repeater function * * @access public * @param string * @param integer number of repeats * @return string */ function repeater($data, $num = 1) { return (($num > 0) ? str_repeat($data, $num) : ''); } ?> \ No newline at end of file From 98d3b54265132dccb3f1c3e05ed4dae1cc7645b9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 14 Dec 2007 13:13:21 +0000 Subject: [PATCH 0742/2544] Fixed a typo in the table library docs. --- user_guide/changelog.html | 2 +- user_guide/libraries/table.html | 293 +------------------------------- 2 files changed, 2 insertions(+), 293 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6fcdbaad..babb020c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 4ce948e6..0e627d12 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -1,292 +1 @@ - - - - -CodeIgniter User Guide : HTML Table Class - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    HTML Table Class

    - -

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('table'); -

    Once loaded, the Table library object will be available using: $this->table

    - - -

    Examples

    - -

    Here is an example showing how you can create a table from a multi-dimensional array. -Note that the first array index will become the table heading (or you can set your own headings using the -set_heading() function described in the function reference below).

    - - -$this->load->library('table');
    -
    -$data = array(
    -             array('Name', 'Color', 'Size'),
    -             array('Fred', 'Blue', 'Small'),
    -             array('Mary', 'Red', 'Large'),
    -             array('John', 'Green', 'Medium')
    -             );
    -
    -echo $this->table->generate($data); -
    - -

    Here is an example of a table created from a database query result. The table class will automatically generate the -headings based on the table names (or you can set your own headings using the set_heading() function described -in the function reference below).

    - - -$this->load->library('table');
    -
    -$query = $this->db->query("SELECT * FROM my_table");
    -
    -echo $this->table->generate($query); -
    - - -

    Here is an example showing how you might create a table using discreet parameters:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading('Name', 'Color', 'Size');
    -
    -$this->table->add_row('Fred', 'Blue', 'Small');
    -$this->table->add_row('Mary', 'Red', 'Large');
    -$this->table->add_row('John', 'Green', 'Medium');
    -
    -echo $this->table->generate(); -
    - -

    Here is the same example, except instead of individual parameters, arrays are used:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading(array('Name', 'Color', 'Size'));
    -
    -$this->table->add_row(array('Fred', 'Blue', 'Small'));
    -$this->table->add_row(array('Mary', 'Red', 'Large'));
    -$this->table->add_row(array('John', 'Green', 'Medium'));
    -
    -echo $this->table->generate(); -
    - - -

    Changing the Look of Your Table

    - -

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template -prototype:

    - - -$tmpl = array (
    -                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',
    -
    -                    'heading_row_start'   => '<tr>',
    -                    'heading_row_end'     => '</tr>',
    -                    'heading_cell_start'  => '<th>',
    -                    'heading_cell_end'    => '</th>',
    -
    -                    'row_start'           => '<tr>',
    -                    'row_end'             => '</tr>',
    -                    'cell_start'          => '<td>',
    -                    'cell_end'            => '</td>',
    -
    -                    'row_alt_start'       => '<tr>',
    -                    'row_alt_end'         => '</tr>',
    -                    'cell_alt_start'      => '<td>',
    -                    'cell_alt_end'        => '</td>',
    -
    -                    'table_close'         => '</table>'
    -              );
    - -
    -$this->table->set_template($tmpl); -
    - -

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each -iteration of the row data.

    - -

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. -In this example, only the table opening tag is being changed:

    - - -$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    - -
    -$this->table->set_template($tmpl); -
    - -
    -

    Function Reference

    - -

    $this->table->generate()

    -

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    - -

    $this->table->set_caption()

    - -

    Permits you to add a caption to the table.

    - -$this->table->set_caption('Colors'); - -

    $this->table->set_heading()

    - -

    Permits you to set the table heading. You can submit an array or discreet params:

    - -$this->table->set_heading('Name', 'Color', 'Size'); -$this->table->set_heading(array('Name', 'Color', 'Size')); - -

    $this->table->add_row()

    - -

    Permits you to add a row to your table. You can submit an array or discreet params:

    - -$this->table->add_row('Blue', 'Red', 'Green'); -$this->table->add_row(array('Blue', 'Red', 'Green')); - - -

    $this->table->make_columns()

    - -

    This function takes a one-dimensional array as input and creates -a multi-dimensional array with a depth equal to the number of -columns desired. This allows a single array with many elements to be -displayed in a table that has a fixed column count. Consider this example:

    - - -$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
    -
    -$new_list = $this->table->make_columns($list, 3);
    -
    -$this->table->generate($new_list)
    -
    -// Generates a table with this prototype
    -
    -<table border="0" cellpadding="4" cellspacing="0">
    -<tr>
    -<td>one</td><td>two</td><td>three</td>
    -</tr><tr>
    -<td>four</td><td>five</td><td>six</td>
    -</tr><tr>
    -<td>seven</td><td>eight</td><td>nine</td>
    -</tr><tr>
    -<td>ten</td><td>eleven</td><td>twelve</td></tr>
    -</table>
    - - - -

    $this->table->set_template()

    - -

    Permits you to set your template. You can submit a full or partial template.

    - - -$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    - -
    -$this->table->set_template($tmpl); -
    - - -

    $this->table->set_empty()

    - -

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    - - -$this->table->set_empty("&nbsp;"); - - -

    $this->table->clear()

    - -

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should -to call this function after each table has been generated to empty the previous table information. Example:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading('Name', 'Color', 'Size');
    -$this->table->add_row('Fred', 'Blue', 'Small');
    -$this->table->add_row('Mary', 'Red', 'Large');
    -$this->table->add_row('John', 'Green', 'Medium');
    -
    -echo $this->table->generate();
    -
    -$this->table->clear();
    -
    -$this->table->set_heading('Name', 'Day', 'Delivery');
    -$this->table->add_row('Fred', 'Wednesday', 'Express');
    -$this->table->add_row('Mary', 'Monday', 'Air');
    -$this->table->add_row('John', 'Saturday', 'Overnight');
    -
    -echo $this->table->generate(); -
    - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : HTML Table Class

    CodeIgniter User Guide Version 1.5.4


    HTML Table Class

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    Initializing the Class

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    $this->load->library('table');

    Once loaded, the Table library object will be available using: $this->table

    Examples

    Here is an example showing how you can create a table from a multi-dimensional array. Note that the first array index will become the table heading (or you can set your own headings using the set_heading() function described in the function reference below).

    $this->load->library('table');

    $data = array(
                 array('Name', 'Color', 'Size'),
                 array('Fred', 'Blue', 'Small'),
                 array('Mary', 'Red', 'Large'),
                 array('John', 'Green', 'Medium')
                 );

    echo $this->table->generate($data);

    Here is an example of a table created from a database query result. The table class will automatically generate the headings based on the table names (or you can set your own headings using the set_heading() function described in the function reference below).

    $this->load->library('table');

    $query = $this->db->query("SELECT * FROM my_table");

    echo $this->table->generate($query);

    Here is an example showing how you might create a table using discreet parameters:

    $this->load->library('table');

    $this->table->set_heading('Name', 'Color', 'Size');

    $this->table->add_row('Fred', 'Blue', 'Small');
    $this->table->add_row('Mary', 'Red', 'Large');
    $this->table->add_row('John', 'Green', 'Medium');

    echo $this->table->generate();

    Here is the same example, except instead of individual parameters, arrays are used:

    $this->load->library('table');

    $this->table->set_heading(array('Name', 'Color', 'Size'));

    $this->table->add_row(array('Fred', 'Blue', 'Small'));
    $this->table->add_row(array('Mary', 'Red', 'Large'));
    $this->table->add_row(array('John', 'Green', 'Medium'));

    echo $this->table->generate();

    Changing the Look of Your Table

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype:

    $tmpl = array (
                        'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',

                        'heading_row_start'   => '<tr>',
                        'heading_row_end'     => '</tr>',
                        'heading_cell_start'  => '<th>',
                        'heading_cell_end'    => '</th>',

                        'row_start'           => '<tr>',
                        'row_end'             => '</tr>',
                        'cell_start'          => '<td>',
                        'cell_end'            => '</td>',

                        'row_alt_start'       => '<tr>',
                        'row_alt_end'         => '</tr>',
                        'cell_alt_start'      => '<td>',
                        'cell_alt_end'        => '</td>',

                        'table_close'         => '</table>'
                  );

    $this->table->set_template($tmpl);

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data.

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed:

    $tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

    $this->table->set_template($tmpl);

    Function Reference

    $this->table->generate()

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    $this->table->set_caption()

    Permits you to add a caption to the table.

    $this->table->set_caption('Colors');

    $this->table->set_heading()

    Permits you to set the table heading. You can submit an array or discreet params:

    $this->table->set_heading('Name', 'Color', 'Size'); $this->table->set_heading(array('Name', 'Color', 'Size'));

    $this->table->add_row()

    Permits you to add a row to your table. You can submit an array or discreet params:

    $this->table->add_row('Blue', 'Red', 'Green'); $this->table->add_row(array('Blue', 'Red', 'Green'));

    $this->table->make_columns()

    This function takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns desired. This allows a single array with many elements to be displayed in a table that has a fixed column count. Consider this example:

    $list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');

    $new_list = $this->table->make_columns($list, 3);

    $this->table->generate($new_list);

    // Generates a table with this prototype

    <table border="0" cellpadding="4" cellspacing="0">
    <tr>
    <td>one</td><td>two</td><td>three</td>
    </tr><tr>
    <td>four</td><td>five</td><td>six</td>
    </tr><tr>
    <td>seven</td><td>eight</td><td>nine</td>
    </tr><tr>
    <td>ten</td><td>eleven</td><td>twelve</td></tr>
    </table>

    $this->table->set_template()

    Permits you to set your template. You can submit a full or partial template.

    $tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

    $this->table->set_template($tmpl);

    $this->table->set_empty()

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    $this->table->set_empty("&nbsp;");

    $this->table->clear()

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this function after each table has been generated to empty the previous table information. Example:

    $this->load->library('table');

    $this->table->set_heading('Name', 'Color', 'Size');
    $this->table->add_row('Fred', 'Blue', 'Small');
    $this->table->add_row('Mary', 'Red', 'Large');
    $this->table->add_row('John', 'Green', 'Medium');

    echo $this->table->generate();

    $this->table->clear();

    $this->table->set_heading('Name', 'Day', 'Delivery');
    $this->table->add_row('Fred', 'Wednesday', 'Express');
    $this->table->add_row('Mary', 'Monday', 'Air');
    $this->table->add_row('John', 'Saturday', 'Overnight');

    echo $this->table->generate();
    \ No newline at end of file From 5a33293b5c830be12f4c29bb3605d6112222e31a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 14 Dec 2007 22:57:22 +0000 Subject: [PATCH 0743/2544] Fixed an example of accept_charset() in the User Agent Library. --- user_guide/changelog.html | 2 +- user_guide/libraries/user_agent.html | 202 +-------------------------- 2 files changed, 2 insertions(+), 202 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index babb020c..6d94d4ac 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 6b54fcdb..7dc747ef 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -1,201 +1 @@ - - - - -CodeIgniter User Guide : User Agent Class - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    User Agent Class

    - -

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. -In addition you can get referrer information as well as language and supported character-set information.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('user_agent'); -

    Once loaded, the object will be available using: $this->agent

    - -

    User Agent Definitions

    - -

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the -various user agent arrays if needed.

    - -

    Example

    - -

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is -a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    - - - -$this->load->library('user_agent');
    -
    -if ($this->agent->is_browser())
    -{
    -    $agent = $this->agent->browser().' '.$this->agent->version();
    -}
    -elseif ($this->agent->is_robot())
    -{
    -    $agent = $this->agent->robot();
    -}
    -elseif ($this->agent->is_mobile())
    -{
    -    $agent = $this->agent->mobile();
    -}
    -else
    -{
    -    $agent = 'Unidentified User Agent';
    -}
    -
    -echo $agent;
    -
    -echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) -
    - - -

    Function Reference

    - - -

    $this->agent->is_browser()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    - -

    $this->agent->is_mobile()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    - -

    $this->agent->is_robot()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    - -

    Note:  The user agent library only contains the most common robot -definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be -very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your -application/config/user_agents.php file.

    - -

    $this->agent->is_referral()

    -

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    - - -

    $this->agent->browser()

    -

    Returns a string containing the name of the web browser viewing your site.

    - -

    $this->agent->version()

    -

    Returns a string containing the version number of the web browser viewing your site.

    - -

    $this->agent->mobile()

    -

    Returns a string containing the name of the mobile device viewing your site.

    - -

    $this->agent->robot()

    -

    Returns a string containing the name of the robot viewing your site.

    - -

    $this->agent->platform()

    -

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    - -

    $this->agent->referrer()

    -

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    - - if ($this->agent->is_referral())
    -{
    -    echo $this->agent->referrer();
    -}
    - - -

    $this->agent->agent_string()

    -

    Returns a string containing the full user agent string. Typically it will be something like this:

    - -Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2 - - -

    $this->agent->accept_lang()

    -

    Lets you determine if the user agent accepts a particular language. Example:

    - -if ($this->agent->accept_lang('en'))
    -{
    -    echo 'You accept English!';
    -}
    - -

    Note: This function is not typically very reliable -since some browsers do not provide language info, and even among those that do, it is not always accurate.

    - - - -

    $this->agent->accept_charset()

    -

    Lets you determine if the user agent accepts a particular language. Example:

    - -if ($this->agent->accept_charset('utf-8'))
    -{
    -    echo 'You browser supports UTF-8!';
    -}
    - -

    Note: This function is not typically very reliable -since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    - - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : User Agent Class

    CodeIgniter User Guide Version 1.5.4


    User Agent Class

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. In addition you can get referrer information as well as language and supported character-set information.

    Initializing the Class

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    $this->load->library('user_agent');

    Once loaded, the object will be available using: $this->agent

    User Agent Definitions

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the various user agent arrays if needed.

    Example

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    $this->load->library('user_agent');

    if ($this->agent->is_browser())
    {
        $agent = $this->agent->browser().' '.$this->agent->version();
    }
    elseif ($this->agent->is_robot())
    {
        $agent = $this->agent->robot();
    }
    elseif ($this->agent->is_mobile())
    {
        $agent = $this->agent->mobile();
    }
    else
    {
        $agent = 'Unidentified User Agent';
    }

    echo $agent;

    echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)

    Function Reference

    $this->agent->is_browser()

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    $this->agent->is_mobile()

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    $this->agent->is_robot()

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    Note:  The user agent library only contains the most common robot definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your application/config/user_agents.php file.

    $this->agent->is_referral()

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    $this->agent->browser()

    Returns a string containing the name of the web browser viewing your site.

    $this->agent->version()

    Returns a string containing the version number of the web browser viewing your site.

    $this->agent->mobile()

    Returns a string containing the name of the mobile device viewing your site.

    $this->agent->robot()

    Returns a string containing the name of the robot viewing your site.

    $this->agent->platform()

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    $this->agent->referrer()

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    if ($this->agent->is_referral())
    {
        echo $this->agent->referrer();
    }

    $this->agent->agent_string()

    Returns a string containing the full user agent string. Typically it will be something like this:

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2

    $this->agent->accept_lang()

    Lets you determine if the user agent accepts a particular language. Example:

    if ($this->agent->accept_lang('en'))
    {
        echo 'You accept English!';
    }

    Note: This function is not typically very reliable since some browsers do not provide language info, and even among those that do, it is not always accurate.

    $this->agent->accept_charset()

    Lets you determine if the user agent accepts a particular character set. Example:

    if ($this->agent->accept_charset('utf-8'))
    {
        echo 'You browser supports UTF-8!';
    }

    Note: This function is not typically very reliable since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    \ No newline at end of file From f9997d9531ee28ce180cbf96470d02826321b769 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 13:31:25 +0000 Subject: [PATCH 0744/2544] "direcotries" to "directories" --- system/language/english/ftp_lang.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index d6a1a40c..a891ae5f 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -1,15 +1 @@ - \ No newline at end of file + \ No newline at end of file From c3d8e6a78ea47e9133ed426fef4b0e4650e64d3d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 13:50:46 +0000 Subject: [PATCH 0745/2544] Added form_reset() function to form helper. --- system/helpers/form_helper.php | 421 +--------------------------- user_guide/changelog.html | 2 +- user_guide/helpers/form_helper.html | 339 +--------------------- 3 files changed, 3 insertions(+), 759 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 17022a3b..a23d4c6d 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1,420 +1 @@ -config->site_url($action).'"'; - - if ( ! isset($attributes['method'])) - { - $form .= ' method="post"'; - } - - if (is_array($attributes) AND count($attributes) > 0) - { - foreach ($attributes as $key => $val) - { - $form .= ' '.$key.'="'.$val.'"'; - } - } - - $form .= '>'; - - if (is_array($hidden) AND count($hidden > 0)) - { - $form .= form_hidden($hidden); - } - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Form Declaration - Multipart type - * - * Creates the opening portion of the form, but with "multipart/form-data". - * - * @access public - * @param string the URI segments of the form destination - * @param array a key/value pair of attributes - * @param array a key/value pair hidden data - * @return string - */ -function form_open_multipart($action, $attributes = array(), $hidden = array()) -{ - $attributes['enctype'] = 'multipart/form-data'; - return form_open($action, $attributes, $hidden); -} - -// ------------------------------------------------------------------------ - -/** - * Hidden Input Field - * - * Generates hidden fields. You can pass a simple key/value string or an associative - * array with multiple values. - * - * @access public - * @param mixed - * @param string - * @return string - */ -function form_hidden($name, $value = '') -{ - if ( ! is_array($name)) - { - return ''; - } - - $form = ''; - foreach ($name as $name => $value) - { - $form .= ''; - } - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Text Input Field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_input($data = '', $value = '', $extra = '') -{ - $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Password Field - * - * Identical to the input function but adds the "password" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_password($data = '', $value = '', $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'password'; - return form_input($data, $value, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Upload Field - * - * Identical to the input function but adds the "file" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_upload($data = '', $value = '', $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'file'; - return form_input($data, $value, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Textarea field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_textarea($data = '', $value = '', $extra = '') -{ - $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - - if ( ! is_array($data) OR ! isset($data['value'])) - { - $val = $value; - } - else - { - $val = $data['value']; - unset($data['value']); // textareas don't use the value attribute - } - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Drop-down Menu - * - * @access public - * @param string - * @param array - * @param string - * @param string - * @return string - */ -function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') -{ - if ($extra != '') $extra = ' '.$extra; - - $form = ''; - - return $form; -} - -// ------------------------------------------------------------------------ - -/** - * Checkbox Field - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') -{ - $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - if (is_array($data) AND array_key_exists('checked', $data)) - { - $checked = $data['checked']; - - if ($checked == FALSE) - { - unset($data['checked']); - } - else - { - $data['checked'] = 'checked'; - } - } - - if ($checked == TRUE) - $defaults['checked'] = 'checked'; - else - unset($defaults['checked']); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Radio Button - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') -{ - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'radio'; - return form_checkbox($data, $value, $checked, $extra); -} - -// ------------------------------------------------------------------------ - -/** - * Submit Button - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -function form_submit($data = '', $value = '', $extra = '') -{ - $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - return "\n"; -} - -// ------------------------------------------------------------------------ - -/** - * Form Close Tag - * - * @access public - * @param string - * @return string - */ -function form_close($extra = '') -{ - return "\n".$extra; -} - -// ------------------------------------------------------------------------ - -/** - * Form Prep - * - * Formats text so that it can be safely placed in a form field in the event it has HTML tags. - * - * @access public - * @param string - * @return string - */ -function form_prep($str = '') -{ - if ($str === '') - { - return ''; - } - - $temp = '__TEMP_AMPERSANDS__'; - - // Replace entities to temporary markers so that - // htmlspecialchars won't mess them up - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - - $str = htmlspecialchars($str); - - // In case htmlspecialchars misses these. - $str = str_replace(array("'", '"'), array("'", """), $str); - - // Decode the temp markers back to entities - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;",$str); - - return $str; -} - -// ------------------------------------------------------------------------ - -/** - * Parse the form attributes - * - * Helper function used by some of the form helpers - * - * @access private - * @param array - * @param array - * @return string - */ -function parse_form_attributes($attributes, $default) -{ - if (is_array($attributes)) - { - foreach ($default as $key => $val) - { - if (isset($attributes[$key])) - { - $default[$key] = $attributes[$key]; - unset($attributes[$key]); - } - } - - if (count($attributes) > 0) - { - $default = array_merge($default, $attributes); - } - } - - $att = ''; - foreach ($default as $key => $val) - { - if ($key == 'value') - { - $val = form_prep($val); - } - - $att .= $key . '="' . $val . '" '; - } - - return $att; -} - -?> \ No newline at end of file +config->site_url($action).'"'; if ( ! isset($attributes['method'])) { $form .= ' method="post"'; } if (is_array($attributes) AND count($attributes) > 0) { foreach ($attributes as $key => $val) { $form .= ' '.$key.'="'.$val.'"'; } } $form .= '>'; if (is_array($hidden) AND count($hidden > 0)) { $form .= form_hidden($hidden); } return $form; } // ------------------------------------------------------------------------ /** * Form Declaration - Multipart type * * Creates the opening portion of the form, but with "multipart/form-data". * * @access public * @param string the URI segments of the form destination * @param array a key/value pair of attributes * @param array a key/value pair hidden data * @return string */ function form_open_multipart($action, $attributes = array(), $hidden = array()) { $attributes['enctype'] = 'multipart/form-data'; return form_open($action, $attributes, $hidden); } // ------------------------------------------------------------------------ /** * Hidden Input Field * * Generates hidden fields. You can pass a simple key/value string or an associative * array with multiple values. * * @access public * @param mixed * @param string * @return string */ function form_hidden($name, $value = '') { if ( ! is_array($name)) { return ''; } $form = ''; foreach ($name as $name => $value) { $form .= ''; } return $form; } // ------------------------------------------------------------------------ /** * Text Input Field * * @access public * @param mixed * @param string * @param string * @return string */ function form_input($data = '', $value = '', $extra = '') { $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); return "\n"; } // ------------------------------------------------------------------------ /** * Password Field * * Identical to the input function but adds the "password" type * * @access public * @param mixed * @param string * @param string * @return string */ function form_password($data = '', $value = '', $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'password'; return form_input($data, $value, $extra); } // ------------------------------------------------------------------------ /** * Upload Field * * Identical to the input function but adds the "file" type * * @access public * @param mixed * @param string * @param string * @return string */ function form_upload($data = '', $value = '', $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'file'; return form_input($data, $value, $extra); } // ------------------------------------------------------------------------ /** * Textarea field * * @access public * @param mixed * @param string * @param string * @return string */ function form_textarea($data = '', $value = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } return "\n"; } // ------------------------------------------------------------------------ /** * Drop-down Menu * * @access public * @param string * @param array * @param string * @param string * @return string */ function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') { if ($extra != '') $extra = ' '.$extra; $form = ''; return $form; } // ------------------------------------------------------------------------ /** * Checkbox Field * * @access public * @param mixed * @param string * @param bool * @param string * @return string */ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); if (is_array($data) AND array_key_exists('checked', $data)) { $checked = $data['checked']; if ($checked == FALSE) { unset($data['checked']); } else { $data['checked'] = 'checked'; } } if ($checked == TRUE) $defaults['checked'] = 'checked'; else unset($defaults['checked']); return "\n"; } // ------------------------------------------------------------------------ /** * Radio Button * * @access public * @param mixed * @param string * @param bool * @param string * @return string */ function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'radio'; return form_checkbox($data, $value, $checked, $extra); } // ------------------------------------------------------------------------ /** * Submit Button * * @access public * @param mixed * @param string * @param string * @return string */ function form_submit($data = '', $value = '', $extra = '') { $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); return "\n"; } // ------------------------------------------------------------------------ /** * Reset Button * * @access public * @param mixed * @param string * @param string * @return string */ function form_reset($data = '', $value = '', $extra = '') { $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); return "\n"; } // ------------------------------------------------------------------------ /** * Form Close Tag * * @access public * @param string * @return string */ function form_close($extra = '') { return "\n".$extra; } // ------------------------------------------------------------------------ /** * Form Prep * * Formats text so that it can be safely placed in a form field in the event it has HTML tags. * * @access public * @param string * @return string */ function form_prep($str = '') { if ($str === '') { return ''; } $temp = '__TEMP_AMPERSANDS__'; // Replace entities to temporary markers so that // htmlspecialchars won't mess them up $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); $str = htmlspecialchars($str); // In case htmlspecialchars misses these. $str = str_replace(array("'", '"'), array("'", """), $str); // Decode the temp markers back to entities $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); $str = preg_replace("/$temp(\w+);/","&\\1;",$str); return $str; } // ------------------------------------------------------------------------ /** * Parse the form attributes * * Helper function used by some of the form helpers * * @access private * @param array * @param array * @return string */ function parse_form_attributes($attributes, $default) { if (is_array($attributes)) { foreach ($default as $key => $val) { if (isset($attributes[$key])) { $default[$key] = $attributes[$key]; unset($attributes[$key]); } } if (count($attributes) > 0) { $default = array_merge($default, $attributes); } } $att = ''; foreach ($default as $key => $val) { if ($key == 'value') { $val = form_prep($val); } $att .= $key . '="' . $val . '" '; } return $att; } ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6d94d4ac..3301a9d8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Added form_reset() function to form helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 3ffad7c6..3cf6f3a6 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1,338 +1 @@ - - - - -CodeIgniter User Guide : Form Helper - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Form Helper

    - -

    The Form Helper file contains functions that assist in working with forms.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('form'); - -

    The following functions are available:

    - - - -

    form_open()

    - -

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you -add form attributes and hidden input fields.

    - -

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable -in the event your URLs ever change.

    - -

    Here's a simple example:

    - -echo form_open('email/send'); - -

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send" /> - -

    Adding Attributes

    - -

    Attributes can be added by passing an associative array to the second parameter, like this:

    - - -$attributes = array('class' => 'email', 'id' => 'myform');
    -
    -echo form_open('email/send', $attributes);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> - -

    Adding Hidden Input Fields

    - -

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    - - -$hidden = array('username' => 'Joe', 'member_id' => '234');
    -
    -echo form_open('email/send', '', $hidden);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    -<input type="hidden" name="username" value="Joe" />
    -<input type="hidden" name="member_id" value="234" />
    - - -

    form_open_multipart()

    - -

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, -which is necessary if you would like to use the form to upload files with.

    - -

    form_hidden()

    - -

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    - -form_hidden('username', 'johndoe');
    -
    -// Would produce:

    -<input type="hidden" name="username" value="johnodoe" />
    - -

    Or you can submit an associative array to create multiple fields:

    - -$data = array(
    -              'name'  => 'John Doe',
    -              'email' => 'john@example.com',
    -              'url'   => 'http://www.example.com'
    -            );
    -
    -echo form_hidden($data);
    -
    -// Would produce:

    -<input type="hidden" name="name" value="John Doe" />
    -<input type="hidden" name="email" value="john@example.com" />
    -<input type="hidden" name="url" value="http://www.example.com" />
    - - - - -

    form_input()

    - -

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first -and second parameter:

    - -echo form_input('username', 'johndoe'); - -

    Or you can pass an associative array containing any data you wish your form to contain:

    - -$data = array(
    -              'name'        => 'username',
    -              'id'          => 'username',
    -              'value'       => 'johndoe',
    -              'maxlength'   => '100',
    -              'size'        => '50',
    -              'style'       => 'width:50%',
    -            );
    -
    -echo form_input($data);
    -
    -// Would produce:

    -<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    - -

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the -third parameter:

    - -$js = 'onClick="some_function()"';
    -
    -echo form_input('username', 'johndoe', $js);
    - -

    form_password()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "password" type.

    - -

    form_upload()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "file" type, allowing it to be used to upload files.

    - -

    form_textarea()

    - -

    This function is identical in all respects to the form_input() function above -except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above -example, you will instead specify "rows" and "cols".

    - - -

    form_dropdown()

    - -

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, -the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. Example:

    - -$options = array(
    -                  'small'  => 'Small Shirt',
    -                  'med'    => 'Medium Shirt',
    -                  'large'   => 'Large Shirt',
    -                  'xlarge' => 'Extra Large Shirt',
    -                );
    -
    -echo form_dropdown('shirts', $options, 'large');
    -
    -// Would produce:

    - -<select name="shirts">
    -<option value="small">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    -<option value="large" selected>Large Shirt</option>
    -<option value="xlarge">Extra Large Shirt</option>
    -</select>
    - - -

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onChange="some_function()"';
    -
    -echo form_dropdown('shirts', $options, 'large', $js);
    - - -

    form_checkbox()

    - -

    Lets you generate a checkbox field. Simple example:

    - - -echo form_checkbox('newsletter', 'accept', TRUE);
    -
    -// Would produce:
    -
    -<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    - -

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    - -

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    - -$data = array(
    -              'name'        => 'newsletter',
    -              'id'          => 'newsletter',
    -              'value'       => 'accept',
    -              'checked'     => TRUE,
    -              'style'       => 'margin:10px',
    -            );
    -
    -echo form_checkbox($data);
    -
    -// Would produce:

    -<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    - -

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onClick="some_function()"';
    -
    - echo form_checkbox('newsletter', 'accept', TRUE, $js)
    - - -

    form_radio()

    -

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    - - -

    form_submit()

    - -

    Lets you generate a standard submit button. Simple example:

    - -echo form_submit('mysubmit', 'Submit Post!');
    -
    -// Would produce:
    -
    -<input type="submit" name="mysubmit" value="Submit Post!" />
    - -

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. -The third parameter lets you add extra data to your form, like JavaScript.

    - - -

    form_close()

    - -

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it -which will be added below the tag. For example:

    - -$string = "</div></div>";
    -
    -echo form_close($string);
    -
    -// Would produce:
    -
    -</form>
    -</div></div>
    - - - - - -

    form_prep()

    - -

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    - -$string = 'Here is a string containing "quoted" text.';
    -
    -<input type="text" name="myform" value="$string" />
    - -

    Since the above string contains a set of quotes it will cause the form to break. -The form_prep function converts HTML so that it can be used safely:

    - -<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> - -

    Note: If you use any of the form helper functions listed in this page the form -values will be prepped automatically, so there is no need to call this function. Use it only if you are -creating your own form elements.

    - - - - -
    - - - - - - - \ No newline at end of file + CodeIgniter User Guide : Form Helper

    CodeIgniter User Guide Version 1.5.4


    Form Helper

    The Form Helper file contains functions that assist in working with forms.

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('form');

    The following functions are available:

    form_open()

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you add form attributes and hidden input fields.

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable in the event your URLs ever change.

    Here's a simple example:

    echo form_open('email/send');

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send" />

    Adding Attributes

    Attributes can be added by passing an associative array to the second parameter, like this:

    $attributes = array('class' => 'email', 'id' => 'myform');

    echo form_open('email/send', $attributes);

    The above example would create a form similar to this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />

    Adding Hidden Input Fields

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    $hidden = array('username' => 'Joe', 'member_id' => '234');

    echo form_open('email/send', '', $hidden);

    The above example would create a form similar to this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    <input type="hidden" name="username" value="Joe" />
    <input type="hidden" name="member_id" value="234" />

    form_open_multipart()

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, which is necessary if you would like to use the form to upload files with.

    form_hidden()

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    form_hidden('username', 'johndoe');

    // Would produce:

    <input type="hidden" name="username" value="johnodoe" />

    Or you can submit an associative array to create multiple fields:

    $data = array(
                  'name'  => 'John Doe',
                  'email' => 'john@example.com',
                  'url'   => 'http://www.example.com'
                );

    echo form_hidden($data);

    // Would produce:

    <input type="hidden" name="name" value="John Doe" />
    <input type="hidden" name="email" value="john@example.com" />
    <input type="hidden" name="url" value="http://www.example.com" />

    form_input()

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first and second parameter:

    echo form_input('username', 'johndoe');

    Or you can pass an associative array containing any data you wish your form to contain:

    $data = array(
                  'name'        => 'username',
                  'id'          => 'username',
                  'value'       => 'johndoe',
                  'maxlength'   => '100',
                  'size'        => '50',
                  'style'       => 'width:50%',
                );

    echo form_input($data);

    // Would produce:

    <input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter:

    $js = 'onClick="some_function()"';

    echo form_input('username', 'johndoe', $js);

    form_password()

    This function is identical in all respects to the form_input() function above except that is sets it as a "password" type.

    form_upload()

    This function is identical in all respects to the form_input() function above except that is sets it as a "file" type, allowing it to be used to upload files.

    form_textarea()

    This function is identical in all respects to the form_input() function above except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above example, you will instead specify "rows" and "cols".

    form_dropdown()

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the value you wish to be selected. Example:

    $options = array(
                      'small'  => 'Small Shirt',
                      'med'    => 'Medium Shirt',
                      'large'   => 'Large Shirt',
                      'xlarge' => 'Extra Large Shirt',
                    );

    echo form_dropdown('shirts', $options, 'large');

    // Would produce:

    <select name="shirts">
    <option value="small">Small Shirt</option>
    <option value="med">Medium Shirt</option>
    <option value="large" selected>Large Shirt</option>
    <option value="xlarge">Extra Large Shirt</option>
    </select>

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter:

    $js = 'onChange="some_function()"';

    echo form_dropdown('shirts', $options, 'large', $js);

    form_checkbox()

    Lets you generate a checkbox field. Simple example:

    echo form_checkbox('newsletter', 'accept', TRUE);

    // Would produce:

    <input type="checkbox" name="newsletter" value="accept" checked="checked" />

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    $data = array(
                  'name'        => 'newsletter',
                  'id'          => 'newsletter',
                  'value'       => 'accept',
                  'checked'     => TRUE,
                  'style'       => 'margin:10px',
                );

    echo form_checkbox($data);

    // Would produce:

    <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter:

    $js = 'onClick="some_function()"';

    echo form_checkbox('newsletter', 'accept', TRUE, $js)

    form_radio()

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    form_submit()

    Lets you generate a standard submit button. Simple example:

    echo form_submit('mysubmit', 'Submit Post!');

    // Would produce:

    <input type="submit" name="mysubmit" value="Submit Post!" />

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. The third parameter lets you add extra data to your form, like JavaScript.

    form_reset()

    Lets you generate a standard reset button. Use is identical to form_submit().

    form_close()

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it which will be added below the tag. For example:

    $string = "</div></div>";

    echo form_close($string);

    // Would produce:

    </form>
    </div></div>

    form_prep()

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    $string = 'Here is a string containing "quoted" text.';

    <input type="text" name="myform" value="$string" />

    Since the above string contains a set of quotes it will cause the form to break. The form_prep function converts HTML so that it can be used safely:

    <input type="text" name="myform" value="<?php echo form_prep($string); ?>" />

    Note: If you use any of the form helper functions listed in this page the form values will be prepped automatically, so there is no need to call this function. Use it only if you are creating your own form elements.

    \ No newline at end of file From bc67c231d60a3414472e4d3f0b84aa813d1afd61 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 14:01:49 +0000 Subject: [PATCH 0746/2544] updated a few changes --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3301a9d8..71c9ed41 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Added form_reset() function to form helper.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Added form_reset() function to form helper.
    • Added a language entry for valid_ip validation error.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file From 488b7ee038ceca4ed083a1fd4cc43788e20101a7 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 14:22:31 +0000 Subject: [PATCH 0747/2544] Fixed a typo in the image language file "suppor" to "support". --- system/language/english/imglib_lang.php | 40 +- user_guide/changelog.html | 500 +++++++++++++++++++++++- 2 files changed, 519 insertions(+), 21 deletions(-) diff --git a/system/language/english/imglib_lang.php b/system/language/english/imglib_lang.php index 68c5804a..1921027f 100644 --- a/system/language/english/imglib_lang.php +++ b/system/language/english/imglib_lang.php @@ -1,21 +1,21 @@ - \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 71c9ed41..9c239926 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1 +1,499 @@ - CodeIgniter User Guide : Change Log

    CodeIgniter User Guide Version 1.5.4


    Change Log

    Version 1.5.5

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • Added titles to all user manual pages.
    • Added a check for NULL fields in the MySQL database backup utility.
    • Documented the timezones() function in the Date Helper.
    • Documented unset_userdata in the Session class.
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Added form_reset() function to form helper.
    • Added a language entry for valid_ip validation error.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • Fixed a bug in captcha calling an invalid PHP function.
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • Fixed an example for XML RPC.
    • Fixed an example of accept_charset() in the User Agent Library.
    • Fixed a missing "?>" in the smiley helper.
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • Fixed a typo in the table library docs.
    • Moved part of the userguide menu javascript to an external file.

    Version 1.5.4

    Release Date: July 12, 2007

    • Added custom Language files to the autoload options.
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • Added array to string into the profiler.
    • Added some additional mime types in application/config/mimes.php.
    • Added filename_security() method to Input library.
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • Fixed MSSQL insert_id().
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • Fixed a typo in the Calendar library
    • Fixed a typo in rpcs.php library
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • Fixed an IP validation bug.
    • Fixed a bug in display of POST keys in the Profiler output
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • Fixed various doc typos.
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • Docs now validate to XHTML 1 transitional
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.

    Version 1.5.3

    Release Date: April 15, 2007

    • Added array to string into the profiler
    • Code Igniter references updated to CodeIgniter
    • pMachine references updated to EllisLab
    • Fixed a bug in the repeater function of string helper.
    • Fixed a bug in ODBC driver
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • Fixed a version bug in the Postgre driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.

    Version 1.5.2

    Release Date: February 13, 2007

    • Added subversion information to the downloads page.
    • Added support for captions in the Table Library
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • Removed unescaped variables in error messages of Input and Router classes
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • Fixed a bug in the form helper that gave textarea a value attribute
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • Fixed some doc typos.

    Version 1.5.1

    Release Date: November 23, 2006

    • Added support for submitting arrays of libraries in the $this->load->library function.
    • Added support for naming custom library files in lower or uppercase.
    • Fixed a bug related to output buffering.
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • Fixed a bug that was suppressing errors in controllers.
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • Fixed some bugs in the Oracle DB driver.
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • Fixed some doc typos.

    Version 1.5.0.1

    Release Date: October 31, 2006

    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • Fixed a bug in the word_wrap() helper function.
    • Fixed an invalid color Hex number in the Profiler class.
    • Fixed a corrupted image in the user guide.

    Version 1.5.0

    Release Date: October 30, 2006

    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • Added Database Caching Class.
    • Added transaction support to the database classes.
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • Added Zip Encoding Library.
    • Added FTP Library.
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • Added support for storing models within sub-folders.
    • Added Download Helper.
    • Added simple_query() function to the database classes
    • Added standard_date() function to the Date Helper.
    • Added $query->free_result() to database class.
    • Added $query->list_fields() function to database class
    • Added $this->db->platform() function
    • Added new File Helper: get_filenames()
    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • Fixed a bug in the Email class related to SMTP Helo data.
    • Fixed a bug in the word wrapping helper and function in the email class.
    • Fixed a bug in the validation class.
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • Fixed a pagination bug that was permitting negative values in the URL.
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • Changed _get_config() to get_config() since the function is not a private one.
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.

    Version 1.4.1

    Release Date: September 21, 2006

    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • Added $this->output->set_header() function, which allows you to set server headers.
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • Added Inflector helper.
    • Added element() function in the array helper.
    • Added RAND() to active record orderby() function.
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • Added output compression option to the config file.
    • Removed the is_numeric test from the db->escape() function.
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • Added some code to allow email attachments to be reset when sending batches of email.
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().

    Version 1.4.0

    Release Date: September 17, 2006

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • Added support for % character in URL.
    • Added the ability to supply full URLs using the anchor() helper function.
    • Added mode parameter to file_write() helper.
    • Added support for changing the port number in the Postgre driver.
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • Updated the form_open() helper to allow the GET method to be used.
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • Updated the Models loader function to allow multiple loads of the same model.
    • Updated the MS SQL driver so that single quotes are escaped.
    • Updated the Postgre and ODBC drivers for better compatibility.
    • Removed a strtolower() call that was changing URL segments to lower case.
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • Removed backticks from Postgre class since these are not needed.
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • Fixed a router bug that was making it too greedy when matching end segments.
    • Fixed a bug that was preventing multiple discreet database calls.
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • Fixed some missing prefixes when using the database prefix feature.
    • Fixed a typo in the Calendar class (cal_november).
    • Fixed a bug in the form_checkbox() helper.
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • Fixed an evaluation bug in the database initialization function.
    • Fixed a minor bug in one of the error messages in the language class.
    • Fixed a bug in the date helper timespan function.
    • Fixed an undefined variable in the DB Driver class.
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • Fixed a couple bugs in the Unit Testing class.
    • Fixed an incorrectly named variable in the Validation class.
    • Fixed an incorrectly named variable in the URI class.
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • Fixed some MS SQL bugs.
    • Fixed some doc typos.

    Version 1.3.3

    Release Date: June 1, 2006

    • Models do not connect automatically to the database as of this version. More info here.
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • Fixed a bug in the active record "having" function.
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • Fixed a bug in the hash() security helper.
    • Fixed some typos.

    Version 1.3.2

    Release Date: April 17, 2006

    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • Fixed a couple bugs in the Model class.
    • Fixed some documentation typos and errata.

    Version 1.3.1

    Release Date: April 11, 2006

    • Added a Unit Testing Library.
    • Added the ability to pass objects to the insert() and update() database functions. This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • Added getwhere function to Active Record class.
    • Added count_all function to Active Record class.
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • Added a new mime type to the upload class for better compatibility.
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • Fixed a bug in the image library when realpath() returns false.
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • Fixed a bug in the "exact_length" function of the validation class.
    • Fixed some typos in the user guide

    Version 1.3

    Release Date: April 3, 2006

    • Added support for Models.
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • Fixed some typos in the default calendar template
    • Fixed some typos in the user guide

    Version 1.2

    Release Date: March 21, 2006

    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • Added new File Helper: delete_files()
    • Added new URL Helpers: base_url(), index_page()
    • Added the ability to create your own core libraries and store them in your local application directory.
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • Added Javascript Calendar plugin.
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • Fixed a bug in the DB "where" function.
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • Fixed some bugs in the xss_clean function

    Version Beta 1.1

    Release Date: March 10, 2006

    • Added a Calendaring class.
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • Fixed a data type error in the form_radio function (form helper)
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • Fixed a pagination problem in the scaffolding.
    • Fixed a bug in the mysql class "where" function.
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • Fixed a bug in the br() function in the HTML helper
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • Removed the "style" attributes form the form helpers.
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.

    Version Beta 1.0

    Release Date: February 28, 2006

    First publicly released version.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Change Log + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Change Log

    + +

    Version 1.5.5

    +

    Release Date: -- still in development

    +
      +
    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • +
    • Added the ability to auto-load Models
    • +
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • +
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • +
    • Reorganized the URI and Routes classes for better clarity.
    • +
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • +
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • +
    • Added titles to all user manual pages.
    • +
    • Added a check for NULL fields in the MySQL database backup utility.
    • +
    • Documented the timezones() function in the Date Helper.
    • +
    • Documented unset_userdata in the Session class.
    • +
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • +
    • Added a few additional mime type variations for CSV.
    • +
    • Added strip_quotes() function to string helper.
    • +
    • Added reduce_multiples() function to string helper.
    • +
    • Added quotes_to_entities() function to string helper.
    • +
    • Added form_reset() function to form helper.
    • +
    • Added a language entry for valid_ip validation error.
    • +
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • +
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • +
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • +
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • +
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • +
    • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
    • +
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • +
    • Fixed a bug in captcha calling an invalid PHP function.
    • +
    • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • +
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • +
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • +
    • Fixed an example of comma-separated emails in the email library documentation.
    • +
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • +
    • Fixed a typo in the database language file.
    • +
    • Fixed a typo in the image language file "suppor" to "support".
    • +
    • Fixed an example for XML RPC.
    • +
    • Fixed an example of accept_charset() in the User Agent Library.
    • +
    • Fixed a missing "?>" in the smiley helper.
    • +
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • +
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • +
    • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
    • +
    • Fixed a typo in the table library docs.
    • +
    • Moved part of the userguide menu javascript to an external file.
    • +
    + + + + + +

    Version 1.5.4

    +

    Release Date: July 12, 2007

    +
      +
    • Added custom Language files to the autoload options.
    • +
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • +
    • Added array to string into the profiler.
    • +
    • Added some additional mime types in application/config/mimes.php.
    • +
    • Added filename_security() method to Input library.
    • +
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • +
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • +
    • Fixed MSSQL insert_id().
    • +
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • +
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • +
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • +
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • +
    • Fixed a typo in the Calendar library
    • +
    • Fixed a typo in rpcs.php library
    • +
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • +
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • +
    • Fixed an IP validation bug.
    • +
    • Fixed a bug in display of POST keys in the Profiler output
    • +
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • +
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • +
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • +
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • +
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • +
    • Fixed various doc typos.
    • +
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • +
    • Docs now validate to XHTML 1 transitional
    • +
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • +
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • +
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • +
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • +
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • +
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • +
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • +
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • +
    +

    Version 1.5.3

    +

    Release Date: April 15, 2007

    +
      +
    • Added array to string into the profiler
    • +
    • Code Igniter references updated to CodeIgniter
    • +
    • pMachine references updated to EllisLab
    • +
    • Fixed a bug in the repeater function of string helper.
    • +
    • Fixed a bug in ODBC driver
    • +
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • +
    • Fixed a bug in the redirect function of the url helper.
    • +
    • Fixed an undefined variable in Loader
    • +
    • Fixed a version bug in the Postgre driver
    • +
    • Fixed a bug in the textarea function of the form helper for use with strings
    • +
    • Fixed doc typos.
    • +
    +

    Version 1.5.2

    +

    Release Date: February 13, 2007

    +
      +
    • Added subversion information to the downloads page.
    • +
    • Added support for captions in the Table Library
    • +
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
    • +
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • +
    • Removed unescaped variables in error messages of Input and Router classes
    • +
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • +
    • Fixed a bug in the form helper that gave textarea a value attribute
    • +
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • +
    • Fixed some doc typos.
    • +
    + + +

    Version 1.5.1

    +

    Release Date: November 23, 2006

    +
      +
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • +
    • Added support for naming custom library files in lower or uppercase.
    • +
    • Fixed a bug related to output buffering.
    • +
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • +
    • Fixed a bug that was suppressing errors in controllers.
    • +
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • +
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • +
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • +
    • Fixed some bugs in the Oracle DB driver.
    • +
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • +
    • Fixed some doc typos.
    • +
    +

    Version 1.5.0.1

    +

    Release Date: October 31, 2006

    +
      +
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • +
    • Fixed a bug in the word_wrap() helper function.
    • +
    • Fixed an invalid color Hex number in the Profiler class.
    • +
    • Fixed a corrupted image in the user guide.
    • +
    + + + +

    Version 1.5.0

    +

    Release Date: October 30, 2006

    + +
      +
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • +
    • Added Database Caching Class.
    • +
    • Added transaction support to the database classes.
    • +
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • +
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • +
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • +
    • Added Zip Encoding Library.
    • +
    • Added FTP Library.
    • +
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • +
    • Added support for storing models within sub-folders.
    • +
    • Added Download Helper.
    • +
    • Added simple_query() function to the database classes
    • +
    • Added standard_date() function to the Date Helper.
    • +
    • Added $query->free_result() to database class.
    • +
    • Added $query->list_fields() function to database class
    • +
    • Added $this->db->platform() function
    • +
    • Added new File Helper: get_filenames()
    • +
    • Added new helper: Smiley Helper
    • +
    • Added support for <ul> and <ol> lists in the HTML Helper
    • +
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • +
    • Added the ability to rename or relocate the "application" folder. +
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • +
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • +
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • +
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • +
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • +
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • +
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • +
    • Fixed a bug in the Email class related to SMTP Helo data.
    • +
    • Fixed a bug in the word wrapping helper and function in the email class.
    • +
    • Fixed a bug in the validation class.
    • +
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • +
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • +
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • +
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • +
    • Fixed a pagination bug that was permitting negative values in the URL.
    • +
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • +
    • Changed _get_config() to get_config() since the function is not a private one.
    • +
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • +
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • +
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • +
    + + + + +

    Version 1.4.1

    +

    Release Date: September 21, 2006

    + +
      +
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • +
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • +
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • +
    • Added $this->output->set_header() function, which allows you to set server headers.
    • +
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • +
    • Added Inflector helper.
    • +
    • Added element() function in the array helper.
    • +
    • Added RAND() to active record orderby() function.
    • +
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • +
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • +
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • +
    • Added output compression option to the config file.
    • +
    • Removed the is_numeric test from the db->escape() function.
    • +
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • +
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • +
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • +
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • +
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • +
    • Added some code to allow email attachments to be reset when sending batches of email.
    • +
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • +
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • +
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • +
    + + + +

    Version 1.4.0

    +

    Release Date: September 17, 2006

    + +
      +
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added regular expressions support for routing rules.
    • +
    • Added the ability to remap function calls within your controllers.
    • +
    • Added the ability to replace core system classes with your own classes.
    • +
    • Added support for % character in URL.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • +
    • Added mode parameter to file_write() helper.
    • +
    • Added support for changing the port number in the Postgre driver.
    • +
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • +
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • +
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • +
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • +
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • +
    • Updated the form_open() helper to allow the GET method to be used.
    • +
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • +
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • +
    • Updated the Models loader function to allow multiple loads of the same model.
    • +
    • Updated the MS SQL driver so that single quotes are escaped.
    • +
    • Updated the Postgre and ODBC drivers for better compatibility.
    • +
    • Removed a strtolower() call that was changing URL segments to lower case.
    • +
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • +
    • Removed backticks from Postgre class since these are not needed.
    • +
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • +
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • +
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • +
    • Fixed a router bug that was making it too greedy when matching end segments.
    • +
    • Fixed a bug that was preventing multiple discreet database calls.
    • +
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • +
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • +
    • Fixed some missing prefixes when using the database prefix feature.
    • +
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed a bug in the form_checkbox() helper.
    • +
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • +
    • Fixed an evaluation bug in the database initialization function.
    • +
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed a bug in the date helper timespan function.
    • +
    • Fixed an undefined variable in the DB Driver class.
    • +
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • +
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • +
    • Fixed a couple bugs in the Unit Testing class.
    • +
    • Fixed an incorrectly named variable in the Validation class.
    • +
    • Fixed an incorrectly named variable in the URI class.
    • +
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • +
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • +
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • +
    • Fixed some MS SQL bugs.
    • +
    • Fixed some doc typos.
    • +
    + + + +

    Version 1.3.3

    +

    Release Date: June 1, 2006

    + +
      + +
    • Models do not connect automatically to the database as of this version. More info here.
    • +
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • +
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • +
    • Fixed a bug in the active record "having" function.
    • +
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • +
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • +
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • +
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • +
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • +
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • +
    • Fixed a bug in the hash() security helper.
    • +
    • Fixed some typos.
    • +
    + + + + +

    Version 1.3.2

    +

    Release Date: April 17, 2006

    + +
      +
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • +
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • +
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • +
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • +
    • Fixed a couple bugs in the Model class.
    • +
    • Fixed some documentation typos and errata.
    • +
    + + + +

    Version 1.3.1

    +

    Release Date: April 11, 2006

    + +
      +
    • Added a Unit Testing Library.
    • +
    • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • +
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • +
    • Added getwhere function to Active Record class.
    • +
    • Added count_all function to Active Record class.
    • +
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • +
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • +
    • Added a new mime type to the upload class for better compatibility.
    • +
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • +
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • +
    • Fixed a bug in the image library when realpath() returns false.
    • +
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • +
    • Fixed a bug in the "exact_length" function of the validation class.
    • +
    • Fixed some typos in the user guide
    • +
    + + +

    Version 1.3

    +

    Release Date: April 3, 2006

    + +
      +
    • Added support for Models.
    • +
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • +
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • +
    • Added a feature to the database class that lets you run custom function calls.
    • +
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • +
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • +
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • +
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • +
    • Added a new error template for use with native PHP errors.
    • +
    • Added "alternator" function in the string helpers. +
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • +
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • +
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and +all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • +
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • +
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • +
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • +
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • +
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • +
    • Fixed some typos in the default calendar template
    • +
    • Fixed some typos in the user guide
    • +
    + + + + + + + + +

    Version 1.2

    +

    Release Date: March 21, 2006

    + +
      +
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • +
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • +
    • Added new File Helper: delete_files()
    • +
    • Added new URL Helpers: base_url(), index_page()
    • +
    • Added the ability to create your own core libraries and store them in your local application directory.
    • +
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • +
    • Added Javascript Calendar plugin.
    • +
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • +
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • +
    • Fixed a bug in the DB "where" function.
    • +
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • +
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • +
    • Fixed some bugs in the xss_clean function
    • +
    + + + + + +

    Version Beta 1.1

    +

    Release Date: March 10, 2006

    + +
      +
    • Added a Calendaring class.
    • +
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • +
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • +
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • +
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • +
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • +
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • +
    • Fixed a data type error in the form_radio function (form helper)
    • +
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • +
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • +
    • Fixed a pagination problem in the scaffolding.
    • +
    • Fixed a bug in the mysql class "where" function.
    • +
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • +
    • Fixed a bug in the br() function in the HTML helper
    • +
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • +
    • Removed the "style" attributes form the form helpers.
    • +
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • +
    + +

    Version Beta 1.0

    +

    Release Date: February 28, 2006

    +

    First publicly released version.

    + +
    + + + + + + + \ No newline at end of file From 218e2bcfd4c9c1ebb2454efc1179d047f40f5b34 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 21:18:14 +0000 Subject: [PATCH 0748/2544] Added a third parameter to Active Record's like() clause to control where the wildcard goes. Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like(). --- system/database/DB_active_rec.php | 97 +++- system/scaffolding/Scaffolding.php | 2 +- user_guide/changelog.html | 2 + user_guide/database/active_record.html | 619 ++++++++++++++++++++++++- 4 files changed, 704 insertions(+), 16 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 9e30a9fa..c6e6039e 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -185,10 +185,22 @@ function where($key, $value = NULL) * @param mixed * @return object */ - function orwhere($key, $value = NULL) + function or_where($key, $value = NULL) { return $this->_where($key, $value, 'OR '); } + + // -------------------------------------------------------------------- + + /** + * orwhere() is an alias of or_where() + * this function is here for backwards compatibility, as + * orwhere() has been deprecated + */ + function orwhere($key, $value = NULL) + { + return $this->or_where($key, $value); + } // -------------------------------------------------------------------- @@ -244,9 +256,9 @@ function _where($key, $value = NULL, $type = 'AND ') * @param mixed * @return object */ - function like($field, $match = '') + function like($field, $match = '', $side = 'both') { - return $this->_like($field, $match, 'AND '); + return $this->_like($field, $match, 'AND ', $side); } // -------------------------------------------------------------------- @@ -262,9 +274,21 @@ function like($field, $match = '') * @param mixed * @return object */ - function orlike($field, $match = '') + function or_like($field, $match = '', $side = 'both') { - return $this->_like($field, $match, 'OR '); + return $this->_like($field, $match, 'OR ', $side); + } + + // -------------------------------------------------------------------- + + /** + * orlike() is an alias of or_like() + * this function is here for backwards compatibility, as + * orlike() has been deprecated + */ + function orlike($field, $match = '', $side = 'both') + { + return $this->orlike($field, $match, $side); } // -------------------------------------------------------------------- @@ -280,7 +304,7 @@ function orlike($field, $match = '') * @param string * @return object */ - function _like($field, $match = '', $type = 'AND ') + function _like($field, $match = '', $type = 'AND ', $side = 'both') { if ( ! is_array($field)) { @@ -292,8 +316,19 @@ function _like($field, $match = '', $type = 'AND ') $prefix = (count($this->ar_like) == 0) ? '' : $type; $v = $this->escape_str($v); - - $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; + + if ($side == 'before') + { + $this->ar_like[] = $prefix." $k LIKE '%{$v}'"; + } + elseif ($side == 'after') + { + $this->ar_like[] = $prefix." $k LIKE '{$v}%'"; + } + else + { + $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; + } } return $this; } @@ -307,7 +342,7 @@ function _like($field, $match = '', $type = 'AND ') * @param string * @return object */ - function groupby($by) + function group_by($by) { if (is_string($by)) { @@ -323,7 +358,19 @@ function groupby($by) } return $this; } - + + // -------------------------------------------------------------------- + + /** + * groupby() is an alias of group_by() + * this function is here for backwards compatibility, as + * groupby() has been deprecated + */ + function groupby($by) + { + return $this->group_by($by); + } + // -------------------------------------------------------------------- /** @@ -401,7 +448,7 @@ function _having($key, $value = '', $type = 'AND ') * @param string direction: asc or desc * @return object */ - function orderby($orderby, $direction = '') + function order_by($orderby, $direction = '') { if (trim($direction) != '') { @@ -411,7 +458,17 @@ function orderby($orderby, $direction = '') $this->ar_orderby[] = $orderby.$direction; return $this; } - + // -------------------------------------------------------------------- + + /** + * orderby() is an alias of order_by() + * this function is here for backwards compatibility, as + * orderby() has been deprecated + */ + function orderby($orderby, $direction = '') + { + return $this->order_by($orderby, $direction); + } // -------------------------------------------------------------------- /** @@ -509,7 +566,7 @@ function get($table = '', $limit = null, $offset = null) // -------------------------------------------------------------------- /** - * GetWhere + * Get_Where * * Allows the where clause, limit and offset to be added directly * @@ -519,7 +576,7 @@ function get($table = '', $limit = null, $offset = null) * @param string the offset clause * @return object */ - function getwhere($table = '', $where = null, $limit = null, $offset = null) + function get_where($table = '', $where = null, $limit = null, $offset = null) { if ($table != '') { @@ -542,6 +599,18 @@ function getwhere($table = '', $where = null, $limit = null, $offset = null) $this->_reset_select(); return $result; } + + // -------------------------------------------------------------------- + + /** + * getwhere() is an alias of get_where() + * this function is here for backwards compatibility, as + * getwhere() has been deprecated + */ + function getwhere($table = '', $where = null, $limit = null, $offset = null) + { + return $this->get_where($table, $where, $limit, $offset); + } // -------------------------------------------------------------------- diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index 70c6156a..8ddb1af0 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -204,7 +204,7 @@ function edit() $primary = $this->CI->db->primary($this->current_table); // Run the query - $query = $this->CI->db->getwhere($this->current_table, array($primary => $id)); + $query = $this->CI->db->get_where($this->current_table, array($primary => $id)); $data = array( 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9c239926..a47d3a01 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -78,6 +78,7 @@

    Version 1.5.5

  • Added quotes_to_entities() function to string helper.
  • Added form_reset() function to form helper.
  • Added a language entry for valid_ip validation error.
  • +
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • Fixed a bug in highlight_pharse() that caused an error with slashes.
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • @@ -101,6 +102,7 @@

    Version 1.5.5

  • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
  • Fixed a typo in the table library docs.
  • Moved part of the userguide menu javascript to an external file.
  • +
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index ee7b245d..1c4783ab 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -1 +1,618 @@ - CodeIgniter User Guide : Active Record

    CodeIgniter User Guide Version 1.5.4


    Active Record Class

    CodeIgniter uses a modified version of the Active Record Database Pattern. This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. In some cases only one or two lines of code are necessary to perform a database action. CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.


     

    Selecting Data

    The following functions allow you to build SQL SELECT statements.

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    $this->db->get();

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    $query = $this->db->get('mytable');

    // Produces: SELECT * FROM mytable

    The second and third parameters enable you do set a limit and offset clause:

    $query = $this->db->get('mytable', 10, 20);

    // Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    $query = $this->db->get('mytable');

    foreach ($query->result() as $row)
    {
        echo $row->title;
    }

    Please visit the result functions page for a full discussion regarding result generation.

    $this->db->getwhere();

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, instead of using the db->where() function:

    $query = $this->db->getwhere('mytable', array('id' => $id), $limit, $offset);

    Please read the about the where function below for more information.

    $this->db->select();

    Permits you to write the SELECT portion of your query:

    $this->db->select('title, content, date');

    $query = $this->db->get('mytable');

    // Produces: SELECT title, content, date FROM mytable

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    $this->db->from();

    Permits you to write the FROM portion of your query:

    $this->db->select('title, content, date');
    $this->db->from('mytable');

    $query = $this->db->get();

    // Produces: SELECT title, content, date FROM mytable

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method you prefer.

    $this->db->join();

    Permits you to write the JOIN portion of your query:

    $this->db->select('*');
    $this->db->from('blogs');
    $this->db->join('comments', 'comments.id = blogs.id');

    $query = $this->db->get();

    // Produces:
    // SELECT * FROM blogs
    // JOIN comments ON comments.id = blogs.id

    Multiple function calls can be made if you need several joins in one query.

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. Options are: left, right, outer, inner, left outer, and right outer.

    $this->db->join('comments', 'comments.id = blogs.id', 'left');

    // Produces: LEFT JOIN comments ON comments.id = blogs.id

    $this->db->where();

    This function enables you to set WHERE clauses using one of four methods:

    Note: All values passed to this function are escaped automatically, producing safer queries.

    1. Simple key/value method: $this->db->where('name', $name);

      // Produces: WHERE name = 'Joe'

      Notice that the equal sign is added for you.

      If you use multiple function calls they will be chained together with AND between them:

      $this->db->where('name', $name);
      $this->db->where('title', $title);
      $this->db->where('status', $status);

      // WHERE = 'Joe' AND title = 'boss' AND status = 'active'
    2. Custom key/value method:

      You can include an operator in the first parameter in order to control the comparison:

      $this->db->where('name !=', $name);
      $this->db->where('id <', $id);

      // Produces: WHERE name != 'Joe' AND id < 45
    3. Associative array method: $array = array('name' => $name, 'title' => $title, 'status' => $status);

      $this->db->where($array);

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'

      You can include your own operators using this method as well:

      $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      $this->db->where($array);
    4. Custom string:

      You can write your own clauses manually:

      $where = "name='Joe' AND status='boss' OR status='active'";

      $this->db->where($where);

    $this->db->orwhere();

    This function is identical to the one above, except that multiple instances are joined by OR:

    $this->db->where('name !=', $name);
    $this->db->orwhere('id >', $id);

    // Produces: WHERE name != 'Joe' OR id > 50

    $this->db->like();

    This function enables you to generate LIKE clauses, useful for doing searches.

    Note: All values passed to this function are escaped automatically.

    1. Simple key/value method: $this->db->like('title', $match);

      // Produces: WHERE title LIKE '%match%'

      If you use multiple function calls they will be chained together with AND between them:

      $this->db->like('title', $match);
      $this->db->like('body', $match);

      // WHERE title LIKE '%match%' AND body LIKE '%match%'
    2. Associative array method: $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      $this->db->like($array);

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'

    $this->db->orlike();

    This function is identical to the one above, except that multiple instances are joined by OR:

    $this->db->like('title', $match);
    $this->db->orlike('body', $match);

    // WHERE title LIKE '%match%' OR body LIKE '%match%'

    $this->db->groupby();

    Permits you to write the GROUP BY portion of your query:

    $this->db->groupby("title");

    // Produces: GROUP BY title

    You can also pass an array of multiple values as well:

    $this->db->groupby(array("title", "date"));

    // Produces: GROUP BY title, date

    $this->db->having();

    Permits you to write the HAVING portion of your query:

    $this->db->having('user_id = 45');

    // Produces: HAVING 'user_id = 45'

    You can also pass an array of multiple values as well:

    $this->db->having(array('title =' => 'My Title', 'id <' => $id));

    // Produces: HAVING title = 'My Title', 'id < 45'

    $this->db->orderby();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are asc or desc

    $this->db->orderby("title", "desc");

    // Produces: ORDER BY title DESC

    You can also pass your own string in the first parameter:

    $this->db->orderby('title desc, name asc');

    // Produces: ORDER BY title DESC, name ASC

    Or multiple function calls can be made if you need multiple fields.

    $this->db->orderby("title", "desc");
    $this->db->orderby("name", "asc");

    // Produces: ORDER BY title DESC, name ASC

    $this->db->limit();

    Lets you limit the number of rows you would like returned by the query:

    $this->db->limit(10);

    // Produces: LIMIT 10

    The second parameter lets you set a result offset.

    $this->db->limit(10, 20);

    // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)

    $this->db->count_all();

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    echo $this->db->count_all('my_table');

    // Produces an integer, like 25
     

    Inserting Data

    $this->db->insert();

    Generates an insert string based on the data you supply, and runs the query. You can either pass an array or an object to the function. Here is an example using an array:

    $data = array(
                   'title' => 'My title' ,
                   'name' => 'My Name' ,
                   'date' => 'My date'
                );

    $this->db->insert('mytable', $data);

    // Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')

    The first parameter will contain the table name, the second is an associative array of values.

    Here is an example using an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->insert('mytable', $object);

    // Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')

    The first parameter will contain the table name, the second is an associative array of values.

    Note: All values are escaped automatically producing safer queries.

    $this->db->set();

    This function enables you to set values for inserts or updates.

    It can be used instead of passing a data array directly to the insert or update functions:

    $this->db->set('name', $name);
    $this->db->insert('mytable');

    // Produces: INSERT INTO mytable (name) VALUES ('{$name}')

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    $this->db->set('name', $name);
    $this->db->set('title', $title);
    $this->db->set('status', $status);
    $this->db->insert('mytable');

    You can also pass an associative array to this function:

    $array = array('name' => $name, 'title' => $title, 'status' => $status);

    $this->db->set($array);
    $this->db->insert('mytable');

    Or an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->set($object);
    $this->db->insert('mytable');
     

    Updating Data

    $this->db->update();

    Generates an update string and runs the query based on the data you supply. You can pass an array or an object to the function. Here is an example using an array:

    $data = array(
                   'title' => $title,
                   'name' => $name,
                   'date' => $date
                );

    $this->db->where('id', $id);
    $this->db->update('mytable', $data);

    // Produces:
    // UPDATE mytable
    // SET title = '{$title}', name = '{$name}', date = '{$date}'
    // WHERE id = $id

    Or you can supply an object:

    /*
        class Myclass {
            var $title = 'My Title';
            var $content = 'My Content';
            var $date = 'My Date';
        }
    */

    $object = new Myclass;

    $this->db->where('id', $id);
    $this->db->update('mytable', $object);

    // Produces:
    // UPDATE mytable
    // SET title = '{$title}', name = '{$name}', date = '{$date}'
    // WHERE id = $id

    Note: All values are escaped automatically producing safer queries.

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. You can optionally pass this information directly into the update function as a string:

    $this->db->update('mytable', $data, "id = 4");

    Or as an array:

    $this->db->update('mytable', $data, array('id' => $id));

    You may also use the $this->db->set() function described above when performing updates.

     

    Deleting Data

    $this->db->delete();

    Generates a delete SQL string and runs the query.

    $this->db->delete('mytable', array('id' => $id));

    // Produces:
    // DELETE FROM mytable
    // WHERE id = $id

    The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing the data to the second parameter of the function:

    $this->db->where('id', $id);
    $this->db->delete('mytable');

    // Produces:
    // DELETE FROM mytable
    // WHERE id = $id

    Note: All values are escaped automatically producing safer queries.

     

    Method Chaining

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    $this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);

    $query = $this->db->get();

    Note: Method chaining only works with PHP 5.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Active Record + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Active Record Class

    + + +

    CodeIgniter uses a modified version of the Active Record Database Pattern. +This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. +In some cases only one or two lines of code are necessary to perform a database action. +CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    + +

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax +is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    + +

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

    + +
    + + + + + + +  +

    Selecting Data

    + +

    The following functions allow you to build SQL SELECT statements.

    + +

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    + + +

    $this->db->get();

    + +

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    + +$query = $this->db->get('mytable');
    +
    +// Produces: SELECT * FROM mytable
    + +

    The second and third parameters enable you do set a limit and offset clause:

    + +$query = $this->db->get('mytable', 10, 20);
    +
    +// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    + + + +

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    + +$query = $this->db->get('mytable');
    +
    +foreach ($query->result() as $row)
    +{
    +    echo $row->title;
    +}
    + +

    Please visit the result functions page for a full discussion regarding result generation.

    + + +

    $this->db->get_where();

    + +

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, +instead of using the db->where() function:

    + +$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); + +

    Please read the about the where function below for more information.

    +

    Note: get_where() was formerly known as getwhere(), which has been deprecated

    +

    $this->db->select();

    + +

    Permits you to write the SELECT portion of your query:

    + + +$this->db->select('title, content, date');
    +
    +$query = $this->db->get('mytable');
    +
    +// Produces: SELECT title, content, date FROM mytable
    + +

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    + + +

    $this->db->from();

    + +

    Permits you to write the FROM portion of your query:

    + + +$this->db->select('title, content, date');
    +$this->db->from('mytable');
    +
    +$query = $this->db->get();
    +
    +// Produces: SELECT title, content, date FROM mytable
    + +

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method +you prefer.

    + +

    $this->db->join();

    + +

    Permits you to write the JOIN portion of your query:

    + + +$this->db->select('*');
    +$this->db->from('blogs');
    +$this->db->join('comments', 'comments.id = blogs.id');
    +
    +$query = $this->db->get();
    +
    +// Produces:
    +// SELECT * FROM blogs
    +// JOIN comments ON comments.id = blogs.id
    +
    + +

    Multiple function calls can be made if you need several joins in one query.

    + +

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. +Options are: left, right, outer, inner, left outer, and right outer.

    + + +$this->db->join('comments', 'comments.id = blogs.id', 'left');
    +
    +// Produces: LEFT JOIN comments ON comments.id = blogs.id
    + + + + + +

    $this->db->where();

    +

    This function enables you to set WHERE clauses using one of four methods:

    + +

    Note: All values passed to this function are escaped automatically, producing safer queries.

    + +
      +
    1. Simple key/value method: + + $this->db->where('name', $name); +

      // Produces: WHERE name = 'Joe' +
      + +

      Notice that the equal sign is added for you.

      + +

      If you use multiple function calls they will be chained together with AND between them:

      + + $this->db->where('name', $name);
      + $this->db->where('title', $title);
      + $this->db->where('status', $status); +

      // WHERE = 'Joe' AND title = 'boss' AND status = 'active' +
      + + +
    2. + +
    3. Custom key/value method: + +

      You can include an operator in the first parameter in order to control the comparison:

      + + $this->db->where('name !=', $name);
      + $this->db->where('id <', $id); +

      // Produces: WHERE name != 'Joe' AND id < 45 +
      + + + +
    4. +
    5. Associative array method: + + + + $array = array('name' => $name, 'title' => $title, 'status' => $status);

      + + $this->db->where($array); +

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active' +
      + +

      You can include your own operators using this method as well:

      + + + $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      + + $this->db->where($array);
      + +
    6. +
    7. Custom string: + +

      You can write your own clauses manually:

      + + + $where = "name='Joe' AND status='boss' OR status='active'";

      + $this->db->where($where);
      + +
    8. +
    + + +

    $this->db->or_where();

    +

    This function is identical to the one above, except that multiple instances are joined by OR:

    + + +$this->db->where('name !=', $name);
    +$this->db->or_where('id >', $id); +
    +
    // Produces: WHERE name != 'Joe' OR id > 50
    + + + + +

    Note: or_where() was formerly known as orwhere(), which has been deprecated.

    +

    $this->db->like();

    +

    This function enables you to generate LIKE clauses, useful for doing searches.

    + +

    Note: All values passed to this function are escaped automatically.

    + + +
      +
    1. Simple key/value method: + + $this->db->like('title', 'match'); +

      // Produces: WHERE title LIKE '%match%'
      + +

      If you use multiple function calls they will be chained together with AND between them:

      + + $this->db->like('title', 'match');
      + $this->db->like('body', 'match'); +

      + // WHERE title LIKE '%match%' AND body LIKE '%match%
      + If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). + $this->db->like('title', 'match', 'before'); +
      + // Produces: WHERE title LIKE '%match'
      +
      + $this->db->like('title', 'match', 'after');
      +// Produces: WHERE title LIKE 'match%'
      +
      + $this->db->like('title', 'match', 'both');
      +// Produces: WHERE title LIKE '%match%'
    2. + +
    3. Associative array method: + + + $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      + + $this->db->like($array); +

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
    4. +
    + + +

    $this->db->or_like();

    +

    This function is identical to the one above, except that multiple instances are joined by OR:

    + + +$this->db->like('title', $match);
    +$this->db->or_like('body', $match); +
    +
    // WHERE title LIKE '%match%' OR body LIKE '%match%'
    + + + + +

    Note: or_like() was formerly known as orlike(), which has been deprecated.

    +

    $this->db->group_by();

    +

    Permits you to write the GROUP BY portion of your query:

    + +$this->db->group_by("title"); +

    // Produces: GROUP BY title +
    + +

    You can also pass an array of multiple values as well:

    + +$this->db->group_by(array("title", "date")); +
    +
    // Produces: GROUP BY title, date
    + + +

    Note: group_by() was formerly known as groupby(), which has been deprecated.

    +

    $this->db->having();

    +

    Permits you to write the HAVING portion of your query:

    + +$this->db->having('user_id = 45'); +

    // Produces: HAVING 'user_id = 45' +
    + +

    You can also pass an array of multiple values as well:

    + + +$this->db->having(array('title =' => 'My Title', 'id <' => $id)); +

    // Produces: HAVING title = 'My Title', 'id < 45' +
    + + + +

    $this->db->order_by();

    +

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. +The second parameter lets you set the direction of the result. Options are asc or desc

    + +$this->db->order_by("title", "desc"); +
    +
    // Produces: ORDER BY title DESC +
    + +

    You can also pass your own string in the first parameter:

    + +$this->db->order_by('title desc, name asc'); +
    +
    // Produces: ORDER BY title DESC, name ASC +
    + +

    Or multiple function calls can be made if you need multiple fields.

    + +

    $this->db->order_by("title", "desc");
    + $this->db->order_by("name", "asc");
    +
    + // Produces: ORDER BY title DESC, name ASC +

    +

    Note: order_by() was formerly known as orderby(), which has been deprecated.

    +

    $this->db->limit();

    +

    Lets you limit the number of rows you would like returned by the query:

    + + +$this->db->limit(10);
    +
    +// Produces: LIMIT 10
    + + +

    The second parameter lets you set a result offset.

    + + +$this->db->limit(10, 20);
    +
    +// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    + + +

    $this->db->count_all();

    + +

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    + +echo $this->db->count_all('my_table');
    +
    +// Produces an integer, like 25
    + + + + +  +

    Inserting Data

    + +

    $this->db->insert();

    +

    Generates an insert string based on the data you supply, and runs the query. You can either pass an +array or an object to the function. Here is an example using an array:

    + + +$data = array(
    +               'title' => 'My title' ,
    +               'name' => 'My Name' ,
    +               'date' => 'My date'
    +            );
    +
    +$this->db->insert('mytable', $data); +

    +// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
    + +

    The first parameter will contain the table name, the second is an associative array of values.

    + +

    Here is an example using an object:

    + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->insert('mytable', $object); +

    +// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')
    + +

    The first parameter will contain the table name, the second is an associative array of values.

    + +

    Note: All values are escaped automatically producing safer queries.

    + + + + +

    $this->db->set();

    +

    This function enables you to set values for inserts or updates.

    + +

    It can be used instead of passing a data array directly to the insert or update functions:

    + +$this->db->set('name', $name); +
    +$this->db->insert('mytable'); +

    +// Produces: INSERT INTO mytable (name) VALUES ('{$name}')
    + +

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    + +$this->db->set('name', $name);
    +$this->db->set('title', $title);
    +$this->db->set('status', $status);
    +$this->db->insert('mytable'); +
    + +

    You can also pass an associative array to this function:

    + + +$array = array('name' => $name, 'title' => $title, 'status' => $status);

    + +$this->db->set($array);
    +$this->db->insert('mytable'); +
    + +

    Or an object:

    + + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->set($object);
    +$this->db->insert('mytable'); +
    + + + +  +

    Updating Data

    + +

    $this->db->update();

    +

    Generates an update string and runs the query based on the data you supply. You can pass an +array or an object to the function. Here is an example using +an array:

    + + +$data = array(
    +               'title' => $title,
    +               'name' => $name,
    +               'date' => $date
    +            );
    +
    +$this->db->where('id', $id);
    +$this->db->update('mytable', $data); +

    +// Produces:
    +// UPDATE mytable
    +// SET title = '{$title}', name = '{$name}', date = '{$date}'
    +// WHERE id = $id
    + +

    Or you can supply an object:

    + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->where('id', $id);
    +$this->db->update('mytable', $object); +
    +
    +// Produces:
    +// UPDATE mytable
    +// SET title = '{$title}', name = '{$name}', date = '{$date}'
    +// WHERE id = $id
    + + + +

    Note: All values are escaped automatically producing safer queries.

    + +

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. +You can optionally pass this information directly into the update function as a string:

    + +$this->db->update('mytable', $data, "id = 4"); + +

    Or as an array:

    + +$this->db->update('mytable', $data, array('id' => $id)); + +

    You may also use the $this->db->set() function described above when performing updates.

    + + +  +

    Deleting Data

    + + + +

    $this->db->delete();

    +

    Generates a delete SQL string and runs the query.

    + + +$this->db->delete('mytable', array('id' => $id)); +

    +// Produces:
    +// DELETE FROM mytable
    +// WHERE id = $id
    + +

    The first parameter is the table name, the second is the where clause. You can also use the where() or or_where() functions instead of passing +the data to the second parameter of the function:

    + + +$this->db->where('id', $id);
    +$this->db->delete('mytable'); +

    +// Produces:
    +// DELETE FROM mytable
    +// WHERE id = $id
    + +

    Note: All values are escaped automatically producing safer queries.

    + + +  +

    Method Chaining

    + +

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    + + +$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
    +
    +$query = $this->db->get();
    + +

    Note: Method chaining only works with PHP 5.

    + + + +
    + + + + + + + \ No newline at end of file From 04036f33f6af540ce371b1ebd1878018f0816ed8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 17 Dec 2007 21:29:53 +0000 Subject: [PATCH 0749/2544] removed a duplicate function --- system/database/DB_active_rec.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index c6e6039e..6a991a2e 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -777,18 +777,6 @@ function use_table($table) // -------------------------------------------------------------------- - /** - * ORDER BY - DEPRECATED - * - * @deprecated use $this->db->orderby() instead - */ - function order_by($orderby, $direction = '') - { - return $this->orderby($orderby, $direction); - } - - // -------------------------------------------------------------------- - /** * Tests whether the string has an SQL operator * From 694b5b8ee6a40b57c91be3c5448bc8f5540d32d8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 18 Dec 2007 15:58:03 +0000 Subject: [PATCH 0750/2544] Added count_all_results() function to Active Record. --- system/database/DB_active_rec.php | 41 ++++++++++++++++++- .../database/drivers/mssql/mssql_driver.php | 9 +++- .../database/drivers/mysql/mysql_driver.php | 32 +++++++++++++-- .../database/drivers/mysqli/mysqli_driver.php | 35 +++++++++++++--- .../drivers/mysqli/mysqli_utility.php | 23 +++++++++-- system/database/drivers/oci8/oci8_driver.php | 9 +++- system/database/drivers/odbc/odbc_driver.php | 9 +++- .../drivers/postgre/postgre_driver.php | 17 ++++++-- .../database/drivers/sqlite/sqlite_driver.php | 9 +++- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 13 +++++- 11 files changed, 176 insertions(+), 22 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 6a991a2e..cb134ea6 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -540,6 +540,7 @@ function set($key, $value = '') * and runs the query * * @access public + * @param string the table * @param string the limit clause * @param string the offset clause * @return object @@ -565,6 +566,39 @@ function get($table = '', $limit = null, $offset = null) // -------------------------------------------------------------------- + /** + * "Count All Results" query + * + * Generates a platform-specific query string that counts all records + * returned by an Active Record query. + * + * @access public + * @param string + * @return string + */ + function count_all_results($table = '') + { + if ($table != '') + { + $this->from($table); + } + + $sql = $this->_compile_select($this->count_string); + + $query = $this->query($sql); + $this->_reset_select(); + + if ($query->num_rows() == 0) + { + return '0'; + } + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + /** * Get_Where * @@ -806,12 +840,17 @@ function _has_operator($str) * @access private * @return string */ - function _compile_select() + function _compile_select($select_override = FALSE) { $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; $sql .= (count($this->ar_select) == 0) ? '*' : implode(', ', $this->ar_select); + if ($select_override !== FALSE) + { + $sql = $select_override; + } + if (count($this->ar_from) > 0) { $sql .= "\nFROM "; diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 5140dd85..051dd5bf 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -30,6 +30,13 @@ */ class CI_DB_mssql_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Non-persistent database connection * @@ -273,7 +280,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM ".$this->dbprefix.$table); + $query = $this->query($this->count_string . "FROM ".$this->dbprefix.$table); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 2e1f30f2..69a238d9 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -30,6 +30,13 @@ */ class CI_DB_mysql_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, @@ -222,7 +229,17 @@ function trans_rollback() */ function escape_str($str) { - if (function_exists('mysql_real_escape_string')) + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val); + } + + return $str; + } + + if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) { return mysql_real_escape_string($str, $this->conn_id); } @@ -279,7 +296,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; @@ -298,9 +315,16 @@ function count_all($table = '') * @access private * @return string */ - function _list_tables() + function _list_tables($prefix_limit = FALSE) { - return "SHOW TABLES FROM `".$this->database."`"; + $sql = "SHOW TABLES FROM `".$this->database."`"; + + if ($prefix_limit !== FALSE AND $this->_stdprefix != '') + { + $sql .= " LIKE '".$this->_stdprefix."%'"; + } + + return $sql; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 4643cb2a..30a256e0 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -30,6 +30,13 @@ */ class CI_DB_mysqli_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, @@ -224,8 +231,19 @@ function trans_rollback() * @return string */ function escape_str($str) - { - return mysqli_real_escape_string($this->conn_id, $str); + { + if (function_exists('mysqli_real_escape_string') AND is_resource($this->conn_id)) + { + return mysqli_real_escape_string($this->conn_id, $str); + } + elseif (function_exists('mysql_escape_string')) + { + return mysql_escape_string($str); + } + else + { + return addslashes($str); + } } // -------------------------------------------------------------------- @@ -271,7 +289,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; @@ -290,9 +308,16 @@ function count_all($table = '') * @access private * @return string */ - function _list_tables() + function _list_tables($prefix_limit = FALSE) { - return "SHOW TABLES FROM `".$this->database."`"; + $sql = "SHOW TABLES FROM `".$this->database."`"; + + if ($prefix_limit !== FALSE AND $this->_stdprefix != '') + { + $sql .= " LIKE '".$this->_stdprefix."%'"; + } + + return $sql; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 55ffcb73..c904e92d 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -219,13 +219,30 @@ function _backup($params = array()) $v = str_replace('\\\r', '\r', $v); $v = str_replace('\\\t', '\t', $v); - // Escape the data if it's not an integer type - $val_str .= ($is_int[$i] == FALSE) ? $this->db->escape($v) : $v; - $val_str .= ', '; + // Is the value NULL? + if ($v == NULL) + { + $val_str .= 'NULL'; + } + else + { + // Escape the data if it's not an integer + if ($is_int[$i] == FALSE) + { + $val_str .= $this->db->escape($v); + } + else + { + $val_str .= $v; + } + } + // Append a comma + $val_str .= ', '; $i++; } + // Remove the comma at the end of the string $val_str = preg_replace( "/, $/" , "" , $val_str); // Build the INSERT string diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 99b5ded1..0cd04cc5 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -43,6 +43,13 @@ class CI_DB_oci8_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(1) AS numrows "; + // Set "auto commit" by default var $_commit = OCI_COMMIT_ON_SUCCESS; @@ -389,7 +396,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(1) AS numrows FROM ".$table); + $query = $this->query($this->count_string . "FROM ".$table); if ($query == FALSE) { diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 3f42f7c3..ef26ea1c 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -30,6 +30,13 @@ */ class CI_DB_odbc_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Non-persistent database connection * @@ -251,7 +258,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index a8a6ca16..beaa7931 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -30,6 +30,13 @@ */ class CI_DB_postgre_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Non-persistent database connection * @@ -277,9 +284,11 @@ function count_all($table = '') { if ($table == '') return '0'; - - $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); - + + $query = $this->query($this->count_string .'FROM "'.$this->dbprefix.$table.'"'); +// original query before count_string was used. Kept for reference +// $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); + if ($query->num_rows() == 0) return '0'; @@ -315,7 +324,7 @@ function _list_tables() */ function _list_columns($table = '') { - return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$this->_escape_table($table)."'"; + return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$this->_escape_table($table)."'"; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index f8a573b3..5f86b8ec 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -32,6 +32,13 @@ */ class CI_DB_sqlite_driver extends CI_DB { + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $count_string = "SELECT COUNT(*) AS numrows "; + /** * Non-persistent database connection * @@ -274,7 +281,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query("SELECT COUNT(*) AS numrows FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a47d3a01..5028032b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,6 +77,7 @@

    Version 1.5.5

  • Added reduce_multiples() function to string helper.
  • Added quotes_to_entities() function to string helper.
  • Added form_reset() function to form helper.
  • +
  • Added count_all_results() function to Active Record.
  • Added a language entry for valid_ip validation error.
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 1c4783ab..d608459e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -392,6 +392,18 @@

    $this->db->limit();

    // Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    +

    $this->db->count_all_results();

    + +

    Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

    +echo $this->db->count_all_results('my_table');
    + +// Produces an integer, like 25
    +
    +$this->db->like('title', 'match');
    +$this->db->from('my_table');
    +echo $this->db->count_all_results();
    +// Produces an integer, like 17
    +

    $this->db->count_all();

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    @@ -401,7 +413,6 @@

    $this->db->count_all();

    // Produces an integer, like 25
    -  

    Inserting Data

    From 6ddb5a17ae1a0a75ca75f846dbb7d3a98f1902a3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 18 Dec 2007 17:22:50 +0000 Subject: [PATCH 0751/2544] Added 'random' as an order_by() option in Active Record. --- system/database/DB_active_rec.php | 11 +++++++++-- system/database/drivers/mssql/mssql_driver.php | 4 ++-- system/database/drivers/mysql/mysql_driver.php | 17 +++++++++-------- .../database/drivers/mysqli/mysqli_driver.php | 7 ++++--- system/database/drivers/oci8/oci8_driver.php | 4 ++-- system/database/drivers/odbc/odbc_driver.php | 5 +++-- .../database/drivers/postgre/postgre_driver.php | 7 ++++--- .../database/drivers/sqlite/sqlite_driver.php | 5 +++-- user_guide/changelog.html | 13 +++++++------ user_guide/database/active_record.html | 3 ++- 10 files changed, 45 insertions(+), 31 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index cb134ea6..e8059ab7 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -450,7 +450,12 @@ function _having($key, $value = '', $type = 'AND ') */ function order_by($orderby, $direction = '') { - if (trim($direction) != '') + if (strtolower($direction) == 'random') + { + $orderby = ''; // Random results want or don't need a field name + $direction = $this->_random_keyword; + } + elseif (trim($direction) != '') { $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; } @@ -458,6 +463,7 @@ function order_by($orderby, $direction = '') $this->ar_orderby[] = $orderby.$direction; return $this; } + // -------------------------------------------------------------------- /** @@ -469,6 +475,7 @@ function orderby($orderby, $direction = '') { return $this->order_by($orderby, $direction); } + // -------------------------------------------------------------------- /** @@ -583,7 +590,7 @@ function count_all_results($table = '') $this->from($table); } - $sql = $this->_compile_select($this->count_string); + $sql = $this->_compile_select($this->_count_string); $query = $this->query($sql); $this->_reset_select(); diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 051dd5bf..89610455 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -35,7 +35,7 @@ class CI_DB_mssql_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(*) AS numrows "; + var $_count_string = "SELECT COUNT(*) AS numrows "; /** * Non-persistent database connection @@ -280,7 +280,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM ".$this->dbprefix.$table); + $query = $this->query($this->_count_string . "FROM ".$this->dbprefix.$table); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 69a238d9..2d91c592 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -30,19 +30,20 @@ */ class CI_DB_mysql_driver extends CI_DB { - /** - * The syntax to count rows is slightly different across different - * database engines, so this string appears in each driver and is - * used for the count_all() and count_all_results() functions. - */ - var $count_string = "SELECT COUNT(*) AS numrows "; - /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, * adding a bit more processing to all queries. */ var $delete_hack = TRUE; + + /** + * The syntax to count rows is slightly different across different + * database engines, so this string appears in each driver and is + * used for the count_all() and count_all_results() functions. + */ + var $_count_string = "SELECT COUNT(*) AS numrows "; + var $_random_keyword = ' RAND()'; // database specific random keyword /** * Non-persistent database connection @@ -296,7 +297,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 30a256e0..09911709 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -35,8 +35,9 @@ class CI_DB_mysqli_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(*) AS numrows "; - + var $_count_string = "SELECT COUNT(*) AS numrows "; + var $_random_keyword = ' RAND()'; // database specific random keyword + /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, @@ -289,7 +290,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 0cd04cc5..e6bcefef 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -48,7 +48,7 @@ class CI_DB_oci8_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(1) AS numrows "; + var $_count_string = "SELECT COUNT(1) AS numrows "; // Set "auto commit" by default var $_commit = OCI_COMMIT_ON_SUCCESS; @@ -396,7 +396,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM ".$table); + $query = $this->query($this->_count_string . "FROM ".$table); if ($query == FALSE) { diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index ef26ea1c..5e167624 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -35,7 +35,8 @@ class CI_DB_odbc_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(*) AS numrows "; + var $_count_string = "SELECT COUNT(*) AS numrows "; + var $_random_keyword = ' RND('.time().')'; // database specific random keyword /** * Non-persistent database connection @@ -258,7 +259,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index beaa7931..e54f9cce 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -35,7 +35,8 @@ class CI_DB_postgre_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(*) AS numrows "; + var $_count_string = "SELECT COUNT(*) AS numrows "; + var $_random_keyword = ' RANDOM()'; // database specific random keyword /** * Non-persistent database connection @@ -285,8 +286,8 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string .'FROM "'.$this->dbprefix.$table.'"'); -// original query before count_string was used. Kept for reference + $query = $this->query($this->_count_string .'FROM "'.$this->dbprefix.$table.'"'); +// original query before _count_string was used. Kept for reference // $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); if ($query->num_rows() == 0) diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 5f86b8ec..aa6738c0 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -37,7 +37,8 @@ class CI_DB_sqlite_driver extends CI_DB { * database engines, so this string appears in each driver and is * used for the count_all() and count_all_results() functions. */ - var $count_string = "SELECT COUNT(*) AS numrows "; + var $_count_string = "SELECT COUNT(*) AS numrows "; + var $_random_keyword = ' Random()'; // database specific random keyword /** * Non-persistent database connection @@ -281,7 +282,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); if ($query->num_rows() == 0) return '0'; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5028032b..612c4db6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,10 +66,11 @@

    Version 1.5.5

  • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
  • Reorganized the URI and Routes classes for better clarity.
  • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
  • -
  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • +
  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • +
  • Added 'random' as an order_by() option in Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • -
  • Documented the timezones() function in the Date Helper.
  • +
  • Documented the timezones() function in the Date Helper.
  • Documented unset_userdata in the Session class.
  • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
  • Added a few additional mime type variations for CSV.
  • @@ -79,16 +80,16 @@

    Version 1.5.5

  • Added form_reset() function to form helper.
  • Added count_all_results() function to Active Record.
  • Added a language entry for valid_ip validation error.
  • -
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • +
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • Fixed a bug in highlight_pharse() that caused an error with slashes.
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • Fixed a bug in the Email library where some timezones were calculated incorrectly.
  • -
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • +
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
  • Fixed a bug in database driver where num_rows property wasn't getting updated.
  • Fixed a bug in captcha calling an invalid PHP function.
  • -
  • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
  • +
  • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
  • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
  • Fixed a bug that was making validation callbacks required even when not set as such.
  • Fixed an example of comma-separated emails in the email library documentation.
  • @@ -103,7 +104,7 @@

    Version 1.5.5

  • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
  • Fixed a typo in the table library docs.
  • Moved part of the userguide menu javascript to an external file.
  • -
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • +
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d608459e..739d56a1 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -353,7 +353,7 @@

    $this->db->having();

    $this->db->order_by();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc

    +The second parameter lets you set the direction of the result. Options are asc or desc, or random.

    $this->db->order_by("title", "desc");
    @@ -375,6 +375,7 @@

    $this->db->order_by();

    // Produces: ORDER BY title DESC, name ASC

    Note: order_by() was formerly known as orderby(), which has been deprecated.

    +

    Note: random ordering is not currently supported in Orcacle or MSSQL drivers.

    $this->db->limit();

    Lets you limit the number of rows you would like returned by the query:

    From 80dd702d4c46552a3d1f94c5083c83eeff333b45 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 18 Dec 2007 23:55:06 +0000 Subject: [PATCH 0752/2544] Added where_in() to Active Record. --- system/database/DB_active_rec.php | 40 ++++++++++++++++++++++++-- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 26 +++++++++++++++-- 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index e8059ab7..c3279e8c 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -41,6 +41,8 @@ class CI_DB_active_record extends CI_DB_driver { var $ar_order = FALSE; var $ar_orderby = array(); var $ar_set = array(); + var $ar_wherein = array(); + /** @@ -240,9 +242,41 @@ function _where($key, $value = NULL, $type = 'AND ') } return $this; } - - - + + // -------------------------------------------------------------------- + + /** + * Where_in + * + * Generates a WHERE field IN ('item', 'item') SQL query + * + * @access public + * @param string The field to search + * @param array The values searched on + * @param string + * @return object + */ + function where_in($key = NULL, $values = NULL, $type = 'and') + { + if ($key === NULL || !is_array($values)) + { + return; + } + + $type = (strtolower($type) == 'or') ? ' OR ' : ' AND '; + + foreach ($values as $value) + { + $this->ar_wherein[] = $this->escape($value); + } + + $prefix = (count($this->ar_where) == 0) ? '' : $type; + + $this->ar_where[] = $prefix.$key. " IN (" . implode(", ", $this->ar_wherein) . ") "; + + return $this; + } + // -------------------------------------------------------------------- /** diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 612c4db6..8853969c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@

    Version 1.5.5

  • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • Added 'random' as an order_by() option in Active Record.
  • +
  • Added where_in() to Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 739d56a1..aafef33b 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -263,11 +263,31 @@

    $this->db->or_where();

    $this->db->or_where('id >', $id);

    // Produces: WHERE name != 'Joe' OR id > 50 - - -

    Note: or_where() was formerly known as orwhere(), which has been deprecated.

    + + +

    $this->db->where_in();

    +

    This function is used to write WHERE clauses that contain the IN keyword.

    + +

    + $names = array('frank', 'Todd', 'James');
    + $this->db->where_in('username', $names);
    + // Produces: AND WHERE username IN ('frank', 'Todd', 'James')

    +

    An optional third parameter can be used to specify if the WHERE statement should be separated with "OR" or "AND" in the event of multiple WHERE calls. The default is "AND".

    +

    $names = array('frank', 'Todd', 'James');
    +
    + $this->db->where('usergroup', '5')
    +$this->db->where_in('username', $names);
    +// Produces: WHERE usergroup = '5' AND WHERE username IN ('frank', 'Todd', 'James')
    +
    +$this->db->where('usergroup', '5')
    +$this->db->where_in('username', $names, 'and');
    +// Produces: WHERE usergroup = '5' AND WHERE username IN ('frank', 'Todd', 'James')
    +
    +$this->db->where('usergroup', '5')
    +$this->db->where_in('username', $names, 'or');
    +// Produces: WHERE usergroup = '5' OR WHERE username IN ('frank', 'Todd', 'James')

    $this->db->like();

    This function enables you to generate LIKE clauses, useful for doing searches.

    From 116c3937d7a9ae414f1fa59e23a624f50200f162 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 19 Dec 2007 00:02:29 +0000 Subject: [PATCH 0753/2544] --- user_guide/database/active_record.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index aafef33b..0146941b 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -274,7 +274,7 @@

    $this->db->where_in();

    $names = array('frank', 'Todd', 'James');
    $this->db->where_in('username', $names);
    // Produces: AND WHERE username IN ('frank', 'Todd', 'James')

    -

    An optional third parameter can be used to specify if the WHERE statement should be separated with "OR" or "AND" in the event of multiple WHERE calls. The default is "AND".

    +

    An optional third parameter can be used to specify if the WHERE statement should be separated with "OR" or "AND" in the event of multiple WHERE calls. The default is "AND". They are called with 'and', 'or'.

    $names = array('frank', 'Todd', 'James');

    $this->db->where('usergroup', '5')
    From c6935514fbe8ead6aed2ee711e1ce106913a9f47 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 19 Dec 2007 14:23:19 +0000 Subject: [PATCH 0754/2544] Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record. --- system/database/DB_active_rec.php | 85 +++++++++++++++++++++++++- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 41 +++++++------ 3 files changed, 107 insertions(+), 21 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index c3279e8c..47368587 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -248,21 +248,99 @@ function _where($key, $value = NULL, $type = 'AND ') /** * Where_in * - * Generates a WHERE field IN ('item', 'item') SQL query + * Generates a WHERE field IN ('item', 'item') SQL query joined with + * AND if appropriate * * @access public * @param string The field to search * @param array The values searched on + + * @return object + */ + function where_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values); + } + + // -------------------------------------------------------------------- + + /** + * Where_in_or + * + * Generates a WHERE field IN ('item', 'item') SQL query joined with + * OR if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + + * @return object + */ + function where_in_or($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, FALSE, 'or'); + } + + // -------------------------------------------------------------------- + + /** + * Where_not_in + * + * Generates a WHERE field NOT IN ('item', 'item') SQL query joined + * with AND if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + + * @return object + */ + function where_not_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Where_not_in_or + * + * Generates a WHERE field NOT IN ('item', 'item') SQL query joined + * with OR if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + + * @return object + */ + function where_not_in_or($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, FALSE, 'or'); + } + + // -------------------------------------------------------------------- + + /** + * Where_in + * + * Called by where_in, where_in_or, where_not_in, where_not_in_or + * + * @access public + * @param string The field to search + * @param array The values searched on + * @param boolean If the statement whould be IN or NOT IN * @param string * @return object */ - function where_in($key = NULL, $values = NULL, $type = 'and') + function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'and') { if ($key === NULL || !is_array($values)) { return; } + $not = ($not) ? ' NOT ' : ''; $type = (strtolower($type) == 'or') ? ' OR ' : ' AND '; foreach ($values as $value) @@ -272,7 +350,7 @@ function where_in($key = NULL, $values = NULL, $type = 'and') $prefix = (count($this->ar_where) == 0) ? '' : $type; - $this->ar_where[] = $prefix.$key. " IN (" . implode(", ", $this->ar_wherein) . ") "; + $this->ar_where[] = $prefix.$key.$not . " IN (" . implode(", ", $this->ar_wherein) . ") "; return $this; } @@ -1005,6 +1083,7 @@ function _reset_select() $this->ar_offset = FALSE; $this->ar_order = FALSE; $this->ar_orderby = array(); + $this->ar_wherein = array(); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8853969c..55edb75d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,7 +68,7 @@

    Version 1.5.5

  • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • Added 'random' as an order_by() option in Active Record.
  • -
  • Added where_in() to Active Record.
  • +
  • Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 0146941b..cf8ad469 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -268,26 +268,33 @@

    $this->db->or_where();

    $this->db->where_in();

    -

    This function is used to write WHERE clauses that contain the IN keyword.

    +

    Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->where_in('username', $names);
    + // Produces: AND WHERE username IN ('Frank', 'Todd', 'James')

    + +

    $this->db->where_in_or();

    +

    Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->where_in_or('username', $names);
    + // Produces: OR WHERE username IN ('Frank', 'Todd', 'James')

    + +

    $this->db->where_not_in();

    +

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->where_not_in('username', $names);
    + // Produces: AND WHERE username NOT IN ('Frank', 'Todd', 'James')

    +

    $this->db->where_not_in_or();

    +

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate

    - $names = array('frank', 'Todd', 'James');
    + $names = array('Frank', 'Todd', 'James');
    $this->db->where_in('username', $names);
    - // Produces: AND WHERE username IN ('frank', 'Todd', 'James')

    -

    An optional third parameter can be used to specify if the WHERE statement should be separated with "OR" or "AND" in the event of multiple WHERE calls. The default is "AND". They are called with 'and', 'or'.

    -

    $names = array('frank', 'Todd', 'James');
    -
    - $this->db->where('usergroup', '5')
    -$this->db->where_in('username', $names);
    -// Produces: WHERE usergroup = '5' AND WHERE username IN ('frank', 'Todd', 'James')
    -
    -$this->db->where('usergroup', '5')
    -$this->db->where_in('username', $names, 'and');
    -// Produces: WHERE usergroup = '5' AND WHERE username IN ('frank', 'Todd', 'James')
    -
    -$this->db->where('usergroup', '5')
    -$this->db->where_in('username', $names, 'or');
    -// Produces: WHERE usergroup = '5' OR WHERE username IN ('frank', 'Todd', 'James')

    + // Produces: OR WHERE username NOT IN ('Frank', 'Todd', 'James')

    +

    $this->db->like();

    This function enables you to generate LIKE clauses, useful for doing searches.

    From da6d240d7b8615b5ae628496c42cb216658eb6e4 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 19 Dec 2007 14:49:29 +0000 Subject: [PATCH 0755/2544] Added support for limit() into update() statements in Active Record. --- system/database/DB_active_rec.php | 10 ++++++++-- system/database/drivers/mssql/mssql_driver.php | 6 ++++-- system/database/drivers/mysql/mysql_driver.php | 6 ++++-- system/database/drivers/mysqli/mysqli_driver.php | 6 ++++-- system/database/drivers/oci8/oci8_driver.php | 8 +++++--- system/database/drivers/odbc/odbc_driver.php | 6 ++++-- system/database/drivers/postgre/postgre_driver.php | 6 ++++-- system/database/drivers/sqlite/sqlite_driver.php | 6 ++++-- user_guide/changelog.html | 1 + 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 47368587..4a88bd81 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -826,7 +826,7 @@ function insert($table = '', $set = NULL) * @param mixed the where clause * @return object */ - function update($table = '', $set = NULL, $where = null) + function update($table = '', $set = NULL, $where = null, $limit = NULL) { if ( ! is_null($set)) { @@ -860,8 +860,13 @@ function update($table = '', $set = NULL, $where = null) { $this->where($where); } + + if ($limit != null) + { + $this->limit($limit); + } - $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where); + $sql = $this->_update($this->dbprefix.$table, $this->ar_set, $this->ar_where, $this->ar_limit); $this->_reset_write(); return $this->query($sql); @@ -1101,6 +1106,7 @@ function _reset_write() $this->ar_set = array(); $this->ar_from = array(); $this->ar_where = array(); + $this->ar_limit = FALSE; } } diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 89610455..613be69b 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -421,14 +421,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 2d91c592..aaa9cc63 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -439,14 +439,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 09911709..f6f106eb 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -432,14 +432,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index e6bcefef..1dd157cc 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -535,14 +535,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 5e167624..66d5f89b 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -394,14 +394,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index e54f9cce..076d87a5 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -423,14 +423,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index aa6738c0..b701d6b9 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -418,14 +418,16 @@ function _insert($table, $keys, $values) * @param array the where clause * @return string */ - function _update($table, $values, $where) + function _update($table, $values, $where, $limit = FALSE) { foreach($values as $key => $val) { $valstr[] = $key." = ".$val; } + + $limit = (!$limit) ? '' : ' LIMIT '.$limit; - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 55edb75d..96e5724c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

    Version 1.5.5

  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • Added 'random' as an order_by() option in Active Record.
  • Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record.
  • +
  • Added support for limit() into update() statements in Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • From e77d77c6b4c094483a3d85b23845436b77796d07 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 19 Dec 2007 15:01:55 +0000 Subject: [PATCH 0756/2544] Added support for limit() into update() and delete() statements in Active Record. --- system/database/DB_active_rec.php | 15 ++++++++++----- system/database/drivers/mssql/mssql_driver.php | 6 ++++-- system/database/drivers/mysql/mysql_driver.php | 6 ++++-- system/database/drivers/mysqli/mysqli_driver.php | 6 ++++-- system/database/drivers/oci8/oci8_driver.php | 6 ++++-- system/database/drivers/odbc/odbc_driver.php | 6 ++++-- .../database/drivers/postgre/postgre_driver.php | 6 ++++-- system/database/drivers/sqlite/sqlite_driver.php | 6 ++++-- user_guide/changelog.html | 2 +- 9 files changed, 39 insertions(+), 20 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 4a88bd81..cea9bddc 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -856,12 +856,12 @@ function update($table = '', $set = NULL, $where = null, $limit = NULL) $table = $this->ar_from[0]; } - if ($where != null) + if ($where != NULL) { $this->where($where); } - if ($limit != null) + if ($limit != NULL) { $this->limit($limit); } @@ -884,7 +884,7 @@ function update($table = '', $set = NULL, $where = null, $limit = NULL) * @param mixed the where clause * @return object */ - function delete($table = '', $where = '') + function delete($table = '', $where = '', $limit = NULL) { if ($table == '') { @@ -905,6 +905,11 @@ function delete($table = '', $where = '') $this->where($where); } + if ($limit != NULL) + { + $this->limit($limit); + } + if (count($this->ar_where) == 0) { if ($this->db_debug) @@ -914,7 +919,7 @@ function delete($table = '', $where = '') return FALSE; } - $sql = $this->_delete($this->dbprefix.$table, $this->ar_where); + $sql = $this->_delete($this->dbprefix.$table, $this->ar_where, $this->ar_limit); $this->_reset_write(); return $this->query($sql); @@ -1096,7 +1101,7 @@ function _reset_select() /** * Resets the active record "write" values. * - * Called by the insert() or update() functions + * Called by the insert() update() and delete() functions * * @access private * @return void diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 613be69b..044fb3ce 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -445,9 +445,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index aaa9cc63..cd86ebf5 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -463,9 +463,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index f6f106eb..ebed8139 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -456,9 +456,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 1dd157cc..c4ab7005 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -559,9 +559,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 66d5f89b..040ffed9 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -418,9 +418,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 076d87a5..88f08b2d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -447,9 +447,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index b701d6b9..6189b1ff 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -442,9 +442,11 @@ function _update($table, $values, $where, $limit = FALSE) * @param array the where clause * @return string */ - function _delete($table, $where) + function _delete($table, $where, $limit = FALSE) { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + $limit = (!$limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where).$limit; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 96e5724c..b122c42f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,7 +69,7 @@

    Version 1.5.5

  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • Added 'random' as an order_by() option in Active Record.
  • Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record.
  • -
  • Added support for limit() into update() statements in Active Record.
  • +
  • Added support for limit() into update() and delete() statements in Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • From e54e3d2786b76266e6b6dde481cc493ba002faae Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 19 Dec 2007 15:53:44 +0000 Subject: [PATCH 0757/2544] where_in_or became or_where_in(), where_not_in_or() became or_where_not_in() for consistency Added not_like() and or_not_like() --- system/database/DB_active_rec.php | 57 +++++++++++++++++++++----- user_guide/database/active_record.html | 18 ++++++-- 2 files changed, 61 insertions(+), 14 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index cea9bddc..0a4327b4 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -276,7 +276,7 @@ function where_in($key = NULL, $values = NULL) * @return object */ - function where_in_or($key = NULL, $values = NULL) + function or_where_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values, FALSE, 'or'); } @@ -314,7 +314,7 @@ function where_not_in($key = NULL, $values = NULL) * @return object */ - function where_not_in_or($key = NULL, $values = NULL) + function or_where_not_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values, FALSE, 'or'); } @@ -372,7 +372,25 @@ function like($field, $match = '', $side = 'both') { return $this->_like($field, $match, 'AND ', $side); } - + + // -------------------------------------------------------------------- + + /** + * Not Like + * + * Generates a NOT LIKE portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function not_like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'AND ', $side, ' NOT'); + } + // -------------------------------------------------------------------- /** @@ -393,6 +411,24 @@ function or_like($field, $match = '', $side = 'both') // -------------------------------------------------------------------- + /** + * OR Not Like + * + * Generates a NOT LIKE portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function or_not_like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'OR ', $side, 'NOT '); + } + + // -------------------------------------------------------------------- + /** * orlike() is an alias of or_like() * this function is here for backwards compatibility, as @@ -416,7 +452,7 @@ function orlike($field, $match = '', $side = 'both') * @param string * @return object */ - function _like($field, $match = '', $type = 'AND ', $side = 'both') + function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') { if ( ! is_array($field)) { @@ -424,22 +460,23 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both') } foreach ($field as $k => $v) - { + { + $prefix = (count($this->ar_like) == 0) ? '' : $type; - + $v = $this->escape_str($v); - + if ($side == 'before') { - $this->ar_like[] = $prefix." $k LIKE '%{$v}'"; + $this->ar_like[] = $prefix." $k $not LIKE '%{$v}'"; } elseif ($side == 'after') { - $this->ar_like[] = $prefix." $k LIKE '{$v}%'"; + $this->ar_like[] = $prefix." $k $not LIKE '{$v}%'"; } else { - $this->ar_like[] = $prefix." $k LIKE '%{$v}%'"; + $this->ar_like[] = $prefix." $k $not LIKE '%{$v}%'"; } } return $this; diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index cf8ad469..d938b5df 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -18,7 +18,6 @@ - @@ -274,7 +273,7 @@

    $this->db->where_in();

    $this->db->where_in('username', $names);
    // Produces: AND WHERE username IN ('Frank', 'Todd', 'James')

    -

    $this->db->where_in_or();

    +

    $this->db->or_where_in();

    Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate

    $names = array('Frank', 'Todd', 'James');
    @@ -288,7 +287,7 @@

    $this->db->where_not_in();

    $this->db->where_not_in('username', $names);
    // Produces: AND WHERE username NOT IN ('Frank', 'Todd', 'James')

    -

    $this->db->where_not_in_or();

    +

    $this->db->or_where_not_in();

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate

    $names = array('Frank', 'Todd', 'James');
    @@ -338,7 +337,7 @@

    $this->db->or_like();

    This function is identical to the one above, except that multiple instances are joined by OR:

    -$this->db->like('title', $match);
    +$this->db->like('title', 'match');
    $this->db->or_like('body', $match);

    // WHERE title LIKE '%match%' OR body LIKE '%match%'
    @@ -347,6 +346,17 @@

    $this->db->or_like();

    Note: or_like() was formerly known as orlike(), which has been deprecated.

    +

    $this->db->not_like();

    +

    This function is identical to like(), except that it generates NOT LIKE statements:

    + $this->db->not_like('title', 'match');
    +
    +// WHERE title NOT LIKE '%match%
    +

    $this->db->or_not_like();

    +

    This function is identical to not_like(), except that multiple instances are joined by OR:

    + $this->db->like('title', 'match');
    +$this->db->or_not_like('body', 'match');
    +
    +// WHERE title LIKE '%match% OR body NOT LIKE 'match'

    $this->db->group_by();

    Permits you to write the GROUP BY portion of your query:

    From 15ddc9d0c1971de92c0f80bfe12f157786f97895 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 20 Dec 2007 13:54:39 +0000 Subject: [PATCH 0758/2544] Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL" Added parenthesis around table names in SQL FROM --- system/database/DB_active_rec.php | 24 ++++++++++++++++-------- user_guide/changelog.html | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 0a4327b4..dfa0a3ef 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -226,16 +226,25 @@ function _where($key, $value = NULL, $type = 'AND ') foreach ($key as $k => $v) { + $prefix = (count($this->ar_where) == 0) ? '' : $type; + + if (is_null($key[$k])) + { + // value appears not to have been set, assign the test to IS NULL + $k .= ' IS NULL'; + } if ( ! is_null($v)) { + if ( ! $this->_has_operator($k)) { $k .= ' ='; } - + $v = ' '.$this->escape($v); + } $this->ar_where[] = $prefix.$k.$v; @@ -278,7 +287,7 @@ function where_in($key = NULL, $values = NULL) */ function or_where_in($key = NULL, $values = NULL) { - return $this->_where_in($key, $values, FALSE, 'or'); + return $this->_where_in($key, $values, FALSE, 'OR '); } // -------------------------------------------------------------------- @@ -316,7 +325,7 @@ function where_not_in($key = NULL, $values = NULL) */ function or_where_not_in($key = NULL, $values = NULL) { - return $this->_where_in($key, $values, FALSE, 'or'); + return $this->_where_in($key, $values, FALSE, 'OR '); } // -------------------------------------------------------------------- @@ -333,7 +342,7 @@ function or_where_not_in($key = NULL, $values = NULL) * @param string * @return object */ - function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'and') + function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') { if ($key === NULL || !is_array($values)) { @@ -341,7 +350,6 @@ function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'and') } $not = ($not) ? ' NOT ' : ''; - $type = (strtolower($type) == 'or') ? ' OR ' : ' AND '; foreach ($values as $value) { @@ -955,13 +963,13 @@ function delete($table = '', $where = '', $limit = NULL) } return FALSE; } - + $sql = $this->_delete($this->dbprefix.$table, $this->ar_where, $this->ar_limit); $this->_reset_write(); return $this->query($sql); } - + // -------------------------------------------------------------------- /** @@ -1020,7 +1028,7 @@ function _compile_select($select_override = FALSE) if (count($this->ar_from) > 0) { $sql .= "\nFROM "; - $sql .= implode(', ', $this->ar_from); + $sql .= '(' . implode(', ', $this->ar_from) . ')'; } if (count($this->ar_join) > 0) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b122c42f..f5f1ad28 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -84,6 +84,7 @@

    Version 1.5.5

  • Added a language entry for valid_ip validation error.
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • +
  • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
  • Fixed a bug in highlight_pharse() that caused an error with slashes.
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • Fixed a bug in the Email library where some timezones were calculated incorrectly.
  • From 026585710c5ad4c5a8e5544d177b6a870f56123e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 20 Dec 2007 14:00:50 +0000 Subject: [PATCH 0759/2544] removed an unneeded setting of $config to NULL --- system/libraries/Loader.php | 986 +++++++++++++++++++++++++++++++++++- 1 file changed, 985 insertions(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 6e4c594e..2de2bd7f 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -1 +1,985 @@ - 'unit', 'user_agent' => 'agent'); /** * Constructor * * Sets the path to the view files and gets the initial output buffering level * * @access public */ function CI_Loader() { $this->_ci_is_php5 = (floor(phpversion()) >= 5) ? TRUE : FALSE; $this->_ci_view_path = APPPATH.'views/'; $this->_ci_ob_level = ob_get_level(); log_message('debug', "Loader Class Initialized"); } // -------------------------------------------------------------------- /** * Class Loader * * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * * @access public * @param string the name of the class * @param mixed the optional parameters * @return void */ function library($library = '', $params = NULL) { if ($library == '') { return FALSE; } if (is_array($library)) { foreach ($library as $class) { $this->_ci_load_class($class, $params); } } else { $this->_ci_load_class($library, $params); } $this->_ci_assign_to_models(); } // -------------------------------------------------------------------- /** * Model Loader * * This function lets users load and instantiate models. * * @access public * @param string the name of the class * @param mixed any initialization parameters * @return void */ function model($model, $name = '', $db_conn = FALSE) { if (is_array($model)) { foreach($model as $babe) { $this->model($babe); } return; } if ($model == '') { return; } // Is the model in a sub-folder? If so, parse out the filename and path. if (strpos($model, '/') === FALSE) { $path = ''; } else { $x = explode('/', $model); $model = end($x); unset($x[count($x)-1]); $path = implode('/', $x).'/'; } if ($name == '') { $name = $model; } if (in_array($name, $this->_ci_models, TRUE)) { return; } $CI =& get_instance(); if (isset($CI->$name)) { show_error('The model name you are loading is the name of a resource that is already being used: '.$name); } $model = strtolower($model); if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT)) { show_error('Unable to locate the model you have specified: '.$model); } if ($db_conn !== FALSE AND ! class_exists('CI_DB')) { if ($db_conn === TRUE) $db_conn = ''; $CI->load->database($db_conn, FALSE, TRUE); } if ( ! class_exists('Model')) { require_once(BASEPATH.'libraries/Model'.EXT); } require_once(APPPATH.'models/'.$path.$model.EXT); $model = ucfirst($model); $CI->$name = new $model(); $CI->$name->_assign_libraries(); $this->_ci_models[] = $name; } // -------------------------------------------------------------------- /** * Database Loader * * @access public * @param string the DB credentials * @param bool whether to return the DB object * @param bool whether to enable active record (this allows us to override the config setting) * @return object */ function database($params = '', $return = FALSE, $active_record = FALSE) { // Do we even need to load the database class? if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) { return FALSE; } require_once(BASEPATH.'database/DB'.EXT); if ($return === TRUE) { return DB($params, $active_record); } // Grab the super object $CI =& get_instance(); // Initialize the db variable. Needed to prevent // reference errors with some configurations $CI->db = ''; // Load the DB class $CI->db =& DB($params, $active_record); // Assign the DB object to any existing models $this->_ci_assign_to_models(); } // -------------------------------------------------------------------- /** * Load the Utilities Class * * @access public * @return string */ function dbutil() { if ( ! class_exists('CI_DB')) { $this->database(); } $CI =& get_instance(); require_once(BASEPATH.'database/DB_utility'.EXT); require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; $CI->dbutil = new $class(); $CI->load->_ci_assign_to_models(); } // -------------------------------------------------------------------- /** * Load View * * This function is used to load a "view" file. It has three parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. * 3. TRUE/FALSE - whether to return the data or load it. In * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * * @access public * @param string * @param array * @param bool * @return void */ function view($view, $vars = array(), $return = FALSE) { return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); } // -------------------------------------------------------------------- /** * Load File * * This is a generic file loader * * @access public * @param string * @param bool * @return string */ function file($path, $return = FALSE) { return $this->_ci_load(array('path' => $path, 'return' => $return)); } // -------------------------------------------------------------------- /** * Set Variables * * Once variables are set they become available within * the controller class and its "view" files. * * @access public * @param array * @return void */ function vars($vars = array()) { $vars = $this->_ci_object_to_array($vars); if (is_array($vars) AND count($vars) > 0) { foreach ($vars as $key => $val) { $this->_ci_cached_vars[$key] = $val; } } } // -------------------------------------------------------------------- /** * Load Helper * * This function loads the specified helper file. * * @access public * @param mixed * @return void */ function helper($helpers = array()) { if ( ! is_array($helpers)) { $helpers = array($helpers); } foreach ($helpers as $helper) { $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); if (isset($this->_ci_helpers[$helper])) { continue; } if (file_exists(APPPATH.'helpers/'.$helper.EXT)) { include_once(APPPATH.'helpers/'.$helper.EXT); } else { if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) { include(BASEPATH.'helpers/'.$helper.EXT); } else { show_error('Unable to load the requested file: helpers/'.$helper.EXT); } } $this->_ci_helpers[$helper] = TRUE; } log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); } // -------------------------------------------------------------------- /** * Load Helpers * * This is simply an alias to the above function in case the * user has written the plural form of this function. * * @access public * @param array * @return void */ function helpers($helpers = array()) { $this->helper($helpers); } // -------------------------------------------------------------------- /** * Load Plugin * * This function loads the specified plugin. * * @access public * @param array * @return void */ function plugin($plugins = array()) { if ( ! is_array($plugins)) { $plugins = array($plugins); } foreach ($plugins as $plugin) { $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); if (isset($this->_ci_plugins[$plugin])) { continue; } if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) { include(APPPATH.'plugins/'.$plugin.EXT); } else { if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) { include(BASEPATH.'plugins/'.$plugin.EXT); } else { show_error('Unable to load the requested file: plugins/'.$plugin.EXT); } } $this->_ci_plugins[$plugin] = TRUE; } log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); } // -------------------------------------------------------------------- /** * Load Plugins * * This is simply an alias to the above function in case the * user has written the plural form of this function. * * @access public * @param array * @return void */ function plugins($plugins = array()) { $this->plugin($plugins); } // -------------------------------------------------------------------- /** * Load Script * * This function loads the specified include file from the * application/scripts/ folder. * * NOTE: This feature has been deprecated but it will remain available * for legacy users. * * @access public * @param array * @return void */ function script($scripts = array()) { if ( ! is_array($scripts)) { $scripts = array($scripts); } foreach ($scripts as $script) { $script = strtolower(str_replace(EXT, '', $script)); if (isset($this->_ci_scripts[$script])) { continue; } if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) { show_error('Unable to load the requested script: scripts/'.$script.EXT); } include(APPPATH.'scripts/'.$script.EXT); } log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); } // -------------------------------------------------------------------- /** * Loads a language file * * @access public * @param array * @param string * @return void */ function language($file = array(), $lang = '') { $CI =& get_instance(); if ( ! is_array($file)) { $file = array($file); } foreach ($file as $langfile) { $CI->lang->load($langfile, $lang); } } /** * Loads language files for scaffolding * * @access public * @param string * @return arra */ function scaffold_language($file = '', $lang = '', $return = FALSE) { $CI =& get_instance(); return $CI->lang->load($file, $lang, $return); } // -------------------------------------------------------------------- /** * Loads a config file * * @access public * @param string * @return void */ function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $CI =& get_instance(); $CI->config->load($file, $use_sections, $fail_gracefully); } // -------------------------------------------------------------------- /** * Scaffolding Loader * * This initializing function works a bit different than the * others. It doesn't load the class. Instead, it simply * sets a flag indicating that scaffolding is allowed to be * used. The actual scaffolding function below is * called by the front controller based on whether the * second segment of the URL matches the "secret" scaffolding * word stored in the application/config/routes.php * * @access public * @param string * @return void */ function scaffolding($table = '') { if ($table === FALSE) { show_error('You must include the name of the table you would like to access when you initialize scaffolding'); } $CI =& get_instance(); $CI->_ci_scaffolding = TRUE; $CI->_ci_scaff_table = $table; } // -------------------------------------------------------------------- /** * Loader * * This function is used to load views and files. * * @access private * @param array * @return void */ function _ci_load($data) { // Set the default data variables foreach (array('view', 'vars', 'path', 'return') as $val) { $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; } // Set the path to the requested file if ($path == '') { $ext = pathinfo($view, PATHINFO_EXTENSION); $file = ($ext == '') ? $view.EXT : $view; $path = $this->_ci_view_path.$file; } else { $x = explode('/', $path); $file = end($x); } if ( ! file_exists($path)) { show_error('Unable to load the requested file: '.$file); } // This allows anything loaded using $this->load (views, files, etc.) // to become accessible from within the Controller and Model functions. // Only needed when running PHP 5 if ($this->_ci_is_instance()) { $CI =& get_instance(); foreach (get_object_vars($CI) as $key => $var) { if ( ! isset($this->$key)) { $this->$key =& $CI->$key; } } } /* * Extract and cache variables * * You can either set variables using the dedicated $this->load_vars() * function or via the second parameter of this function. We'll merge * the two types and cache them so that views that are embedded within * other views can have access to these variables. */ if (is_array($vars)) { $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); } extract($this->_ci_cached_vars); /* * Buffer the output * * We buffer the output for two reasons: * 1. Speed. You get a significant speed boost. * 2. So that the final rendered template can be * post-processed by the output class. Why do we * need post processing? For one thing, in order to * show the elapsed page load time. Unless we * can intercept the content right before it's sent to * the browser and then stop the timer it won't be accurate. */ ob_start(); // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(' $this->_ci_ob_level + 1) { ob_end_flush(); } else { // PHP 4 requires that we use a global global $OUT; $OUT->set_output(ob_get_contents()); @ob_end_clean(); } } // -------------------------------------------------------------------- /** * Load class * * This function loads the requested class. * * @access private * @param string the item that is being loaded * @param mixed any additional parameters * @return void */ function _ci_load_class($class, $params = NULL) { // Get the class name $class = str_replace(EXT, '', $class); // We'll test for both lowercase and capitalized versions of the file name foreach (array(ucfirst($class), strtolower($class)) as $class) { $subclass = APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT; // Is this a class extension request? if (file_exists($subclass)) { $baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT; if ( ! file_exists($baseclass)) { log_message('error', "Unable to load the requested class: ".$class); show_error("Unable to load the requested class: ".$class); } // Safety: Was the class already loaded by a previous call? if (in_array($subclass, $this->_ci_classes)) { $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; } include($baseclass); include($subclass); $this->_ci_classes[] = $subclass; return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); } // Lets search for the requested library file and load it. $is_duplicate = FALSE; for ($i = 1; $i < 3; $i++) { $path = ($i % 2) ? APPPATH : BASEPATH; $filepath = $path.'libraries/'.$class.EXT; // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) { continue; } // Safety: Was the class already loaded by a previous call? if (in_array($filepath, $this->_ci_classes)) { $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; } include($filepath); $this->_ci_classes[] = $filepath; return $this->_ci_init_class($class, '', $params); } } // END FOREACH // If we got this far we were unable to find the requested class. // We do not issue errors if the load call failed due to a duplicate request if ($is_duplicate == FALSE) { log_message('error', "Unable to load the requested class: ".$class); show_error("Unable to load the requested class: ".$class); } } // -------------------------------------------------------------------- /** * Instantiates a class * * @access private * @param string * @param string * @return null */ function _ci_init_class($class, $prefix = '', $config = FALSE) { // Is there an associated config file for this class? if ($config === NULL) { $config = NULL; if (file_exists(APPPATH.'config/'.$class.EXT)) { include(APPPATH.'config/'.$class.EXT); } } if ($prefix == '') { $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; } else { $name = $prefix.$class; } // Set the variable name we will assign the class to $class = strtolower($class); $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; // Instantiate the class $CI =& get_instance(); if ($config !== NULL) { $CI->$classvar = new $name($config); } else { $CI->$classvar = new $name; } } // -------------------------------------------------------------------- /** * Autoloader * * The config/autoload.php file contains an array that permits sub-systems, * libraries, plugins, and helpers to be loaded automatically. * * @access private * @param array * @return void */ function _ci_autoloader() { include(APPPATH.'config/autoload'.EXT); if ( ! isset($autoload)) { return FALSE; } // Load any custom config file if (count($autoload['config']) > 0) { $CI =& get_instance(); foreach ($autoload['config'] as $key => $val) { $CI->config->load($val); } } // Autoload plugins, helpers, scripts and languages foreach (array('helper', 'plugin', 'script', 'language') as $type) { if (isset($autoload[$type]) AND count($autoload[$type]) > 0) { $this->$type($autoload[$type]); } } // Autoload models if (isset($autoload['model'])) { $this->model($autoload['model']); } // A little tweak to remain backward compatible // The $autoload['core'] item was deprecated if ( ! isset($autoload['libraries'])) { $autoload['libraries'] = $autoload['core']; } // Load libraries if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) { // Load the database driver. if (in_array('database', $autoload['libraries'])) { $this->database(); $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); } // Load scaffolding if (in_array('scaffolding', $autoload['libraries'])) { $this->scaffolding(); $autoload['libraries'] = array_diff($autoload['libraries'], array('scaffolding')); } // Load all other libraries foreach ($autoload['libraries'] as $item) { $this->library($item); } // Load the model class. if (in_array('model', $autoload['libraries'])) { $this->model(); $autoload['libraries'] = array_diff($autoload['libraries'], array('model')); } } } // -------------------------------------------------------------------- /** * Assign to Models * * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) * will be available to models, if any exist. * * @access private * @param object * @return array */ function _ci_assign_to_models() { if (count($this->_ci_models) == 0) { return; } if ($this->_ci_is_instance()) { $CI =& get_instance(); foreach ($this->_ci_models as $model) { $CI->$model->_assign_libraries(); } } else { foreach ($this->_ci_models as $model) { $this->$model->_assign_libraries(); } } } // -------------------------------------------------------------------- /** * Object to Array * * Takes an object as input and converts the class variables to array key/vals * * @access private * @param object * @return array */ function _ci_object_to_array($object) { return (is_object($object)) ? get_object_vars($object) : $object; } // -------------------------------------------------------------------- /** * Determines whether we should use the CI instance or $this * * @access private * @return bool */ function _ci_is_instance() { if ($this->_ci_is_php5 == TRUE) { return TRUE; } global $CI; return (is_object($CI)) ? TRUE : FALSE; } } ?> \ No newline at end of file + 'unit', 'user_agent' => 'agent'); + + + /** + * Constructor + * + * Sets the path to the view files and gets the initial output buffering level + * + * @access public + */ + function CI_Loader() + { + $this->_ci_is_php5 = (floor(phpversion()) >= 5) ? TRUE : FALSE; + $this->_ci_view_path = APPPATH.'views/'; + $this->_ci_ob_level = ob_get_level(); + + log_message('debug', "Loader Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Class Loader + * + * This function lets users load and instantiate classes. + * It is designed to be called from a user's app controllers. + * + * @access public + * @param string the name of the class + * @param mixed the optional parameters + * @return void + */ + function library($library = '', $params = NULL) + { + if ($library == '') + { + return FALSE; + } + + if (is_array($library)) + { + foreach ($library as $class) + { + $this->_ci_load_class($class, $params); + } + } + else + { + $this->_ci_load_class($library, $params); + } + + $this->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Model Loader + * + * This function lets users load and instantiate models. + * + * @access public + * @param string the name of the class + * @param mixed any initialization parameters + * @return void + */ + function model($model, $name = '', $db_conn = FALSE) + { + if (is_array($model)) + { + foreach($model as $babe) + { + $this->model($babe); + } + return; + } + + if ($model == '') + { + return; + } + + // Is the model in a sub-folder? If so, parse out the filename and path. + if (strpos($model, '/') === FALSE) + { + $path = ''; + } + else + { + $x = explode('/', $model); + $model = end($x); + unset($x[count($x)-1]); + $path = implode('/', $x).'/'; + } + + if ($name == '') + { + $name = $model; + } + + if (in_array($name, $this->_ci_models, TRUE)) + { + return; + } + + $CI =& get_instance(); + if (isset($CI->$name)) + { + show_error('The model name you are loading is the name of a resource that is already being used: '.$name); + } + + $model = strtolower($model); + + if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT)) + { + show_error('Unable to locate the model you have specified: '.$model); + } + + if ($db_conn !== FALSE AND ! class_exists('CI_DB')) + { + if ($db_conn === TRUE) + $db_conn = ''; + + $CI->load->database($db_conn, FALSE, TRUE); + } + + if ( ! class_exists('Model')) + { + require_once(BASEPATH.'libraries/Model'.EXT); + } + + require_once(APPPATH.'models/'.$path.$model.EXT); + + $model = ucfirst($model); + + $CI->$name = new $model(); + $CI->$name->_assign_libraries(); + + $this->_ci_models[] = $name; + } + + // -------------------------------------------------------------------- + + /** + * Database Loader + * + * @access public + * @param string the DB credentials + * @param bool whether to return the DB object + * @param bool whether to enable active record (this allows us to override the config setting) + * @return object + */ + function database($params = '', $return = FALSE, $active_record = FALSE) + { + // Do we even need to load the database class? + if (class_exists('CI_DB') AND $return == FALSE AND $active_record == FALSE) + { + return FALSE; + } + + require_once(BASEPATH.'database/DB'.EXT); + + if ($return === TRUE) + { + return DB($params, $active_record); + } + + // Grab the super object + $CI =& get_instance(); + + // Initialize the db variable. Needed to prevent + // reference errors with some configurations + $CI->db = ''; + + // Load the DB class + $CI->db =& DB($params, $active_record); + + // Assign the DB object to any existing models + $this->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Load the Utilities Class + * + * @access public + * @return string + */ + function dbutil() + { + if ( ! class_exists('CI_DB')) + { + $this->database(); + } + + $CI =& get_instance(); + + require_once(BASEPATH.'database/DB_utility'.EXT); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); + $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; + + $CI->dbutil = new $class(); + $CI->load->_ci_assign_to_models(); + } + + // -------------------------------------------------------------------- + + /** + * Load View + * + * This function is used to load a "view" file. It has three parameters: + * + * 1. The name of the "view" file to be included. + * 2. An associative array of data to be extracted for use in the view. + * 3. TRUE/FALSE - whether to return the data or load it. In + * some cases it's advantageous to be able to return data so that + * a developer can process it in some way. + * + * @access public + * @param string + * @param array + * @param bool + * @return void + */ + function view($view, $vars = array(), $return = FALSE) + { + return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Load File + * + * This is a generic file loader + * + * @access public + * @param string + * @param bool + * @return string + */ + function file($path, $return = FALSE) + { + return $this->_ci_load(array('path' => $path, 'return' => $return)); + } + + // -------------------------------------------------------------------- + + /** + * Set Variables + * + * Once variables are set they become available within + * the controller class and its "view" files. + * + * @access public + * @param array + * @return void + */ + function vars($vars = array()) + { + $vars = $this->_ci_object_to_array($vars); + + if (is_array($vars) AND count($vars) > 0) + { + foreach ($vars as $key => $val) + { + $this->_ci_cached_vars[$key] = $val; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Load Helper + * + * This function loads the specified helper file. + * + * @access public + * @param mixed + * @return void + */ + function helper($helpers = array()) + { + if ( ! is_array($helpers)) + { + $helpers = array($helpers); + } + + foreach ($helpers as $helper) + { + $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); + + if (isset($this->_ci_helpers[$helper])) + { + continue; + } + + if (file_exists(APPPATH.'helpers/'.$helper.EXT)) + { + include_once(APPPATH.'helpers/'.$helper.EXT); + } + else + { + if (file_exists(BASEPATH.'helpers/'.$helper.EXT)) + { + include(BASEPATH.'helpers/'.$helper.EXT); + } + else + { + show_error('Unable to load the requested file: helpers/'.$helper.EXT); + } + } + + $this->_ci_helpers[$helper] = TRUE; + + } + + log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); + } + + // -------------------------------------------------------------------- + + /** + * Load Helpers + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function helpers($helpers = array()) + { + $this->helper($helpers); + } + + // -------------------------------------------------------------------- + + /** + * Load Plugin + * + * This function loads the specified plugin. + * + * @access public + * @param array + * @return void + */ + function plugin($plugins = array()) + { + if ( ! is_array($plugins)) + { + $plugins = array($plugins); + } + + foreach ($plugins as $plugin) + { + $plugin = strtolower(str_replace(EXT, '', str_replace('_plugin.', '', $plugin)).'_pi'); + + if (isset($this->_ci_plugins[$plugin])) + { + continue; + } + + if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) + { + include(APPPATH.'plugins/'.$plugin.EXT); + } + else + { + if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) + { + include(BASEPATH.'plugins/'.$plugin.EXT); + } + else + { + show_error('Unable to load the requested file: plugins/'.$plugin.EXT); + } + } + + $this->_ci_plugins[$plugin] = TRUE; + } + + log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); + } + + // -------------------------------------------------------------------- + + /** + * Load Plugins + * + * This is simply an alias to the above function in case the + * user has written the plural form of this function. + * + * @access public + * @param array + * @return void + */ + function plugins($plugins = array()) + { + $this->plugin($plugins); + } + + // -------------------------------------------------------------------- + + /** + * Load Script + * + * This function loads the specified include file from the + * application/scripts/ folder. + * + * NOTE: This feature has been deprecated but it will remain available + * for legacy users. + * + * @access public + * @param array + * @return void + */ + function script($scripts = array()) + { + if ( ! is_array($scripts)) + { + $scripts = array($scripts); + } + + foreach ($scripts as $script) + { + $script = strtolower(str_replace(EXT, '', $script)); + + if (isset($this->_ci_scripts[$script])) + { + continue; + } + + if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) + { + show_error('Unable to load the requested script: scripts/'.$script.EXT); + } + + include(APPPATH.'scripts/'.$script.EXT); + } + + log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); + } + + // -------------------------------------------------------------------- + + /** + * Loads a language file + * + * @access public + * @param array + * @param string + * @return void + */ + function language($file = array(), $lang = '') + { + $CI =& get_instance(); + + if ( ! is_array($file)) + { + $file = array($file); + } + + foreach ($file as $langfile) + { + $CI->lang->load($langfile, $lang); + } + } + + /** + * Loads language files for scaffolding + * + * @access public + * @param string + * @return arra + */ + function scaffold_language($file = '', $lang = '', $return = FALSE) + { + $CI =& get_instance(); + return $CI->lang->load($file, $lang, $return); + } + + // -------------------------------------------------------------------- + + /** + * Loads a config file + * + * @access public + * @param string + * @return void + */ + function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + { + $CI =& get_instance(); + $CI->config->load($file, $use_sections, $fail_gracefully); + } + + // -------------------------------------------------------------------- + + /** + * Scaffolding Loader + * + * This initializing function works a bit different than the + * others. It doesn't load the class. Instead, it simply + * sets a flag indicating that scaffolding is allowed to be + * used. The actual scaffolding function below is + * called by the front controller based on whether the + * second segment of the URL matches the "secret" scaffolding + * word stored in the application/config/routes.php + * + * @access public + * @param string + * @return void + */ + function scaffolding($table = '') + { + if ($table === FALSE) + { + show_error('You must include the name of the table you would like to access when you initialize scaffolding'); + } + + $CI =& get_instance(); + $CI->_ci_scaffolding = TRUE; + $CI->_ci_scaff_table = $table; + } + + // -------------------------------------------------------------------- + + /** + * Loader + * + * This function is used to load views and files. + * + * @access private + * @param array + * @return void + */ + function _ci_load($data) + { + // Set the default data variables + foreach (array('view', 'vars', 'path', 'return') as $val) + { + $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; + } + + // Set the path to the requested file + if ($path == '') + { + $ext = pathinfo($view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $view.EXT : $view; + $path = $this->_ci_view_path.$file; + } + else + { + $x = explode('/', $path); + $file = end($x); + } + + if ( ! file_exists($path)) + { + show_error('Unable to load the requested file: '.$file); + } + + // This allows anything loaded using $this->load (views, files, etc.) + // to become accessible from within the Controller and Model functions. + // Only needed when running PHP 5 + + if ($this->_ci_is_instance()) + { + $CI =& get_instance(); + foreach (get_object_vars($CI) as $key => $var) + { + if ( ! isset($this->$key)) + { + $this->$key =& $CI->$key; + } + } + } + + /* + * Extract and cache variables + * + * You can either set variables using the dedicated $this->load_vars() + * function or via the second parameter of this function. We'll merge + * the two types and cache them so that views that are embedded within + * other views can have access to these variables. + */ + if (is_array($vars)) + { + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); + } + extract($this->_ci_cached_vars); + + /* + * Buffer the output + * + * We buffer the output for two reasons: + * 1. Speed. You get a significant speed boost. + * 2. So that the final rendered template can be + * post-processed by the output class. Why do we + * need post processing? For one thing, in order to + * show the elapsed page load time. Unless we + * can intercept the content right before it's sent to + * the browser and then stop the timer it won't be accurate. + */ + ob_start(); + + // If the PHP installation does not support short tags we'll + // do a little string replacement, changing the short tags + // to standard PHP echo statements. + + if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) + { + echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(' $this->_ci_ob_level + 1) + { + ob_end_flush(); + } + else + { + // PHP 4 requires that we use a global + global $OUT; + $OUT->set_output(ob_get_contents()); + @ob_end_clean(); + } + } + + // -------------------------------------------------------------------- + + /** + * Load class + * + * This function loads the requested class. + * + * @access private + * @param string the item that is being loaded + * @param mixed any additional parameters + * @return void + */ + function _ci_load_class($class, $params = NULL) + { + // Get the class name + $class = str_replace(EXT, '', $class); + + // We'll test for both lowercase and capitalized versions of the file name + foreach (array(ucfirst($class), strtolower($class)) as $class) + { + $subclass = APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT; + + // Is this a class extension request? + if (file_exists($subclass)) + { + $baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT; + + if ( ! file_exists($baseclass)) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($subclass, $this->_ci_classes)) + { + $is_duplicate = TRUE; + log_message('debug', $class." class already loaded. Second attempt ignored."); + return; + } + + include($baseclass); + include($subclass); + $this->_ci_classes[] = $subclass; + + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); + } + + // Lets search for the requested library file and load it. + $is_duplicate = FALSE; + for ($i = 1; $i < 3; $i++) + { + $path = ($i % 2) ? APPPATH : BASEPATH; + $filepath = $path.'libraries/'.$class.EXT; + + // Does the file exist? No? Bummer... + if ( ! file_exists($filepath)) + { + continue; + } + + // Safety: Was the class already loaded by a previous call? + if (in_array($filepath, $this->_ci_classes)) + { + $is_duplicate = TRUE; + log_message('debug', $class." class already loaded. Second attempt ignored."); + return; + } + + include($filepath); + $this->_ci_classes[] = $filepath; + return $this->_ci_init_class($class, '', $params); + } + } // END FOREACH + + // If we got this far we were unable to find the requested class. + // We do not issue errors if the load call failed due to a duplicate request + if ($is_duplicate == FALSE) + { + log_message('error', "Unable to load the requested class: ".$class); + show_error("Unable to load the requested class: ".$class); + } + } + + // -------------------------------------------------------------------- + + /** + * Instantiates a class + * + * @access private + * @param string + * @param string + * @return null + */ + function _ci_init_class($class, $prefix = '', $config = FALSE) + { + // Is there an associated config file for this class? + if ($config === NULL) + { + if (file_exists(APPPATH.'config/'.$class.EXT)) + { + include(APPPATH.'config/'.$class.EXT); + } + } + + if ($prefix == '') + { + $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; + } + else + { + $name = $prefix.$class; + } + + // Set the variable name we will assign the class to + $class = strtolower($class); + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + + // Instantiate the class + $CI =& get_instance(); + if ($config !== NULL) + { + $CI->$classvar = new $name($config); + } + else + { + $CI->$classvar = new $name; + } + } + + // -------------------------------------------------------------------- + + /** + * Autoloader + * + * The config/autoload.php file contains an array that permits sub-systems, + * libraries, plugins, and helpers to be loaded automatically. + * + * @access private + * @param array + * @return void + */ + function _ci_autoloader() + { + include(APPPATH.'config/autoload'.EXT); + + if ( ! isset($autoload)) + { + return FALSE; + } + + // Load any custom config file + if (count($autoload['config']) > 0) + { + $CI =& get_instance(); + foreach ($autoload['config'] as $key => $val) + { + $CI->config->load($val); + } + } + + // Autoload plugins, helpers, scripts and languages + foreach (array('helper', 'plugin', 'script', 'language') as $type) + { + if (isset($autoload[$type]) AND count($autoload[$type]) > 0) + { + $this->$type($autoload[$type]); + } + } + + // Autoload models + if (isset($autoload['model'])) + { + $this->model($autoload['model']); + } + + // A little tweak to remain backward compatible + // The $autoload['core'] item was deprecated + if ( ! isset($autoload['libraries'])) + { + $autoload['libraries'] = $autoload['core']; + } + + // Load libraries + if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) + { + // Load the database driver. + if (in_array('database', $autoload['libraries'])) + { + $this->database(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); + } + + // Load scaffolding + if (in_array('scaffolding', $autoload['libraries'])) + { + $this->scaffolding(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('scaffolding')); + } + + // Load all other libraries + foreach ($autoload['libraries'] as $item) + { + $this->library($item); + } + + // Load the model class. + if (in_array('model', $autoload['libraries'])) + { + $this->model(); + $autoload['libraries'] = array_diff($autoload['libraries'], array('model')); + } + } + } + + // -------------------------------------------------------------------- + + /** + * Assign to Models + * + * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) + * will be available to models, if any exist. + * + * @access private + * @param object + * @return array + */ + function _ci_assign_to_models() + { + if (count($this->_ci_models) == 0) + { + return; + } + + if ($this->_ci_is_instance()) + { + $CI =& get_instance(); + foreach ($this->_ci_models as $model) + { + $CI->$model->_assign_libraries(); + } + } + else + { + foreach ($this->_ci_models as $model) + { + $this->$model->_assign_libraries(); + } + } + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @access private + * @param object + * @return array + */ + function _ci_object_to_array($object) + { + return (is_object($object)) ? get_object_vars($object) : $object; + } + + // -------------------------------------------------------------------- + + /** + * Determines whether we should use the CI instance or $this + * + * @access private + * @return bool + */ + function _ci_is_instance() + { + if ($this->_ci_is_php5 == TRUE) + { + return TRUE; + } + + global $CI; + return (is_object($CI)) ? TRUE : FALSE; + } + +} +?> \ No newline at end of file From aa7f769c1e6f46171f2fbc15f43428207c02abcb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 20 Dec 2007 14:38:56 +0000 Subject: [PATCH 0760/2544] fixed typo: $field_names[] vs $Ffield_names[] --- system/database/drivers/postgre/postgre_result.php | 2 +- system/database/drivers/sqlite/sqlite_result.php | 2 +- user_guide/changelog.html | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 9938d406..9fd2a7e9 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -65,7 +65,7 @@ function list_fields() $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) { - $Ffield_names[] = pg_field_name($this->result_id, $i); + $field_names[] = pg_field_name($this->result_id, $i); } return $field_names; diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 9a2e2b6e..caa16781 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -65,7 +65,7 @@ function list_fields() $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) { - $Ffield_names[] = sqlite_field_name($this->result_id, $i); + $field_names[] = sqlite_field_name($this->result_id, $i); } return $field_names; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f5f1ad28..033824b5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -86,6 +86,7 @@

    Version 1.5.5

  • Moved the safe mode and auth checks for the Email library into the constructor.
  • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
  • Fixed a bug in highlight_pharse() that caused an error with slashes.
  • +
  • Fixed a bug: $field_names[] vs $Ffield_names[] in postgre and sqlite drivers
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • Fixed a bug in the Email library where some timezones were calculated incorrectly.
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • From 41f60d44e37cc52d41a49d0d640f71761a82abe7 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 20 Dec 2007 20:09:22 +0000 Subject: [PATCH 0761/2544] Added the ability to pass an array of tables to the delete() statement in Active Record. --- system/database/DB_active_rec.php | 23 +++++++++++++++++++---- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index dfa0a3ef..d48d1c5b 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -925,11 +925,13 @@ function update($table = '', $set = NULL, $where = null, $limit = NULL) * Compiles a delete string and runs the query * * @access public - * @param string the table to retrieve the results from + * @param mixed the table(s) to delete from. String or array * @param mixed the where clause + * @param mixed the limit clause + * @param boolean * @return object */ - function delete($table = '', $where = '', $limit = NULL) + function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) { if ($table == '') { @@ -945,6 +947,16 @@ function delete($table = '', $where = '', $limit = NULL) $table = $this->ar_from[0]; } + if (is_array($table)) + { + foreach($table as $single_table) + { + $this->delete($this->dbprefix.$single_table, $where, $limit, FALSE); + } + $this->_reset_write(); + return; + } + if ($where != '') { $this->where($where); @@ -963,10 +975,13 @@ function delete($table = '', $where = '', $limit = NULL) } return FALSE; } - + $sql = $this->_delete($this->dbprefix.$table, $this->ar_where, $this->ar_limit); - $this->_reset_write(); + if ($reset_data) + { + $this->_reset_write(); + } return $this->query($sql); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 033824b5..3fbac474 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@

    Version 1.5.5

  • Added 'random' as an order_by() option in Active Record.
  • Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record.
  • Added support for limit() into update() and delete() statements in Active Record.
  • +
  • Added the ability to pass an array of tables to the delete() statement in Active Record.
  • Added titles to all user manual pages.
  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d938b5df..e7c823fd 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -623,14 +623,16 @@

    $this->db->delete();

    The first parameter is the table name, the second is the where clause. You can also use the where() or or_where() functions instead of passing the data to the second parameter of the function:

    - -$this->db->where('id', $id);
    -$this->db->delete('mytable'); -

    -// Produces:
    -// DELETE FROM mytable
    -// WHERE id = $id
    - +

    $this->db->where('id', $id);
    + $this->db->delete('mytable');
    +
    + // Produces:
    + // DELETE FROM mytable
    + // WHERE id = $id

    +

    An array of table names can be passed into delete() if you would like to delete data from more then 1 table.

    +

    $tables = array('table1', 'table2', 'table3');
    +$this->db->where('id', '5');
    +$this->db->delete($tables);

    Note: All values are escaped automatically producing safer queries.

    From 0a64f440ea25495dd96c6a5fd00d315077029f89 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 21 Dec 2007 05:27:44 +0000 Subject: [PATCH 0762/2544] blackBerry to blackberry --- system/application/config/user_agents.php | 204 +++++++++++----------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/system/application/config/user_agents.php b/system/application/config/user_agents.php index 6fa7b4a7..08a665f9 100644 --- a/system/application/config/user_agents.php +++ b/system/application/config/user_agents.php @@ -1,103 +1,103 @@ - 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - '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( - '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', - 'Mozilla' => 'Mozilla', - 'Safari' => 'Safari', - 'Konqueror' => 'Konqueror', - 'icab' => 'iCab', - 'Lynx' => 'Lynx', - 'Links' => 'Links', - 'hotjava' => 'HotJava', - 'amaya' => 'Amaya', - 'IBrowse' => 'IBrowse' - ); - -$mobiles = array( - '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' - ); - -// 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' - ); - - + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + '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( + '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', + 'Mozilla' => 'Mozilla', + 'Safari' => 'Safari', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' + ); + +$mobiles = array( + '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' + ); + +// 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' + ); + + ?> \ No newline at end of file From fac8042f055048d83414d72a18fc0d70ec7d3ddf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 21 Dec 2007 14:59:26 +0000 Subject: [PATCH 0763/2544] Added Zip Encoding Class to the table of contents of the userguide. --- user_guide/changelog.html | 3 ++- user_guide/toc.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3fbac474..7bdc3da2 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -108,7 +108,8 @@

    Version 1.5.5

  • Fixed a typo in the String Helper (uniquid changed to uniqid)
  • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
  • Fixed a typo in the table library docs.
  • -
  • Moved part of the userguide menu javascript to an external file.
  • +
  • Moved part of the userguide menu javascript to an external file.
  • +
  • Added Zip Encoding Class to the table of contents of the userguide.
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • diff --git a/user_guide/toc.html b/user_guide/toc.html index 125b506c..3f6b16e4 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -144,6 +144,7 @@

    Class Reference

  • User Agent Class
  • Validation Class
  • XML-RPC Class
  • +
  • Zip Encoding Class
  • From 4e387c30919569814e912f8136280fc1433a05f3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 22 Dec 2007 16:41:29 +0000 Subject: [PATCH 0764/2544] typos fixes --- user_guide/changelog.html | 4 +--- user_guide/helpers/file_helper.html | 2 +- user_guide/libraries/validation.html | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7bdc3da2..91875890 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -103,11 +103,9 @@

    Version 1.5.5

  • Fixed a typo in the image language file "suppor" to "support".
  • Fixed an example for XML RPC.
  • Fixed an example of accept_charset() in the User Agent Library.
  • -
  • Fixed a missing "?>" in the smiley helper.
  • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
  • Fixed a typo in the String Helper (uniquid changed to uniqid)
  • -
  • Fixed a typo in the DocBlock comment for unset_userdata() in Session.
  • -
  • Fixed a typo in the table library docs.
  • +
  • Fixed assorted user guide typos.
  • Moved part of the userguide menu javascript to an external file.
  • Added Zip Encoding Class to the table of contents of the userguide.
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 815b7fd2..da8337cb 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -79,7 +79,7 @@

    read_file('path')

    Note: The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index.

    -

    If you server is running an open_basedir restriction this function +

    If your server is running an open_basedir restriction this function might not work if you are trying to access a file above the calling script.

    write_file('path', $data)

    diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index b63c3e1c..90ff0c12 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -675,7 +675,7 @@

    set_select()

    <select name="myselect">
    <option value="one" <?= $this->validation->set_select('myselect', 'one'); ?> >One</option>
    -<option value="two" <?= $this->validation->set_select('myselect', 'two'); ?> >Three</option>
    +<option value="two" <?= $this->validation->set_select('myselect', 'two'); ?> >Two</option>
    <option value="three" <?= $this->validation->set_select('myselect', 'three'); ?> >Three</option>
    </select>
    From 4a969bb208c1fc955d86b0b2c73b1af2689323fe Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 22 Dec 2007 19:56:04 +0000 Subject: [PATCH 0765/2544] typo --- user_guide/libraries/image_lib.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 8dddcf0a..83dc8b3c 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -79,7 +79,7 @@

    Image Manipulation Class

    Initializing the Class

    Like most other classes in CodeIgniter, the image class is initialized in your controller -using the $this->load_library function:

    +using the $this->load->library function:

    $this->load->library('image_lib');

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    From 7184f342863b7056437ce441a4fed135128cd8f6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 26 Dec 2007 14:47:10 +0000 Subject: [PATCH 0766/2544] example fix --- user_guide/general/routing.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 15ba73ce..f7f93c83 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -114,14 +114,14 @@

    Examples

    Here are a few routing examples:

    $route['journals'] = "blogs"; -

    Any URL containing the word "journals" in the first segment will be remapped to the "blogs" class.

    +

    A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.

    $route['blog/joe'] = "blogs/users/34"; -

    Any URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    +

    A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    $route['product/:any'] = "catalog/product_lookup"; -

    Any URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    +

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    Important: Do not use leading/trailing slashes.

    From 5e12894eb97cc902892b7c4de79bec55772f7b83 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 28 Dec 2007 21:33:03 +0000 Subject: [PATCH 0767/2544] Added the ability to use aliases with joins in Active Record. --- system/database/DB_active_rec.php | 107 ++++++++++++++++++++++++++---- user_guide/changelog.html | 1 + 2 files changed, 95 insertions(+), 13 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index d48d1c5b..4bf3098d 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -42,7 +42,7 @@ class CI_DB_active_record extends CI_DB_driver { var $ar_orderby = array(); var $ar_set = array(); var $ar_wherein = array(); - + var $ar_aliased_tables = array(); /** @@ -103,8 +103,10 @@ function from($from) { foreach ((array)$from as $val) { + $this->_track_aliases($val); $this->ar_from[] = $this->dbprefix.$val; } + return $this; } @@ -137,11 +139,6 @@ function join($table, $cond, $type = '') } } - if ($this->dbprefix) - { - $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); - } - // If a DB prefix is used we might need to add it to the column names if ($this->dbprefix) { @@ -150,8 +147,11 @@ function join($table, $cond, $type = '') // Next we add the prefixes to the condition $cond = preg_replace('|([\w\.]+)([\W\s]+)(.+)|', $this->dbprefix . "$1$2" . $this->dbprefix . "$3", $cond); - } - + + $this->_track_aliases($table); + + } + $this->ar_join[] = $type.'JOIN '.$this->dbprefix.$table.' ON '.$cond; return $this; } @@ -511,7 +511,7 @@ function group_by($by) $val = trim($val); if ($val != '') - $this->ar_groupby[] = $val; + $this->ar_groupby[] = $this->dbprefix.$val; } return $this; } @@ -713,6 +713,7 @@ function get($table = '', $limit = null, $offset = null) { if ($table != '') { + $this->_track_aliases($table); $this->from($table); } @@ -744,6 +745,7 @@ function count_all_results($table = '') { if ($table != '') { + $this->_track_aliases($table); $this->from($table); } @@ -778,6 +780,7 @@ function get_where($table = '', $where = null, $limit = null, $offset = null) { if ($table != '') { + $this->_track_aliases($table); $this->from($table); } @@ -871,7 +874,7 @@ function insert($table = '', $set = NULL) * @param mixed the where clause * @return object */ - function update($table = '', $set = NULL, $where = null, $limit = NULL) + function update($table = '', $set = NULL, $where = NULL, $limit = NULL) { if ( ! is_null($set)) { @@ -1020,6 +1023,63 @@ function _has_operator($str) // -------------------------------------------------------------------- + /** + * Track Aliases + * + * Used to track SQL statements written with aliased tables. + * + * @access private + * @param string The table to inspect + * @return string + */ + function _track_aliases($table) + { + // if a table alias is used we can recognize it by a space + if (strpos($table, " ") !== FALSE) + { + // if the alias is written with the AS keyowrd, get it out + $table = preg_replace('/AS/i', '', $table); + + $this->ar_aliased_tables[] = trim(strrchr($table, " ") . '.'); + } + + return $this->dbprefix.$table; + } + + // -------------------------------------------------------------------- + + /** + * Filter Table Aliases + * + * Intelligently removes database prefixes from aliased tables + * + * @access private + * @param array An array of compiled SQL + * @return array Cleaned up statement with aliases accounted for + */ + function _filter_table_aliases($statements) + { + $filter_tables_with_aliases = array(); + + foreach ($statements as $statement) + { + $tables_with_dbprefix = array(); + + foreach ($this->ar_aliased_tables as $k => $v) + { + $tables_with_dbprefix[$k] = '/'.$this->dbprefix.str_replace('.', '', $v).'\./'; + } + + $statement = preg_replace($tables_with_dbprefix, $this->ar_aliased_tables, $statement); + + $filter_tables_with_aliases[] = $statement; + } + + return $filter_tables_with_aliases; + } + + // -------------------------------------------------------------------- + /** * Compile the SELECT statement * @@ -1047,9 +1107,19 @@ function _compile_select($select_override = FALSE) } if (count($this->ar_join) > 0) - { + { $sql .= "\n"; - $sql .= implode("\n", $this->ar_join); + + // special consideration for table aliases + if (count($this->ar_aliased_tables) > 0 && $this->dbprefix) + { + $sql .= implode("\n", $this->_filter_table_aliases($this->ar_join)); + } + else + { + $sql .= implode("\n", $this->ar_join); + } + } if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) @@ -1071,8 +1141,18 @@ function _compile_select($select_override = FALSE) if (count($this->ar_groupby) > 0) { + $sql .= "\nGROUP BY "; - $sql .= implode(', ', $this->ar_groupby); + + // special consideration for table aliases + if (count($this->ar_aliased_tables) > 0 && $this->dbprefix) + { + $sql .= implode(", ", $this->_filter_table_aliases($this->ar_groupby)); + } + else + { + $sql .= implode(', ', $this->ar_groupby); + } } if (count($this->ar_having) > 0) @@ -1154,6 +1234,7 @@ function _reset_select() $this->ar_order = FALSE; $this->ar_orderby = array(); $this->ar_wherein = array(); + $this->ar_aliased_tables = array(); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 91875890..d8bdc799 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,6 +82,7 @@

    Version 1.5.5

  • Added quotes_to_entities() function to string helper.
  • Added form_reset() function to form helper.
  • Added count_all_results() function to Active Record.
  • +
  • Added the ability to use aliases with joins in Active Record.
  • Added a language entry for valid_ip validation error.
  • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • From 9805f61a0aca60f3d01e89d1f3d66a2ce9ff3d83 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 31 Dec 2007 16:02:32 +0000 Subject: [PATCH 0768/2544] Fixed a bug in Validation where individual error messages for checkboxes wasn't supported. --- system/libraries/Validation.php | 10 ++++++++-- user_guide/changelog.html | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 575c5262..468f2ad4 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -228,8 +228,14 @@ function run() $line = $this->_error_messages['isset']; } - $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $this->_error_array[] = sprintf($line, $field); + // Build the error message + $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $message = sprintf($line, $mfield); + + // Set the error variable. Example: $this->username_error + $error = $field.'_error'; + $this->$error = $this->_error_prefix.$message.$this->_error_suffix; + $this->_error_array[] = $message; } continue; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d8bdc799..152dd481 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -92,6 +92,7 @@

    Version 1.5.5

  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • Fixed a bug in the Email library where some timezones were calculated incorrectly.
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • +
  • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
  • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
  • Fixed a bug in database driver where num_rows property wasn't getting updated.
  • Fixed a bug in captcha calling an invalid PHP function.
  • From 848b77685de0346da3f9fb8614e59f7d11552e61 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 31 Dec 2007 16:43:05 +0000 Subject: [PATCH 0769/2544] Fixed a bug in _object_to_array that broke some types of inserts and updates. --- system/database/DB_active_rec.php | 4 +++- user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 4bf3098d..b9594050 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1202,7 +1202,9 @@ function _object_to_array($object) $array = array(); foreach (get_object_vars($object) as $key => $val) { - if ( ! is_object($val) AND ! is_array($val)) + // There are some built in keys we need to ignore for this conversion + if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table') + { $array[$key] = $val; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 152dd481..3c234654 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -99,6 +99,7 @@

    Version 1.5.5

  • Fixed a bug in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
  • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
  • Fixed a bug that was making validation callbacks required even when not set as such.
  • +
  • Fixed a bug in _object_to_array that broke some types of inserts and updates.
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • From a0fa90b1bbb61d47bcc9bc95d983e66dfc8732dd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 1 Jan 2008 15:59:47 +0000 Subject: [PATCH 0770/2544] Fixed a bug in get_filenames() in the File Helper where the array wasn't cleared after each call. --- system/helpers/file_helper.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 18798fdf..d07d35f9 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -156,7 +156,7 @@ function delete_files($path, $del_dir = FALSE, $level = 0) */ function get_filenames($source_dir, $include_path = FALSE) { - static $_filedata = array(); + $_filedata = array(); if ($fp = @opendir($source_dir)) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3c234654..b28ec8c4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -100,6 +100,7 @@

    Version 1.5.5

  • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
  • Fixed a bug that was making validation callbacks required even when not set as such.
  • Fixed a bug in _object_to_array that broke some types of inserts and updates.
  • +
  • Fixed a bug in get_filenames() in the File Helper where the array wasn't cleared after each call.
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • From 032a5c0b61746e1dd82e400ad8ac639f92d3788c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 2 Jan 2008 21:51:31 +0000 Subject: [PATCH 0771/2544] Documented distinct() in Active Record. --- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b28ec8c4..8fa74a13 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@

    Version 1.5.5

  • Added a check for NULL fields in the MySQL database backup utility.
  • Documented the timezones() function in the Date Helper.
  • Documented unset_userdata in the Session class.
  • +
  • Documented distinct() in Active Record.
  • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
  • Added a few additional mime type variations for CSV.
  • Added strip_quotes() function to string helper.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index e7c823fd..d4310164 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -370,8 +370,15 @@

    $this->db->group_by();



    // Produces: GROUP BY title, date
    -

    Note: group_by() was formerly known as groupby(), which has been deprecated.

    + +

    $this->db->distinct();
    +

    +

    Adds the "DISTINCT" keyword to to a query

    +

    $this->db->distinct();
    + $this->db->get('table');
    +
    + // Produces: SELECT DISTINCT * FROM table

    $this->db->having();

    Permits you to write the HAVING portion of your query:

    From f3e8a3508a4c9bfc203ce861a73e989dc4771f49 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 4 Jan 2008 14:30:38 +0000 Subject: [PATCH 0772/2544] Added form_fieldset(), form_fieldset_close(), and form_label() to form helper. --- system/helpers/form_helper.php | 524 ++++++++++++++++++++++++++++++++- 1 file changed, 523 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a23d4c6d..e591eb74 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1 +1,523 @@ -config->site_url($action).'"'; if ( ! isset($attributes['method'])) { $form .= ' method="post"'; } if (is_array($attributes) AND count($attributes) > 0) { foreach ($attributes as $key => $val) { $form .= ' '.$key.'="'.$val.'"'; } } $form .= '>'; if (is_array($hidden) AND count($hidden > 0)) { $form .= form_hidden($hidden); } return $form; } // ------------------------------------------------------------------------ /** * Form Declaration - Multipart type * * Creates the opening portion of the form, but with "multipart/form-data". * * @access public * @param string the URI segments of the form destination * @param array a key/value pair of attributes * @param array a key/value pair hidden data * @return string */ function form_open_multipart($action, $attributes = array(), $hidden = array()) { $attributes['enctype'] = 'multipart/form-data'; return form_open($action, $attributes, $hidden); } // ------------------------------------------------------------------------ /** * Hidden Input Field * * Generates hidden fields. You can pass a simple key/value string or an associative * array with multiple values. * * @access public * @param mixed * @param string * @return string */ function form_hidden($name, $value = '') { if ( ! is_array($name)) { return ''; } $form = ''; foreach ($name as $name => $value) { $form .= ''; } return $form; } // ------------------------------------------------------------------------ /** * Text Input Field * * @access public * @param mixed * @param string * @param string * @return string */ function form_input($data = '', $value = '', $extra = '') { $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); return "\n"; } // ------------------------------------------------------------------------ /** * Password Field * * Identical to the input function but adds the "password" type * * @access public * @param mixed * @param string * @param string * @return string */ function form_password($data = '', $value = '', $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'password'; return form_input($data, $value, $extra); } // ------------------------------------------------------------------------ /** * Upload Field * * Identical to the input function but adds the "file" type * * @access public * @param mixed * @param string * @param string * @return string */ function form_upload($data = '', $value = '', $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'file'; return form_input($data, $value, $extra); } // ------------------------------------------------------------------------ /** * Textarea field * * @access public * @param mixed * @param string * @param string * @return string */ function form_textarea($data = '', $value = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } return "\n"; } // ------------------------------------------------------------------------ /** * Drop-down Menu * * @access public * @param string * @param array * @param string * @param string * @return string */ function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') { if ($extra != '') $extra = ' '.$extra; $form = ''; return $form; } // ------------------------------------------------------------------------ /** * Checkbox Field * * @access public * @param mixed * @param string * @param bool * @param string * @return string */ function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); if (is_array($data) AND array_key_exists('checked', $data)) { $checked = $data['checked']; if ($checked == FALSE) { unset($data['checked']); } else { $data['checked'] = 'checked'; } } if ($checked == TRUE) $defaults['checked'] = 'checked'; else unset($defaults['checked']); return "\n"; } // ------------------------------------------------------------------------ /** * Radio Button * * @access public * @param mixed * @param string * @param bool * @param string * @return string */ function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') { if ( ! is_array($data)) { $data = array('name' => $data); } $data['type'] = 'radio'; return form_checkbox($data, $value, $checked, $extra); } // ------------------------------------------------------------------------ /** * Submit Button * * @access public * @param mixed * @param string * @param string * @return string */ function form_submit($data = '', $value = '', $extra = '') { $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); return "\n"; } // ------------------------------------------------------------------------ /** * Reset Button * * @access public * @param mixed * @param string * @param string * @return string */ function form_reset($data = '', $value = '', $extra = '') { $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); return "\n"; } // ------------------------------------------------------------------------ /** * Form Close Tag * * @access public * @param string * @return string */ function form_close($extra = '') { return "\n".$extra; } // ------------------------------------------------------------------------ /** * Form Prep * * Formats text so that it can be safely placed in a form field in the event it has HTML tags. * * @access public * @param string * @return string */ function form_prep($str = '') { if ($str === '') { return ''; } $temp = '__TEMP_AMPERSANDS__'; // Replace entities to temporary markers so that // htmlspecialchars won't mess them up $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); $str = htmlspecialchars($str); // In case htmlspecialchars misses these. $str = str_replace(array("'", '"'), array("'", """), $str); // Decode the temp markers back to entities $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); $str = preg_replace("/$temp(\w+);/","&\\1;",$str); return $str; } // ------------------------------------------------------------------------ /** * Parse the form attributes * * Helper function used by some of the form helpers * * @access private * @param array * @param array * @return string */ function parse_form_attributes($attributes, $default) { if (is_array($attributes)) { foreach ($default as $key => $val) { if (isset($attributes[$key])) { $default[$key] = $attributes[$key]; unset($attributes[$key]); } } if (count($attributes) > 0) { $default = array_merge($default, $attributes); } } $att = ''; foreach ($default as $key => $val) { if ($key == 'value') { $val = form_prep($val); } $att .= $key . '="' . $val . '" '; } return $att; } ?> \ No newline at end of file +config->site_url($action).'"'; + + if ( ! isset($attributes['method'])) + { + $form .= ' method="post"'; + } + + if (is_array($attributes) AND count($attributes) > 0) + { + foreach ($attributes as $key => $val) + { + $form .= ' '.$key.'="'.$val.'"'; + } + } + + $form .= '>'; + + if (is_array($hidden) AND count($hidden > 0)) + { + $form .= form_hidden($hidden); + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Form Declaration - Multipart type + * + * Creates the opening portion of the form, but with "multipart/form-data". + * + * @access public + * @param string the URI segments of the form destination + * @param array a key/value pair of attributes + * @param array a key/value pair hidden data + * @return string + */ +function form_open_multipart($action, $attributes = array(), $hidden = array()) +{ + $attributes['enctype'] = 'multipart/form-data'; + return form_open($action, $attributes, $hidden); +} + +// ------------------------------------------------------------------------ + +/** + * Hidden Input Field + * + * Generates hidden fields. You can pass a simple key/value string or an associative + * array with multiple values. + * + * @access public + * @param mixed + * @param string + * @return string + */ +function form_hidden($name, $value = '') +{ + if ( ! is_array($name)) + { + return ''; + } + + $form = ''; + foreach ($name as $name => $value) + { + $form .= ''; + } + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Text Input Field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_input($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Password Field + * + * Identical to the input function but adds the "password" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_password($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'password'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Upload Field + * + * Identical to the input function but adds the "file" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_upload($data = '', $value = '', $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'file'; + return form_input($data, $value, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Textarea field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_textarea($data = '', $value = '', $extra = '') +{ + $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); + + if ( ! is_array($data) OR ! isset($data['value'])) + { + $val = $value; + } + else + { + $val = $data['value']; + unset($data['value']); // textareas don't use the value attribute + } + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Drop-down Menu + * + * @access public + * @param string + * @param array + * @param string + * @param string + * @return string + */ +function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') +{ + if ($extra != '') $extra = ' '.$extra; + + $form = ''; + + return $form; +} + +// ------------------------------------------------------------------------ + +/** + * Checkbox Field + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_checkbox($data = '', $value = '', $checked = TRUE, $extra = '') +{ + $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + if (is_array($data) AND array_key_exists('checked', $data)) + { + $checked = $data['checked']; + + if ($checked == FALSE) + { + unset($data['checked']); + } + else + { + $data['checked'] = 'checked'; + } + } + + if ($checked == TRUE) + $defaults['checked'] = 'checked'; + else + unset($defaults['checked']); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Radio Button + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +function form_radio($data = '', $value = '', $checked = TRUE, $extra = '') +{ + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'radio'; + return form_checkbox($data, $value, $checked, $extra); +} + +// ------------------------------------------------------------------------ + +/** + * Submit Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_submit($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Reset Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +function form_reset($data = '', $value = '', $extra = '') +{ + $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return "\n"; +} + +// ------------------------------------------------------------------------ + +/** + * Form Label Tag + * + * @access public + * @param string The text to appear onscreen + * @param string The id the label applies to + * @param string Additional attributes + * @return string + */ +function form_label($label_text = '', $id = '', $attributes = array()) +{ + + $label = ' 0) + { + foreach ($attributes as $key => $val) + { + $label .= ' '.$key.'="'.$val.'"'; + } + } + + $label .= ">$label_text"; + + return $label; +} + +// ------------------------------------------------------------------------ +/** + * Fieldset Tag + * + * Used to produce
    text. To close fieldset + * use form_fieldset_close() + * + * @access public + * @param string The legend text + * @param string Additional attributes + * @return string + */ +function form_fieldset($legend_text = '', $attributes = array()) +{ + + $fieldset = " 0) + { + foreach ($attributes as $key => $val) + { + $fieldset .= ' '.$key.'="'.$val.'"'; + } + } + + $fieldset .= ">\n"; + + if ($legend_text != '') + { + $fieldset .= "$legend_text\n"; + } + + + + return $fieldset; +} + +// ------------------------------------------------------------------------ + +/** + * Fieldset Close Tag + * + * @access public + * @param string + * @return string + */ +function form_fieldset_close($extra = '') +{ + return "
    \n".$extra; +} + +// ------------------------------------------------------------------------ + +/** + * Form Close Tag + * + * @access public + * @param string + * @return string + */ +function form_close($extra = '') +{ + return "\n".$extra; +} + +// ------------------------------------------------------------------------ + +/** + * Form Prep + * + * Formats text so that it can be safely placed in a form field in the event it has HTML tags. + * + * @access public + * @param string + * @return string + */ +function form_prep($str = '') +{ + if ($str === '') + { + return ''; + } + + $temp = '__TEMP_AMPERSANDS__'; + + // Replace entities to temporary markers so that + // htmlspecialchars won't mess them up + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + $str = htmlspecialchars($str); + + // In case htmlspecialchars misses these. + $str = str_replace(array("'", '"'), array("'", """), $str); + + // Decode the temp markers back to entities + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;",$str); + + return $str; +} + +// ------------------------------------------------------------------------ + +/** + * Parse the form attributes + * + * Helper function used by some of the form helpers + * + * @access private + * @param array + * @param array + * @return string + */ +function parse_form_attributes($attributes, $default) +{ + if (is_array($attributes)) + { + foreach ($default as $key => $val) + { + if (isset($attributes[$key])) + { + $default[$key] = $attributes[$key]; + unset($attributes[$key]); + } + } + + if (count($attributes) > 0) + { + $default = array_merge($default, $attributes); + } + } + + $att = ''; + foreach ($default as $key => $val) + { + if ($key == 'value') + { + $val = form_prep($val); + } + + $att .= $key . '="' . $val . '" '; + } + + return $att; +} + +?> \ No newline at end of file From 402835cc53b2c3ee1b42f306aff2bcabf0bea33c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 4 Jan 2008 14:30:58 +0000 Subject: [PATCH 0773/2544] docs for form_fieldset(), form_fieldset_close(), and form_label() --- user_guide/helpers/form_helper.html | 387 +++++++++++++++++++++++++++- 1 file changed, 386 insertions(+), 1 deletion(-) diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 3cf6f3a6..82ee29a5 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1 +1,386 @@ - CodeIgniter User Guide : Form Helper

    CodeIgniter User Guide Version 1.5.4


    Form Helper

    The Form Helper file contains functions that assist in working with forms.

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('form');

    The following functions are available:

    form_open()

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you add form attributes and hidden input fields.

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable in the event your URLs ever change.

    Here's a simple example:

    echo form_open('email/send');

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send" />

    Adding Attributes

    Attributes can be added by passing an associative array to the second parameter, like this:

    $attributes = array('class' => 'email', 'id' => 'myform');

    echo form_open('email/send', $attributes);

    The above example would create a form similar to this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />

    Adding Hidden Input Fields

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    $hidden = array('username' => 'Joe', 'member_id' => '234');

    echo form_open('email/send', '', $hidden);

    The above example would create a form similar to this:

    <form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    <input type="hidden" name="username" value="Joe" />
    <input type="hidden" name="member_id" value="234" />

    form_open_multipart()

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, which is necessary if you would like to use the form to upload files with.

    form_hidden()

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    form_hidden('username', 'johndoe');

    // Would produce:

    <input type="hidden" name="username" value="johnodoe" />

    Or you can submit an associative array to create multiple fields:

    $data = array(
                  'name'  => 'John Doe',
                  'email' => 'john@example.com',
                  'url'   => 'http://www.example.com'
                );

    echo form_hidden($data);

    // Would produce:

    <input type="hidden" name="name" value="John Doe" />
    <input type="hidden" name="email" value="john@example.com" />
    <input type="hidden" name="url" value="http://www.example.com" />

    form_input()

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first and second parameter:

    echo form_input('username', 'johndoe');

    Or you can pass an associative array containing any data you wish your form to contain:

    $data = array(
                  'name'        => 'username',
                  'id'          => 'username',
                  'value'       => 'johndoe',
                  'maxlength'   => '100',
                  'size'        => '50',
                  'style'       => 'width:50%',
                );

    echo form_input($data);

    // Would produce:

    <input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter:

    $js = 'onClick="some_function()"';

    echo form_input('username', 'johndoe', $js);

    form_password()

    This function is identical in all respects to the form_input() function above except that is sets it as a "password" type.

    form_upload()

    This function is identical in all respects to the form_input() function above except that is sets it as a "file" type, allowing it to be used to upload files.

    form_textarea()

    This function is identical in all respects to the form_input() function above except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above example, you will instead specify "rows" and "cols".

    form_dropdown()

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the value you wish to be selected. Example:

    $options = array(
                      'small'  => 'Small Shirt',
                      'med'    => 'Medium Shirt',
                      'large'   => 'Large Shirt',
                      'xlarge' => 'Extra Large Shirt',
                    );

    echo form_dropdown('shirts', $options, 'large');

    // Would produce:

    <select name="shirts">
    <option value="small">Small Shirt</option>
    <option value="med">Medium Shirt</option>
    <option value="large" selected>Large Shirt</option>
    <option value="xlarge">Extra Large Shirt</option>
    </select>

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter:

    $js = 'onChange="some_function()"';

    echo form_dropdown('shirts', $options, 'large', $js);

    form_checkbox()

    Lets you generate a checkbox field. Simple example:

    echo form_checkbox('newsletter', 'accept', TRUE);

    // Would produce:

    <input type="checkbox" name="newsletter" value="accept" checked="checked" />

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    $data = array(
                  'name'        => 'newsletter',
                  'id'          => 'newsletter',
                  'value'       => 'accept',
                  'checked'     => TRUE,
                  'style'       => 'margin:10px',
                );

    echo form_checkbox($data);

    // Would produce:

    <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter:

    $js = 'onClick="some_function()"';

    echo form_checkbox('newsletter', 'accept', TRUE, $js)

    form_radio()

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    form_submit()

    Lets you generate a standard submit button. Simple example:

    echo form_submit('mysubmit', 'Submit Post!');

    // Would produce:

    <input type="submit" name="mysubmit" value="Submit Post!" />

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. The third parameter lets you add extra data to your form, like JavaScript.

    form_reset()

    Lets you generate a standard reset button. Use is identical to form_submit().

    form_close()

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it which will be added below the tag. For example:

    $string = "</div></div>";

    echo form_close($string);

    // Would produce:

    </form>
    </div></div>

    form_prep()

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    $string = 'Here is a string containing "quoted" text.';

    <input type="text" name="myform" value="$string" />

    Since the above string contains a set of quotes it will cause the form to break. The form_prep function converts HTML so that it can be used safely:

    <input type="text" name="myform" value="<?php echo form_prep($string); ?>" />

    Note: If you use any of the form helper functions listed in this page the form values will be prepped automatically, so there is no need to call this function. Use it only if you are creating your own form elements.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Form Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Form Helper

    + +

    The Form Helper file contains functions that assist in working with forms.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('form'); + +

    The following functions are available:

    + + + +

    form_open()

    + +

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +add form attributes and hidden input fields.

    + +

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable +in the event your URLs ever change.

    + +

    Here's a simple example:

    + +echo form_open('email/send'); + +

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send" /> + +

    Adding Attributes

    + +

    Attributes can be added by passing an associative array to the second parameter, like this:

    + + +$attributes = array('class' => 'email', 'id' => 'myform');
    +
    +echo form_open('email/send', $attributes);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> + +

    Adding Hidden Input Fields

    + +

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    + + +$hidden = array('username' => 'Joe', 'member_id' => '234');
    +
    +echo form_open('email/send', '', $hidden);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    +<input type="hidden" name="username" value="Joe" />
    +<input type="hidden" name="member_id" value="234" />
    + + +

    form_open_multipart()

    + +

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, +which is necessary if you would like to use the form to upload files with.

    + +

    form_hidden()

    + +

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    + +form_hidden('username', 'johndoe');
    +
    +// Would produce:

    +<input type="hidden" name="username" value="johnodoe" />
    + +

    Or you can submit an associative array to create multiple fields:

    + +$data = array(
    +              'name'  => 'John Doe',
    +              'email' => 'john@example.com',
    +              'url'   => 'http://www.example.com'
    +            );
    +
    +echo form_hidden($data);
    +
    +// Would produce:

    +<input type="hidden" name="name" value="John Doe" />
    +<input type="hidden" name="email" value="john@example.com" />
    +<input type="hidden" name="url" value="http://www.example.com" />
    + + + + +

    form_input()

    + +

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first +and second parameter:

    + +echo form_input('username', 'johndoe'); + +

    Or you can pass an associative array containing any data you wish your form to contain:

    + +$data = array(
    +              'name'        => 'username',
    +              'id'          => 'username',
    +              'value'       => 'johndoe',
    +              'maxlength'   => '100',
    +              'size'        => '50',
    +              'style'       => 'width:50%',
    +            );
    +
    +echo form_input($data);
    +
    +// Would produce:

    +<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    + +

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the +third parameter:

    + +$js = 'onClick="some_function()"';
    +
    +echo form_input('username', 'johndoe', $js);
    + +

    form_password()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "password" type.

    + +

    form_upload()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "file" type, allowing it to be used to upload files.

    + +

    form_textarea()

    + +

    This function is identical in all respects to the form_input() function above +except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above +example, you will instead specify "rows" and "cols".

    + + +

    form_dropdown()

    + +

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, +the second parameter will contain an associative array of options, and the third parameter will contain the +value you wish to be selected. Example:

    + +$options = array(
    +                  'small'  => 'Small Shirt',
    +                  'med'    => 'Medium Shirt',
    +                  'large'   => 'Large Shirt',
    +                  'xlarge' => 'Extra Large Shirt',
    +                );
    +
    +echo form_dropdown('shirts', $options, 'large');
    +
    +// Would produce:

    + +<select name="shirts">
    +<option value="small">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected>Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    + + +

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onChange="some_function()"';
    +
    +echo form_dropdown('shirts', $options, 'large', $js);
    + + +

    form_fieldset()

    + +

    Lets you generate fieldset/legend fields.

    +echo form_fieldset('Address Information');
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close(); +
    +
    +// Produces
    +<fieldset id="address_info"> +
    +<legend>Address Information</legend> +
    +<p>form content here</p> +
    +</fieldset>
    +

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    +

    $attributes = array('class' => 'address_info');
    + echo form_fieldset('Address Information', $attributes);
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close();
    +
    +// Produces
    +<fieldset id="address_info" class="address_info">
    +<legend>Address Information</legend>
    +<p>form content here</p>
    +</fieldset>

    +

    form_fieldset_close()

    +

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it + which will be added below the tag. For example:

    +$string = "</div></div>";
    +
    +echo fieldset_close($string);
    +
    +// Would produce:
    +</fieldset>
    +</div></div>
    +

    form_checkbox()

    +

    Lets you generate a checkbox field. Simple example:

    +echo form_checkbox('newsletter', 'accept', TRUE);
    +
    +// Would produce:
    +
    +<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    +

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    +

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    + +$data = array(
    +              'name'        => 'newsletter',
    +              'id'          => 'newsletter',
    +              'value'       => 'accept',
    +              'checked'     => TRUE,
    +              'style'       => 'margin:10px',
    +            );
    +
    +echo form_checkbox($data);
    +
    +// Would produce:

    +<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    + +

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onClick="some_function()"';
    +
    + echo form_checkbox('newsletter', 'accept', TRUE, $js)
    + + +

    form_radio()

    +

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    + + +

    form_submit()

    + +

    Lets you generate a standard submit button. Simple example:

    +echo form_submit('mysubmit', 'Submit Post!');
    +
    +// Would produce:
    +
    +<input type="submit" name="mysubmit" value="Submit Post!" />
    +

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. + The third parameter lets you add extra data to your form, like JavaScript.

    +

    form_label()

    +

    Lets you generate a <label>. Simple example:

    +echo form_label('What is your Name', 'username');
    +
    +// Would produce: +
    +<label id="username">What is your Name</label>
    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    $attributes = array(
    + 'class' => 'mycustomclass',
    + 'style' => 'color: #000;',
    +);
    + echo form_label('What is your Name', 'username', $attributes);
    +
    +// Would produce:
    +<label id="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    +

    form_reset()

    + +

    Lets you generate a standard reset button. Use is identical to form_submit().

    + +

    form_close()

    + +

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

    + +$string = "</div></div>";
    +
    +echo form_close($string);
    +
    +// Would produce:
    +
    +</form>
    +</div></div>
    + + + + + +

    form_prep()

    + +

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    + +$string = 'Here is a string containing "quoted" text.';
    +
    +<input type="text" name="myform" value="$string" />
    + +

    Since the above string contains a set of quotes it will cause the form to break. +The form_prep function converts HTML so that it can be used safely:

    + +<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> + +

    Note: If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this function. Use it only if you are +creating your own form elements.

    + + + + +
    + + + + + + + \ No newline at end of file From 4bbc5c7e832604a468681ea50511f114ef7fb1d5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 4 Jan 2008 17:00:42 +0000 Subject: [PATCH 0774/2544] d'oh! Incomplete example. --- user_guide/helpers/form_helper.html | 770 ++++++++++++++-------------- 1 file changed, 385 insertions(+), 385 deletions(-) diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 82ee29a5..c2659528 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1,386 +1,386 @@ - - - - -CodeIgniter User Guide : Form Helper - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Form Helper

    - -

    The Form Helper file contains functions that assist in working with forms.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('form'); - -

    The following functions are available:

    - - - -

    form_open()

    - -

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you -add form attributes and hidden input fields.

    - -

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable -in the event your URLs ever change.

    - -

    Here's a simple example:

    - -echo form_open('email/send'); - -

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send" /> - -

    Adding Attributes

    - -

    Attributes can be added by passing an associative array to the second parameter, like this:

    - - -$attributes = array('class' => 'email', 'id' => 'myform');
    -
    -echo form_open('email/send', $attributes);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> - -

    Adding Hidden Input Fields

    - -

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    - - -$hidden = array('username' => 'Joe', 'member_id' => '234');
    -
    -echo form_open('email/send', '', $hidden);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    -<input type="hidden" name="username" value="Joe" />
    -<input type="hidden" name="member_id" value="234" />
    - - -

    form_open_multipart()

    - -

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, -which is necessary if you would like to use the form to upload files with.

    - -

    form_hidden()

    - -

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    - -form_hidden('username', 'johndoe');
    -
    -// Would produce:

    -<input type="hidden" name="username" value="johnodoe" />
    - -

    Or you can submit an associative array to create multiple fields:

    - -$data = array(
    -              'name'  => 'John Doe',
    -              'email' => 'john@example.com',
    -              'url'   => 'http://www.example.com'
    -            );
    -
    -echo form_hidden($data);
    -
    -// Would produce:

    -<input type="hidden" name="name" value="John Doe" />
    -<input type="hidden" name="email" value="john@example.com" />
    -<input type="hidden" name="url" value="http://www.example.com" />
    - - - - -

    form_input()

    - -

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first -and second parameter:

    - -echo form_input('username', 'johndoe'); - -

    Or you can pass an associative array containing any data you wish your form to contain:

    - -$data = array(
    -              'name'        => 'username',
    -              'id'          => 'username',
    -              'value'       => 'johndoe',
    -              'maxlength'   => '100',
    -              'size'        => '50',
    -              'style'       => 'width:50%',
    -            );
    -
    -echo form_input($data);
    -
    -// Would produce:

    -<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    - -

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the -third parameter:

    - -$js = 'onClick="some_function()"';
    -
    -echo form_input('username', 'johndoe', $js);
    - -

    form_password()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "password" type.

    - -

    form_upload()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "file" type, allowing it to be used to upload files.

    - -

    form_textarea()

    - -

    This function is identical in all respects to the form_input() function above -except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above -example, you will instead specify "rows" and "cols".

    - - -

    form_dropdown()

    - -

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, -the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. Example:

    - -$options = array(
    -                  'small'  => 'Small Shirt',
    -                  'med'    => 'Medium Shirt',
    -                  'large'   => 'Large Shirt',
    -                  'xlarge' => 'Extra Large Shirt',
    -                );
    -
    -echo form_dropdown('shirts', $options, 'large');
    -
    -// Would produce:

    - -<select name="shirts">
    -<option value="small">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    -<option value="large" selected>Large Shirt</option>
    -<option value="xlarge">Extra Large Shirt</option>
    -</select>
    - - -

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onChange="some_function()"';
    -
    -echo form_dropdown('shirts', $options, 'large', $js);
    - - -

    form_fieldset()

    - -

    Lets you generate fieldset/legend fields.

    -echo form_fieldset('Address Information');
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close(); -
    -
    -// Produces
    -<fieldset id="address_info"> -
    -<legend>Address Information</legend> -
    -<p>form content here</p> -
    -</fieldset>
    -

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    -

    $attributes = array('class' => 'address_info');
    - echo form_fieldset('Address Information', $attributes);
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close();
    -
    -// Produces
    -<fieldset id="address_info" class="address_info">
    -<legend>Address Information</legend>
    -<p>form content here</p>
    -</fieldset>

    -

    form_fieldset_close()

    -

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

    -$string = "</div></div>";
    -
    -echo fieldset_close($string);
    -
    -// Would produce:
    -</fieldset>
    -</div></div>
    -

    form_checkbox()

    -

    Lets you generate a checkbox field. Simple example:

    -echo form_checkbox('newsletter', 'accept', TRUE);
    -
    -// Would produce:
    -
    -<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    -

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    -

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    - -$data = array(
    -              'name'        => 'newsletter',
    -              'id'          => 'newsletter',
    -              'value'       => 'accept',
    -              'checked'     => TRUE,
    -              'style'       => 'margin:10px',
    -            );
    -
    -echo form_checkbox($data);
    -
    -// Would produce:

    -<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    - -

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onClick="some_function()"';
    -
    - echo form_checkbox('newsletter', 'accept', TRUE, $js)
    - - -

    form_radio()

    -

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    - - -

    form_submit()

    - -

    Lets you generate a standard submit button. Simple example:

    -echo form_submit('mysubmit', 'Submit Post!');
    -
    -// Would produce:
    -
    -<input type="submit" name="mysubmit" value="Submit Post!" />
    -

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

    -

    form_label()

    -

    Lets you generate a <label>. Simple example:

    -echo form_label('What is your Name', 'username');
    -
    -// Would produce: -
    -<label id="username">What is your Name</label>
    -

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    -

    $attributes = array(
    - 'class' => 'mycustomclass',
    - 'style' => 'color: #000;',
    -);
    - echo form_label('What is your Name', 'username', $attributes);
    -
    -// Would produce:
    -<label id="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    -

    form_reset()

    - -

    Lets you generate a standard reset button. Use is identical to form_submit().

    - -

    form_close()

    - -

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it -which will be added below the tag. For example:

    - -$string = "</div></div>";
    -
    -echo form_close($string);
    -
    -// Would produce:
    -
    -</form>
    -</div></div>
    - - - - - -

    form_prep()

    - -

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    - -$string = 'Here is a string containing "quoted" text.';
    -
    -<input type="text" name="myform" value="$string" />
    - -

    Since the above string contains a set of quotes it will cause the form to break. -The form_prep function converts HTML so that it can be used safely:

    - -<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> - -

    Note: If you use any of the form helper functions listed in this page the form -values will be prepped automatically, so there is no need to call this function. Use it only if you are -creating your own form elements.

    - - - - -
    - - - - - - + + + + +CodeIgniter User Guide : Form Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Form Helper

    + +

    The Form Helper file contains functions that assist in working with forms.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('form'); + +

    The following functions are available:

    + + + +

    form_open()

    + +

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +add form attributes and hidden input fields.

    + +

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable +in the event your URLs ever change.

    + +

    Here's a simple example:

    + +echo form_open('email/send'); + +

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send" /> + +

    Adding Attributes

    + +

    Attributes can be added by passing an associative array to the second parameter, like this:

    + + +$attributes = array('class' => 'email', 'id' => 'myform');
    +
    +echo form_open('email/send', $attributes);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> + +

    Adding Hidden Input Fields

    + +

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    + + +$hidden = array('username' => 'Joe', 'member_id' => '234');
    +
    +echo form_open('email/send', '', $hidden);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    +<input type="hidden" name="username" value="Joe" />
    +<input type="hidden" name="member_id" value="234" />
    + + +

    form_open_multipart()

    + +

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, +which is necessary if you would like to use the form to upload files with.

    + +

    form_hidden()

    + +

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    + +form_hidden('username', 'johndoe');
    +
    +// Would produce:

    +<input type="hidden" name="username" value="johnodoe" />
    + +

    Or you can submit an associative array to create multiple fields:

    + +$data = array(
    +              'name'  => 'John Doe',
    +              'email' => 'john@example.com',
    +              'url'   => 'http://www.example.com'
    +            );
    +
    +echo form_hidden($data);
    +
    +// Would produce:

    +<input type="hidden" name="name" value="John Doe" />
    +<input type="hidden" name="email" value="john@example.com" />
    +<input type="hidden" name="url" value="http://www.example.com" />
    + + + + +

    form_input()

    + +

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first +and second parameter:

    + +echo form_input('username', 'johndoe'); + +

    Or you can pass an associative array containing any data you wish your form to contain:

    + +$data = array(
    +              'name'        => 'username',
    +              'id'          => 'username',
    +              'value'       => 'johndoe',
    +              'maxlength'   => '100',
    +              'size'        => '50',
    +              'style'       => 'width:50%',
    +            );
    +
    +echo form_input($data);
    +
    +// Would produce:

    +<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    + +

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the +third parameter:

    + +$js = 'onClick="some_function()"';
    +
    +echo form_input('username', 'johndoe', $js);
    + +

    form_password()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "password" type.

    + +

    form_upload()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "file" type, allowing it to be used to upload files.

    + +

    form_textarea()

    + +

    This function is identical in all respects to the form_input() function above +except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above +example, you will instead specify "rows" and "cols".

    + + +

    form_dropdown()

    + +

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, +the second parameter will contain an associative array of options, and the third parameter will contain the +value you wish to be selected. Example:

    + +$options = array(
    +                  'small'  => 'Small Shirt',
    +                  'med'    => 'Medium Shirt',
    +                  'large'   => 'Large Shirt',
    +                  'xlarge' => 'Extra Large Shirt',
    +                );
    +
    +echo form_dropdown('shirts', $options, 'large');
    +
    +// Would produce:

    + +<select name="shirts">
    +<option value="small">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected>Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    + + +

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onChange="some_function()"';
    +
    +echo form_dropdown('shirts', $options, 'large', $js);
    + + +

    form_fieldset()

    + +

    Lets you generate fieldset/legend fields.

    +echo form_fieldset('Address Information');
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close(); +
    +
    +// Produces
    +<fieldset id="address_info"> +
    +<legend>Address Information</legend> +
    +<p>form content here</p> +
    +</fieldset>
    +

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    +

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    + echo form_fieldset('Address Information', $attributes);
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close();
    +
    +// Produces
    +<fieldset id="address_info" class="address_info">
    +<legend>Address Information</legend>
    +<p>form content here</p>
    +</fieldset>

    +

    form_fieldset_close()

    +

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it + which will be added below the tag. For example:

    +$string = "</div></div>";
    +
    +echo fieldset_close($string);
    +
    +// Would produce:
    +</fieldset>
    +</div></div>
    +

    form_checkbox()

    +

    Lets you generate a checkbox field. Simple example:

    +echo form_checkbox('newsletter', 'accept', TRUE);
    +
    +// Would produce:
    +
    +<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    +

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    +

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    + +$data = array(
    +              'name'        => 'newsletter',
    +              'id'          => 'newsletter',
    +              'value'       => 'accept',
    +              'checked'     => TRUE,
    +              'style'       => 'margin:10px',
    +            );
    +
    +echo form_checkbox($data);
    +
    +// Would produce:

    +<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    + +

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onClick="some_function()"';
    +
    + echo form_checkbox('newsletter', 'accept', TRUE, $js)
    + + +

    form_radio()

    +

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    + + +

    form_submit()

    + +

    Lets you generate a standard submit button. Simple example:

    +echo form_submit('mysubmit', 'Submit Post!');
    +
    +// Would produce:
    +
    +<input type="submit" name="mysubmit" value="Submit Post!" />
    +

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. + The third parameter lets you add extra data to your form, like JavaScript.

    +

    form_label()

    +

    Lets you generate a <label>. Simple example:

    +echo form_label('What is your Name', 'username');
    +
    +// Would produce: +
    +<label id="username">What is your Name</label>
    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    $attributes = array(
    + 'class' => 'mycustomclass',
    + 'style' => 'color: #000;',
    +);
    + echo form_label('What is your Name', 'username', $attributes);
    +
    +// Would produce:
    +<label id="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    +

    form_reset()

    + +

    Lets you generate a standard reset button. Use is identical to form_submit().

    + +

    form_close()

    + +

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

    + +$string = "</div></div>";
    +
    +echo form_close($string);
    +
    +// Would produce:
    +
    +</form>
    +</div></div>
    + + + + + +

    form_prep()

    + +

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    + +$string = 'Here is a string containing "quoted" text.';
    +
    +<input type="text" name="myform" value="$string" />
    + +

    Since the above string contains a set of quotes it will cause the form to break. +The form_prep function converts HTML so that it can be used safely:

    + +<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> + +

    Note: If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this function. Use it only if you are +creating your own form elements.

    + + + + +
    + + + + + + \ No newline at end of file From 4021b51750afb7e39dc0e5ea6e839c7da4e069ab Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 4 Jan 2008 22:26:12 +0000 Subject: [PATCH 0775/2544] added the ability to have multiple selected items in form_dropdown() --- system/helpers/form_helper.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index e591eb74..a67ea050 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -221,18 +221,24 @@ function form_textarea($data = '', $value = '', $extra = '') * @param string * @return string */ -function form_dropdown($name = '', $options = array(), $selected = '', $extra = '') +function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') { + if ( ! is_array($selected)) + { + $selected = array($selected); + } + if ($extra != '') $extra = ' '.$extra; - - $form = '\n"; foreach ($options as $key => $val) { $key = (string) $key; $val = (string) $val; - $sel = ($selected != $key) ? '' : ' selected="selected"'; + $sel = (in_array($key, $selected))?' selected="selected"':''; $form .= '\n"; } From 1a2cbdf2ec852bfe9b122ebf47fb6fb0216f38ca Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 4 Jan 2008 22:26:37 +0000 Subject: [PATCH 0776/2544] documented the ability to have multiple selected items in form_dropdown() --- user_guide/helpers/form_helper.html | 783 ++++++++++++++-------------- 1 file changed, 398 insertions(+), 385 deletions(-) diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index c2659528..62c1f68f 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1,386 +1,399 @@ - - - - -CodeIgniter User Guide : Form Helper - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.5.4

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Form Helper

    - -

    The Form Helper file contains functions that assist in working with forms.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('form'); - -

    The following functions are available:

    - - - -

    form_open()

    - -

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you -add form attributes and hidden input fields.

    - -

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable -in the event your URLs ever change.

    - -

    Here's a simple example:

    - -echo form_open('email/send'); - -

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send" /> - -

    Adding Attributes

    - -

    Attributes can be added by passing an associative array to the second parameter, like this:

    - - -$attributes = array('class' => 'email', 'id' => 'myform');
    -
    -echo form_open('email/send', $attributes);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> - -

    Adding Hidden Input Fields

    - -

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    - - -$hidden = array('username' => 'Joe', 'member_id' => '234');
    -
    -echo form_open('email/send', '', $hidden);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    -<input type="hidden" name="username" value="Joe" />
    -<input type="hidden" name="member_id" value="234" />
    - - -

    form_open_multipart()

    - -

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, -which is necessary if you would like to use the form to upload files with.

    - -

    form_hidden()

    - -

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    - -form_hidden('username', 'johndoe');
    -
    -// Would produce:

    -<input type="hidden" name="username" value="johnodoe" />
    - -

    Or you can submit an associative array to create multiple fields:

    - -$data = array(
    -              'name'  => 'John Doe',
    -              'email' => 'john@example.com',
    -              'url'   => 'http://www.example.com'
    -            );
    -
    -echo form_hidden($data);
    -
    -// Would produce:

    -<input type="hidden" name="name" value="John Doe" />
    -<input type="hidden" name="email" value="john@example.com" />
    -<input type="hidden" name="url" value="http://www.example.com" />
    - - - - -

    form_input()

    - -

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first -and second parameter:

    - -echo form_input('username', 'johndoe'); - -

    Or you can pass an associative array containing any data you wish your form to contain:

    - -$data = array(
    -              'name'        => 'username',
    -              'id'          => 'username',
    -              'value'       => 'johndoe',
    -              'maxlength'   => '100',
    -              'size'        => '50',
    -              'style'       => 'width:50%',
    -            );
    -
    -echo form_input($data);
    -
    -// Would produce:

    -<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    - -

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the -third parameter:

    - -$js = 'onClick="some_function()"';
    -
    -echo form_input('username', 'johndoe', $js);
    - -

    form_password()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "password" type.

    - -

    form_upload()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "file" type, allowing it to be used to upload files.

    - -

    form_textarea()

    - -

    This function is identical in all respects to the form_input() function above -except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above -example, you will instead specify "rows" and "cols".

    - - -

    form_dropdown()

    - -

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, -the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. Example:

    - -$options = array(
    -                  'small'  => 'Small Shirt',
    -                  'med'    => 'Medium Shirt',
    -                  'large'   => 'Large Shirt',
    -                  'xlarge' => 'Extra Large Shirt',
    -                );
    -
    -echo form_dropdown('shirts', $options, 'large');
    -
    -// Would produce:

    - -<select name="shirts">
    -<option value="small">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    -<option value="large" selected>Large Shirt</option>
    -<option value="xlarge">Extra Large Shirt</option>
    -</select>
    - - -

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onChange="some_function()"';
    -
    -echo form_dropdown('shirts', $options, 'large', $js);
    - - -

    form_fieldset()

    - -

    Lets you generate fieldset/legend fields.

    -echo form_fieldset('Address Information');
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close(); -
    -
    -// Produces
    -<fieldset id="address_info"> -
    -<legend>Address Information</legend> -
    -<p>form content here</p> -
    -</fieldset>
    -

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    -

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    - echo form_fieldset('Address Information', $attributes);
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close();
    -
    -// Produces
    -<fieldset id="address_info" class="address_info">
    -<legend>Address Information</legend>
    -<p>form content here</p>
    -</fieldset>

    -

    form_fieldset_close()

    -

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

    -$string = "</div></div>";
    -
    -echo fieldset_close($string);
    -
    -// Would produce:
    -</fieldset>
    -</div></div>
    -

    form_checkbox()

    -

    Lets you generate a checkbox field. Simple example:

    -echo form_checkbox('newsletter', 'accept', TRUE);
    -
    -// Would produce:
    -
    -<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    -

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    -

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    - -$data = array(
    -              'name'        => 'newsletter',
    -              'id'          => 'newsletter',
    -              'value'       => 'accept',
    -              'checked'     => TRUE,
    -              'style'       => 'margin:10px',
    -            );
    -
    -echo form_checkbox($data);
    -
    -// Would produce:

    -<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    - -

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onClick="some_function()"';
    -
    - echo form_checkbox('newsletter', 'accept', TRUE, $js)
    - - -

    form_radio()

    -

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    - - -

    form_submit()

    - -

    Lets you generate a standard submit button. Simple example:

    -echo form_submit('mysubmit', 'Submit Post!');
    -
    -// Would produce:
    -
    -<input type="submit" name="mysubmit" value="Submit Post!" />
    -

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

    -

    form_label()

    -

    Lets you generate a <label>. Simple example:

    -echo form_label('What is your Name', 'username');
    -
    -// Would produce: -
    -<label id="username">What is your Name</label>
    -

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    -

    $attributes = array(
    - 'class' => 'mycustomclass',
    - 'style' => 'color: #000;',
    -);
    - echo form_label('What is your Name', 'username', $attributes);
    -
    -// Would produce:
    -<label id="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    -

    form_reset()

    - -

    Lets you generate a standard reset button. Use is identical to form_submit().

    - -

    form_close()

    - -

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it -which will be added below the tag. For example:

    - -$string = "</div></div>";
    -
    -echo form_close($string);
    -
    -// Would produce:
    -
    -</form>
    -</div></div>
    - - - - - -

    form_prep()

    - -

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    - -$string = 'Here is a string containing "quoted" text.';
    -
    -<input type="text" name="myform" value="$string" />
    - -

    Since the above string contains a set of quotes it will cause the form to break. -The form_prep function converts HTML so that it can be used safely:

    - -<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> - -

    Note: If you use any of the form helper functions listed in this page the form -values will be prepped automatically, so there is no need to call this function. Use it only if you are -creating your own form elements.

    - - - - -
    - - - - - - + + + + +CodeIgniter User Guide : Form Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Form Helper

    + +

    The Form Helper file contains functions that assist in working with forms.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('form'); + +

    The following functions are available:

    + + + +

    form_open()

    + +

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +add form attributes and hidden input fields.

    + +

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable +in the event your URLs ever change.

    + +

    Here's a simple example:

    + +echo form_open('email/send'); + +

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send" /> + +

    Adding Attributes

    + +

    Attributes can be added by passing an associative array to the second parameter, like this:

    + + +$attributes = array('class' => 'email', 'id' => 'myform');
    +
    +echo form_open('email/send', $attributes);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" /> + +

    Adding Hidden Input Fields

    + +

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    + + +$hidden = array('username' => 'Joe', 'member_id' => '234');
    +
    +echo form_open('email/send', '', $hidden);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/www.your-site.com/index.php/email/send"  class="email"  id="myform" />
    +<input type="hidden" name="username" value="Joe" />
    +<input type="hidden" name="member_id" value="234" />
    + + +

    form_open_multipart()

    + +

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, +which is necessary if you would like to use the form to upload files with.

    + +

    form_hidden()

    + +

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    + +form_hidden('username', 'johndoe');
    +
    +// Would produce:

    +<input type="hidden" name="username" value="johnodoe" />
    + +

    Or you can submit an associative array to create multiple fields:

    + +$data = array(
    +              'name'  => 'John Doe',
    +              'email' => 'john@example.com',
    +              'url'   => 'http://www.example.com'
    +            );
    +
    +echo form_hidden($data);
    +
    +// Would produce:

    +<input type="hidden" name="name" value="John Doe" />
    +<input type="hidden" name="email" value="john@example.com" />
    +<input type="hidden" name="url" value="http://www.example.com" />
    + + + + +

    form_input()

    + +

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first +and second parameter:

    + +echo form_input('username', 'johndoe'); + +

    Or you can pass an associative array containing any data you wish your form to contain:

    + +$data = array(
    +              'name'        => 'username',
    +              'id'          => 'username',
    +              'value'       => 'johndoe',
    +              'maxlength'   => '100',
    +              'size'        => '50',
    +              'style'       => 'width:50%',
    +            );
    +
    +echo form_input($data);
    +
    +// Would produce:

    +<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    + +

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the +third parameter:

    + +$js = 'onClick="some_function()"';
    +
    +echo form_input('username', 'johndoe', $js);
    + +

    form_password()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "password" type.

    + +

    form_upload()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "file" type, allowing it to be used to upload files.

    + +

    form_textarea()

    + +

    This function is identical in all respects to the form_input() function above +except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above +example, you will instead specify "rows" and "cols".

    + + +

    form_dropdown()

    + +

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, +the second parameter will contain an associative array of options, and the third parameter will contain the +value you wish to be selected. You can also pass an array through the third parameter, and CodeIgniter will create a multiple select for you. Example:

    + +$options = array(
    +                  'small'  => 'Small Shirt',
    +                  'med'    => 'Medium Shirt',
    +                  'large'   => 'Large Shirt',
    +                  'xlarge' => 'Extra Large Shirt',
    +                );
    +
    +$shirts_on_sale = array('small', 'large');
    +
    +echo form_dropdown('shirts', $options, 'large');
    +
    +// Would produce:
    +
    +<select name="shirts">
    +<option value="small">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected="selected">Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    +
    +echo form_dropdown('shirts', $options, $shirts_on_sale);
    +
    +// Would produce:
    +
    +<select name="shirts" multiple="multiple">
    +<option value="small" selected="selected">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected="selected">Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    + + +

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onChange="some_function()"';
    +
    +echo form_dropdown('shirts', $options, 'large', $js);
    + + +

    form_fieldset()

    + +

    Lets you generate fieldset/legend fields.

    +echo form_fieldset('Address Information');
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close(); +
    +
    +// Produces
    +<fieldset id="address_info"> +
    +<legend>Address Information</legend> +
    +<p>form content here</p> +
    +</fieldset>
    +

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    +

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    + echo form_fieldset('Address Information', $attributes);
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close();
    +
    +// Produces
    +<fieldset id="address_info" class="address_info">
    +<legend>Address Information</legend>
    +<p>form content here</p>
    +</fieldset>

    +

    form_fieldset_close()

    +

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it + which will be added below the tag. For example:

    +$string = "</div></div>";
    +
    +echo fieldset_close($string);
    +
    +// Would produce:
    +</fieldset>
    +</div></div>
    +

    form_checkbox()

    +

    Lets you generate a checkbox field. Simple example:

    +echo form_checkbox('newsletter', 'accept', TRUE);
    +
    +// Would produce:
    +
    +<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    +

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    +

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    + +$data = array(
    +              'name'        => 'newsletter',
    +              'id'          => 'newsletter',
    +              'value'       => 'accept',
    +              'checked'     => TRUE,
    +              'style'       => 'margin:10px',
    +            );
    +
    +echo form_checkbox($data);
    +
    +// Would produce:

    +<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    + +

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onClick="some_function()"';
    +
    + echo form_checkbox('newsletter', 'accept', TRUE, $js)
    + + +

    form_radio()

    +

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    + + +

    form_submit()

    + +

    Lets you generate a standard submit button. Simple example:

    +echo form_submit('mysubmit', 'Submit Post!');
    +
    +// Would produce:
    +
    +<input type="submit" name="mysubmit" value="Submit Post!" />
    +

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. + The third parameter lets you add extra data to your form, like JavaScript.

    +

    form_label()

    +

    Lets you generate a <label>. Simple example:

    +echo form_label('What is your Name', 'username');
    +
    +// Would produce: +
    +<label id="username">What is your Name</label>
    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    $attributes = array(
    + 'class' => 'mycustomclass',
    + 'style' => 'color: #000;',
    +);
    + echo form_label('What is your Name', 'username', $attributes);
    +
    +// Would produce:
    +<label id="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    +

    form_reset()

    + +

    Lets you generate a standard reset button. Use is identical to form_submit().

    + +

    form_close()

    + +

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

    + +$string = "</div></div>";
    +
    +echo form_close($string);
    +
    +// Would produce:
    +
    +</form>
    +</div></div>
    + + + + + +

    form_prep()

    + +

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    + +$string = 'Here is a string containing "quoted" text.';
    +
    +<input type="text" name="myform" value="$string" />
    + +

    Since the above string contains a set of quotes it will cause the form to break. +The form_prep function converts HTML so that it can be used safely:

    + +<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> + +

    Note: If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this function. Use it only if you are +creating your own form elements.

    + + + + +
    + + + + + + \ No newline at end of file From a070db9c481346b4f9884bd32c3d1445a795f7a8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 5 Jan 2008 20:30:22 +0000 Subject: [PATCH 0777/2544] added strtolower into charset and lang test --- system/libraries/User_agent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 67a3c2b8..f80bb0bb 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -256,7 +256,7 @@ function _set_languages() { if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') { - $languages = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_LANGUAGE'])); + $languages = preg_replace('/(;q=.+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE']))); $this->languages = explode(',', $languages); } @@ -279,7 +279,7 @@ function _set_charsets() { if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') { - $charsets = preg_replace('/(;q=.+)/i', '', trim($_SERVER['HTTP_ACCEPT_CHARSET'])); + $charsets = preg_replace('/(;q=.+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET']))); $this->charsets = explode(',', $charsets); } From fd5c01a1c14f396bb63b3e2dce7dab2548a1cefa Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 6 Jan 2008 20:04:12 +0000 Subject: [PATCH 0778/2544] Fixed a bug in the upload library when allowed_files wasn't defined. --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index f804dcec..33ee9477 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -512,7 +512,7 @@ function is_image() */ function is_allowed_filetype() { - if (count($this->allowed_types) == 0) + if (count($this->allowed_types) == 0 || ! is_array($this->allowed_types)) { $this->set_error('upload_no_file_types'); return FALSE; From e4e603b1083242fd08fc84e2cb29e998dddaee0c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 9 Jan 2008 14:18:14 +0000 Subject: [PATCH 0779/2544] fix for is_really_writable --- system/helpers/file_helper.php | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index d07d35f9..83ef6a06 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -176,4 +176,39 @@ function get_filenames($source_dir, $include_path = FALSE) } } +// -------------------------------------------------------------------- + +/** + * Tests for file writability + * + * is_writable() returns TRUE on Windows servers + * when you really can't write to the file + * as the OS reports to PHP as FALSE only if the + * read-only attribute is marked. Ugh? + * + * @access private + * @return void + */ +function is_really_writable($file) +{ + if (is_dir($file)) + { + $file = rtrim($file, '/').'/'.md5(rand(1,100)); + + if (($fp = @fopen($file, 'ab')) === FALSE) + { + return FALSE; + } + + @chmod($file, 0777); + @unlink($file); + } + elseif (($fp = @fopen($file, 'ab')) === FALSE) + { + return FALSE; + } + + fclose($fp); + return TRUE; +} ?> \ No newline at end of file From 56e5722f2861f0e4c2bd0c9bb4e9d5065dd0a5b0 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 9 Jan 2008 19:43:40 +0000 Subject: [PATCH 0780/2544] bugfix --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a67ea050..1d2cb860 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -229,7 +229,7 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext } if ($extra != '') $extra = ' '.$extra; - $multiple = (count($selected > 1))?' multiple="multiple"':''; + $multiple = (count($selected) > 1)?' multiple="multiple"':''; $form = '\n"; From 67b44edaf539245ca12789f19cca1e7a9437f4f3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 12 Jan 2008 16:18:02 +0000 Subject: [PATCH 0782/2544] added raw_where() and raw_or_where() into AR --- system/database/DB_active_rec.php | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index b9594050..683ded0a 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -206,6 +206,44 @@ function orwhere($key, $value = NULL) // -------------------------------------------------------------------- + /** + * Raw Where + * + * Generates an unfiltered WHERE portion of the query. + * Separates multiple calls with AND + * + * @access public + * @param string + * @return string + */ + function raw_where($statement) + { + $prefix = (count($this->ar_where) == 0) ? '' : ' AND '; + $this->ar_where[] = $prefix.$statement; + return $statement; + } + + // -------------------------------------------------------------------- + + /** + * Raw OR Where + * + * Generates an unfiltered WHERE portion of the query. + * Separates multiple calls with OR + * + * @access public + * @param string + * @return string + */ + function raw_or_where($statement) + { + $prefix = (count($this->ar_where) == 0) ? '' : ' OR '; + $this->ar_where[] = $prefix.$statement; + return $statement; + } + + // -------------------------------------------------------------------- + /** * Where * From 39af731090428b2a50bc196cc89931520483569f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 14 Jan 2008 05:46:49 +0000 Subject: [PATCH 0783/2544] removed raw_where and raw_or_where. They duplicated existing functionality better left elsewhere. --- system/database/DB_active_rec.php | 38 ------------------------------- 1 file changed, 38 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 683ded0a..e697cac7 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -203,44 +203,6 @@ function orwhere($key, $value = NULL) { return $this->or_where($key, $value); } - - // -------------------------------------------------------------------- - - /** - * Raw Where - * - * Generates an unfiltered WHERE portion of the query. - * Separates multiple calls with AND - * - * @access public - * @param string - * @return string - */ - function raw_where($statement) - { - $prefix = (count($this->ar_where) == 0) ? '' : ' AND '; - $this->ar_where[] = $prefix.$statement; - return $statement; - } - - // -------------------------------------------------------------------- - - /** - * Raw OR Where - * - * Generates an unfiltered WHERE portion of the query. - * Separates multiple calls with OR - * - * @access public - * @param string - * @return string - */ - function raw_or_where($statement) - { - $prefix = (count($this->ar_where) == 0) ? '' : ' OR '; - $this->ar_where[] = $prefix.$statement; - return $statement; - } // -------------------------------------------------------------------- From 85c7c61523177bb9307c6ea8439090de4c39c457 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 14 Jan 2008 13:18:36 +0000 Subject: [PATCH 0784/2544] fix a segment db cache bug --- system/database/DB_cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index f8ea616c..1e741070 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -163,7 +163,7 @@ function delete($segment_one = '', $segment_two = '') { if ($segment_one == '') { - $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(2); + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); } if ($segment_two == '') From 8f4f7b10a8161a453d7a21e951248d471dbb3b3f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 15 Jan 2008 13:58:35 +0000 Subject: [PATCH 0785/2544] Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login). --- system/language/english/email_lang.php | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index 430ae4ab..040e0eaa 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -1,21 +1,21 @@ - \ No newline at end of file From 0fe8297a38fcf1237914d633201e2f8486f3e7d4 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 15 Jan 2008 13:58:47 +0000 Subject: [PATCH 0786/2544] Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login). --- system/libraries/Email.php | 1818 +++++++++++++++++++++++++++++++++++- 1 file changed, 1817 insertions(+), 1 deletion(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index c0593df0..7b5ebca8 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1 +1,1817 @@ - 0) { $this->initialize($config); } log_message('debug', "Email Class Initialized"); } // -------------------------------------------------------------------- /** * Initialize preferences * * @access public * @param array * @return void */ function initialize($config = array()) { $this->clear(); foreach ($config as $key => $val) { if (isset($this->$key)) { $method = 'set_'.$key; if (method_exists($this, $method)) { $this->$method($val); } else { $this->$key = $val; } } } $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; } // -------------------------------------------------------------------- /** * Initialize the Email Data * * @access public * @return void */ function clear($clear_attachments = FALSE) { $this->_subject = ""; $this->_body = ""; $this->_finalbody = ""; $this->_header_str = ""; $this->_replyto_flag = FALSE; $this->_recipients = array(); $this->_headers = array(); $this->_debug_msg = array(); $this->_set_header('User-Agent', $this->useragent); $this->_set_header('Date', $this->_set_date()); if ($clear_attachments !== FALSE) { $this->_attach_name = array(); $this->_attach_type = array(); $this->_attach_disp = array(); } } // -------------------------------------------------------------------- /** * Set FROM * * @access public * @param string * @param string * @return void */ function from($from, $name = '') { if (preg_match( '/\<(.*)\>/', $from, $match)) $from = $match['1']; if ($this->validate) $this->validate_email($this->_str_to_array($from)); if ($name != '' && substr($name, 0, 1) != '"') { $name = '"'.$name.'"'; } $this->_set_header('From', $name.' <'.$from.'>'); $this->_set_header('Return-Path', '<'.$from.'>'); } // -------------------------------------------------------------------- /** * Set Reply-to * * @access public * @param string * @param string * @return void */ function reply_to($replyto, $name = '') { if (preg_match( '/\<(.*)\>/', $replyto, $match)) $replyto = $match['1']; if ($this->validate) $this->validate_email($this->_str_to_array($replyto)); if ($name == '') { $name = $replyto; } if (substr($name, 0, 1) != '"') { $name = '"'.$name.'"'; } $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); $this->_replyto_flag = TRUE; } // -------------------------------------------------------------------- /** * Set Recipients * * @access public * @param string * @return void */ function to($to) { $to = $this->_str_to_array($to); $to = $this->clean_email($to); if ($this->validate) $this->validate_email($to); if ($this->_get_protocol() != 'mail') $this->_set_header('To', implode(", ", $to)); switch ($this->_get_protocol()) { case 'smtp' : $this->_recipients = $to; break; case 'sendmail' : $this->_recipients = implode(", ", $to); break; case 'mail' : $this->_recipients = implode(", ", $to); break; } } // -------------------------------------------------------------------- /** * Set CC * * @access public * @param string * @return void */ function cc($cc) { $cc = $this->_str_to_array($cc); $cc = $this->clean_email($cc); if ($this->validate) $this->validate_email($cc); $this->_set_header('Cc', implode(", ", $cc)); if ($this->_get_protocol() == "smtp") $this->_cc_array = $cc; } // -------------------------------------------------------------------- /** * Set BCC * * @access public * @param string * @param string * @return void */ function bcc($bcc, $limit = '') { if ($limit != '' && is_numeric($limit)) { $this->bcc_batch_mode = true; $this->bcc_batch_size = $limit; } $bcc = $this->_str_to_array($bcc); $bcc = $this->clean_email($bcc); if ($this->validate) $this->validate_email($bcc); if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) $this->_bcc_array = $bcc; else $this->_set_header('Bcc', implode(", ", $bcc)); } // -------------------------------------------------------------------- /** * Set Email Subject * * @access public * @param string * @return void */ function subject($subject) { $subject = preg_replace("/(\r\n)|(\r)|(\n)/", "", $subject); $subject = preg_replace("/(\t)/", " ", $subject); $this->_set_header('Subject', trim($subject)); } // -------------------------------------------------------------------- /** * Set Body * * @access public * @param string * @return void */ function message($body) { $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); } // -------------------------------------------------------------------- /** * Assign file attachments * * @access public * @param string * @return string */ function attach($filename, $disposition = 'attachment') { $this->_attach_name[] = $filename; $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters } // -------------------------------------------------------------------- /** * Add a Header Item * * @access public * @param string * @param string * @return void */ function _set_header($header, $value) { $this->_headers[$header] = $value; } // -------------------------------------------------------------------- /** * Convert a String to an Array * * @access public * @param string * @return array */ function _str_to_array($email) { if ( ! is_array($email)) { if (ereg(',$', $email)) $email = substr($email, 0, -1); if (ereg('^,', $email)) $email = substr($email, 1); if (ereg(',', $email)) { $x = explode(',', $email); $email = array(); for ($i = 0; $i < count($x); $i ++) $email[] = trim($x[$i]); } else { $email = trim($email); settype($email, "array"); } } return $email; } // -------------------------------------------------------------------- /** * Set Multipart Value * * @access public * @param string * @return void */ function set_alt_message($str = '') { $this->alt_message = ($str == '') ? '' : $str; } // -------------------------------------------------------------------- /** * Set Mailtype * * @access public * @param string * @return void */ function set_mailtype($type = 'text') { $this->mailtype = ($type == 'html') ? 'html' : 'text'; } // -------------------------------------------------------------------- /** * Set Wordwrap * * @access public * @param string * @return void */ function set_wordwrap($wordwrap = TRUE) { $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; } // -------------------------------------------------------------------- /** * Set Protocol * * @access public * @param string * @return void */ function set_protocol($protocol = 'mail') { $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); } // -------------------------------------------------------------------- /** * Set Priority * * @access public * @param integer * @return void */ function set_priority($n = 3) { if ( ! is_numeric($n)) { $this->priority = 3; return; } if ($n < 1 OR $n > 5) { $this->priority = 3; return; } $this->priority = $n; } // -------------------------------------------------------------------- /** * Set Newline Character * * @access public * @param string * @return void */ function set_newline($newline = "\n") { if ($newline != "\n" AND $newline != "\r\n" AND $newline != "\r") { $this->newline = "\n"; return; } $this->newline = $newline; } // -------------------------------------------------------------------- /** * Set Message Boundary * * @access private * @return void */ function _set_boundaries() { $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary } // -------------------------------------------------------------------- /** * Get the Message ID * * @access private * @return string */ function _get_message_id() { $from = $this->_headers['Return-Path']; $from = str_replace(">", "", $from); $from = str_replace("<", "", $from); return "<".uniqid('').strstr($from, '@').">"; } // -------------------------------------------------------------------- /** * Get Mail Protocol * * @access private * @param bool * @return string */ function _get_protocol($return = true) { $this->protocol = strtolower($this->protocol); $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol; if ($return == true) return $this->protocol; } // -------------------------------------------------------------------- /** * Get Mail Encoding * * @access private * @param bool * @return string */ function _get_encoding($return = true) { $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '7bit' : $this->_encoding; if ( ! in_array($this->charset, $this->_base_charsets, TRUE)) $this->_encoding = "8bit"; if ($return == true) return $this->_encoding; } // -------------------------------------------------------------------- /** * Get content type (text/html/attachment) * * @access private * @return string */ function _get_content_type() { if ($this->mailtype == 'html' && count($this->_attach_name) == 0) return 'html'; elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) return 'html-attach'; elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) return 'plain-attach'; else return 'plain'; } // -------------------------------------------------------------------- /** * Set RFC 822 Date * * @access public * @return string */ function _set_date() { $timezone = date("Z"); $operator = (substr($timezone, 0, 1) == '-') ? '-' : '+'; $timezone = abs($timezone); $timezone = floor($timezone/3600) * 100 + ($timezone % 3600 ) / 60; return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); } // -------------------------------------------------------------------- /** * Mime message * * @access private * @return string */ function _get_mime_message() { return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; } // -------------------------------------------------------------------- /** * Validate Email Address * * @access public * @param string * @return bool */ function validate_email($email) { if ( ! is_array($email)) { $this->_set_error_message('email_must_be_array'); return FALSE; } foreach ($email as $val) { if ( ! $this->valid_email($val)) { $this->_set_error_message('email_invalid_address', $val); return FALSE; } } } // -------------------------------------------------------------------- /** * Email Validation * * @access public * @param string * @return bool */ function valid_email($address) { if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) return FALSE; else return TRUE; } // -------------------------------------------------------------------- /** * Clean Extended Email Address: Joe Smith * * @access public * @param string * @return string */ function clean_email($email) { if ( ! is_array($email)) { if (preg_match('/\<(.*)\>/', $email, $match)) return $match['1']; else return $email; } $clean_email = array(); for ($i=0; $i < count($email); $i++) { if (preg_match( '/\<(.*)\>/', $email[$i], $match)) $clean_email[] = $match['1']; else $clean_email[] = $email[$i]; } return $clean_email; } // -------------------------------------------------------------------- /** * Build alternative plain text message * * This function provides the raw message for use * in plain-text headers of HTML-formatted emails. * If the user hasn't specified his own alternative message * it creates one by stripping the HTML * * @access private * @return string */ function _get_alt_message() { if ($this->alt_message != "") { return $this->word_wrap($this->alt_message, '76'); } if (eregi( '\', $this->_body, $match)) { $body = $match['1']; $body = substr($body, strpos($body, ">") + 1); } else { $body = $this->_body; } $body = trim(strip_tags($body)); $body = preg_replace( '#

    CodeIgniter User Guide Version 1.5.4


    Database Configuration

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). The config file is located at:

    application/config/database.php

    The config settings are stored in a multi-dimensional array with this prototype:

    $db['default']['hostname'] = "localhost";
    $db['default']['username'] = "root";
    $db['default']['password'] = "";
    $db['default']['database'] = "database_name";
    $db['default']['dbdriver'] = "mysql";
    $db['default']['dbprefix'] = "";
    $db['default']['pconnect'] = TRUE;
    $db['default']['db_debug'] = FALSE;
    $db['default']['active_r'] = TRUE;

    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, production, test, etc.) under a single installation, you can set up a connection group for each, then switch between groups as needed. For example, to set up a "test" environment you would do this:

    $db['test']['hostname'] = "localhost";
    $db['test']['username'] = "root";
    $db['test']['password'] = "";
    $db['test']['database'] = "database_name";
    $db['test']['dbdriver'] = "mysql";
    $db['test']['dbprefix'] = "";
    $db['test']['pconnect'] = TRUE;
    $db['test']['db_debug'] = FALSE;
    $db['test']['active_r'] = TRUE;

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    $active_group = "test";

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" for the primary connection, but it too can be renamed to something more relevant to your project.

    Explanation of Values:

    • hostname - The hostname of your database server. Often this is "localhost".
    • 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, postgre, obdc, etc. Must be specified in lower case.
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources.

      Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.

    • port - The database port number. Currently only used with the Postgre driver.

    Note: Depending on what database platform you are using (MySQL, Postgre, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Database Configuration + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.5.4

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Database Configuration

    + +

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). +The config file is located at:

    + +

    application/config/database.php

    + +

    The config settings are stored in a multi-dimensional array with this prototype:

    + +$db['default']['hostname'] = "localhost";
    +$db['default']['username'] = "root";
    +$db['default']['password'] = "";
    +$db['default']['database'] = "database_name";
    +$db['default']['dbdriver'] = "mysql";
    +$db['default']['dbprefix'] = "";
    +$db['default']['pconnect'] = TRUE;
    +$db['default']['db_debug'] = FALSE;
    +$db['default']['active_r'] = TRUE;
    +$db['default']['cache_on'] = FALSE;
    +$db['default']['cachedir'] = "";
    + +

    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, production, test, etc.) +under a single installation, you can set up a connection group for each, then switch between groups as needed. +For example, to set up a "test" environment you would do this:

    + +$db['test']['hostname'] = "localhost";
    +$db['test']['username'] = "root";
    +$db['test']['password'] = "";
    +$db['test']['database'] = "database_name";
    +$db['test']['dbdriver'] = "mysql";
    +$db['test']['dbprefix'] = "";
    +$db['test']['pconnect'] = TRUE;
    +$db['test']['db_debug'] = FALSE;
    +$db['test']['active_r'] = TRUE;
    +$db['default']['cache_on'] = FALSE;
    +$db['default']['cachedir'] = "";
    + + +

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    + +$active_group = "test"; + +

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" +for the primary connection, but it too can be renamed to something more relevant to your project.

    + +

    Explanation of Values:

    + +
      +
    • hostname - The hostname of your database server. Often this is "localhost".
    • +
    • 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, postgre, obdc, etc. Must be specified in lower case.
    • +
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • +
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • +
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • +
    • active_r - TRUE/FALSE (boolean) - Whether to load the Active Record Class. If you are not using the active record class you can have it omitted when the database classes are initialized in order to utilize less resources. +

      Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.

    • +
    • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
    • +
    • cachedir - The absolute server path to your database query cache directory.
    • +
    • port - The database port number. Currently only used with the Postgre driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    • +
    + +

    Note: Depending on what database platform you are using (MySQL, Postgre, etc.) +not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and +the database name will be the path to your database file. The information above assumes you are using MySQL.

    + + + +
    + + + + + + + \ No newline at end of file From 6e848ed2afa39b5c99fda7bc061c864bd619269f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 15 Jan 2008 14:26:23 +0000 Subject: [PATCH 0788/2544] Fixed a bug in the Oracle driver that prevented num_rows from working. --- system/database/DB_driver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index fc700ec3..a7f03e3e 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -329,7 +329,6 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $RES = new $driver(); $RES->conn_id = $this->conn_id; $RES->result_id = $this->result_id; - $RES->num_rows = $RES->num_rows(); if ($this->dbdriver == 'oci8') { @@ -337,7 +336,9 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $RES->curs_id = NULL; $RES->limit_used = $this->limit_used; } - + + $RES->num_rows = $RES->num_rows(); + // Is query caching enabled? If so, we'll serialize the // result object and save it to a cache file. if ($this->cache_on == TRUE AND $this->_cache_init()) From 305f63b920acb8f58125f932f7462c1b71ba18c4 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 15 Jan 2008 17:41:32 +0000 Subject: [PATCH 0789/2544] fixed a bug in parser where numeric data is ignored --- system/libraries/Parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 4e1f9b9a..33cb1214 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -54,13 +54,13 @@ function parse($template, $data, $return = FALSE) foreach ($data as $key => $val) { - if (is_string($val)) + if (is_array($val)) { - $template = $this->_parse_single($key, $val, $template); + $template = $this->_parse_pair($key, $val, $template); } - elseif (is_array($val)) + else { - $template = $this->_parse_pair($key, $val, $template); + $template = $this->_parse_single($key, (string)$val, $template); } } From 76708b780c558c0d5db1efd8e11787269e0507e3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 15 Jan 2008 23:58:19 +0000 Subject: [PATCH 0790/2544] bug(re)fix: I am so smart. s - m - r - t --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 7c3bc9d8..9f3509d5 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -231,7 +231,7 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext } if ($extra != '') $extra = ' '.$extra; - $multiple = (count($selected > 1))?' multiple="multiple"':''; + $multiple = (count($selected) > 1))?' multiple="multiple"':''; $form = '\n"; diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php index 57897263..c8c48f84 100644 --- a/system/language/english/db_lang.php +++ b/system/language/english/db_lang.php @@ -8,7 +8,7 @@ $lang['db_must_set_table'] = 'You must set the database table to be used with your query.'; $lang['db_must_use_set'] = 'You must use the "set" method to update an entry.'; $lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.'; -$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" clause.'; +$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.'; $lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.'; $lang['db_unsupported_function'] = 'This feature is not available for the database you are using.'; $lang['db_transaction_failure'] = 'Transaction failure: Rollback performed.'; @@ -17,8 +17,8 @@ $lang['db_unsuported_compression'] = 'The file compression format you chose is not supported by your server.'; $lang['db_filepath_error'] = 'Unable to write data to the file path you have submitted.'; $lang['db_invalid_cache_path'] = 'The cache path you submitted is not valid or writable.'; - - - +$lang['db_table_name_required'] = 'A table name is required for that operation.'; +$lang['db_column_name_required'] = 'A column name is required for that operation.'; +$lang['db_column_definition_required'] = 'A column definition is required for that operation.'; ?> \ No newline at end of file diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index 040e0eaa..430ae4ab 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -1,21 +1,21 @@ - \ No newline at end of file diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 99652c0b..f833cb71 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -236,15 +236,44 @@ function dbutil() } $CI =& get_instance(); + + // for backwards compatibility, load dbforge so we can extend dbutils off it + // this use is deprecated and strongly discouraged + $CI->load->dbforge(); require_once(BASEPATH.'database/DB_utility'.EXT); require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; - $CI->dbutil = new $class(); + $CI->dbutil =& new $class(); + $CI->load->_ci_assign_to_models(); } + // -------------------------------------------------------------------- + + /** + * Load the Database Forge Class + * + * @access public + * @return string + */ + function dbforge() + { + if ( ! class_exists('CI_DB')) + { + $this->database(); + } + + $CI =& get_instance(); + + require_once(BASEPATH.'database/DB_forge'.EXT); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge'.EXT); + $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; + + $CI->dbforge = new $class(); + } + // -------------------------------------------------------------------- /** diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8fa74a13..902e5e64 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    @@ -57,7 +57,7 @@

    Change Log

    -

    Version 1.5.5

    +

    Version 1.6.0

    Release Date: -- still in development

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • @@ -66,30 +66,42 @@

      Version 1.5.5

    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • -
    • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
    • -
    • Added 'random' as an order_by() option in Active Record.
    • -
    • Added where_in(), where_in_or(), where_not_in(), and where_not_in_or() to Active Record.
    • -
    • Added support for limit() into update() and delete() statements in Active Record.
    • +
    • Added DBForge to the database tools.
    • +
    • Moved create_database() and drop_database() into DBForge.
    • +
    • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
    • +
    • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
    • +
    • Added protect_identifiers() in Active Record.
    • +
    • Alll AR queries are backticked if appropriate to the database.
    • +
    • Added where_in(), where_in_or(), where_not_in(), where_not_in_or(), not_like() and or_not_like() to Active Record.
    • +
    • Added support for limit() into update() and delete() statements in Active Record.
    • +
    • Added empty_table() and truncate_table() to Active Record.
    • Added the ability to pass an array of tables to the delete() statement in Active Record.
    • -
    • Added titles to all user manual pages.
    • +
    • Added count_all_results() function to Active Record.
    • +
    • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
    • +
    • Added the ability to use aliases with joins in Active Record.
    • +
    • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
    • +
    • Added a third parameter to set() in Active Record that withholds escaping data.
    • Added a check for NULL fields in the MySQL database backup utility.
    • -
    • Documented the timezones() function in the Date Helper.
    • -
    • Documented unset_userdata in the Session class.
    • -
    • Documented distinct() in Active Record.
    • -
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Added a few additional mime type variations for CSV.
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • -
    • Added form_reset() function to form helper.
    • -
    • Added count_all_results() function to Active Record.
    • -
    • Added the ability to use aliases with joins in Active Record.
    • +
    • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
    • +
    • Added support for external urls in form_open().
    • Added a language entry for valid_ip validation error.
    • -
    • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
    • +
    • Added titles to all user manual pages.
    • +
    • Added Zip Encoding Class to the table of contents of the userguide.
    • Moved the safe mode and auth checks for the Email library into the constructor.
    • +
    • Moved part of the userguide menu javascript to an external file.
    • +
    • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
    • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
    • +
    • Documented distinct() in Active Record.
    • +
    • Documented the timezones() function in the Date Helper.
    • +
    • Documented unset_userdata in the Session class.
    • +
    • Documented 2 config options to the Database configuration page.
    • Fixed a bug in highlight_pharse() that caused an error with slashes.
    • -
    • Fixed a bug: $field_names[] vs $Ffield_names[] in postgre and sqlite drivers
    • +
    • Fixed a bug: $field_names[] vs $Ffield_names[] in postgre and sqlite drivers.
    • +
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • Fixed a bug in the Email library where some timezones were calculated incorrectly.
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • @@ -102,19 +114,22 @@

      Version 1.5.5

    • Fixed a bug that was making validation callbacks required even when not set as such.
    • Fixed a bug in _object_to_array that broke some types of inserts and updates.
    • Fixed a bug in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • +
    • Fixed a bug that prevented num_rows from working in Oracle.
    • +
    • Fixed a bug in the parser class where numeric data was ignored.
    • +
    • Fixed a bug when loading plugin files as _plugin. and not _pi.
    • +
    • Fixed a bug in the SQLite driver for PHP 4.
    • Fixed an example of comma-separated emails in the email library documentation.
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • Fixed a typo in the database language file.
    • -
    • Fixed a typo in the image language file "suppor" to "support".
    • +
    • Fixed a typo in the image language file "suppor" to "support".
    • Fixed an example for XML RPC.
    • -
    • Fixed an example of accept_charset() in the User Agent Library.
    • -
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • -
    • Fixed a typo in the String Helper (uniquid changed to uniqid)
    • +
    • Fixed an example of accept_charset() in the User Agent Library.
    • +
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • +
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • +
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login).
    • Fixed assorted user guide typos.
    • -
    • Moved part of the userguide menu javascript to an external file.
    • -
    • Added Zip Encoding Class to the table of contents of the userguide.
    • -
    • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
    • -
    +
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • + diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d4310164..45cabdba 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    @@ -128,19 +128,53 @@

    $this->db->get_where();

    Please read the about the where function below for more information.

    Note: get_where() was formerly known as getwhere(), which has been deprecated

    -

    $this->db->select();

    +

    $this->db->select();

    Permits you to write the SELECT portion of your query:

    - - +

    $this->db->select('title, content, date');

    $query = $this->db->get('mytable');

    -// Produces: SELECT title, content, date FROM mytable
    +// Produces: SELECT title, content, date FROM mytable

    +

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    -

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    +

    $this->Db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.

    +

    $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);
    + $query = $this->db->get('mytable');
    +

    +

    $this->db->select_max();

    +

    Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_max('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT MAX(age) as age FROM members
    +
    +$this->db->select_max('age', 'member_age');
    +$query = $this->db->get('members');
    +// Produces: SELECT MAX(age) as member_age FROM members

    + +

    $this->db->select_min();

    +

    Writes a "SELECT MIN(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_min('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT MIN(age) as age FROM members

    + +

    $this->db->select_avg();

    +

    Writes a "SELECT AVG(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_avg('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT AVG(age) as age FROM members

    + +

    $this->db->select_sum();

    +

    Writes a "SELECT SUM(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_sum('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT SUM(age) as age FROM members

    $this->db->from();

    @@ -154,8 +188,8 @@

    $this->db->from();


    // Produces: SELECT title, content, date FROM mytable -

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method -you prefer.

    +

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method +you prefer.

    $this->db->join();

    @@ -294,6 +328,19 @@

    $this->db->or_where_not_in();

    $this->db->where_in('username', $names);
    // Produces: OR WHERE username NOT IN ('Frank', 'Todd', 'James')

    +

    $this->db->raw_where();

    +

    Generates an unfiltered WHERE portion of the query exactly as the developer passes it. Separates multiple calls with AND
    + $this->db->raw_where('(grade > 50 AND grade < 75)');
    + // Produces: AND WHERE (grade > 50 AND grade < 75)

    + +

    $this->db->raw_or_where();

    +

    Generates an unfiltered WHERE portion of the query exactly as the developer passes it. Separates multiple calls with OR
    + $this->db->raw_where('(grade > 50 AND grade < 75)');
    + // Produces: OR WHERE (grade > 50 AND grade < 75)

    + +

    Note: All values passed through raw_where() and raw_or_where() are not escaped automatically, or otherwise touched. It is the responsibility of the developer to ensure all queries are safe. Consider using protect_identifiers() and escaping your queries as appropriate.

    + +

    $this->db->like();

    This function enables you to generate LIKE clauses, useful for doing searches.

    @@ -390,11 +437,12 @@

    $this->db->having();

    $this->db->having(array('title =' => 'My Title', 'id <' => $id)); -

    // Produces: HAVING title = 'My Title', 'id < 45' -
    +

    // Produces: HAVING title = 'My Title', 'id < 45' +

    $this->db->or_having();

    +

    Identical to having(), only separates multiple clauses with "OR".

    $this->db->order_by();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are asc or desc, or random.

    @@ -419,7 +467,7 @@

    $this->db->order_by();

    // Produces: ORDER BY title DESC, name ASC

    Note: order_by() was formerly known as orderby(), which has been deprecated.

    -

    Note: random ordering is not currently supported in Orcacle or MSSQL drivers.

    +

    Note: random ordering is not currently supported in Orcacle or MSSQL drivers. These will default to 'ASC'.

    $this->db->limit();

    Lets you limit the number of rows you would like returned by the query:

    @@ -516,14 +564,19 @@

    $this->db->set();

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    -$this->db->set('name', $name);
    -$this->db->set('title', $title);
    -$this->db->set('status', $status);
    -$this->db->insert('mytable'); -
    - +$this->db->set('name', $name);
    +$this->db->set('title', $title);
    +$this->db->set('status', $status);
    +$this->db->insert('mytable');
    +

    set() will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter.

    +

    $this->db->set('field', 'field+1', FALSE);
    + $this->db->insert('mytable');
    + // gives INSERT INTO mytable (field) VALUES (field+1)
    +
    + $this->db->set('field', 'field+1');
    + $this->db->insert('mytable');
    + // gives INSERT INTO mytable (field) VALUES ('field+1')

    You can also pass an associative array to this function:

    - $array = array('name' => $name, 'title' => $title, 'status' => $status);

    @@ -640,9 +693,23 @@

    $this->db->delete();

    $tables = array('table1', 'table2', 'table3');
    $this->db->where('id', '5');
    $this->db->delete($tables);

    -

    Note: All values are escaped automatically producing safer queries.

    - - +

    If you want to delete all data from a table, you can use the truncate() function, or empty_table().

    +

    $this->db->empty_table();

    +

    Generates a delete SQL string and runs the query. $this->db->empty_table('mytable');
    +
    +// Produces
    +// DELETE FROM mytable

    +

    $this->db->truncate();

    +

    Generates a truncate SQL string and runs the query.

    + $this->db->from('mytable');
    +$this->db->truncate();
    +// or
    +$this->db->truncate('mytable');
    +
    +// Produce:
    +// TRUNCATE mytable
    +
    +

    Note: If the TRUNCATE command isn't available, truncate() will execute as "DELETE FROM table".

     

    Method Chaining

    diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index d2cbd9c8..11cc3f5c 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index f61b6f7e..6157acfa 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b9b61d32..f6097f2b 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 04c0c2c4..96dd1f06 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 8989b961..bcda80f8 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 6dc4eeb8..ab092075 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html new file mode 100644 index 00000000..90991a9c --- /dev/null +++ b/user_guide/database/forge.html @@ -0,0 +1,221 @@ + + + + +CodeIgniter User Guide : Database Utility Class + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + +

    Database Forge Class

    + +

    The Database Forge Class contains functions that help you manage your database.

    + +

    Table of Contents

    + + + + +

    Initializing the Forge Class

    + +

    Important:  In order to initialize the Forge class, your database driver must +already be running, since the forge class relies on it.

    + +

    Load the Forge Class as follows:

    + +$this->load->dbforge() + +

    Once initialized you will access the functions using the $this->dbforge object:

    + +$this->dbforge->some_function() +

    $this->dbforge->create_database('db_name')

    + +

    Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + +if ($this->dbutil->create_database('my_db'))
    +{
    +    echo 'Database created!';
    +}
    + + + + +

    $this->dbforge->drop_database('db_name')

    + +

    Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + +if ($this->dbutil->drop_database('my_db'))
    +{
    +    echo 'Database deleted!';
    +}
    + + +

    Creating and Dropping Tables

    +

    There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this.

    +

    Adding fields

    +

    Fields are created via an associative array. Within the array you must include a 'type' key that relates to the datatype of the field. For example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR) also require a 'constraint' key.

    +

    $fields = array(
    +                        'users' => array(
    +                                                  'type' => 'varchar',
    +                                                  'constraint' => '100',
    +                                           ),
    +                 );
    +
    +// will translate to "users VARCHAR(100)" when the field is added.

    +

    Additionally, the following key/values can be used:

    +
      +
    • unsigned/true : to generate "UNSIGNED" in the field definition
    • +
    • default/value : to generate a default value in the field definition
    • +
    • null/true : to generate "NULL" in the field definition. Without this, the field will default to "NOT NULL"
    • +
    • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must
    • +
    +

    $fields = array(
    +                         'blog_id' => array(
    +                                                  'type' => 'INT',
    +                                                  'constraint' => 5,
    +                                                  'unsigned' => TRUE,
    +                                                  'auto_increment' => TRUE
    +                                           ),
    +                         'blog_title' => array(
    +                                                 'type' => 'VARCHAR',
    +                                                 'constraint' => '100',
    +                                          ),
    +                        'blog_author' => array(
    +                                                 'type' =>'VARCHAR',
    +                                                 'constraint' => '100',
    +                                                 'default' => 'King of Town',
    +                                          ),
    +                        'blog_description' => array(
    +                                                 'type' => 'TEXT',
    +                                                 'null' => TRUE,
    +                                          ),
    +                );
    + );

    +

    After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

    +

    $this->dbforge->add_field()

    +

    The add fields function will accept the above array.

    +

    Passing strings as fields

    +

    If you know exactly how you want a field to be created, you can pass the string into the field definitions with add_field()

    +

    $this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");

    +

    Note: Multiple calls to add_field() are cumulative.

    +

    Creating an id field

    +

    There is a special exception for creating id fields. A field with type id will automatically be assinged as an INT(9) auto_incrementing Primary Key.

    +

    $this->dbforge->add_field('id');
    + // gives id INT(9) NOT NULL AUTO_INCREMENT

    +

    Adding Keys

    +

    Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().

    +

    $this->dbforge->add_key('blog_id', TRUE);
    + // gives PRIMARY KEY (blog_id)
    +
    + $this->dbforge->add_key('blog_name');
    + // gives KEY (blog_name)

    +

    Creating a table

    +

    After fields and keys have been declared, you can create a new table with

    +

    $this->dbforge->create_table('table_name')
    +// gives CREATE TABLE table_name

    +

    An optional second parameter set to TRUE adds an "IF NOT EXISTS" clause into the definition

    +

    $this->dbforge->create_table('table_name')
    +// gives CREATE TABLE IF NOT EXISTS table_name

    +

    Dropping a table

    +

    Executes a DROP TABLE sql

    +

    $this->dbforge->drop_table('table_name')
    +// gives DROP TABLE IF EXISTS table_name

    +

    Modifying Tables

    +

    $this->dbforge->add_column()

    +

    The add_column() function is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields.

    +

    $fields = array(
    +                         'preferences' => array('type' => 'TEXT')
    +);
    +$this->dbforge->add_column('table_name', $fields);
    +
    +// gives ALTER TABLE sites ADD preferences TEXT

    +

    $this->dbforge->drop_column()

    +

    Used to remove a column from a table.

    +

    $this->dbforge->drop_column('table_name', 'column_to_drop');

    +

    $this->dbforge->modify_column()

    +

    The usage of this function is identical to add_coumn(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    +

    $fields = array(
    +                        'old_name' => array(
    +                                                         'name' => 'new_name',
    +                                                         'type' => 'TEXT',
    +                                                ),
    +);
    +$this->dbforge->modify_column('sites', $fields);
    +
    + // gives ALTER TABLE sites CHANGE old_name new_name TEXT

    +

     

    +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 6db89e0c..93b9a6dd 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 7ad5ace4..d4319b91 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    @@ -75,7 +75,8 @@

    The Database Class

  • Field MetaData
  • Custom Function Calls
  • Query Caching
  • -
  • Database Utilities Class
  • +
  • Database manipulation with Database Forge
  • +
  • Database Utilities Class
  • diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index e1d346c3..3ff8cc70 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    @@ -80,8 +80,10 @@

    $this->db->simple_query();

    It simply lets you submit a query. Most users will rarely use this function.

    +

    Protecting identifiers

    +

    In many databases it is advisable to protect table and field names - for example with backticks in MySQL. Active Record queries are automatically protected, however if you need to manually protect an identifier you can use:

    +

    $this->db->protect_identifier('table_name');

    Escaping Queries

    -

    It's a very good security practice to escape your data before submitting it into your database. CodeIgniter has two functions that help you do this:

    diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 9ce6a310..31b07567 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 22e05c10..16c3bba9 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -1 +1,113 @@ - CodeIgniter User Guide : Table Data

    CodeIgniter User Guide Version 1.5.4


    Table Data

    These functions let you fetch table information.

    $this->db->list_tables();

    Returns an array containing the names of all the tables in the database you are currently connected to. Example:

    $tables = $this->db->list_tables();

    foreach ($tables as $table)
    {
       echo $table;
    }

    $this->db->table_exists();

    Sometimes it's helpful to know whether a particular table exists before running an operation on it. Returns a boolean TRUE/FALSE. Usage example:

    if ($this->db->table_exists('table_name'))
    {
       // some code...
    }

    Note: Replace table_name with the name of the table you are looking for.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Table Data + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + + +

    Table Data

    + +

    These functions let you fetch table information.

    + +

    $this->db->list_tables();

    + +

    Returns an array containing the names of all the tables in the database you are currently connected to. Example:

    + +$tables = $this->db->list_tables();
    +
    +foreach ($tables as $table)
    +{
    +   echo $table;
    +} +
    + + +

    $this->db->table_exists();

    + +

    Sometimes it's helpful to know whether a particular table exists before running an operation on it. +Returns a boolean TRUE/FALSE. Usage example:

    + + +if ($this->db->table_exists('table_name'))
    +{
    +   // some code...
    +} +
    + +

    Note: Replace table_name with the name of the table you are looking for.

    + + + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 8a9ac1b0..3adf0192 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 6b6956c8..cdf3f68f 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    @@ -65,8 +65,6 @@

    Table of Contents

    - -

    Initializing the Utility Class

    + +

    Initializing the Utility Class

    Important:  In order to initialize the Utility class, your database driver must already be running, since the utilities class relies on it.

    @@ -91,36 +89,9 @@

    Initializing the Utility Class

    $this->dbutil->some_function() - - - -

    $this->dbutil->create_database('db_name')

    - -

    Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - -if ($this->dbutil->create_database('my_db'))
    -{
    -    echo 'Database created!';
    -}
    - - - - -

    $this->dbutil->drop_database('db_name')

    - -

    Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - -if ($this->dbutil->drop_database('my_db'))
    -{
    -    echo 'Database deleted!';
    -}
    - - - -

    $this->dbutil->list_databases()

    +

    $this->dbutil->list_databases()

    Returns an array of database names:

    - $dbs = $this->dbutil->list_databases();

    @@ -128,10 +99,7 @@

    $this->dbutil->list_databases()

    {
        echo $db;
    }
    - - - -

    $this->dbutil->optimize_table('table_name');

    +

    $this->dbutil->optimize_table('table_name');

    Note:  This features is only available for MySQL/MySQLi databases.

    @@ -148,8 +116,7 @@

    $this->dbutil->optimize_table('table_name');

    Note: Not all database platforms support table optimization.

    - -

    $this->dbutil->repair_table('table_name');

    +

    $this->dbutil->repair_table('table_name');

    Note:  This features is only available for MySQL/MySQLi databases.

    @@ -166,8 +133,7 @@

    $this->dbutil->repair_table('table_name');

    Note: Not all database platforms support table repairs.

    - -

    $this->dbutil->optimize_database();

    +

    $this->dbutil->optimize_database();

    Note:  This features is only available for MySQL/MySQLi databases.

    @@ -185,8 +151,7 @@

    $this->dbutil->optimize_database();

    Note: Not all database platforms support table optimization.

    - -

    $this->dbutil->csv_from_result($db_result)

    +

    $this->dbutil->csv_from_result($db_result)

    Permits you to generate a CSV file from a query result. The first parameter of the function must contain the result object from your query. Example:

    @@ -213,8 +178,7 @@

    $this->dbutil->csv_from_result($db_result)

    If you need to write the file use the File Helper.

    - -

    $this->dbutil->xml_from_result($db_result)

    +

    $this->dbutil->xml_from_result($db_result)

    Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second may contain an optional array of config parameters. Example:

    @@ -238,8 +202,7 @@

    $this->dbutil->xml_from_result($db_result)

    If you need to write the file use the File Helper.

    - -

    $this->dbutil->backup()

    +

    $this->dbutil->backup()

    Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

    @@ -320,12 +283,11 @@

    Description of Backup Preferences

    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index b5a9d695..1db17274 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 5398d85f..84869083 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 5af8be10..0ece5b01 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 959994f0..67b1dd85 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -1 +1,115 @@ - CodeIgniter User Guide : Web Page Caching

    CodeIgniter User Guide Version 1.5.4


    Web Page Caching

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the server resources, memory, and processing cycles utilized, which affect your page load speeds. By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    How Does Caching Work?

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    Enabling Caching

    To enable caching, put the following tag in any of your controller functions:

    $this->output->cache(n);

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems most logical to you. Once the tag is in place, your pages will begin being cached.

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    Note: Before the cache files can be written you must set the file permissions on your system/cache folder such that it is writable.

    Deleting Caches

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you will need to manually delete it from your cache folder.

    \ No newline at end of file + + + + +CodeIgniter User Guide : Web Page Caching + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Web Page Caching

    + +

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    + +

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the +server resources, memory, and processing cycles utilized, which affect your page load speeds. +By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    + + +

    How Does Caching Work?

    + +

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. +When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved +and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    + +

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    + +

    Enabling Caching

    + +

    To enable caching, put the following tag in any of your controller functions:

    + +$this->output->cache(n); + +

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    + +

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems +most logical to you. Once the tag is in place, your pages will begin being cached.

    + +

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    +

    Note: Before the cache files can be written you must set the file permissions on your +system/cache folder such that it is writable.

    + +

    Deleting Caches

    + +

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: +Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you +will need to manually delete it from your cache folder.

    + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index f9426212..b85c6e14 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 870ff8c3..b284e4f6 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index f5e12f8f..d489963b 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 99a670c8..48a705c5 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 6dc061f6..9da97b41 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 8c4f6957..0ac71075 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 96b6bc69..7e564bae 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 40fb40d7..e5d0f110 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 3e2f9d35..24b47a5e 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index e22114ae..747b5f39 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 90f89553..cfeefaca 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 6fd75586..5b84d7a4 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 9eb6f1b4..ebcdb41b 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index d93d646c..b57673c5 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 74952d75..1849ddaa 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index f7f93c83..88e13ff6 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 48d1b193..25f20a5d 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 843b6c58..8c9c6c8c 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 48c4a1ff..c8e3c672 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 1bcaf419..eba45738 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 136d475a..8dd8cc79 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 46307d18..f902592c 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 7b91d880..ea2612e2 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index d739778b..c3b35c56 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index dd644e54..55f13db0 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index da8337cb..646956cd 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 62c1f68f..bc9c8902 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 8dc3f006..564f4e6f 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 41526906..2946641c 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index e19eaec5..917e0cc7 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 0c9f7b92..6032d68c 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 715c3df4..c9b86c82 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -1 +1,204 @@ - CodeIgniter User Guide : Smiley Helper

    CodeIgniter User Guide Version 1.5.4


    Smiley Helper

    The Smiley Helper file contains functions that let you manage smileys (emoticons).

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('smiley');

    Overview

    The Smiley helper has a renderer that takes plain text simileys, like :-) and turns them into a image representation, like smile!

    It also lets you display a set of smiley images that when clicked will be inserted into a form field. For example, if you have a blog that allows user commenting you can show the smileys next to the comment form. Your users can click a desired smiley and with the help of some JavaScript it will be placed into the form field.

    Clickable Smileys Tutorial

    Here is an example demonstrating how you might create a set of clickable smileys next to a form field. This example requires that you first download and install the smiley images, then create a controller and the View as described.

    Important: Before you begin, please download the smiley images and put them in a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at application/config/smileys.php

    The Controller

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    Important: Change the URL in the get_clickable_smileys() function below so that it points to your smiley folder.

    You'll notice that in addition to the smiley helper we are using the Table Class.

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    Function Reference

    get_clickable_smileys()

    Returns an array containing your smiley images wrapped in a cliackable link. You must supply the URL to your smiley folder via the first parameter:

    $image_array = get_clickable_smileys("http://www.your-site.com/images/smileys/");

    js_insert_smiley()

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. The first parameter must contain the name of your form, the second parameter must contain the name of the form field. This function is designed to be placed into the <head> area of your web page.

    <?php echo js_insert_smiley('blog', 'comments'); ?>

    parse_smileys()

    Takes a string of text as input and replaces any contained plain text smileys into the image equivalent. The first parameter must contain your string, the second must contain the the URL to your smiley folder:

    $str = 'Here are some simileys: :-) ;-)'; $str = parse_smileys($str, "http://www.your-site.com/images/smileys/"); echo $str;
    \ No newline at end of file + + + + +CodeIgniter User Guide : Smiley Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Smiley Helper

    + +

    The Smiley Helper file contains functions that let you manage smileys (emoticons).

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('smiley'); + +

    Overview

    + +

    The Smiley helper has a renderer that takes plain text simileys, like :-) and turns +them into a image representation, like smile!

    + +

    It also lets you display a set of smiley images that when clicked will be inserted into a form field. +For example, if you have a blog that allows user commenting you can show the smileys next to the comment form. +Your users can click a desired smiley and with the help of some JavaScript it will be placed into the form field.

    + + + +

    Clickable Smileys Tutorial

    + +

    Here is an example demonstrating how you might create a set of clickable smileys next to a form field. This example +requires that you first download and install the smiley images, then create a controller and the View as described.

    + +

    Important: Before you begin, please download the smiley images and put them in +a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at +application/config/smileys.php

    + + +

    The Controller

    + +

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    + +

    Important: Change the URL in the get_clickable_smileys() function below so that it points to +your smiley folder.

    + +

    You'll notice that in addition to the smiley helper we are using the Table Class.

    + + + +

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    + + + + + +

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    + +

    Function Reference

    + + +

    get_clickable_smileys()

    + +

    Returns an array containing your smiley images wrapped in a cliackable link. You must supply the URL to your smiley folder +via the first parameter:

    + +$image_array = get_clickable_smileys("http://www.your-site.com/images/smileys/"); + + +

    js_insert_smiley()

    + +

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. +The first parameter must contain the name of your form, the second parameter must contain the name of the +form field. This function is designed to be placed into the <head> area of your web page.

    + +<?php echo js_insert_smiley('blog', 'comments'); ?> + + +

    parse_smileys()

    + +

    Takes a string of text as input and replaces any contained plain text smileys into the image +equivalent. The first parameter must contain your string, the second must contain the the URL to your smiley folder:

    + + + +$str = 'Here are some simileys: :-) ;-)'; + +$str = parse_smileys($str, "http://www.your-site.com/images/smileys/"); + +echo $str; + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 554afc82..74be2306 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -1 +1,176 @@ - CodeIgniter User Guide : String Helper

    CodeIgniter User Guide Version 1.5.4


    String Helper

    The String Helper file contains functions that assist in working with strings.

    Loading this Helper

    This helper is loaded using the following code:

    $this->load->helper('string');

    The following functions are available:

    random_string()

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • numeric:  Numeric string.
    • nozero:  Numeric string with no zeros.
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. Returns a fixed length 33 character string.

    Usage example:

    echo random_string('alnum', 16);

    alternator()

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    for ($i = 0; $i < 10; $i++)
    {
        echo alternator('string one', 'string two');
    }

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    for ($i = 0; $i < 10; $i++)
    {
        echo alternator('one', 'two', 'three', 'four', 'five');
    }

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    repeater()

    Generates repeating copies of the data you submit. Example:

    $string = "\n";
    echo repeater($string, 30);

    The above would generate 30 newlines.

    reduce_double_slashes()

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    $string = "http://www.example.com//index.php";
    echo reduce_double_slashes($string); // results in "http://www.example.com/index.php"

    trim_slashes()

    Removes any leading/trailing slashes from a string. Example:

    $string = "/this/that/theother/";
    echo trim_slashes($string); // results in this/that/theother

    reduce_multiples()

    Reduces multiple instances of a particular character occuring directly after each other. Example:

    $string="Fred, Bill,, Joe, Jimmy";
    $string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"

    The function accepts the following parameters: reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string) The first parameter contrains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced. The third parameter is False by default. If it it's to true it will remove occurences of the character at the beginning and the end of the string. Example: $string=",Fred, Bill,, Joe, Jimmy,";
    $string=reduce_multiples($string,",",true); //results in "Fred, Bill, Joe, Jimmy"

    quotes_to_entities()

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    $string="Joe's \"dinner\"";
    $string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;"

    strip_quotes()

    Removes single and double quotes from a string. Example:

    $string="Joe's \"dinner\"";
    $string=strip_quotes($string); //results in "Joes dinner"
    \ No newline at end of file + + + + +CodeIgniter User Guide : String Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    String Helper

    + +

    The String Helper file contains functions that assist in working with strings.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('string'); + +

    The following functions are available:

    + +

    random_string()

    + +

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    + +

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    + + +
      +
    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • +
    • numeric:  Numeric string.
    • +
    • nozero:  Numeric string with no zeros.
    • +
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. +Returns a fixed length 33 character string.
    • +
    + +

    Usage example:

    + +echo random_string('alnum', 16); + + +

    alternator()

    + +

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    + +for ($i = 0; $i < 10; $i++)
    +{
    +    echo alternator('string one', 'string two');
    +}
    +
    + +

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    + +for ($i = 0; $i < 10; $i++)
    +{
    +    echo alternator('one', 'two', 'three', 'four', 'five');
    +}
    +
    + +

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    + + + +

    repeater()

    +

    Generates repeating copies of the data you submit. Example:

    +$string = "\n";
    +echo repeater($string, 30);
    + +

    The above would generate 30 newlines.

    +

    reduce_double_slashes()

    +

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    +$string = "http://www.example.com//index.php";
    +echo reduce_double_slashes($string); // results in "http://www.example.com/index.php"
    +

    trim_slashes()

    +

    Removes any leading/trailing slashes from a string. Example:
    +
    + $string = "/this/that/theother/";
    +echo trim_slashes($string); // results in this/that/theother

    + + +

    reduce_multiples()

    +

    Reduces multiple instances of a particular character occuring directly after each other. Example:

    + +$string="Fred, Bill,, Joe, Jimmy";
    +$string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy" +
    +

    The function accepts the following parameters: +reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string) + +The first parameter contrains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced. +The third parameter is False by default. If it it's to true it will remove occurences of the character at the beginning and the end of the string. Example: + + +$string=",Fred, Bill,, Joe, Jimmy,";
    +$string=reduce_multiples($string,",",true); //results in "Fred, Bill, Joe, Jimmy" +
    +

    + +

    quotes_to_entities()

    +

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    +$string="Joe's \"dinner\"";
    +$string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;" +
    + +

    strip_quotes()

    +

    Removes single and double quotes from a string. Example:

    +$string="Joe's \"dinner\"";
    +$string=strip_quotes($string); //results in "Joes dinner" +
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 7a83d8f9..217689c4 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 686f5c23..e3d18f8f 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index f2c45c34..854d06a2 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 6336eec5..47082a59 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/index.html b/user_guide/index.html index e944de71..69c90fc0 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f93b8977..1104f8ba 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 299f73e8..c31c6615 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 40b7e36c..ceff6a52 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 0c251cb8..ee4b1b21 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 7a296def..9a5f7d72 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index f74eadc0..0edef1d5 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 628ce9b3..e3cd1abf 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 3aa8a633..ece73a58 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index bc5fab1f..04e68f35 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 69867888..ff4bcc39 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 6b15a8e8..9a3e801e 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 7a3e8955..22d8d288 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 7c455422..54dabda3 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 8b94fdf7..c1c90b33 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html new file mode 100644 index 00000000..9aa15b2e --- /dev/null +++ b/user_guide/installation/upgrade_160.html @@ -0,0 +1,108 @@ + + + + +CodeIgniter User Guide : Upgrading from 1.5.3 to 1.5.4 + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.5.4 to 1.6.0

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/libraries
    • +
    • system/plugins
    • +
    • system/language
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +

    Step 2: Add time_to_update to your config.php

    +

    Add the following to system/application/config/config.php with the other session configuration options

    +

    $config['sess_time_to_update'] = 300;

    + +

    Step 3: Add to your database.php

    +

    Add the following to system/application/config/database.php with the other database configuration options

    +

    $db['default']['char_set'] = "utf8";
    +$db['default']['dbcollat'] = "utf8_general_ci";

    + +

    Step 4: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 7253e4fc..a57d5529 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 6546a5bb..ecc00b2f 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index f17554e0..af83f8e5 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index ae6c571a..698df01c 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 3eec0a02..67352adc 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 527c34a4..c59374ca 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -1 +1,299 @@ - CodeIgniter User Guide : Email Class

    CodeIgniter User Guide Version 1.5.4


    Email Class

    CodeIgniter's robust Email Class supports the following features:

    • Multiple Protocols: Mail, Sendmail, and SMTP
    • Multiple recipients
    • CC and BCCs
    • HTML or Plaintext email
    • Attachments
    • Word wrapping
    • Priorities
    • BCC Batch Mode, enabling large email lists to be broken into small BCC batches.
    • Email Debugging tools

    Sending Email

    Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

    Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your controllers.

    $this->load->library('email');

    $this->email->from('your@your-site.com', 'Your Name');
    $this->email->to('someone@example.com');
    $this->email->cc('another@another-example.com');
    $this->email->bcc('them@their-example.com');

    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');

    $this->email->send();

    echo $this->email->print_debugger();

    Setting Email Preferences

    There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually as described here, or automatically via preferences stored in your config file, described below:

    Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

    $config['protocol'] = 'sendmail';
    $config['mailpath'] = '/usr/sbin/sendmail';
    $config['charset'] = 'iso-8859-1';
    $config['wordwrap'] = TRUE;

    $this->email->initialize($config);

    Note: Most of the preferences have default values that will be used if you do not set them.

    Setting Email Preferences in a Config File

    If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

    Email Preferences

    The following is a list of all the preferences that can be set when sending email.

    Preference Default Value Options Description
    useragentCodeIgniterNoneThe "user agent".
    protocolmailmail, sendmail, or smtpThe mail sending protocol.
    mailpath/usr/sbin/sendmailNoneThe server path to Sendmail.
    smtp_hostNo DefaultNoneSMTP Server Address.
    smtp_userNo DefaultNoneSMTP Username.
    smtp_passNo DefaultNoneSMTP Password.
    smtp_port25NoneSMTP Port.
    smtp_timeout5NoneSMTP Timeout (in seconds).
    wordwrapTRUETRUE or FALSE (boolean)Enable word-wrap.
    wrapchars76 Character count to wrap at.
    mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
    charsetutf-8Character set (utf-8, iso-8859-1, etc.).
    validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
    priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
    newline\n"\r\n" or "\n"Newline character. (Use "\r\n" to comply with RFC 822).
    bcc_batch_modeFALSETRUE or FALSE (boolean)Enable BCC Batch Mode.
    bcc_batch_size200NoneNumber of emails in each BCC batch.

    Email Function Reference

    $this->email->from()

    Sets the email address and name of the person sending the email:

    $this->email->from('you@your-site.com', 'Your Name');

    $this->email->reply_to()

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    $this->email->reply_to('you@your-site.com', 'Your Name');

    $this->email->to()

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    $this->email->to('someone@example.com'); $this->email->to('one@example.com, two@example.com, three@example.com'); $list = array('one@example.com', 'two@example.com', 'three@example.com');

    $this->email->to($list);

    $this->email->cc()

    Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    $this->email->bcc()

    Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    $this->email->subject()

    Sets the email subject:

    $this->email->subject('This is my subject');

    $this->email->message()

    Sets the email message body:

    $this->email->message('This is my message');

    $this->email->set_alt_message()

    Sets the alternative email message body:

    $this->email->set_alt_message('This is the alternative message');

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative message with no HTML formatting which is added to the header string for people who do not accept HTML email. If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

    $this->email->clear()

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function in a loop, permitting the data to be reset between cycles.

    foreach ($list as $name => $address)
    {
        $this->email->clear();

        $this->email->to($address);
        $this->email->from('your@your-site.com');
        $this->email->subject('Here is your info '.$name);
        $this->email->message('Hi '.$name.' Here is the info you requested.');
        $this->email->send();
    }

    If you set the parameter to TRUE any attachments will be cleared as well:

    $this->email->clear(TRUE);

    $this->email->send()

    The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used conditionally:

    if ( ! $this->email->send())
    {
        // Generate error
    }

    $this->email->attach()

    Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. For multiple attachments use the function multiple times. For example:

    $this->email->attach('/path/to/photo1.jpg');
    $this->email->attach('/path/to/photo2.jpg');
    $this->email->attach('/path/to/photo3.jpg');

    $this->email->send();

    $this->email->print_debugger()

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    Overriding Word Wrapping

    If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override word wrapping within part of your message like this:

    The text of your email that
    gets wrapped normally.

    {unwrap}http://www.example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}

    More text that will be
    wrapped normally.

    Place the item you do not want word-wrapped between: {unwrap} {/unwrap}

    \ No newline at end of file + + + + +CodeIgniter User Guide : Email Class + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Email Class

    + +

    CodeIgniter's robust Email Class supports the following features:

    + + +
      +
    • Multiple Protocols: Mail, Sendmail, and SMTP
    • +
    • Multiple recipients
    • +
    • CC and BCCs
    • +
    • HTML or Plaintext email
    • +
    • Attachments
    • +
    • Word wrapping
    • +
    • Priorities
    • +
    • BCC Batch Mode, enabling large email lists to be broken into small BCC batches.
    • +
    • Email Debugging tools
    • +
    + + +

    Sending Email

    + +

    Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

    + +

    Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your +controllers.

    + +$this->load->library('email');
    +
    +$this->email->from('your@your-site.com', 'Your Name');
    +$this->email->to('someone@example.com');
    +$this->email->cc('another@another-example.com');
    +$this->email->bcc('them@their-example.com');
    +
    +$this->email->subject('Email Test');
    +$this->email->message('Testing the email class.');
    +
    +$this->email->send();
    +
    +echo $this->email->print_debugger();
    + + + + +

    Setting Email Preferences

    + +

    There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually +as described here, or automatically via preferences stored in your config file, described below:

    + +

    Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

    + +$config['protocol'] = 'sendmail';
    +$config['mailpath'] = '/usr/sbin/sendmail';
    +$config['charset'] = 'iso-8859-1';
    +$config['wordwrap'] = TRUE;
    +
    +$this->email->initialize($config);
    + +

    Note: Most of the preferences have default values that will be used if you do not set them.

    Setting Email Preferences in a Config File

    + +

    If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the email.php, add the $config +array in that file. Then save the file at config/email.php and it will be used automatically. You +will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

    + + + + +

    Email Preferences

    + +

    The following is a list of all the preferences that can be set when sending email.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    useragentCodeIgniterNoneThe "user agent".
    protocolmailmail, sendmail, or smtpThe mail sending protocol.
    mailpath/usr/sbin/sendmailNoneThe server path to Sendmail.
    smtp_hostNo DefaultNoneSMTP Server Address.
    smtp_userNo DefaultNoneSMTP Username.
    smtp_passNo DefaultNoneSMTP Password.
    smtp_port25NoneSMTP Port.
    smtp_timeout5NoneSMTP Timeout (in seconds).
    wordwrapTRUETRUE or FALSE (boolean)Enable word-wrap.
    wrapchars76 Character count to wrap at.
    mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
    charsetutf-8Character set (utf-8, iso-8859-1, etc.).
    validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
    priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
    newline\n"\r\n" or "\n"Newline character. (Use "\r\n" to comply with RFC 822).
    bcc_batch_modeFALSETRUE or FALSE (boolean)Enable BCC Batch Mode.
    bcc_batch_size200NoneNumber of emails in each BCC batch.
    + + +

    Email Function Reference

    + +

    $this->email->from()

    +

    Sets the email address and name of the person sending the email:

    +$this->email->from('you@your-site.com', 'Your Name'); + +

    $this->email->reply_to()

    +

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    +$this->email->reply_to('you@your-site.com', 'Your Name'); + + +

    $this->email->to()

    +

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    + +$this->email->to('someone@example.com'); +$this->email->to('one@example.com, two@example.com, three@example.com'); + +$list = array('one@example.com', 'two@example.com', 'three@example.com');
    +
    +$this->email->to($list);
    + +

    $this->email->cc()

    +

    Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    + +

    $this->email->bcc()

    +

    Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    + + +

    $this->email->subject()

    +

    Sets the email subject:

    +$this->email->subject('This is my subject'); + +

    $this->email->message()

    +

    Sets the email message body:

    +$this->email->message('This is my message'); + +

    $this->email->set_alt_message()

    +

    Sets the alternative email message body:

    +$this->email->set_alt_message('This is the alternative message'); + +

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative +message with no HTML formatting which is added to the header string for people who do not accept HTML email. +If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

    + + + +

    $this->email->clear()

    +

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function +in a loop, permitting the data to be reset between cycles.

    +foreach ($list as $name => $address)
    +{
    +    $this->email->clear();

    + +    $this->email->to($address);
    +    $this->email->from('your@your-site.com');
    +    $this->email->subject('Here is your info '.$name);
    +    $this->email->message('Hi '.$name.' Here is the info you requested.');
    +    $this->email->send();
    +}
    + +

    If you set the parameter to TRUE any attachments will be cleared as well:

    + +$this->email->clear(TRUE); + + +

    $this->email->send()

    +

    The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used +conditionally:

    + +if ( ! $this->email->send())
    +{
    +    // Generate error
    +}
    + + +

    $this->email->attach()

    +

    Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. +For multiple attachments use the function multiple times. For example:

    + +$this->email->attach('/path/to/photo1.jpg');
    +$this->email->attach('/path/to/photo2.jpg');
    +$this->email->attach('/path/to/photo3.jpg');
    +
    +$this->email->send();
    + + +

    $this->email->print_debugger()

    +

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    + + +

    Overriding Word Wrapping

    + +

    If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can +get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override +word wrapping within part of your message like this:

    + +The text of your email that
    +gets wrapped normally.
    +
    +{unwrap}http://www.example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
    +
    +More text that will be
    +wrapped normally.
    + +

    Place the item you do not want word-wrapped between: {unwrap} {/unwrap}

    + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index ab6195cb..f3b3d440 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 86ee0cc8..46865aca 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index b88b640a..58581196 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 83dc8b3c..39c1bd27 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index de623c07..2bca88ae 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 7883e2a0..3ee62008 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 7ff597c6..6aec87c1 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 27a458a8..2d131956 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index d18d364f..e05a6e88 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index a5271dea..dab6937e 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 0e627d12..93eb38dd 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -1 +1,292 @@ - CodeIgniter User Guide : HTML Table Class

    CodeIgniter User Guide Version 1.5.4


    HTML Table Class

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    Initializing the Class

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    $this->load->library('table');

    Once loaded, the Table library object will be available using: $this->table

    Examples

    Here is an example showing how you can create a table from a multi-dimensional array. Note that the first array index will become the table heading (or you can set your own headings using the set_heading() function described in the function reference below).

    $this->load->library('table');

    $data = array(
                 array('Name', 'Color', 'Size'),
                 array('Fred', 'Blue', 'Small'),
                 array('Mary', 'Red', 'Large'),
                 array('John', 'Green', 'Medium')
                 );

    echo $this->table->generate($data);

    Here is an example of a table created from a database query result. The table class will automatically generate the headings based on the table names (or you can set your own headings using the set_heading() function described in the function reference below).

    $this->load->library('table');

    $query = $this->db->query("SELECT * FROM my_table");

    echo $this->table->generate($query);

    Here is an example showing how you might create a table using discreet parameters:

    $this->load->library('table');

    $this->table->set_heading('Name', 'Color', 'Size');

    $this->table->add_row('Fred', 'Blue', 'Small');
    $this->table->add_row('Mary', 'Red', 'Large');
    $this->table->add_row('John', 'Green', 'Medium');

    echo $this->table->generate();

    Here is the same example, except instead of individual parameters, arrays are used:

    $this->load->library('table');

    $this->table->set_heading(array('Name', 'Color', 'Size'));

    $this->table->add_row(array('Fred', 'Blue', 'Small'));
    $this->table->add_row(array('Mary', 'Red', 'Large'));
    $this->table->add_row(array('John', 'Green', 'Medium'));

    echo $this->table->generate();

    Changing the Look of Your Table

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype:

    $tmpl = array (
                        'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',

                        'heading_row_start'   => '<tr>',
                        'heading_row_end'     => '</tr>',
                        'heading_cell_start'  => '<th>',
                        'heading_cell_end'    => '</th>',

                        'row_start'           => '<tr>',
                        'row_end'             => '</tr>',
                        'cell_start'          => '<td>',
                        'cell_end'            => '</td>',

                        'row_alt_start'       => '<tr>',
                        'row_alt_end'         => '</tr>',
                        'cell_alt_start'      => '<td>',
                        'cell_alt_end'        => '</td>',

                        'table_close'         => '</table>'
                  );

    $this->table->set_template($tmpl);

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data.

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed:

    $tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

    $this->table->set_template($tmpl);

    Function Reference

    $this->table->generate()

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    $this->table->set_caption()

    Permits you to add a caption to the table.

    $this->table->set_caption('Colors');

    $this->table->set_heading()

    Permits you to set the table heading. You can submit an array or discreet params:

    $this->table->set_heading('Name', 'Color', 'Size'); $this->table->set_heading(array('Name', 'Color', 'Size'));

    $this->table->add_row()

    Permits you to add a row to your table. You can submit an array or discreet params:

    $this->table->add_row('Blue', 'Red', 'Green'); $this->table->add_row(array('Blue', 'Red', 'Green'));

    $this->table->make_columns()

    This function takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns desired. This allows a single array with many elements to be displayed in a table that has a fixed column count. Consider this example:

    $list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');

    $new_list = $this->table->make_columns($list, 3);

    $this->table->generate($new_list);

    // Generates a table with this prototype

    <table border="0" cellpadding="4" cellspacing="0">
    <tr>
    <td>one</td><td>two</td><td>three</td>
    </tr><tr>
    <td>four</td><td>five</td><td>six</td>
    </tr><tr>
    <td>seven</td><td>eight</td><td>nine</td>
    </tr><tr>
    <td>ten</td><td>eleven</td><td>twelve</td></tr>
    </table>

    $this->table->set_template()

    Permits you to set your template. You can submit a full or partial template.

    $tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );

    $this->table->set_template($tmpl);

    $this->table->set_empty()

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    $this->table->set_empty("&nbsp;");

    $this->table->clear()

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this function after each table has been generated to empty the previous table information. Example:

    $this->load->library('table');

    $this->table->set_heading('Name', 'Color', 'Size');
    $this->table->add_row('Fred', 'Blue', 'Small');
    $this->table->add_row('Mary', 'Red', 'Large');
    $this->table->add_row('John', 'Green', 'Medium');

    echo $this->table->generate();

    $this->table->clear();

    $this->table->set_heading('Name', 'Day', 'Delivery');
    $this->table->add_row('Fred', 'Wednesday', 'Express');
    $this->table->add_row('Mary', 'Monday', 'Air');
    $this->table->add_row('John', 'Saturday', 'Overnight');

    echo $this->table->generate();
    \ No newline at end of file + + + + +CodeIgniter User Guide : HTML Table Class + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    HTML Table Class

    + +

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('table'); +

    Once loaded, the Table library object will be available using: $this->table

    + + +

    Examples

    + +

    Here is an example showing how you can create a table from a multi-dimensional array. +Note that the first array index will become the table heading (or you can set your own headings using the +set_heading() function described in the function reference below).

    + + +$this->load->library('table');
    +
    +$data = array(
    +             array('Name', 'Color', 'Size'),
    +             array('Fred', 'Blue', 'Small'),
    +             array('Mary', 'Red', 'Large'),
    +             array('John', 'Green', 'Medium')
    +             );
    +
    +echo $this->table->generate($data); +
    + +

    Here is an example of a table created from a database query result. The table class will automatically generate the +headings based on the table names (or you can set your own headings using the set_heading() function described +in the function reference below).

    + + +$this->load->library('table');
    +
    +$query = $this->db->query("SELECT * FROM my_table");
    +
    +echo $this->table->generate($query); +
    + + +

    Here is an example showing how you might create a table using discreet parameters:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading('Name', 'Color', 'Size');
    +
    +$this->table->add_row('Fred', 'Blue', 'Small');
    +$this->table->add_row('Mary', 'Red', 'Large');
    +$this->table->add_row('John', 'Green', 'Medium');
    +
    +echo $this->table->generate(); +
    + +

    Here is the same example, except instead of individual parameters, arrays are used:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading(array('Name', 'Color', 'Size'));
    +
    +$this->table->add_row(array('Fred', 'Blue', 'Small'));
    +$this->table->add_row(array('Mary', 'Red', 'Large'));
    +$this->table->add_row(array('John', 'Green', 'Medium'));
    +
    +echo $this->table->generate(); +
    + + +

    Changing the Look of Your Table

    + +

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template +prototype:

    + + +$tmpl = array (
    +                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',
    +
    +                    'heading_row_start'   => '<tr>',
    +                    'heading_row_end'     => '</tr>',
    +                    'heading_cell_start'  => '<th>',
    +                    'heading_cell_end'    => '</th>',
    +
    +                    'row_start'           => '<tr>',
    +                    'row_end'             => '</tr>',
    +                    'cell_start'          => '<td>',
    +                    'cell_end'            => '</td>',
    +
    +                    'row_alt_start'       => '<tr>',
    +                    'row_alt_end'         => '</tr>',
    +                    'cell_alt_start'      => '<td>',
    +                    'cell_alt_end'        => '</td>',
    +
    +                    'table_close'         => '</table>'
    +              );
    + +
    +$this->table->set_template($tmpl); +
    + +

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each +iteration of the row data.

    + +

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. +In this example, only the table opening tag is being changed:

    + + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    + +
    +

    Function Reference

    + +

    $this->table->generate()

    +

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    + +

    $this->table->set_caption()

    + +

    Permits you to add a caption to the table.

    + +$this->table->set_caption('Colors'); + +

    $this->table->set_heading()

    + +

    Permits you to set the table heading. You can submit an array or discreet params:

    + +$this->table->set_heading('Name', 'Color', 'Size'); +$this->table->set_heading(array('Name', 'Color', 'Size')); + +

    $this->table->add_row()

    + +

    Permits you to add a row to your table. You can submit an array or discreet params:

    + +$this->table->add_row('Blue', 'Red', 'Green'); +$this->table->add_row(array('Blue', 'Red', 'Green')); + + +

    $this->table->make_columns()

    + +

    This function takes a one-dimensional array as input and creates +a multi-dimensional array with a depth equal to the number of +columns desired. This allows a single array with many elements to be +displayed in a table that has a fixed column count. Consider this example:

    + + +$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
    +
    +$new_list = $this->table->make_columns($list, 3);
    +
    +$this->table->generate($new_list);
    +
    +// Generates a table with this prototype
    +
    +<table border="0" cellpadding="4" cellspacing="0">
    +<tr>
    +<td>one</td><td>two</td><td>three</td>
    +</tr><tr>
    +<td>four</td><td>five</td><td>six</td>
    +</tr><tr>
    +<td>seven</td><td>eight</td><td>nine</td>
    +</tr><tr>
    +<td>ten</td><td>eleven</td><td>twelve</td></tr>
    +</table>
    + + + +

    $this->table->set_template()

    + +

    Permits you to set your template. You can submit a full or partial template.

    + + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    + + +

    $this->table->set_empty()

    + +

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    + + +$this->table->set_empty("&nbsp;"); + + +

    $this->table->clear()

    + +

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should +to call this function after each table has been generated to empty the previous table information. Example:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading('Name', 'Color', 'Size');
    +$this->table->add_row('Fred', 'Blue', 'Small');
    +$this->table->add_row('Mary', 'Red', 'Large');
    +$this->table->add_row('John', 'Green', 'Medium');
    +
    +echo $this->table->generate();
    +
    +$this->table->clear();
    +
    +$this->table->set_heading('Name', 'Day', 'Delivery');
    +$this->table->add_row('Fred', 'Wednesday', 'Express');
    +$this->table->add_row('Mary', 'Monday', 'Air');
    +$this->table->add_row('John', 'Saturday', 'Overnight');
    +
    +echo $this->table->generate(); +
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index a971cb0c..096e16ac 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index e2f1d114..1f37649c 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 4b71480b..2306d82a 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -1 +1,252 @@ - CodeIgniter User Guide : URI Class

    CodeIgniter User Guide Version 1.5.4


    URI Class

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can also retrieve information about the re-routed segments.

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    $this->uri->segment(n)

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this:

    http://www.your-site.com/index.php/news/local/metro/crime_is_up

    The segment numbers would be this:

    1. news
    2. local
    3. metro
    4. crime_is_up

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, this would tell the function to return the number zero in the event of failure:

    $product_id = $this->uri->segment(3, 0);

    It helps avoid having to write code like this:

    if ($this->uri->segment(3) === FALSE)
    {
        $product_id = 0;
    }
    else
    {
        $product_id = $this->uri->segment(3);
    }

    $this->uri->rsegment(n)

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->slash_segment(n)

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second parameter. If the parameter is not used, a trailing slash added. Examples:

    $this->uri->slash_segment(3);
    $this->uri->slash_segment(3, 'leading');
    $this->uri->slash_segment(3, 'both');

    Returns:

    1. segment/
    2. /segment
    3. /segment/

    $this->uri->slash_rsegment(n)

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->uri_to_assoc(n)

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    index.php/user/search/name/joe/location/UK/gender/male

    Using this function you can turn the URI into an associative array with this prototype:

    [array]
    (
        'name' => 'joe'
        'location' => 'UK'
        'gender' => 'male'
    )

    The first parameter of the function lets you set an offset. By default it is set to 3 since your URI will normally contain a controller/function in the first and second segments. Example:

    $array = $this->uri->uri_to_assoc(3);

    echo $array['name'];

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    $default = array('name', 'gender', 'location', 'type', 'sort');

    $array = $this->uri->uri_to_assoc(3, $default);

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    $this->uri->ruri_to_assoc(n)

    This function is identical to the previous one, except that it creates an associative array using the re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->assoc_to_uri()

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    $array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');

    $str = $this->uri->assoc_to_uri($array);

    // Produces: product/shoes/size/large/color/red

    $this->uri->uri_string()

    Returns a string with the complete URI. For example, if this is your full URL:

    http://www.your-site.com/index.php/news/local/345

    The function would return this:

    /news/local/345

    $this->uri->ruri_string(n)

    This function is identical to the previous one, except that it returns the re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->total_segments()

    Returns the total number of segments.

    $this->uri->total_rsegments(n)

    This function is identical to the previous one, except that it returns the total number of segments in your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    $this->uri->segment_array()

    Returns an array containing the URI segments. For example:

    $segs = $this->uri->segment_array();

    foreach ($segs as $segment)
    {
        echo $segment;
        echo '<br />';
    }

    $this->uri->rsegment_array(n)

    This function is identical to the previous one, except that it returns the array of segments in your re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    \ No newline at end of file + + + + +CodeIgniter User Guide : URI Class + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    URI Class

    + +

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can +also retrieve information about the re-routed segments.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + +

    $this->uri->segment(n)

    + +

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. +Segments are numbered from left to right. For example, if your full URL is this:

    + +http://www.your-site.com/index.php/news/local/metro/crime_is_up + +

    The segment numbers would be this:

    + +
      +
    1. news
    2. +
    3. local
    4. +
    5. metro
    6. +
    7. crime_is_up
    8. +
    + +

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that +permits you to set your own default value if the segment is missing. +For example, this would tell the function to return the number zero in the event of failure:

    + +$product_id = $this->uri->segment(3, 0); + +

    It helps avoid having to write code like this:

    + +if ($this->uri->segment(3) === FALSE)
    +{
    +    $product_id = 0;
    +}
    +else
    +{
    +    $product_id = $this->uri->segment(3);
    +}
    +
    + +

    $this->uri->rsegment(n)

    + +

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + +

    $this->uri->slash_segment(n)

    + +

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second +parameter. If the parameter is not used, a trailing slash added. Examples:

    + +$this->uri->slash_segment(3);
    +$this->uri->slash_segment(3, 'leading');
    +$this->uri->slash_segment(3, 'both');
    + +

    Returns:

    + +
      +
    1. segment/
    2. +
    3. /segment
    4. +
    5. /segment/
    6. +
    + + +

    $this->uri->slash_rsegment(n)

    + +

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->uri_to_assoc(n)

    + +

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    + +index.php/user/search/name/joe/location/UK/gender/male + +

    Using this function you can turn the URI into an associative array with this prototype:

    + +[array]
    +(
    +    'name' => 'joe'
    +    'location' => 'UK'
    +    'gender' => 'male'
    +)
    + +

    The first parameter of the function lets you set an offset. By default it is set to 3 since your +URI will normally contain a controller/function in the first and second segments. Example:

    + + +$array = $this->uri->uri_to_assoc(3);
    +
    +echo $array['name']; +
    + + +

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    + + +$default = array('name', 'gender', 'location', 'type', 'sort');
    +
    +$array = $this->uri->uri_to_assoc(3, $default);
    + +

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    + +

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    + + +

    $this->uri->ruri_to_assoc(n)

    + +

    This function is identical to the previous one, except that it creates an associative array using the +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + +

    $this->uri->assoc_to_uri()

    + +

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    + +$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
    +
    +$str = $this->uri->assoc_to_uri($array);
    +
    +// Produces: product/shoes/size/large/color/red +
    + + +

    $this->uri->uri_string()

    + +

    Returns a string with the complete URI. For example, if this is your full URL:

    + +http://www.your-site.com/index.php/news/local/345 + +

    The function would return this:

    + +/news/local/345 + + +

    $this->uri->ruri_string(n)

    + +

    This function is identical to the previous one, except that it returns the +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->total_segments()

    + +

    Returns the total number of segments.

    + + +

    $this->uri->total_rsegments(n)

    + +

    This function is identical to the previous one, except that it returns the total number of segments in your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->segment_array()

    + +

    Returns an array containing the URI segments. For example:

    + + +$segs = $this->uri->segment_array();
    +
    +foreach ($segs as $segment)
    +{
    +    echo $segment;
    +    echo '<br />';
    +}
    + +

    $this->uri->rsegment_array(n)

    + +

    This function is identical to the previous one, except that it returns the array of segments in your +re-routed URI in the event you are using CodeIgniter's URI Routing feature. + + + +

    + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 7dc747ef..ab37935e 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -1 +1,201 @@ - CodeIgniter User Guide : User Agent Class

    CodeIgniter User Guide Version 1.5.4


    User Agent Class

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. In addition you can get referrer information as well as language and supported character-set information.

    Initializing the Class

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    $this->load->library('user_agent');

    Once loaded, the object will be available using: $this->agent

    User Agent Definitions

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the various user agent arrays if needed.

    Example

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    $this->load->library('user_agent');

    if ($this->agent->is_browser())
    {
        $agent = $this->agent->browser().' '.$this->agent->version();
    }
    elseif ($this->agent->is_robot())
    {
        $agent = $this->agent->robot();
    }
    elseif ($this->agent->is_mobile())
    {
        $agent = $this->agent->mobile();
    }
    else
    {
        $agent = 'Unidentified User Agent';
    }

    echo $agent;

    echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)

    Function Reference

    $this->agent->is_browser()

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    $this->agent->is_mobile()

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    $this->agent->is_robot()

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    Note:  The user agent library only contains the most common robot definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your application/config/user_agents.php file.

    $this->agent->is_referral()

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    $this->agent->browser()

    Returns a string containing the name of the web browser viewing your site.

    $this->agent->version()

    Returns a string containing the version number of the web browser viewing your site.

    $this->agent->mobile()

    Returns a string containing the name of the mobile device viewing your site.

    $this->agent->robot()

    Returns a string containing the name of the robot viewing your site.

    $this->agent->platform()

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    $this->agent->referrer()

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    if ($this->agent->is_referral())
    {
        echo $this->agent->referrer();
    }

    $this->agent->agent_string()

    Returns a string containing the full user agent string. Typically it will be something like this:

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2

    $this->agent->accept_lang()

    Lets you determine if the user agent accepts a particular language. Example:

    if ($this->agent->accept_lang('en'))
    {
        echo 'You accept English!';
    }

    Note: This function is not typically very reliable since some browsers do not provide language info, and even among those that do, it is not always accurate.

    $this->agent->accept_charset()

    Lets you determine if the user agent accepts a particular character set. Example:

    if ($this->agent->accept_charset('utf-8'))
    {
        echo 'You browser supports UTF-8!';
    }

    Note: This function is not typically very reliable since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    \ No newline at end of file + + + + +CodeIgniter User Guide : User Agent Class + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    User Agent Class

    + +

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. +In addition you can get referrer information as well as language and supported character-set information.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('user_agent'); +

    Once loaded, the object will be available using: $this->agent

    + +

    User Agent Definitions

    + +

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the +various user agent arrays if needed.

    + +

    Example

    + +

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is +a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    + + + +$this->load->library('user_agent');
    +
    +if ($this->agent->is_browser())
    +{
    +    $agent = $this->agent->browser().' '.$this->agent->version();
    +}
    +elseif ($this->agent->is_robot())
    +{
    +    $agent = $this->agent->robot();
    +}
    +elseif ($this->agent->is_mobile())
    +{
    +    $agent = $this->agent->mobile();
    +}
    +else
    +{
    +    $agent = 'Unidentified User Agent';
    +}
    +
    +echo $agent;
    +
    +echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) +
    + + +

    Function Reference

    + + +

    $this->agent->is_browser()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    + +

    $this->agent->is_mobile()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    + +

    $this->agent->is_robot()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    + +

    Note:  The user agent library only contains the most common robot +definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be +very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your +application/config/user_agents.php file.

    + +

    $this->agent->is_referral()

    +

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    + + +

    $this->agent->browser()

    +

    Returns a string containing the name of the web browser viewing your site.

    + +

    $this->agent->version()

    +

    Returns a string containing the version number of the web browser viewing your site.

    + +

    $this->agent->mobile()

    +

    Returns a string containing the name of the mobile device viewing your site.

    + +

    $this->agent->robot()

    +

    Returns a string containing the name of the robot viewing your site.

    + +

    $this->agent->platform()

    +

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    + +

    $this->agent->referrer()

    +

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    + + if ($this->agent->is_referral())
    +{
    +    echo $this->agent->referrer();
    +}
    + + +

    $this->agent->agent_string()

    +

    Returns a string containing the full user agent string. Typically it will be something like this:

    + +Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2 + + +

    $this->agent->accept_lang()

    +

    Lets you determine if the user agent accepts a particular language. Example:

    + +if ($this->agent->accept_lang('en'))
    +{
    +    echo 'You accept English!';
    +}
    + +

    Note: This function is not typically very reliable +since some browsers do not provide language info, and even among those that do, it is not always accurate.

    + + + +

    $this->agent->accept_charset()

    +

    Lets you determine if the user agent accepts a particular character set. Example:

    + +if ($this->agent->accept_charset('utf-8'))
    +{
    +    echo 'You browser supports UTF-8!';
    +}
    + +

    Note: This function is not typically very reliable +since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 90ff0c12..30de0fd2 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index cd2f9e30..03912791 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -1 +1,487 @@ - CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes

    CodeIgniter User Guide Version 1.5.4


    XML-RPC and XML-RPC Server Classes

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up your own XML-RPC server to receive requests.

    What is XML-RPC?

    Quite simply it is a way for two computers to communicate over the internet using XML. One computer, which we will call the client, sends an XML-RPC request to another computer, which we will call the server. Once the server receives and processes the request it will send back a response to the client.

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will send a request to an XML-RPC Server running on your site. This request might be a new weblog entry being sent for publication, or it could be a request for an existing entry for editing. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. Once processed, the server will then send back a response message.

    For detailed specifications, you can visit the XML-RPC site.

    Initializing the Class

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    To load the XML-RPC class you will use:

    $this->load->library('xmlrpc');

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    To load the XML-RPC Server class you will use:

    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs');

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    Sending XML-RPC Requests

    To send a request to an XML-RPC server you must specify the following information:

    • The URL of the server
    • The method on the server you wish to call
    • The request data (explained below).

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    $this->load->library('xmlrpc');

    $this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    $this->xmlrpc->method('weblogUpdates.ping');

    $request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    $this->xmlrpc->request($request);

    if ( ! $this->xmlrpc->send_request())
    {
        echo $this->xmlrpc->display_error();
    }

    Explanation

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The request (in this case, the title and URL of your site) is placed into an array for transportation, and compiled using the request() function. Lastly, the full request is sent. If the send_request() method returns false we will display the error message sent back from the XML-RPC Server.

    Anatomy of a Request

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request is referred to as a request parameter. The above example has two parameters: The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    Request parameters must be placed into an array for transportation, and each parameter can be one of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings you will have to include the data type in the request array.

    Here is an example of a simple array with three parameters:

    $request = array('John', 'Doe', 'www.some-site.com');
    $this->xmlrpc->request($request);

    If you use data types other than strings, or if you have several different data types, you will place each parameter into its own array, with the data type in the second position:

    $request = array (
                       array('John', 'string'),
                       array('Doe', 'string'),
                       array(FALSE, 'boolean'),
                       array(12345, 'int')
                     );
    $this->xmlrpc->request($request);
    The Data Types section below has a full list of data types.

    Creating an XML-RPC Server

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the appropriate functions for processing.

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate class and method for processing.

    Here is an example to illustrate:

    $this->load->library('xmlrpc');
    $this->load->library('xmlrpcs');

    $config['functions']['new_post']  = array('function' => 'My_blog.new_entry');
    $config['functions']['update_post'] = array('function' => 'My_blog.update_entry');

    $this->xmlrpcs->initialize($config);
    $this->xmlrpcs->serve();

    The above example contains an array specifying two method requests that the Server allows. The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    In other words, if an XML-RPC Client sends a request for the new_post method, your server will load the My_blog class and call the new_entry function. If the request is for the update_post method, your server will load the My_blog class and call the update_entry function.

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    Processing Server Requests

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass an object to that method containing the data sent by the client.

    Using the above example, if the new_post method is requested, the server will expect a class to exist with this prototype:

    class My_blog extends Controller {

        function new_post($request)
        {

        }
    }

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. Using this object you will have access to the request parameters enabling you to process the request. When you are done you will send a Response back to the Client.

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing function might look:

    class My_blog extends Controller {

        function getUserInfo($request)
        {
            $username = 'smitty';
            $password = 'secretsmittypass';

            $this->load->library('xmlrpc');
        
            $parameters = $request->output_parameters();
        
            if ($parameters['1'] != $username AND $parameters['2'] != $password)
            {
                return $this->xmlrpc->send_error_message('100', 'Invalid Access');
            }
        
            $response = array(array('nickname'  => array('Smitty','string'),
                                    'userid'    => array('99','string'),
                                    'url'       => array('http://yoursite.com','string'),
                                    'email'     => array('jsmith@yoursite.com','string'),
                                    'lastname'  => array('Smith','string'),
                                    'firstname' => array('John','string')
                                    ),
                             'struct');

            return $this->xmlrpc->send_response($response);
        }
    }

    Notes:

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. In the above example, the output parameters will be the username and password.

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    If the operation was successful, the client will be sent back a response array containing the user's info.

    Formatting a Response

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array that contains a single item. This item can be an array with several additional arrays, but there can be only one primary array index. In other words, the basic prototype is this:

    $response = array('Response data', 'array');

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    $response = array (
                       array(
                             'first_name' => array('John', 'string'),
                             'last_name' => array('Doe', 'string'),
                             'member_id' => array(123435, 'int'),
                             'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
                            ),
                     'struct'
                     );

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    As with Requests, a response can be on of the seven data types listed in the Data Types section.

    Sending an Error Response

    If you need to send the client an error response you will use the following:

    return $this->xmlrpc->send_error_message('123', 'Requested data not available');

    The first parameter is the error number while the second parameter is the error message.

    Creating Your Own Client and Server

    To help you understand everything we've covered thus far, let's create a couple controllers that act as XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    The Client

    Using a text editor, create a controller called xmlrpc_client.php. In it, place this code and save it to your applications/controllers/ folder:

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    The Server

    Using a text editor, create a controller called xmlrpc_server.php. In it, place this code and save it to your applications/controllers/ folder:

    Try it!

    Now visit the your site using a URL similar to this:

    www.your-site.com/index.php/xmlrpc_client/

    You should now see the message you sent to the server, and its response back to you.

    The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. The Server receives the request and maps it to the "process" function, where a response is sent back.

     

    XML-RPC Function Reference

    $this->xmlrpc->server()

    Sets the URL and port number of the server to which a request is to be sent:

    $this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);

    $this->xmlrpc->timeout()

    Set a time out period (in seconds) after which the request will be canceled:

    $this->xmlrpc->timeout(6);

    $this->xmlrpc->method()

    Sets the method that will be requested from the XML-RPC server:

    $this->xmlrpc->method('method');

    Where method is the name of the method.

    $this->xmlrpc->request()

    Takes an array of data and builds request to be sent to XML-RPC server:

    $request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    $this->xmlrpc->request($request);

    $this->xmlrpc->send_request()

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    $this->xmlrpc->set_debug(TRUE);

    Enables debugging, which will display a variety of information and error data helpful during development.

    $this->xmlrpc->display_error()

    Returns an error message as a string if your request failed for some reason.

    echo $this->xmlrpc->display_error();

    $this->xmlrpc->display_response()

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    $this->xmlrpc->display_response();

    $this->xmlrpc->send_error_message()

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter is the error message.

    return $this->xmlrpc->send_error_message('123', 'Requested data not available');

    $this->xmlrpc->send_response()

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    $response = array(
                     array(
                            'flerror' => array(FALSE, 'boolean'),
                            'message' => "Thanks for the ping!")
                         )
                     'struct');
    return $this->xmlrpc->send_response($response);

    Data Types

    According to the XML-RPC spec there are seven types of values that you can send via XML-RPC:

    • int or i4
    • boolean
    • string
    • double
    • dateTime.iso8601
    • base64
    • struct (contains array of values)
    • array (contains array of values)
    \ No newline at end of file + + + + +CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    XML-RPC and XML-RPC Server Classes

    + + +

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up +your own XML-RPC server to receive requests.

    + + +

    What is XML-RPC?

    + +

    Quite simply it is a way for two computers to communicate over the internet using XML. +One computer, which we will call the client, sends an XML-RPC request to +another computer, which we will call the server. Once the server receives and processes the request it +will send back a response to the client.

    + +

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will +send a request to an XML-RPC Server running on your site. This request might be a new weblog entry +being sent for publication, or it could be a request for an existing entry for editing. + +When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. +Once processed, the server will then send back a response message.

    + +

    For detailed specifications, you can visit the XML-RPC site.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    + +

    To load the XML-RPC class you will use:

    +$this->load->library('xmlrpc'); +

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    + +

    To load the XML-RPC Server class you will use:

    + +$this->load->library('xmlrpc');
    +$this->load->library('xmlrpcs'); +
    +

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    + +

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    + + + +

    Sending XML-RPC Requests

    + +

    To send a request to an XML-RPC server you must specify the following information:

    + +
      +
    • The URL of the server
    • +
    • The method on the server you wish to call
    • +
    • The request data (explained below).
    • +
    + +

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    + + +$this->load->library('xmlrpc');
    +
    +$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    +$this->xmlrpc->method('weblogUpdates.ping');
    + +
    +$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    +$this->xmlrpc->request($request);
    +
    +if ( ! $this->xmlrpc->send_request())
    +{
    +    echo $this->xmlrpc->display_error();
    +}
    + +

    Explanation

    + +

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The +request (in this case, the title and URL of your site) is placed into an array for transportation, and +compiled using the request() function. +Lastly, the full request is sent. If the send_request() method returns false we will display the error message +sent back from the XML-RPC Server.

    + +

    Anatomy of a Request

    + +

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request +is referred to as a request parameter. The above example has two parameters: +The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    + +

    Request parameters must be placed into an array for transportation, and each parameter can be one +of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings +you will have to include the data type in the request array.

    + +

    Here is an example of a simple array with three parameters:

    + +$request = array('John', 'Doe', 'www.some-site.com');
    +$this->xmlrpc->request($request);
    + +

    If you use data types other than strings, or if you have several different data types, you will place +each parameter into its own array, with the data type in the second position:

    + + +$request = array (
    +                   array('John', 'string'),
    +                   array('Doe', 'string'),
    +                   array(FALSE, 'boolean'),
    +                   array(12345, 'int')
    +                 ); +
    +$this->xmlrpc->request($request);
    + +The Data Types section below has a full list of data types. + + + +

    Creating an XML-RPC Server

    + +

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the +appropriate functions for processing.

    + +

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming +request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate +class and method for processing.

    + +

    Here is an example to illustrate:

    + + +$this->load->library('xmlrpc');
    +$this->load->library('xmlrpcs');
    +
    +$config['functions']['new_post']  = array('function' => 'My_blog.new_entry');
    +$config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
    +
    +$this->xmlrpcs->initialize($config);
    +$this->xmlrpcs->serve();
    + +

    The above example contains an array specifying two method requests that the Server allows. +The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    + +

    In other words, if an XML-RPC Client sends a request for the new_post method, your +server will load the My_blog class and call the new_entry function. +If the request is for the update_post method, your +server will load the My_blog class and call the update_entry function.

    + +

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, +or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    + + +

    Processing Server Requests

    + +

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass +an object to that method containing the data sent by the client.

    + +

    Using the above example, if the new_post method is requested, the server will expect a class +to exist with this prototype:

    + +class My_blog extends Controller {
    +
    +    function new_post($request)
    +    {
    +
    +    }
    +} +
    + +

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. +Using this object you will have access to the request parameters enabling you to process the request. When +you are done you will send a Response back to the Client.

    + +

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). +Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends +back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing +function might look:

    + + +class My_blog extends Controller {
    +
    +    function getUserInfo($request)
    +    {
    + +        $username = 'smitty';
    +        $password = 'secretsmittypass';

    + +        $this->load->library('xmlrpc');
    +    
    +        $parameters = $request->output_parameters();
    +    
    +        if ($parameters['1'] != $username AND $parameters['2'] != $password)
    +        {
    +            return $this->xmlrpc->send_error_message('100', 'Invalid Access');
    +        }
    +    
    +        $response = array(array('nickname'  => array('Smitty','string'),
    +                                'userid'    => array('99','string'),
    +                                'url'       => array('http://yoursite.com','string'),
    +                                'email'     => array('jsmith@yoursite.com','string'),
    +                                'lastname'  => array('Smith','string'),
    +                                'firstname' => array('John','string')
    +                                ),
    +                         'struct');
    +
    +        return $this->xmlrpc->send_response($response);
    +    }
    +} +
    + +

    Notes:

    +

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. +In the above example, the output parameters will be the username and password.

    + +

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    + +

    If the operation was successful, the client will be sent back a response array containing the user's info.

    + + +

    Formatting a Response

    + +

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array +that contains a single item. This item can be an array with several additional arrays, but there +can be only one primary array index. In other words, the basic prototype is this:

    + +$response = array('Response data', 'array'); + +

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own +array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    + + +$response = array (
    +                   array(
    +                         'first_name' => array('John', 'string'),
    +                         'last_name' => array('Doe', 'string'),
    +                         'member_id' => array(123435, 'int'),
    +                         'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
    +                        ),
    +                 'struct'
    +                 ); +
    + +

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    + +

    As with Requests, a response can be on of the seven data types listed in the Data Types section.

    + + +

    Sending an Error Response

    + +

    If you need to send the client an error response you will use the following:

    + +return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

    The first parameter is the error number while the second parameter is the error message.

    + + + + + + +

    Creating Your Own Client and Server

    + +

    To help you understand everything we've covered thus far, let's create a couple controllers that act as +XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    + +

    The Client

    + +

    Using a text editor, create a controller called xmlrpc_client.php. +In it, place this code and save it to your applications/controllers/ folder:

    + + + +

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    + +

    The Server

    + +

    Using a text editor, create a controller called xmlrpc_server.php. +In it, place this code and save it to your applications/controllers/ folder:

    + + + +

    Try it!

    + +

    Now visit the your site using a URL similar to this:

    +www.your-site.com/index.php/xmlrpc_client/ + +

    You should now see the message you sent to the server, and its response back to you.

    + +

    The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. +The Server receives the request and maps it to the "process" function, where a response is sent back.

    + + + +

     

    +

    XML-RPC Function Reference

    + +

    $this->xmlrpc->server()

    +

    Sets the URL and port number of the server to which a request is to be sent:

    +$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80); + +

    $this->xmlrpc->timeout()

    +

    Set a time out period (in seconds) after which the request will be canceled:

    +$this->xmlrpc->timeout(6); + +

    $this->xmlrpc->method()

    +

    Sets the method that will be requested from the XML-RPC server:

    +$this->xmlrpc->method('method'); + +

    Where method is the name of the method.

    + +

    $this->xmlrpc->request()

    +

    Takes an array of data and builds request to be sent to XML-RPC server:

    +$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    +$this->xmlrpc->request($request);
    + +

    $this->xmlrpc->send_request()

    +

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    + +

    $this->xmlrpc->set_debug(TRUE);

    +

    Enables debugging, which will display a variety of information and error data helpful during development.

    + + +

    $this->xmlrpc->display_error()

    +

    Returns an error message as a string if your request failed for some reason.

    +echo $this->xmlrpc->display_error(); + +

    $this->xmlrpc->display_response()

    +

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    +$this->xmlrpc->display_response(); + +

    $this->xmlrpc->send_error_message()

    +

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter +is the error message.

    +return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

    $this->xmlrpc->send_response()

    +

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    +$response = array(
    +                 array(
    +                        'flerror' => array(FALSE, 'boolean'),
    +                        'message' => "Thanks for the ping!")
    +                     )
    +                 'struct');
    +return $this->xmlrpc->send_response($response);
    + + + +

    Data Types

    + +

    According to the XML-RPC spec there are seven types +of values that you can send via XML-RPC:

    + +
      +
    • int or i4
    • +
    • boolean
    • +
    • string
    • +
    • double
    • +
    • dateTime.iso8601
    • +
    • base64
    • +
    • struct (contains array of values)
    • +
    • array (contains array of values)
    • +
    + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 165d61b0..a2ef6c42 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/license.html b/user_guide/license.html index 8c712e53..ddee1c08 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 9e070ac3..2a3d52fe 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 8614daed..7fe91530 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -1 +1,172 @@ - CodeIgniter User Guide : CodeIgniter at a Glance

    CodeIgniter User Guide Version 1.5.4


    CodeIgniter at a Glance

    CodeIgniter is an Application Framework

    CodeIgniter is a toolkit for people who build web application 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.

    CodeIgniter is Free

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. For more information please read the license agreement.

    CodeIgniter Runs on PHP 4

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    CodeIgniter is Light Weight

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system is very lean and quite fast.

    CodeIgniter is Fast

    Really fast. We challenge you to find a framework that has better performance than CodeIgniter.

    CodeIgniter Uses M-V-C

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    CodeIgniter Generates Clean URLs

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    www.your-site.com/news/article/345

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    CodeIgniter Packs a Punch

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

    CodeIgniter is Extensible

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    CodeIgniter Does Not Require a Template Engine

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    <ul>

    <?php foreach ($addressbook as $name):?>

    <li><?=$name?></li>

    <?php endforeach; ?>

    </ul>

    Contrast this with the pseudo-code used by a template engine:

    <ul>

    {foreach from=$addressbook item="name"}

    <li>{$name}</li>

    {/foreach}

    </ul>

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    CodeIgniter is Thoroughly Documented

    Programmers love to code and hate to write documentation. We're no different, of course, but since documentation is as important as the code itself, we are committed to doing it. Our source code is extremely clean and well commented as well.

    CodeIgniter has a Friendly Community of Users

    Our growing community of users can be seen actively participating in our Community Forums.

    \ No newline at end of file + + + + +CodeIgniter User Guide : CodeIgniter at a Glance + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    CodeIgniter at a Glance

    + + +

    CodeIgniter is an Application Framework

    + +

    CodeIgniter is a toolkit for people who build web application 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.

    + +

    CodeIgniter is Free

    +

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. +For more information please read the license agreement.

    + + +

    CodeIgniter Runs on PHP 4

    +

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling +in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), +at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our +potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so +we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    + +

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    + +

    CodeIgniter is Light Weight

    +

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system +is very lean and quite fast. +

    + +

    CodeIgniter is Fast

    +

    Really fast. We challenge you to find a framework that has better performance than CodeIgniter.

    + + +

    CodeIgniter Uses M-V-C

    +

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. +This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    + +

    CodeIgniter Generates Clean URLs

    +

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" +approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    + +www.your-site.com/news/article/345 + +

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    + +

    CodeIgniter Packs a Punch

    +

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, +like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and +much more.

    + +

    CodeIgniter is Extensible

    +

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    + + +

    CodeIgniter Does Not Require a Template Engine

    +

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. + +Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    + +<ul>
    +
    +<?php foreach ($addressbook as $name):?>
    +
    +<li><?=$name?></li>
    +
    +<?php endforeach; ?>
    +
    +</ul>
    + +

    Contrast this with the pseudo-code used by a template engine:

    + +<ul>
    +
    +{foreach from=$addressbook item="name"}
    +
    +<li>{$name}</li>
    +
    +{/foreach}
    +
    +</ul>
    + +

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted +back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    + + +

    CodeIgniter is Thoroughly Documented

    +

    Programmers love to code and hate to write documentation. We're no different, of course, but +since documentation is as important as the code itself, +we are committed to doing it. Our source code is extremely clean and well commented as well.

    + + +

    CodeIgniter has a Friendly Community of Users

    + +

    Our growing community of users can be seen actively participating in our Community Forums.

    + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 02b953ed..14bace86 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 4685da8e..738c91da 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 9b6abac2..66622b44 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index b168542f..868c9612 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/toc.html b/user_guide/toc.html index 3f6b16e4..6ab19a3c 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
    - +

    CodeIgniter User Guide Version 1.5.4

    CodeIgniter User Guide Version 1.6.0

    From 35683d6584628220510d964da0015f9f98af34dc Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 21:22:03 +0000 Subject: [PATCH 0795/2544] added char_set and dbcollat to the code comments --- system/application/config/database.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/application/config/database.php b/system/application/config/database.php index 1ee0c4bb..59b97398 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -25,6 +25,8 @@ | ['active_r'] TRUE/FALSE - Whether to load the active record class | ['cache_on'] TRUE/FALSE - Enables/disables query caching | ['cachedir'] The path to the folder where cache files should be stored +| ['char_set'] The character set used in communicating with the database +| ['dbcollat'] The character collation used in communicating with the database | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the "default" group). From 60e8d912da6380f3d9a2a1c58058cc99b70a8c45 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 21:47:29 +0000 Subject: [PATCH 0796/2544] typos --- user_guide/changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 902e5e64..9bf79659 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,7 +71,7 @@

    Version 1.6.0

  • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
  • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
  • Added protect_identifiers() in Active Record.
  • -
  • Alll AR queries are backticked if appropriate to the database.
  • +
  • All AR queries are backticked if appropriate to the database.
  • Added where_in(), where_in_or(), where_not_in(), where_not_in_or(), not_like() and or_not_like() to Active Record.
  • Added support for limit() into update() and delete() statements in Active Record.
  • Added empty_table() and truncate_table() to Active Record.
  • @@ -99,7 +99,7 @@

    Version 1.6.0

  • Documented the timezones() function in the Date Helper.
  • Documented unset_userdata in the Session class.
  • Documented 2 config options to the Database configuration page.
  • -
  • Fixed a bug in highlight_pharse() that caused an error with slashes.
  • +
  • Fixed a bug in highlight_phrase() that caused an error with slashes.
  • Fixed a bug: $field_names[] vs $Ffield_names[] in postgre and sqlite drivers.
  • Fixed a bug in the upload library when allowed_files wasn't defined.
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • From 91f50b626517ff34a0436df8e08f2dddfd2d5d7a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 21:48:18 +0000 Subject: [PATCH 0797/2544] fix for single word identifiers with no spaces that need protecting in _protect_identifiers() --- system/database/drivers/mysql/mysql_driver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index a164552e..9dc69767 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -452,7 +452,7 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) !== FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" if ($first_word_only === TRUE) @@ -462,6 +462,10 @@ function _protect_identifiers($item, $first_word_only = FALSE) $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); } + else + { + return "`{$item}`"; + } $exceptions = array('AS', '/', '-', '%', '+', '*'); From 68d021b7d83a9c9a991fc0cef8cddd8149487255 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 21:58:37 +0000 Subject: [PATCH 0798/2544] === instead of !== ::blush:: --- system/database/drivers/mysql/mysql_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 9dc69767..4535e8cd 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -452,7 +452,7 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (ctype_alnum($item) !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" if ($first_word_only === TRUE) From cdbdf2d30dd1dd6aff2ea25e9875814080d416e2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 22:18:03 +0000 Subject: [PATCH 0799/2544] special fix for $first_word_only to work with other changes to _protect_identifiers() --- system/database/drivers/mysql/mysql_driver.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 4535e8cd..36e36516 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -455,12 +455,9 @@ function _protect_identifiers($item, $first_word_only = FALSE) if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" - if ($first_word_only === TRUE) - { - return '`'.preg_replace('/ /', '` ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); } else { From 6157938ad5dd9d48607921593ca4ed7bff3e3a8b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 22:22:42 +0000 Subject: [PATCH 0800/2544] --- system/database/drivers/mysqli/mysqli_driver.php | 15 ++++++++------- system/database/drivers/oci8/oci8_driver.php | 15 ++++++++------- system/database/drivers/odbc/odbc_driver.php | 15 ++++++++------- .../database/drivers/postgre/postgre_driver.php | 15 ++++++++------- system/database/drivers/sqlite/sqlite_driver.php | 15 ++++++++------- 5 files changed, 40 insertions(+), 35 deletions(-) diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index d295ca9f..94a29937 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -446,27 +446,28 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" - if ($first_word_only === TRUE) - { - return '`'.preg_replace('/ /', '` ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + } + else + { + return "`{$item}`"; } $exceptions = array('AS', '/', '-', '%', '+', '*'); foreach ($exceptions as $exception) { + if (stristr($item, " `{$exception}` ") !== FALSE) { $item = preg_replace('/ `('.preg_quote($exception).')` /i', ' $1 ', $item); } } - return $item; } diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 6d3b7226..160a56d5 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -557,27 +557,28 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" - if ($first_word_only === TRUE) - { - return '`'.preg_replace('/ /', '` ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + } + else + { + return "`{$item}`"; } $exceptions = array('AS', '/', '-', '%', '+', '*'); foreach ($exceptions as $exception) { + if (stristr($item, " `{$exception}` ") !== FALSE) { $item = preg_replace('/ `('.preg_quote($exception).')` /i', ' $1 ', $item); } } - return $item; } diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 0bdfc41d..c5c582d0 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -422,27 +422,28 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" - if ($first_word_only === TRUE) - { - return '`'.preg_replace('/ /', '` ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + } + else + { + return "`{$item}`"; } $exceptions = array('AS', '/', '-', '%', '+', '*'); foreach ($exceptions as $exception) { + if (stristr($item, " `{$exception}` ") !== FALSE) { $item = preg_replace('/ `('.preg_quote($exception).')` /i', ' $1 ', $item); } } - return $item; } diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 63a72f5d..fa27f03d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -444,27 +444,28 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need ""item1" "item2"" and not ""item1 item2"" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return ""field" >= 1" - if ($first_word_only === TRUE) - { - return '"'.preg_replace('/ /', '" ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item); + } + else + { + return ""{$item}""; } $exceptions = array('AS', '/', '-', '%', '+', '*'); foreach ($exceptions as $exception) { + if (stristr($item, " "{$exception}" ") !== FALSE) { $item = preg_replace('/ "('.preg_quote($exception).')" /i', ' $1 ', $item); } } - return $item; } diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 2d0ca157..110b208d 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -438,27 +438,28 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "item1 item2" as a string, and so // we may need "`item1` `item2`" and not "`item1 item2`" - if (strpos($item, ' ') !== FALSE) + if (ctype_alnum($item) === FALSE) { // This function may get "field >= 1", and need it to return "`field` >= 1" - if ($first_word_only === TRUE) - { - return '`'.preg_replace('/ /', '` ', $item, 1); - } + $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^|\s|\()([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1`$2`$3', $item); + } + else + { + return "`{$item}`"; } $exceptions = array('AS', '/', '-', '%', '+', '*'); foreach ($exceptions as $exception) { + if (stristr($item, " `{$exception}` ") !== FALSE) { $item = preg_replace('/ `('.preg_quote($exception).')` /i', ' $1 ', $item); } } - return $item; } From 9884449add2bf1a52de10b82a366637b595734fd Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 22:26:37 +0000 Subject: [PATCH 0801/2544] Added Compat.php file --- index.php | 16 ------ system/codeigniter/CodeIgniter.php | 2 +- system/codeigniter/Compat.php | 84 ++++++++++++++++++++++++++++++ user_guide/changelog.html | 2 + 4 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 system/codeigniter/Compat.php diff --git a/index.php b/index.php index 7b47d081..eb364ec0 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,4 @@ mark('total_execution_time_start'); $BM->mark('loading_time_base_classes_start'); /* * ------------------------------------------------------ * Instantiate the hooks class * ------------------------------------------------------ */ $EXT =& load_class('Hooks'); /* * ------------------------------------------------------ * Is there a "pre_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ * Instantiate the base classes * ------------------------------------------------------ */ $CFG =& load_class('Config'); $URI =& load_class('URI'); $RTR =& load_class('Router'); $OUT =& load_class('Output'); /* * ------------------------------------------------------ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache($CFG, $RTR) == TRUE) { exit; } } /* * ------------------------------------------------------ * Load the remaining base classes * ------------------------------------------------------ */ $IN =& load_class('Input'); $LANG =& load_class('Language'); /* * ------------------------------------------------------ * Load the app controller and local controller * ------------------------------------------------------ * * Note: Due to the poor object handling in PHP 4 we'll * conditionally load different versions of the base * class. Retaining PHP 4 compatibility requires a bit of a hack. * * Note: The Loader class needs to be included first * */ if (floor(phpversion()) < 5) { load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); } else { require(BASEPATH.'codeigniter/Base5'.EXT); } // Load the base controller class load_class('Controller', FALSE); // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); /* * ------------------------------------------------------ * Security check * ------------------------------------------------------ * * None of the functions in the app controller or the * loader class can be called via the URI, nor can * controller functions that begin with an underscore */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) OR $method == 'controller' OR substr($method, 0, 1) == '_' OR in_array($method, get_class_methods('Controller'), TRUE) ) { show_404(); } /* * ------------------------------------------------------ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ * Instantiate the controller and call requested method * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); // Instantiate the Controller and pass any global data that might exist $assign_to_controller = ( ! isset($assign_to_controller)) ? NULL : $assign_to_controller; $CI = new $class($assign_to_controller); unset($assign_to_controller); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) { if ($EXT->_call_hook('scaffolding_override') === FALSE) { $CI->_ci_scaffolding(); } } else { /* * ------------------------------------------------------ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); // Is there a "remap" function? if (method_exists($CI, '_remap')) { $CI->_remap($method); } else { if ( ! method_exists($CI, $method)) { show_404(); } // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); } } // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); /* * ------------------------------------------------------ * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } /* * ------------------------------------------------------ * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } ?> \ No newline at end of file +mark('total_execution_time_start'); $BM->mark('loading_time_base_classes_start'); /* * ------------------------------------------------------ * Instantiate the hooks class * ------------------------------------------------------ */ $EXT =& load_class('Hooks'); /* * ------------------------------------------------------ * Is there a "pre_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ * Instantiate the base classes * ------------------------------------------------------ */ $CFG =& load_class('Config'); $URI =& load_class('URI'); $RTR =& load_class('Router'); $OUT =& load_class('Output'); /* * ------------------------------------------------------ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache($CFG, $RTR) == TRUE) { exit; } } /* * ------------------------------------------------------ * Load the remaining base classes * ------------------------------------------------------ */ $IN =& load_class('Input'); $LANG =& load_class('Language'); /* * ------------------------------------------------------ * Load the app controller and local controller * ------------------------------------------------------ * * Note: Due to the poor object handling in PHP 4 we'll * conditionally load different versions of the base * class. Retaining PHP 4 compatibility requires a bit of a hack. * * Note: The Loader class needs to be included first * */ if (floor(phpversion()) < 5) { load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); } else { require(BASEPATH.'codeigniter/Base5'.EXT); } // Load the base controller class load_class('Controller', FALSE); // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); /* * ------------------------------------------------------ * Security check * ------------------------------------------------------ * * None of the functions in the app controller or the * loader class can be called via the URI, nor can * controller functions that begin with an underscore */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) OR $method == 'controller' OR substr($method, 0, 1) == '_' OR in_array($method, get_class_methods('Controller'), TRUE) ) { show_404(); } /* * ------------------------------------------------------ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ * Instantiate the controller and call requested method * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); // Instantiate the Controller and pass any global data that might exist $assign_to_controller = ( ! isset($assign_to_controller)) ? NULL : $assign_to_controller; $CI = new $class($assign_to_controller); unset($assign_to_controller); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) { if ($EXT->_call_hook('scaffolding_override') === FALSE) { $CI->_ci_scaffolding(); } } else { /* * ------------------------------------------------------ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); // Is there a "remap" function? if (method_exists($CI, '_remap')) { $CI->_remap($method); } else { if ( ! method_exists($CI, $method)) { show_404(); } // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); } } // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); /* * ------------------------------------------------------ * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } /* * ------------------------------------------------------ * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } ?> \ No newline at end of file diff --git a/system/codeigniter/Compat.php b/system/codeigniter/Compat.php new file mode 100644 index 00000000..3c5f70d6 --- /dev/null +++ b/system/codeigniter/Compat.php @@ -0,0 +1,84 @@ + \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9bf79659..e879918e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

    Version 1.6.0

  • Added support for external urls in form_open().
  • Added a language entry for valid_ip validation error.
  • Added titles to all user manual pages.
  • +
  • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
  • Added Zip Encoding Class to the table of contents of the userguide.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • Moved part of the userguide menu javascript to an external file.
  • @@ -118,6 +119,7 @@

    Version 1.6.0

  • Fixed a bug in the parser class where numeric data was ignored.
  • Fixed a bug when loading plugin files as _plugin. and not _pi.
  • Fixed a bug in the SQLite driver for PHP 4.
  • +
  • Fixed a bug in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • From ba1e4f852dcbccedbb7be89ae4dfeefc8018aaae Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 23:09:30 +0000 Subject: [PATCH 0802/2544] deprecated scaffolding --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e879918e..ce24491e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -131,7 +131,8 @@

    Version 1.6.0

  • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login).
  • Fixed assorted user guide typos.
  • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • - +
  • Deprecated Scaffolding.
  • + From 47845f201626e4e2751bd73cd5823f334f47e43d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 23:23:02 +0000 Subject: [PATCH 0803/2544] prefixed reserved variables of _ci_load() in order to not conflict with view file variables --- system/libraries/Loader.php | 30 +++++++++++++++--------------- user_guide/changelog.html | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index f833cb71..b78790d6 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -295,7 +295,7 @@ function dbforge() */ function view($view, $vars = array(), $return = FALSE) { - return $this->_ci_load(array('view' => $view, 'vars' => $this->_ci_object_to_array($vars), 'return' => $return)); + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); } // -------------------------------------------------------------------- @@ -312,7 +312,7 @@ function view($view, $vars = array(), $return = FALSE) */ function file($path, $return = FALSE) { - return $this->_ci_load(array('path' => $path, 'return' => $return)); + return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); } // -------------------------------------------------------------------- @@ -611,25 +611,25 @@ function scaffolding($table = '') function _ci_load($data) { // Set the default data variables - foreach (array('view', 'vars', 'path', 'return') as $val) + foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $val) { $$val = ( ! isset($data[$val])) ? FALSE : $data[$val]; } // Set the path to the requested file - if ($path == '') + if ($_ci_path == '') { - $ext = pathinfo($view, PATHINFO_EXTENSION); - $file = ($ext == '') ? $view.EXT : $view; - $path = $this->_ci_view_path.$file; + $ext = pathinfo($_ci_view, PATHINFO_EXTENSION); + $file = ($ext == '') ? $_ci_view.EXT : $_ci_view; + $_ci_path = $this->_ci_view_path.$file; } else { - $x = explode('/', $path); + $x = explode('/', $_ci_path); $file = end($x); } - if ( ! file_exists($path)) + if ( ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$file); } @@ -658,9 +658,9 @@ function _ci_load($data) * the two types and cache them so that views that are embedded within * other views can have access to these variables. */ - if (is_array($vars)) + if (is_array($_ci_vars)) { - $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $vars); + $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars); } extract($this->_ci_cached_vars); @@ -684,17 +684,17 @@ function _ci_load($data) if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { - echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace(''.preg_replace("/;*\s*\?>/", "; ?>", str_replace('Version 1.6.0
  • Added Zip Encoding Class to the table of contents of the userguide.
  • Moved the safe mode and auth checks for the Email library into the constructor.
  • Moved part of the userguide menu javascript to an external file.
  • +
  • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
  • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
  • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
  • Documented distinct() in Active Record.
  • From 825bc9b3d6e4895a8c1473cd25852dad0fe6d5f5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 23:37:42 +0000 Subject: [PATCH 0804/2544] fixed a bug if num_link wasn't postive --- system/libraries/Pagination.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 538c4272..76968197 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -124,6 +124,13 @@ function create_links() // Prep the current page - no funny business! $this->cur_page = (int) $this->cur_page; } + + $this->num_links = (int)$this->num_links; + + if ($this->num_links < 1) + { + show_error('Your number of links must be a positive number.'); + } if ( ! is_numeric($this->cur_page)) { From 7226bb9036833a5619014f7c64f036cdc281e5cd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 23:39:13 +0000 Subject: [PATCH 0805/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d5fb0242..91e6168e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -121,6 +121,7 @@

    Version 1.6.0

  • Fixed a bug when loading plugin files as _plugin. and not _pi.
  • Fixed a bug in the SQLite driver for PHP 4.
  • Fixed a bug in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
  • +
  • Fixed a bug in Pagination to scan for non-positive num_links.
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • From fbe122d0c029f254019d6ebb53c9b85706d0a1a1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 16 Jan 2008 23:59:30 +0000 Subject: [PATCH 0806/2544] added some extra protection in ctype_ function overrides to make return values match PHP's native methods for non-string types and empty strings --- system/codeigniter/Compat.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system/codeigniter/Compat.php b/system/codeigniter/Compat.php index 3c5f70d6..108b0a1a 100644 --- a/system/codeigniter/Compat.php +++ b/system/codeigniter/Compat.php @@ -55,6 +55,11 @@ { function ctype_digit($str) { + if (! is_string($str) OR $str == '') + { + return FALSE; + } + return ! preg_match('/[^0-9]/', $str); } } @@ -75,6 +80,11 @@ function ctype_digit($str) { function ctype_alnum($str) { + if (! is_string($str) OR $str == '') + { + return FALSE; + } + return ! preg_match('/[^0-9a-z]/i', $str); } } From 8b25191aededd91dd4ab942fd0c776f073433db2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 00:34:37 +0000 Subject: [PATCH 0807/2544] Fixed bug #2810 with nested tags improperly having paragraph tags placed around them. --- system/helpers/typography_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 355f02cf..aa751db8 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -152,8 +152,8 @@ function convert($str) * ends. Later on we'll do some further clean up. * */ - $str = preg_replace("#(<.*?)(".$this->block_elements.")(.*?>)#", "

    \\1\\2\\3", $str); - $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

    ", $str); + $str = preg_replace("#(<)(".$this->block_elements.")(.*?>)#", "

    \\1\\2\\3", $str); + $str = preg_replace("#(block_elements.")(.*?>)#", "\\1\\2\\3

    ", $str); /* * Convert "ignore" tags to temporary marker From 6b9e36d35da9c1963b9e22c7c526e24a87f35e6a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 00:37:46 +0000 Subject: [PATCH 0808/2544] typography helper bugfix note --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 91e6168e..f2ae1f8c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -122,6 +122,7 @@

    Version 1.6.0

  • Fixed a bug in the SQLite driver for PHP 4.
  • Fixed a bug in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
  • Fixed a bug in Pagination to scan for non-positive num_links.
  • +
  • Fixed a bug in the typography helper causing extraneous paragraph tags when string contains tags.
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • @@ -529,4 +530,4 @@

    Version Beta 1.0

    - \ No newline at end of file + From bafe651a15358793689e2e2f7efcfcdfec2869ae Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 03:37:53 +0000 Subject: [PATCH 0809/2544] typos --- user_guide/changelog.html | 4 ++-- user_guide/general/models.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f2ae1f8c..eec1c2e9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,7 +62,7 @@

    Version 1.6.0

    • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
    • Added the ability to auto-load Models
    • -
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or no. Previously they were always saved.
    • +
    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
    • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
    • Reorganized the URI and Routes classes for better clarity.
    • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
    • @@ -530,4 +530,4 @@

      Version Beta 1.0

    - + diff --git a/user_guide/general/models.html b/user_guide/general/models.html index cfeefaca..f5238eec 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -203,7 +203,7 @@

    Loading a Model

    }

    Auto-loading Models

    -

    If you find that you need a particular model globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the mdoel to the autoload array.

    +

    If you find that you need a particular model globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the model to the autoload array.

    Connecting to your Database

    From 0796b8df9e0abcda2caeb078aef2722a0f9aa193 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 03:41:37 +0000 Subject: [PATCH 0810/2544] moved an strtolower higher into the init_class function for case insensitivity --- system/libraries/Loader.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index b78790d6..842e375a 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -820,6 +820,8 @@ function _ci_load_class($class, $params = NULL) */ function _ci_init_class($class, $prefix = '', $config = FALSE) { + $class = strtolower($class); + // Is there an associated config file for this class? if ($config === NULL) { @@ -838,8 +840,7 @@ function _ci_init_class($class, $prefix = '', $config = FALSE) $name = $prefix.$class; } - // Set the variable name we will assign the class to - $class = strtolower($class); + // Set the variable name we will assign the class to $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; // Instantiate the class From c2cfd266abef9f42b8857ad7ae39c7b87fcf1e23 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 13:30:57 +0000 Subject: [PATCH 0811/2544] added language folder to application --- system/application/language/english/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 system/application/language/english/index.html diff --git a/system/application/language/english/index.html b/system/application/language/english/index.html new file mode 100644 index 00000000..5a1f5d6a --- /dev/null +++ b/system/application/language/english/index.html @@ -0,0 +1,15 @@ + + + + +403 Forbidden + + + + + +

    Directory access is forbidden.

    + + + + \ No newline at end of file From 57211eb60cb5bcb844695746e8cba9aa6c1f9924 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 15:56:05 +0000 Subject: [PATCH 0812/2544] clarified capitalization of model class names --- user_guide/general/models.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/models.html b/user_guide/general/models.html index f5238eec..8aea194e 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -137,7 +137,7 @@

    Anatomy of a Model

        }
    } -

    Where Model_name is the name of your class. Class names must be capitalized. +

    Where Model_name is the name of your class. Class names must have the first letter capitalized with the rest of the name lowercase. Make sure your class extends the base Model class.

    The file name will be a lower case version of your class name. For example, if your class is this:

    From d32d45c350ac692db6397648d77b8b0d69ef7923 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 19:21:03 +0000 Subject: [PATCH 0813/2544] fixed bug #3003 preventing encryption from working with modes other than MCRYPT_MODE_ECB. Also added some noise to the cipher so the IV can safely be transported along with the encrypted data. --- system/libraries/Encrypt.php | 77 +++++++++++++++++++++++++++++++++++- user_guide/changelog.html | 6 ++- 2 files changed, 79 insertions(+), 4 deletions(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index e5ad78c1..5b2b7c01 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -249,7 +249,7 @@ function mcrypt_encode($data, $key) { $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); $init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND); - return mcrypt_encrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect); + return $this->_add_cipher_noise($init_vect.mcrypt_encrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), $key); } // -------------------------------------------------------------------- @@ -264,13 +264,86 @@ function mcrypt_encode($data, $key) */ function mcrypt_decode($data, $key) { + $data = $this->_remove_cipher_noise($data, $key); $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); - $init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND); + $init_vect = substr($data, 0, $init_size); + $data = substr($data, $init_size); return rtrim(mcrypt_decrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), "\0"); } // -------------------------------------------------------------------- + /** + * Adds permuted noise to the IV + encrypted data to protect + * against Man-in-the-middle attacks on CBC mode ciphers + * http://www.ciphersbyritter.com/GLOSSARY.HTM#IV + * + * Function description + * + * @access private + * @param string + * @param string + * @return string + */ + function _add_cipher_noise($data, $key) + { + $keyhash = $this->hash($key); + $keylen = strlen($keyhash); + $str = ''; + + for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j) + { + if ($j >= $keylen) + { + $j = 0; + } + + $str .= chr((ord($data[$i]) + ord($keyhash[$j])) % 256); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Removes permuted noise from the IV + encrypted data, reversing + * _add_cipher_noise() + * + * Function description + * + * @access public + * @param type + * @return type + */ + function _remove_cipher_noise($data, $key) + { + $keyhash = $this->hash($key); + $keylen = strlen($keyhash); + $str = ''; + + for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j) + { + if ($j >= $keylen) + { + $j = 0; + } + + $temp = ord($data[$i]) - ord($keyhash[$j]); + + if ($temp < 0) + { + $temp = $temp + 256; + } + + $str .= chr($temp); + } + + return $str; + } + + // -------------------------------------------------------------------- + /** * Set the Mcrypt Cipher * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index eec1c2e9..3b6a3220 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -97,7 +97,8 @@

    Version 1.6.0

  • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
  • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
  • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
  • -
  • Documented distinct() in Active Record.
  • +
  • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
  • +
  • Documented distinct() in Active Record.
  • Documented the timezones() function in the Date Helper.
  • Documented unset_userdata in the Session class.
  • Documented 2 config options to the Database configuration page.
  • @@ -123,7 +124,8 @@

    Version 1.6.0

  • Fixed a bug in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
  • Fixed a bug in Pagination to scan for non-positive num_links.
  • Fixed a bug in the typography helper causing extraneous paragraph tags when string contains tags.
  • -
  • Fixed an example of comma-separated emails in the email library documentation.
  • +
  • Fixed a bug in the Encryption Library to support modes other than MCRYPT_MODE_ECB
  • +
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • Fixed a typo in the image language file "suppor" to "support".
  • From 1d4191447297c4404c59e364c465476b795ba28e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 19:56:03 +0000 Subject: [PATCH 0814/2544] typo fixes --- user_guide/libraries/sessions.html | 2 +- user_guide/toc.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 0bc743c8..9fca09be 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
    - +

    CodeIgniter User Guide Version 1.5.3

    CodeIgniter User Guide Version 1.6.0

    diff --git a/user_guide/toc.html b/user_guide/toc.html index 6ab19a3c..5bd0a384 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -144,7 +144,7 @@

    Class Reference

  • User Agent Class
  • Validation Class
  • XML-RPC Class
  • -
  • Zip Encoding Class
  • +
  • Zip Encoding Class
  • From 05b3a5df12ec91f4762786c4b8a70136825b1e41 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 20:25:46 +0000 Subject: [PATCH 0815/2544] orderby fix --- system/database/DB_active_rec.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 3cc65aff..c899b7f4 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -749,7 +749,8 @@ function order_by($orderby, $direction = '') $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; } - $this->ar_orderby[] = $this->_protect_identifiers($orderby).$direction; + $this->ar_orderby[] = $this->_protect_identifiers($orderby, TRUE).$direction; + return $this; } From 73ed7b1c00db25b624d59fd11eacb868aa680d63 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Jan 2008 21:28:06 +0000 Subject: [PATCH 0816/2544] --- system/language/english/email_lang.php | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index 430ae4ab..040e0eaa 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -1,21 +1,21 @@ - \ No newline at end of file From dd4fe956952f9f9fd3184c34e75d4be76f899b64 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 23:00:01 +0000 Subject: [PATCH 0817/2544] modified download links to work with new location --- user_guide/installation/downloads.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 1104f8ba..e1b7605b 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -59,17 +59,17 @@

    Downloading CodeIgniter

    From 646c04f97188b5b95ed14dbb3fc8a976c7c79322 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 17 Jan 2008 23:01:42 +0000 Subject: [PATCH 0818/2544] removed $assign_to_controller - seems redundant all things considered --- index.php | 14 -------------- system/codeigniter/CodeIgniter.php | 2 +- user_guide/changelog.html | 1 - 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/index.php b/index.php index eb364ec0..85042d41 100644 --- a/index.php +++ b/index.php @@ -42,20 +42,6 @@ */ $application_folder = "application"; - -/* -|--------------------------------------------------------------- -| Default Controller Data Assignment -|--------------------------------------------------------------- -| -| If you need any data passed by default to your controllers you -| can use this variable. When a controller class is instantiated -| this data will be passed to the controller constructor. -| -*/ - $assign_to_controller = NULL; - - /* |=============================================================== | END OF USER CONFIGURABLE SETTINGS diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 1b38f272..39d07b0d 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -1 +1 @@ -mark('total_execution_time_start'); $BM->mark('loading_time_base_classes_start'); /* * ------------------------------------------------------ * Instantiate the hooks class * ------------------------------------------------------ */ $EXT =& load_class('Hooks'); /* * ------------------------------------------------------ * Is there a "pre_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ * Instantiate the base classes * ------------------------------------------------------ */ $CFG =& load_class('Config'); $URI =& load_class('URI'); $RTR =& load_class('Router'); $OUT =& load_class('Output'); /* * ------------------------------------------------------ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache($CFG, $RTR) == TRUE) { exit; } } /* * ------------------------------------------------------ * Load the remaining base classes * ------------------------------------------------------ */ $IN =& load_class('Input'); $LANG =& load_class('Language'); /* * ------------------------------------------------------ * Load the app controller and local controller * ------------------------------------------------------ * * Note: Due to the poor object handling in PHP 4 we'll * conditionally load different versions of the base * class. Retaining PHP 4 compatibility requires a bit of a hack. * * Note: The Loader class needs to be included first * */ if (floor(phpversion()) < 5) { load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); } else { require(BASEPATH.'codeigniter/Base5'.EXT); } // Load the base controller class load_class('Controller', FALSE); // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); /* * ------------------------------------------------------ * Security check * ------------------------------------------------------ * * None of the functions in the app controller or the * loader class can be called via the URI, nor can * controller functions that begin with an underscore */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) OR $method == 'controller' OR substr($method, 0, 1) == '_' OR in_array($method, get_class_methods('Controller'), TRUE) ) { show_404(); } /* * ------------------------------------------------------ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ * Instantiate the controller and call requested method * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); // Instantiate the Controller and pass any global data that might exist $assign_to_controller = ( ! isset($assign_to_controller)) ? NULL : $assign_to_controller; $CI = new $class($assign_to_controller); unset($assign_to_controller); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) { if ($EXT->_call_hook('scaffolding_override') === FALSE) { $CI->_ci_scaffolding(); } } else { /* * ------------------------------------------------------ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); // Is there a "remap" function? if (method_exists($CI, '_remap')) { $CI->_remap($method); } else { if ( ! method_exists($CI, $method)) { show_404(); } // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); } } // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); /* * ------------------------------------------------------ * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } /* * ------------------------------------------------------ * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } ?> \ No newline at end of file +mark('total_execution_time_start'); $BM->mark('loading_time_base_classes_start'); /* * ------------------------------------------------------ * Instantiate the hooks class * ------------------------------------------------------ */ $EXT =& load_class('Hooks'); /* * ------------------------------------------------------ * Is there a "pre_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ * Instantiate the base classes * ------------------------------------------------------ */ $CFG =& load_class('Config'); $URI =& load_class('URI'); $RTR =& load_class('Router'); $OUT =& load_class('Output'); /* * ------------------------------------------------------ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache($CFG, $RTR) == TRUE) { exit; } } /* * ------------------------------------------------------ * Load the remaining base classes * ------------------------------------------------------ */ $IN =& load_class('Input'); $LANG =& load_class('Language'); /* * ------------------------------------------------------ * Load the app controller and local controller * ------------------------------------------------------ * * Note: Due to the poor object handling in PHP 4 we'll * conditionally load different versions of the base * class. Retaining PHP 4 compatibility requires a bit of a hack. * * Note: The Loader class needs to be included first * */ if (floor(phpversion()) < 5) { load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); } else { require(BASEPATH.'codeigniter/Base5'.EXT); } // Load the base controller class load_class('Controller', FALSE); // Load the local application controller // Note: The Router class automatically validates the controller path. If this include fails it // means that the default controller in the Routes.php file is not resolving to something valid. if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking $BM->mark('loading_time_base_classes_end'); /* * ------------------------------------------------------ * Security check * ------------------------------------------------------ * * None of the functions in the app controller or the * loader class can be called via the URI, nor can * controller functions that begin with an underscore */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) OR $method == 'controller' OR substr($method, 0, 1) == '_' OR in_array($method, get_class_methods('Controller'), TRUE) ) { show_404(); } /* * ------------------------------------------------------ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ * Instantiate the controller and call requested method * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); $CI = new $class(); // Is this a scaffolding request? if ($RTR->scaffolding_request === TRUE) { if ($EXT->_call_hook('scaffolding_override') === FALSE) { $CI->_ci_scaffolding(); } } else { /* * ------------------------------------------------------ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); // Is there a "remap" function? if (method_exists($CI, '_remap')) { $CI->_remap($method); } else { if ( ! method_exists($CI, $method)) { show_404(); } // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, (($RTR->fetch_directory() == '') ? 2 : 3))); } } // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); /* * ------------------------------------------------------ * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } /* * ------------------------------------------------------ * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } ?> \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3b6a3220..ab933811 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,7 +63,6 @@

    Version 1.6.0

  • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
  • Added the ability to auto-load Models
  • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
  • -
  • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
  • Reorganized the URI and Routes classes for better clarity.
  • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
  • Added DBForge to the database tools.
  • From c76a3746c9141ab767219fca0f0dbc7535d52cb7 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 18 Jan 2008 00:42:35 +0000 Subject: [PATCH 0819/2544] Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4 by re-syncing the master object from the copy --- system/libraries/Controller.php | 9 +++++++++ user_guide/changelog.html | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 0b34465a..1b9a42a1 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -84,6 +84,15 @@ function _ci_initialize() else { $this->_ci_autoloader(); + + // sync up the objects since PHP4 was working from a copy + foreach (array_keys(get_object_vars($this)) as $attribute) + { + if (is_object($this->$attribute)) + { + $this->load->$attribute =& $this->$attribute; + } + } } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ab933811..89276e24 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -123,7 +123,8 @@

    Version 1.6.0

  • Fixed a bug in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
  • Fixed a bug in Pagination to scan for non-positive num_links.
  • Fixed a bug in the typography helper causing extraneous paragraph tags when string contains tags.
  • -
  • Fixed a bug in the Encryption Library to support modes other than MCRYPT_MODE_ECB
  • +
  • Fixed a bug in the Encryption Library to support modes other than MCRYPT_MODE_ECB
  • +
  • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4
  • Fixed an example of comma-separated emails in the email library documentation.
  • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
  • Fixed a typo in the database language file.
  • From cdf6a5f6b3c182cdce94c105e61dbea8830dea53 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 18 Jan 2008 03:08:09 +0000 Subject: [PATCH 0820/2544] added link to upgrading guide --- user_guide/installation/upgrading.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index ecc00b2f..fb931bb9 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -60,6 +60,7 @@

    Upgrading From a Previous Version

    Please read the upgrade notes corresponding to the version you are upgrading from.

      +
    • Upgrading from 1.5.4 to 1.6.0
    • Upgrading from 1.5.3 to 1.5.4
    • Upgrading from 1.5.2 to 1.5.3
    • Upgrading from 1.5.0 or 1.5.1 to 1.5.2
    • From f6cd45ccb9f8825eb44dd2fa736c7aa0082ff98c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 18 Jan 2008 14:31:51 +0000 Subject: [PATCH 0821/2544] fix for count_all --- system/database/drivers/mssql/mssql_driver.php | 4 ++-- system/database/drivers/mysql/mysql_driver.php | 2 +- system/database/drivers/mysqli/mysqli_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 4 ++-- system/database/drivers/postgre/postgre_driver.php | 4 +--- system/database/drivers/sqlite/sqlite_driver.php | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 06a508e7..71d6c427 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -297,8 +297,8 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM ".$this->dbprefix.$table); - + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); + if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 36e36516..9ba37b45 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -312,7 +312,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 94a29937..e548fb05 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -306,7 +306,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 160a56d5..56095e92 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -413,7 +413,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM ".$table); + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); if ($query == FALSE) { diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index c5c582d0..03f58e26 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -281,8 +281,8 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); - + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); + if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index fa27f03d..8ea76033 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -302,9 +302,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string .'FROM "'.$this->dbprefix.$table.'"'); -// original query before _count_string was used. Kept for reference -// $query = $this->query('SELECT COUNT(*) AS numrows FROM "'.$this->dbprefix.$table.'"'); + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); if ($query->num_rows() == 0) return '0'; diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 110b208d..31b29289 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -298,7 +298,7 @@ function count_all($table = '') if ($table == '') return '0'; - $query = $this->query($this->_count_string . "FROM `".$this->dbprefix.$table."`"); + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); if ($query->num_rows() == 0) return '0'; From f8f05703f61689b4d0b432f12e36a27f15778458 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 18 Jan 2008 14:39:23 +0000 Subject: [PATCH 0822/2544] added check for "multiple" attribute in form_dropdown() (bug# 3261) --- system/helpers/form_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index c3a3ccb5..a727f471 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -231,7 +231,8 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext } if ($extra != '') $extra = ' '.$extra; - $multiple = (count($selected) > 1) ? ' multiple="multiple"' : ''; + + $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; $form = 'Search User Guide    - - - - -
      - - - -
      - -

      Upgrading from 1.5.4 to 1.5.5

      - -

      Before performing an update you should take your site offline by replacing the index.php file with a static one.

      - - - -

      Step 1: Update your CodeIgniter files

      - -

      Replace these files and directories in your "system" folder with the new versions:

      - -
        - -
      • system/codeigniter
      • -
      • system/database
      • -
      • system/helpers
      • -
      • system/libraries
      • -
      • system/plugins
      • -
      - -

      Note: If you have any custom developed files in these folders please make copies of them first.

      - -

      Step 2: Add time_to_update to your config.php

      -

      Add the following to system/application/config/config.php with the other

      -$config['sess_time_to_update'] = 300; -

      Step 3: Update your user guide

      -

      Please also replace your local copy of the user guide with the new version.

      - -
      - - - - - - - \ No newline at end of file From 5a34f04129f97fff9f6a3f8b9d02bf724134cd06 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 19 Jan 2008 19:41:54 +0000 Subject: [PATCH 0839/2544] added email helper --- system/helpers/email_helper.php | 54 +++++++++++++ user_guide/helpers/download_helper.html | 3 +- user_guide/helpers/email_helper.html | 103 ++++++++++++++++++++++++ user_guide/helpers/file_helper.html | 5 +- user_guide/nav/nav.js | 1 + user_guide/toc.html | 1 + 6 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 system/helpers/email_helper.php create mode 100644 user_guide/helpers/email_helper.html diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php new file mode 100644 index 00000000..3729e042 --- /dev/null +++ b/system/helpers/email_helper.php @@ -0,0 +1,54 @@ + \ No newline at end of file diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index ff9bd2e8..a82d1980 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -104,8 +104,7 @@

      force_download('filename', 'data')

         ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  File Helper -

      +Next Topic:  Email Helper

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html new file mode 100644 index 00000000..fe0e3cc4 --- /dev/null +++ b/user_guide/helpers/email_helper.html @@ -0,0 +1,103 @@ + + + + +CodeIgniter User Guide : Download Helper + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.0

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Download Helper

    + +

    The Download Helper lets you download data to your desktop.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper(email); + +

    The following functions are available:

    + +

    valid_email('email')

    + +

    Checks if an email is a correctly formatted email. Note that is doesn't actually prove the email will recieve mail, simply that it is a validly formed address.

    +

    It returns TRUE/FALSE

    + $this->load->helper(email);
    +
    +if (valid_email('email@somesite.com'))
    +{
    +    echo 'email is valid';
    +}
    +else
    +{
    +    echo 'email is not valid';
    +}
    +

    send_email('recipient', 'subject', 'message')

    +

    Sends an email using PHP's native mail() function. For a more robust email solution, see CodeIgniter's Email Class.

    +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 29a85940..d2d61ad0 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -136,12 +136,11 @@

    get_filenames('path/to/directory/')

    diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ef484f6f..951c1905 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -102,6 +102,7 @@ function create_menu(basepath) '
  • Date Helper
  • ' + '
  • Directory Helper
  • ' + '
  • Download Helper
  • ' + + '
  • Email Helper
  • ' + '
  • File Helper
  • ' + '
  • Form Helper
  • ' + '
  • HTML Helper
  • ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 3c6b827c..465d8f4b 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -158,6 +158,7 @@

    Helper Reference

  • Date Helper
  • Directory Helper
  • Download Helper
  • +
  • Email Helper
  • File Helper
  • Form Helper
  • HTML Helper
  • From 08c688747f7ed2757ad428c7c4e2f6a5fd97dc23 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 19 Jan 2008 19:43:17 +0000 Subject: [PATCH 0840/2544] Added an email helper into core helpers. --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 74068ef3..684d3fa9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -120,7 +120,8 @@

    Version 1.6.0

  • Helpers & Plugins
      -
    • Added strip_quotes() function to string helper.
    • +
    • Added an email helper into core helpers.
    • +
    • Added strip_quotes() function to string helper.
    • Added reduce_multiples() function to string helper.
    • Added quotes_to_entities() function to string helper.
    • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
    • From d87815d21ec08974eaa386f0be9936a5f1e630fa Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 19 Jan 2008 19:48:33 +0000 Subject: [PATCH 0841/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 684d3fa9..3283b1a6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

      Version 1.6.0

    • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
    • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
    • Added a check for NULL fields in the MySQL database backup utility.
    • +
    • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
    • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
  • From afd99ac2c240faafc3c3d18f5bb4aa03cd24c41c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 19 Jan 2008 19:59:14 +0000 Subject: [PATCH 0842/2544] Added attributes into of userguide for valid html. --- user_guide/changelog.html | 7 ++++--- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/index.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 107 files changed, 110 insertions(+), 109 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3283b1a6..f86e1f53 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Change Log @@ -136,6 +136,7 @@

    Version 1.6.0

  • Documentation Changes
    • Added titles to all user manual pages.
    • +
    • Added attributes into <html> of userguide for valid html.
    • Added Zip Encoding Class to the table of contents of the userguide.
    • Moved part of the userguide menu javascript to an external file.
    • Documented distinct() in Active Record.
    • @@ -308,7 +309,7 @@

      Version 1.5.0

    • Added new helper: Smiley Helper
    • Added support for <ul> and <ol> lists in the HTML Helper
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • -
    • Added the ability to rename or relocate the "application" folder. +
    • Added the ability to rename or relocate the "application" folder.
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • @@ -492,7 +493,7 @@

      Version 1.3

    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • Added a new error template for use with native PHP errors.
    • -
    • Added "alternator" function in the string helpers. +
    • Added "alternator" function in the string helpers.
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 4ba5bfd9..bf436996 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Active Record diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 9e007f92..d286c928 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Database Caching Class diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 87ff2dfe..97661de2 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Custom Function Calls diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b6126d9f..c9ad2e3c 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Database Configuration diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index adf0c518..a86866d2 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Connecting to your Database diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 434aa828..d8c01aa0 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Database Quick Start diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index de5e021b..6da71c11 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Field Data diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 0a404544..7fc6589c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Database Utility Class diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 6567c027..edf7faec 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Query Helper Functions diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 6ad90e97..76c32e2d 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : The Database Class diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 21b550ae..687076f9 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Queries diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 6c6142c0..6a7bf04a 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Generating Query Results diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index c5d2aaae..9f1c9746 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Table Data diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 19f091e9..1c2d9b13 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Transactions diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 56a728b1..b6cdb8ac 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Database Utility Class diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index a91af151..3446b263 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Alternate PHP Syntax for View Files diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 148850ee..daf5fb6c 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Creating Ancillary Classes diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 8d000a96..8cf89194 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Auto-loading Resources diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 5cf81167..ecf06531 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Web Page Caching diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 3b25087d..cd11eb1a 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Controllers diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 9ba027ca..c8117b96 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Creating Core System Classes diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 38ad1077..370f1d40 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Creating Libraries diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index eb1d4b81..04f9475d 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Credits diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 4db0c4d4..a3baf696 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Error Handling diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 65e549c6..f4e607f5 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Helper Functions diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 0441aca1..63bf4bea 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Hooks diff --git a/user_guide/general/index.html b/user_guide/general/index.html index a2200422..f7cb9e87 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Getting Started With CodeIgniter diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 3ae4c587..a9d3703d 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Using CodeIgniter Libraries diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 3cc899eb..7b0613b6 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Managing your Applications diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 3164669e..9a672ff2 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Models diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index a34f3680..20272891 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Plugins diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index f9c937db..adb16849 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Profiling Your Application diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 9dd9e9e8..7ac2938c 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Quick Reference Chart diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index df63b914..9acbd57d 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Server Requirements diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 9b29c3f2..ce1700b8 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : URI Routing diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 27ee2090..cb4eceb0 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Scaffolding diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 9a48c7ea..0dd1f1f2 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Security diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index f3a01e5c..a3389dee 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : CodeIgniter URLs diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 5ad9fc5c..e41503f5 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Views diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index a9c443cd..b9fac010 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Array Helper diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 37167d87..81e679b6 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Cookie Helper diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 73a980aa..d98a72e9 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Date Helper diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index fcb10cc9..0fd84695 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Directory Helper diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index a82d1980..7da50777 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Download Helper diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index fe0e3cc4..b7aff6f2 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Download Helper diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index d2d61ad0..f78cc58c 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : File Helper diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index cc2dda1f..ed583b0b 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Form Helper diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index c3133a15..be59bf07 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : HTML Helper diff --git a/user_guide/helpers/index.html b/user_guide/helpers/index.html index 23fb245d..04aafe98 100644 --- a/user_guide/helpers/index.html +++ b/user_guide/helpers/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Helper Functions diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 699be580..e931cb10 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Inflector Helper diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 4cd5d6e4..8b15d907 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Security Helper diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 50b095f9..50805488 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Smiley Helper diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 206c5eaf..4cebf502 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : String Helper diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 43db044d..5e6af006 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Text Helper diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 5a283840..543db3f4 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Typography Helper diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index d28b6956..a177a1c2 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : URL Helper diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 936f1e82..086a3f27 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : XML Helper diff --git a/user_guide/index.html b/user_guide/index.html index 62ebcbc5..491e5c80 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Welcome to CodeIgniter diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 03ce391b..f6561d43 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Downloading CodeIgniter diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 89bd2563..f01fbb3d 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Installation Instructions diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 80122619..294ec8a6 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Troubleshooting diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 01ffa0aa..554a80ad 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 202cc33c..95cec499 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 32195404..dad3e8ca 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 2cf13cc7..9a6d0751 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 9bd50aca..b71694c2 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 6ee915f4..e03547b2 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 90bb62af..239fa51e 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index a6c93e80..456e4dac 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index d0a19bac..370e3b87 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 5671b48a..33d3837b 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 07dfa5dc..6e8316c9 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Upgrading from 1.5.3 to 1.5.4 diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index dffbb76f..231404d0 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Upgrading from 1.5.3 to 1.5.4 diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 09e93c09..1f47418d 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index fccebe0b..c40da5af 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Upgrading From a Previous Version diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 1a91abff..9fcd6459 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Benchmarking Class diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 5e4e30c2..2e75a7ed 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Calendaring Class diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index bf653fe8..93b08571 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Config Class diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 01085d58..6da687bf 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Email Class diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index c4499a8d..1890c2ea 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Encryption Class diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 46f6120d..64a93031 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : File Uploading Class diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 87309f83..8f3c10a9 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : FTP Class diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 1cca5bc6..9cb31a58 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Image Manipulation Class diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index e1c5fcb2..0cd81e3f 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Input Class diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 38fd4ae5..72fec89a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Language Class diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 56ccc213..ad120f50 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Loader Class diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 827cc8bd..1905f324 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Output Class diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index f8389f9b..e8696f68 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Pagination Class diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 8bf4afd1..0809ea16 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Template Parser Class diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 86d6e161..7d6c6930 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 59930d4f..0c15a070 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : HTML Table Class diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index d816fab3..b0956061 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Trackback Class diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 0143c9c7..70567fcd 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Unit Testing Class diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 180e56ce..6c424cb1 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : URI Class diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 1d11fbd0..59304f6a 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : User Agent Class diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 377503be..af5631ca 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Form Validation diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index a44f8bd1..49678a64 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 23e7587c..8361c92d 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Zip Encoding Class diff --git a/user_guide/license.html b/user_guide/license.html index b8230251..5962967d 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : CodeIgniter License Agreement diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 2a7e5622..74e6f70c 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Application Flow Chart diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 665d0a5b..28208109 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : CodeIgniter at a Glance diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 4d380b75..139dd8c8 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : CodeIgniter Features diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 61d156bf..bcbd1794 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Design and Architectural Goals diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 7a05862d..2f3df3c5 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : CodeIgniter Overview diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 603e58a3..03c94fe5 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Model-View-Controller diff --git a/user_guide/toc.html b/user_guide/toc.html index 465d8f4b..b729b528 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -1,5 +1,5 @@ - + CodeIgniter User Guide : Table of Contents From 5b0a881d9251ce94114f0cc0eb6f080c163044aa Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 21 Jan 2008 14:26:33 +0000 Subject: [PATCH 0843/2544] documented sess_time_to_update --- user_guide/libraries/sessions.html | 104 +++++++++++++++-------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 7d6c6930..4e46b85a 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -231,57 +231,59 @@

      Session Preferences

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      PreferenceDefaultOptionsDescription
      sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
      sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). -If you would like a non-expiring session set the value to zero: 0
      sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
      sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
      sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
      sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically -changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
      sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.PreferenceDefaultOptionsDescription
      sess_cookie_nameci_sessionNoneThe name you world the session cookie saved as.
      sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0
      sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
      sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
      sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
      sess_time_to_update300Time in millisecondsThis options controls how often the session class will regenerate itself and create a new session id.
      sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically + changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
      sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
      From 78c3fa83531d4c1ca292f64e9383a9a4ff0f795b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 21 Jan 2008 15:11:13 +0000 Subject: [PATCH 0844/2544] assorted guide fixes and additions --- user_guide/changelog.html | 4 ++-- user_guide/general/controllers.html | 2 ++ user_guide/general/requirements.html | 4 ++-- user_guide/general/views.html | 15 ++++++--------- user_guide/helpers/email_helper.html | 9 ++++----- user_guide/overview/at_a_glance.html | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f86e1f53..e1d2365d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,7 +72,7 @@

      Version 1.6.0

      • Added protect_identifiers() in Active Record.
      • All AR queries are backticked if appropriate to the database.
      • -
      • Added where_in(), where_in_or(), where_not_in(), where_not_in_or(), not_like() and or_not_like() to Active Record.
      • +
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • Added support for limit() into update() and delete() statements in Active Record.
      • Added empty_table() and truncate_table() to Active Record.
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • @@ -113,7 +113,7 @@

        Version 1.6.0

      • Moved the safe mode and auth checks for the Email library into the constructor.
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • -
      • Modified Upload class $_FILE error messages to be more precise.
      • +
      • Modified Upload class $_FILES error messages to be more precise.
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • Added a few additional mime type variations for CSV.
      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index cd11eb1a..d4f1489c 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -375,6 +375,8 @@

      Reserved Function Names

    • CI_Loader
    • config
    • database
    • +
    • dbutil
    • +
    • dbforge
    • file
    • helper
    • helpers
    • diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 9acbd57d..11a50767 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -58,8 +58,8 @@

      Server Requirements

        -
      • PHP version 4.3.2 or newer
      • -
      • A Database. Supported databases are MySQL, MySQLi, MS SQL, Postgre, Oracle, SQLite, and ODBC
      • +
      • PHP version 4.3.2 or newer.
      • +
      • A Database is required for most web appliction programming. Current supported databases are MySQL, MySQLi, MS SQL, Postgre, Oracle, SQLite, and ODBC.
      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index e41503f5..851da92e 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -162,7 +162,7 @@

      Adding Dynamic Data to the View

      Let's try it with your controller file. Open it add this code:

      @@ -193,9 +193,6 @@

      Adding Dynamic Data to the View

      Then load the page at the URL you've been using and you should see the variables replaced.

      -

      Note: You'll notice that in the example above we are using PHP's alternative syntax. If you -are not familiar with it you can read about it here.

      -

      Creating Loops

      The data array you pass to your view files is not limited to simple variables. You can @@ -205,7 +202,7 @@

      Creating Loops

      Here's a simple example. Add this to your controller:

      @@ -242,12 +239,12 @@

      Creating Loops

      <?php endforeach;?> </ul> - </body> </html> - +

      Note: You'll notice that in the example above we are using PHP's alternative syntax. If you +are not familiar with it you can read about it here.

  • diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index b7aff6f2..48c47f29 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -2,7 +2,7 @@ -CodeIgniter User Guide : Download Helper +CodeIgniter User Guide : Email Helper @@ -57,15 +57,14 @@
    -

    Download Helper

    - -

    The Download Helper lets you download data to your desktop.

    +

    Email Helper

    +

    The Email Helper provides some assitive functions for working with Email. For a more robust email solution, see CodeIgniter's Email Class.

    Loading this Helper

    This helper is loaded using the following code:

    -$this->load->helper(email); +

    $this->load->helper('email');

    The following functions are available:

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 28208109..f762f789 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -74,7 +74,7 @@

    CodeIgniter Runs on PHP 4

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our -potential audience. Major OS vendors like RedHat have yet to support PHP 5, and they are unlikely to do so until 2007, so +potential audience. Major OS vendors like RedHat are moving slowly to support PHP 5, and they are unlikely to do so in the short term, so we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    From af6a8be88c21e80889980426792b52f7aeee01f9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 21 Jan 2008 15:24:06 +0000 Subject: [PATCH 0845/2544] typo fix string helper --- user_guide/helpers/string_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 4cebf502..476822e4 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -80,7 +80,7 @@

    random_string()

  • numeric:  Numeric string.
  • nozero:  Numeric string with no zeros.
  • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. -Returns a fixed length 33 character string.
  • +Returns a fixed length 32 character string.

    Usage example:

    From df264429b7171da21524be93d38e334fadec801b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 21 Jan 2008 16:48:11 +0000 Subject: [PATCH 0846/2544] added dbprefix to dbforge functions --- system/database/DB_forge.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index d4f1faeb..f8b74c08 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -180,7 +180,7 @@ function create_table($table = '', $if_not_exists = FALSE) show_error('Field information is required.'); } - $sql = $this->_create_table($table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); + $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); $this->_reset(); return $this->db->query($sql); @@ -197,7 +197,7 @@ function create_table($table = '', $if_not_exists = FALSE) */ function drop_table($table_name) { - $sql = $this->_drop_table($table_name); + $sql = $this->_drop_table($this->db->dbprefix.$table_name); if (is_bool($sql)) { @@ -234,7 +234,7 @@ function add_column($table = '', $field = array(), $after_field = '') show_error('Field information is required.'); } - $sql = $this->_alter_table('ADD', $table, $this->fields, $after_field); + $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); $this->_reset(); return $this->db->query($sql); @@ -263,7 +263,7 @@ function drop_column($table = '', $column_name = '') show_error('A column name is required for that operation.'); } - $sql = $this->_alter_table('DROP', $table, $column_name); + $sql = $this->_alter_table('DROP', $this->db->dbprefix.$table, $column_name); return $this->db->query($sql); } @@ -296,7 +296,7 @@ function modify_column($table = '', $field = array()) show_error('Field information is required.'); } - $sql = $this->_alter_table('CHANGE', $table, $this->fields); + $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); $this->_reset(); return $this->db->query($sql); From 7a9193afa6d890a91eb3528fa0e62df799b07ed6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 21 Jan 2008 18:39:20 +0000 Subject: [PATCH 0847/2544] replaced www.codeigniter.com with codeigniter.com --- index.php | 2 +- system/application/config/config.php | 6 ++-- system/application/config/hooks.php | 2 +- system/application/config/routes.php | 2 +- system/application/config/smileys.php | 2 +- system/codeigniter/Base4.php | 6 ++-- system/codeigniter/Base5.php | 6 ++-- system/codeigniter/CodeIgniter.php | 6 ++-- system/codeigniter/Common.php | 6 ++-- system/codeigniter/Compat.php | 6 ++-- system/database/DB.php | 6 ++-- system/database/DB_active_rec.php | 6 ++-- system/database/DB_cache.php | 6 ++-- system/database/DB_driver.php | 6 ++-- system/database/DB_forge.php | 6 ++-- system/database/DB_result.php | 6 ++-- system/database/DB_utility.php | 6 ++-- .../database/drivers/mssql/mssql_driver.php | 6 ++-- system/database/drivers/mssql/mssql_forge.php | 6 ++-- .../database/drivers/mssql/mssql_result.php | 6 ++-- .../database/drivers/mssql/mssql_utility.php | 6 ++-- .../database/drivers/mysql/mysql_driver.php | 6 ++-- system/database/drivers/mysql/mysql_forge.php | 6 ++-- .../database/drivers/mysql/mysql_result.php | 6 ++-- .../database/drivers/mysql/mysql_utility.php | 6 ++-- .../database/drivers/mysqli/mysqli_driver.php | 6 ++-- .../database/drivers/mysqli/mysqli_forge.php | 6 ++-- .../database/drivers/mysqli/mysqli_result.php | 6 ++-- .../drivers/mysqli/mysqli_utility.php | 6 ++-- system/database/drivers/oci8/oci8_driver.php | 6 ++-- system/database/drivers/oci8/oci8_forge.php | 6 ++-- system/database/drivers/oci8/oci8_result.php | 6 ++-- system/database/drivers/oci8/oci8_utility.php | 6 ++-- system/database/drivers/odbc/odbc_driver.php | 6 ++-- system/database/drivers/odbc/odbc_forge.php | 6 ++-- system/database/drivers/odbc/odbc_result.php | 6 ++-- system/database/drivers/odbc/odbc_utility.php | 6 ++-- .../drivers/postgre/postgre_driver.php | 6 ++-- .../drivers/postgre/postgre_forge.php | 6 ++-- .../drivers/postgre/postgre_result.php | 6 ++-- .../drivers/postgre/postgre_utility.php | 6 ++-- .../database/drivers/sqlite/sqlite_driver.php | 6 ++-- .../database/drivers/sqlite/sqlite_forge.php | 6 ++-- .../database/drivers/sqlite/sqlite_result.php | 6 ++-- .../drivers/sqlite/sqlite_utility.php | 6 ++-- system/helpers/array_helper.php | 6 ++-- system/helpers/cookie_helper.php | 6 ++-- system/helpers/date_helper.php | 6 ++-- system/helpers/directory_helper.php | 6 ++-- system/helpers/download_helper.php | 6 ++-- system/helpers/email_helper.php | 6 ++-- system/helpers/file_helper.php | 6 ++-- system/helpers/form_helper.php | 6 ++-- system/helpers/html_helper.php | 6 ++-- system/helpers/inflector_helper.php | 6 ++-- system/helpers/security_helper.php | 6 ++-- system/helpers/smiley_helper.php | 6 ++-- system/helpers/string_helper.php | 6 ++-- system/helpers/text_helper.php | 6 ++-- system/helpers/typography_helper.php | 8 +++--- system/helpers/url_helper.php | 6 ++-- system/helpers/xml_helper.php | 6 ++-- system/libraries/Benchmark.php | 6 ++-- system/libraries/Calendar.php | 6 ++-- system/libraries/Config.php | 6 ++-- system/libraries/Controller.php | 6 ++-- system/libraries/Email.php | 6 ++-- system/libraries/Encrypt.php | 6 ++-- system/libraries/Exceptions.php | 6 ++-- system/libraries/Ftp.php | 6 ++-- system/libraries/Hooks.php | 6 ++-- system/libraries/Image_lib.php | 6 ++-- system/libraries/Input.php | 6 ++-- system/libraries/Language.php | 6 ++-- system/libraries/Loader.php | 6 ++-- system/libraries/Log.php | 6 ++-- system/libraries/Model.php | 6 ++-- system/libraries/Output.php | 6 ++-- system/libraries/Pagination.php | 6 ++-- system/libraries/Parser.php | 6 ++-- system/libraries/Profiler.php | 6 ++-- system/libraries/Router.php | 6 ++-- system/libraries/Session.php | 6 ++-- system/libraries/Sha1.php | 6 ++-- system/libraries/Table.php | 6 ++-- system/libraries/Trackback.php | 6 ++-- system/libraries/URI.php | 6 ++-- system/libraries/Unit_test.php | 6 ++-- system/libraries/Upload.php | 6 ++-- system/libraries/User_agent.php | 6 ++-- system/libraries/Validation.php | 6 ++-- system/libraries/Xmlrpc.php | 14 +++++----- system/libraries/Xmlrpcs.php | 6 ++-- system/libraries/Zip.php | 6 ++-- system/plugins/captcha_pi.php | 4 +-- system/plugins/js_calendar_pi.php | 4 +-- system/scaffolding/Scaffolding.php | 6 ++-- system/scaffolding/views/footer.php | 2 +- user_guide/changelog.html | 6 ++-- user_guide/database/active_record.html | 4 +-- user_guide/database/caching.html | 4 +-- user_guide/database/call_function.html | 4 +-- user_guide/database/configuration.html | 4 +-- user_guide/database/connecting.html | 4 +-- user_guide/database/examples.html | 4 +-- user_guide/database/fields.html | 4 +-- user_guide/database/forge.html | 4 +-- user_guide/database/helpers.html | 4 +-- user_guide/database/index.html | 4 +-- user_guide/database/queries.html | 4 +-- user_guide/database/results.html | 4 +-- user_guide/database/table_data.html | 4 +-- user_guide/database/transactions.html | 4 +-- user_guide/database/utilities.html | 4 +-- user_guide/general/alternative_php.html | 4 +-- user_guide/general/ancillary_classes.html | 4 +-- user_guide/general/autoloader.html | 4 +-- user_guide/general/caching.html | 4 +-- user_guide/general/controllers.html | 4 +-- user_guide/general/core_classes.html | 4 +-- user_guide/general/creating_libraries.html | 4 +-- user_guide/general/credits.html | 4 +-- user_guide/general/errors.html | 4 +-- user_guide/general/helpers.html | 4 +-- user_guide/general/hooks.html | 4 +-- user_guide/general/index.html | 8 +++--- user_guide/general/libraries.html | 4 +-- user_guide/general/managing_apps.html | 4 +-- user_guide/general/models.html | 4 +-- user_guide/general/plugins.html | 4 +-- user_guide/general/profiling.html | 4 +-- user_guide/general/quick_reference.html | 6 ++-- user_guide/general/requirements.html | 4 +-- user_guide/general/routing.html | 4 +-- user_guide/general/scaffolding.html | 4 +-- user_guide/general/security.html | 4 +-- user_guide/general/urls.html | 4 +-- user_guide/general/views.html | 4 +-- user_guide/helpers/array_helper.html | 4 +-- user_guide/helpers/cookie_helper.html | 4 +-- user_guide/helpers/date_helper.html | 4 +-- user_guide/helpers/directory_helper.html | 4 +-- user_guide/helpers/download_helper.html | 4 +-- user_guide/helpers/email_helper.html | 4 +-- user_guide/helpers/file_helper.html | 4 +-- user_guide/helpers/form_helper.html | 4 +-- user_guide/helpers/html_helper.html | 4 +-- user_guide/helpers/index.html | 4 +-- user_guide/helpers/inflector_helper.html | 4 +-- user_guide/helpers/security_helper.html | 4 +-- user_guide/helpers/smiley_helper.html | 6 ++-- user_guide/helpers/string_helper.html | 4 +-- user_guide/helpers/text_helper.html | 4 +-- user_guide/helpers/typography_helper.html | 4 +-- user_guide/helpers/url_helper.html | 4 +-- user_guide/helpers/xml_helper.html | 4 +-- user_guide/index.html | 4 +-- user_guide/installation/downloads.html | 28 +++++++++---------- user_guide/installation/index.html | 4 +-- user_guide/installation/troubleshooting.html | 4 +-- user_guide/installation/upgrade_120.html | 4 +-- user_guide/installation/upgrade_130.html | 4 +-- user_guide/installation/upgrade_131.html | 4 +-- user_guide/installation/upgrade_132.html | 4 +-- user_guide/installation/upgrade_133.html | 4 +-- user_guide/installation/upgrade_140.html | 4 +-- user_guide/installation/upgrade_141.html | 4 +-- user_guide/installation/upgrade_150.html | 8 +++--- user_guide/installation/upgrade_152.html | 4 +-- user_guide/installation/upgrade_153.html | 4 +-- user_guide/installation/upgrade_154.html | 4 +-- user_guide/installation/upgrade_160.html | 4 +-- user_guide/installation/upgrade_b11.html | 4 +-- user_guide/installation/upgrading.html | 4 +-- user_guide/libraries/benchmark.html | 4 +-- user_guide/libraries/calendar.html | 4 +-- user_guide/libraries/config.html | 4 +-- user_guide/libraries/email.html | 4 +-- user_guide/libraries/encryption.html | 4 +-- user_guide/libraries/file_uploading.html | 4 +-- user_guide/libraries/ftp.html | 4 +-- user_guide/libraries/image_lib.html | 4 +-- user_guide/libraries/input.html | 4 +-- user_guide/libraries/language.html | 4 +-- user_guide/libraries/loader.html | 4 +-- user_guide/libraries/output.html | 4 +-- user_guide/libraries/pagination.html | 4 +-- user_guide/libraries/parser.html | 4 +-- user_guide/libraries/sessions.html | 4 +-- user_guide/libraries/table.html | 4 +-- user_guide/libraries/trackback.html | 4 +-- user_guide/libraries/unit_testing.html | 4 +-- user_guide/libraries/uri.html | 4 +-- user_guide/libraries/user_agent.html | 4 +-- user_guide/libraries/validation.html | 4 +-- user_guide/libraries/xmlrpc.html | 4 +-- user_guide/libraries/zip.html | 4 +-- user_guide/license.html | 4 +-- user_guide/nav/nav.js | 4 +-- user_guide/overview/appflow.html | 4 +-- user_guide/overview/at_a_glance.html | 6 ++-- user_guide/overview/features.html | 4 +-- user_guide/overview/goals.html | 4 +-- user_guide/overview/index.html | 4 +-- user_guide/overview/mvc.html | 4 +-- user_guide/toc.html | 8 +++--- 206 files changed, 525 insertions(+), 525 deletions(-) diff --git a/index.php b/index.php index 85042d41..ebf696e8 100644 --- a/index.php +++ b/index.php @@ -34,7 +34,7 @@ | folder then the default one you can set its name here. The folder | can also be renamed or relocated anywhere on your server. | For more info please see the user guide: -| http://www.codeigniter.com/user_guide/general/managing_apps.html +| http://codeigniter.com/user_guide/general/managing_apps.html | | | NO TRAILING SLASH! diff --git a/system/application/config/config.php b/system/application/config/config.php index 3b2ca4a1..a02fed14 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -51,7 +51,7 @@ | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | -| http://www.codeigniter.com/user_guide/general/urls.html +| http://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ""; @@ -99,8 +99,8 @@ | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | -| http://www.codeigniter.com/user_guide/general/core_classes.html -| http://www.codeigniter.com/user_guide/general/creating_libraries.html +| http://codeigniter.com/user_guide/general/core_classes.html +| http://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'MY_'; diff --git a/system/application/config/hooks.php b/system/application/config/hooks.php index 95e74cbf..f0a0d6e3 100644 --- a/system/application/config/hooks.php +++ b/system/application/config/hooks.php @@ -6,7 +6,7 @@ | This file lets you define "hooks" to extend CI without hacking the core | files. Please see the user guide for info: | -| http://www.codeigniter.com/user_guide/general/hooks.html +| http://codeigniter.com/user_guide/general/hooks.html | */ diff --git a/system/application/config/routes.php b/system/application/config/routes.php index be09f5aa..1395b7ae 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -17,7 +17,7 @@ | | Please see the user guide for complete details: | -| http://www.codeigniter.com/user_guide/general/routing.html +| http://codeigniter.com/user_guide/general/routing.html | | ------------------------------------------------------------------------- | RESERVED ROUTES diff --git a/system/application/config/smileys.php b/system/application/config/smileys.php index 2a0d6891..a227d8b6 100644 --- a/system/application/config/smileys.php +++ b/system/application/config/smileys.php @@ -8,7 +8,7 @@ | :-) and :) use the same image replacement. | | Please see user guide for more info: -| http://www.codeigniter.com/user_guide/helpers/smiley_helper.html +| http://codeigniter.com/user_guide/helpers/smiley_helper.html | */ diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index 4d276f43..577977c1 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.3 * @filesource */ @@ -36,7 +36,7 @@ * @subpackage codeigniter * @category front-controller * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/ + * @link http://codeigniter.com/user_guide/ */ class CI_Base extends CI_Loader { diff --git a/system/codeigniter/Base5.php b/system/codeigniter/Base5.php index 9b59197d..c731a00c 100644 --- a/system/codeigniter/Base5.php +++ b/system/codeigniter/Base5.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.3 * @filesource */ @@ -27,7 +27,7 @@ * @subpackage codeigniter * @category front-controller * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/ + * @link http://codeigniter.com/user_guide/ */ class CI_Base { diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 07973863..7556f48d 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage codeigniter * @category Front-controller * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/ + * @link http://codeigniter.com/user_guide/ */ // CI Version diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 327702f1..b6f0a46e 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage codeigniter * @category Common Functions * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/ + * @link http://codeigniter.com/user_guide/ */ // ------------------------------------------------------------------------ diff --git a/system/codeigniter/Compat.php b/system/codeigniter/Compat.php index 357eb53c..56ebbf45 100644 --- a/system/codeigniter/Compat.php +++ b/system/codeigniter/Compat.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -25,7 +25,7 @@ * @subpackage codeigniter * @category Compatibility Functions * @author ExpressionEngine Development Team - * @link http://www.codeigniter.com/user_guide/ + * @link http://codeigniter.com/user_guide/ */ // ------------------------------------------------------------------------ diff --git a/system/database/DB.php b/system/database/DB.php index b059e76a..abd782c3 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ function &DB($params = '', $active_record = FALSE) { diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index ace2a275..08213af5 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_active_record extends CI_DB_driver { diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index ac297acf..44b8e815 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 bffdfc63..65be13dc 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_driver { diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index f8b74c08..7febb72c 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_forge { diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 7b5b384b..7d509791 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_result { diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 513664be..9b78aa8e 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_utility extends CI_DB_forge { diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 6b453abb..e0c4db75 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 eda308fb..baf776c7 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 ca3ca4b4..c95fd91f 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 08527120..87f8196f 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 e876deb4..6e53537b 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_driver extends CI_DB { diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 71327f57..6e3a2d17 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 bfbac29d..9e6a3c3d 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_result extends CI_DB_result { diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 38feaaff..dc8fd086 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 bfdabe19..d645cc82 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_driver extends CI_DB { diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 388c6652..cb315a45 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 6861da79..586c2925 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_result extends CI_DB_result { diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 2aa5eccd..bb1f6f91 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 820501c0..bc0862b5 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ /** diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 57f2885b..b9d9e635 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 b1a703b2..30dd0da0 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_oci8_result extends CI_DB_result { diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 6b53a4f2..117f8e62 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 c4a3df16..daecabe1 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 455cb0ff..374c15fc 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/database/ + * @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 c818c337..dd3f9238 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 561a6e4b..f74d031b 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/database/ + * @link http://codeigniter.com/database/ */ class CI_DB_odbc_utility extends CI_DB_utility { diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 5bf87c59..34d76de6 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -26,7 +26,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 e3d6a8f7..81ac8e92 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_forge extends CI_DB_forge { diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index d09e5730..fdce01aa 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 240e1b7d..573654f6 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 60289c74..9cc69bb6 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -28,7 +28,7 @@ * @subpackage Drivers * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 efc94fbf..e3196cce 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 859b65ff..b8f3dc5b 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @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 c2f8b9bb..d1e1fe02 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -20,7 +20,7 @@ * * @category Database * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/database/ + * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlite_utility extends CI_DB_utility { diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index d559adf2..85d03794 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/array_helper.html + * @link http://codeigniter.com/user_guide/helpers/array_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index c1469a9e..2a4a963d 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/cookie_helper.html + * @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 7213c3aa..9f4c66b4 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/date_helper.html + * @link http://codeigniter.com/user_guide/helpers/date_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 273c8eeb..4a499de5 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/directory_helper.html + * @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 ece22d9a..e8bc2f7f 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/download_helper.html + * @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 3729e042..b44fae55 100644 --- a/system/helpers/email_helper.php +++ b/system/helpers/email_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/email_helper.html + * @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 ebf30e94..a5dc437c 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/file_helpers.html + * @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 5c145706..a2bc2002 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/form_helper.html + * @link http://codeigniter.com/user_guide/helpers/form_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 07757c27..a11d23e1 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/html_helper.html + * @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 a72d0cef..b1864cb0 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/directory_helper.html + * @link http://codeigniter.com/user_guide/helpers/directory_helper.html */ diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 44c6811d..97c9a6ba 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/security_helper.html + * @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 58ed20ef..d61ea782 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/smiley_helper.html + * @link http://codeigniter.com/user_guide/helpers/smiley_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index ff7dc0aa..42bcd57a 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/string_helper.html + * @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 211ef105..9620e03e 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/text_helper.html + * @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 93a887db..4a746c6e 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/typography_helper.html + * @link http://codeigniter.com/user_guide/helpers/typography_helper.html */ // ------------------------------------------------------------------------ @@ -83,7 +83,7 @@ function auto_typography($str) * @access private * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/ + * @link http://codeigniter.com/user_guide/helpers/ */ class Auto_typography { diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 39ef484c..9969af04 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/url_helper.html + * @link http://codeigniter.com/user_guide/helpers/url_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index 8c39a751..1a2c7379 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/xml_helper.html + * @link http://codeigniter.com/user_guide/helpers/xml_helper.html */ // ------------------------------------------------------------------------ diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index 88ef95ce..bca37822 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -25,7 +25,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/benchmark.html + * @link http://codeigniter.com/user_guide/libraries/benchmark.html */ class CI_Benchmark { diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 5aa3cb60..a85c1830 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/calendar.html + * @link http://codeigniter.com/user_guide/libraries/calendar.html */ class CI_Calendar { diff --git a/system/libraries/Config.php b/system/libraries/Config.php index 92c60b4d..9b8b07c5 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/config.html + * @link http://codeigniter.com/user_guide/libraries/config.html */ class CI_Config { diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index d515bedb..ad9c6680 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -25,7 +25,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/general/controllers.html + * @link http://codeigniter.com/user_guide/general/controllers.html */ class Controller extends CI_Base { diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 77e5bf5c..6136a050 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/email.html + * @link http://codeigniter.com/user_guide/libraries/email.html */ class CI_Email { diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index ccc470c2..b533c043 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/encryption.html + * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_Encrypt { diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 9223ff2b..b22ef9f7 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Exceptions * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/exceptions.html + * @link http://codeigniter.com/user_guide/libraries/exceptions.html */ class CI_Exceptions { var $action; diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 77a982f8..9fdee012 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/ftp.html + * @link http://codeigniter.com/user_guide/libraries/ftp.html */ class CI_FTP { diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 04cdd0a3..49cb230c 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -25,7 +25,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/encryption.html + * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_Hooks { diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index f563adab..9a78adf6 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Image_lib * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/image_lib.html + * @link http://codeigniter.com/user_guide/libraries/image_lib.html */ class CI_Image_lib { diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 40440249..de70738e 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Input * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/input.html + * @link http://codeigniter.com/user_guide/libraries/input.html */ class CI_Input { var $use_xss_clean = FALSE; diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 40816f94..3dac1a61 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Language * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/language.html + * @link http://codeigniter.com/user_guide/libraries/language.html */ class CI_Language { diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index d2f57027..e2420a0c 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @author ExpressionEngine Dev Team * @category Loader - * @link http://www.codeigniter.com/user_guide/libraries/loader.html + * @link http://codeigniter.com/user_guide/libraries/loader.html */ class CI_Loader { diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 2218addc..011bdbfd 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Logging * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/general/errors.html + * @link http://codeigniter.com/user_guide/general/errors.html */ class CI_Log { diff --git a/system/libraries/Model.php b/system/libraries/Model.php index bfadd9a4..8181ead3 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/config.html + * @link http://codeigniter.com/user_guide/libraries/config.html */ class Model { diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 14640d85..ed9f6f4f 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Output * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/output.html + * @link http://codeigniter.com/user_guide/libraries/output.html */ class CI_Output { diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 8c057364..ba1572f6 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Pagination * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/pagination.html + * @link http://codeigniter.com/user_guide/libraries/pagination.html */ class CI_Pagination { diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 8e4d6040..a0b310f0 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Parser * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/parser.html + * @link http://codeigniter.com/user_guide/libraries/parser.html */ class CI_Parser { diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 65d62f2a..3b189027 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -28,7 +28,7 @@ * @subpackage Libraries * @category Libraries * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/general/profiling.html + * @link http://codeigniter.com/user_guide/general/profiling.html */ class CI_Profiler { diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 685426ac..df72cea2 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @author ExpressionEngine Dev Team * @category Libraries - * @link http://www.codeigniter.com/user_guide/general/routing.html + * @link http://codeigniter.com/user_guide/general/routing.html */ class CI_Router { diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 5bc17f16..a92db0ec 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Sessions * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/sessions.html + * @link http://codeigniter.com/user_guide/libraries/sessions.html */ class CI_Session { diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index e9b724b3..6bb89117 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -40,7 +40,7 @@ * @subpackage Libraries * @category Encryption * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/general/encryption.html + * @link http://codeigniter.com/user_guide/general/encryption.html */ class CI_SHA { diff --git a/system/libraries/Table.php b/system/libraries/Table.php index f67b17ea..d1c52548 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.3.1 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category HTML Tables * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/uri.html + * @link http://codeigniter.com/user_guide/libraries/uri.html */ class CI_Table { diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index d325b7ee..5371e905 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category Trackbacks * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/trackback.html + * @link http://codeigniter.com/user_guide/libraries/trackback.html */ class CI_Trackback { diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 5aafbb4c..1349ebed 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category URI * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/uri.html + * @link http://codeigniter.com/user_guide/libraries/uri.html */ class CI_URI { diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index 4bf32d64..33a8f310 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.3.1 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category UnitTesting * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/uri.html + * @link http://codeigniter.com/user_guide/libraries/uri.html */ class CI_Unit_test { diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 387f7252..6511c68a 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Uploads * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/file_uploading.html + * @link http://codeigniter.com/user_guide/libraries/file_uploading.html */ class CI_Upload { diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 7670d7b8..9fa45c8a 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -24,7 +24,7 @@ * @subpackage Libraries * @category User Agent * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/user_agent.html + * @link http://codeigniter.com/user_guide/libraries/user_agent.html */ class CI_User_agent { diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 061cacc9..d96b4f6f 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Libraries * @category Validation * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/validation.html + * @link http://codeigniter.com/user_guide/libraries/validation.html */ class CI_Validation { diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 4426ff49..9eb32934 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -28,7 +28,7 @@ * @subpackage Libraries * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class CI_Xmlrpc { @@ -338,7 +338,7 @@ function send_response($response) * * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Client extends CI_Xmlrpc { @@ -416,7 +416,7 @@ function sendPayload($msg) * * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Response { @@ -596,7 +596,7 @@ function iso8601_decode($time, $utc=0) * * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Message extends CI_Xmlrpc { @@ -1193,7 +1193,7 @@ function decode_message($param) * * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Values extends CI_Xmlrpc { diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 6854c8c3..59ac5857 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -32,7 +32,7 @@ * @subpackage Libraries * @category XML-RPC * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/xmlrpc.html + * @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 da40f8db..a3d42f34 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -28,7 +28,7 @@ * @subpackage Libraries * @category Encryption * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/libraries/zip.html + * @link http://codeigniter.com/user_guide/libraries/zip.html */ class CI_Zip { diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index 7e6a35f9..11d4564d 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php index a2259d66..86270cac 100644 --- a/system/plugins/js_calendar_pi.php +++ b/system/plugins/js_calendar_pi.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index bffc0ec2..a9777040 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -23,7 +23,7 @@ * @package CodeIgniter * @subpackage Scaffolding * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/general/scaffolding.html + * @link http://codeigniter.com/user_guide/general/scaffolding.html */ class Scaffolding { diff --git a/system/scaffolding/views/footer.php b/system/scaffolding/views/footer.php index d25365dd..a287664f 100644 --- a/system/scaffolding/views/footer.php +++ b/system/scaffolding/views/footer.php @@ -2,7 +2,7 @@
    diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e1d2365d..a852d742 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -40,7 +40,7 @@ @@ -371,7 +371,7 @@

    Version 1.4.0

    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • -
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • Added regular expressions support for routing rules.
    • Added the ability to remap function calls within your controllers.
    • Added the ability to replace core system classes with your own classes.
    • @@ -576,7 +576,7 @@

      Version Beta 1.0

      User Guide Home   ·   Next Topic:  Credits

      -

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2007  ·  Ellislab, Inc.

      diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index bf436996..42738968 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -39,7 +39,7 @@
    - + diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 8cf5478e..ea347cb5 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -105,7 +105,7 @@

    $this->load->view('file_name', $data, true/fals

    $this->load->model('Model_name');

    $this->load->model('Model_name');

    -

    If you model is located in a sub-folder, include the relative path from your models folder. For example, if you have a model located at application/models/blog/queries.php you'll load it using:

    +

    If your model is located in a sub-folder, include the relative path from your models folder. For example, if you have a model located at application/models/blog/queries.php you'll load it using:

    $this->load->model('blog/queries');

    If you would like your model assigned to a different object name you can specify it via the second parameter of the loading function:

    From 95d06605c68f9b2073b0a01e7fa81aad4aa0e755 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 27 May 2008 21:45:59 +0000 Subject: [PATCH 1178/2544] added routing example --- user_guide/general/routing.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index fca1e3b8..e6642fb0 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -108,7 +108,6 @@

    Wildcards

    Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.

    -

    Examples

    Here are a few routing examples:

    @@ -119,10 +118,12 @@

    Examples

    $route['blog/joe'] = "blogs/users/34";

    A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    - $route['product/:any'] = "catalog/product_lookup";

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    +$route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; +

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

    +

    Important: Do not use leading/trailing slashes.

    Regular Expressions

    From 9e11220c2b780ca3320deae7e91a272b84c88533 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 28 May 2008 23:46:28 +0000 Subject: [PATCH 1179/2544] added error suppression to fopen() in write_file() --- system/helpers/file_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 0d33fe3f..86c5c09d 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -87,7 +87,7 @@ function read_file($file) { function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE) { - if ( ! $fp = fopen($path, $mode)) + if ( ! $fp = @fopen($path, $mode)) { return FALSE; } From bd4400988922b2560975a80498404d7ecd000c0b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 29 May 2008 17:52:11 +0000 Subject: [PATCH 1180/2544] made MySQL/MySQLi forge use explicitly named KEYs, added ability to specify multi-column non-primary keys in table creation --- system/database/drivers/mssql/mssql_forge.php | 16 ++++++++++---- system/database/drivers/mysql/mysql_forge.php | 17 ++++++++++++--- .../database/drivers/mysqli/mysqli_forge.php | 17 ++++++++++++--- system/database/drivers/oci8/oci8_forge.php | 17 ++++++++++++--- system/database/drivers/odbc/odbc_forge.php | 16 ++++++++++---- .../drivers/postgre/postgre_forge.php | 14 ++++++++++--- .../database/drivers/sqlite/sqlite_forge.php | 21 ++++++++++++++----- system/plugins/captcha_pi.php | 4 ++-- user_guide/changelog.html | 2 ++ user_guide/database/forge.html | 12 +++++++++-- user_guide/libraries/trackback.html | 4 ++-- 11 files changed, 109 insertions(+), 31 deletions(-) diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index ddd1bb6a..6995d342 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -147,16 +147,24 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $primary_keys = $this->db->_protect_identifiers($primary_keys); $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - + if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); foreach ($keys as $key) { - $sql .= ",\n\tFOREIGN KEY ($key)"; + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; } } - + $sql .= "\n)"; return $sql; diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index a631e430..28143a04 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -153,16 +153,27 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) if (count($primary_keys) > 0) { + $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; } if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); foreach ($keys as $key) { - $sql .= ",\n\tKEY ($key)"; + if (is_array($key)) + { + $key_name = $this->db->_protect_identifiers(implode('_', $key)); + $key = $this->db->_protect_identifiers($key); + } + else + { + $key_name = $this->db->_protect_identifiers($key); + $key = array($key_name); + } + + $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; } } diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index f767acbe..da79bc6a 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -153,16 +153,27 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) if (count($primary_keys) > 0) { + $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; } if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); foreach ($keys as $key) { - $sql .= ",\n\tKEY ($key)"; + if (is_array($key)) + { + $key_name = $this->db->_protect_identifiers(implode('_', $key)); + $key = $this->db->_protect_identifiers($key); + } + else + { + $key_name = $this->db->_protect_identifiers($key); + $key = array($key_name); + } + + $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; } } diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 9f3fac54..6266c75a 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -135,10 +135,21 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - if (count($keys) > 0) + if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); - $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $keys) . ")"; + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $key) . ")"; + } } $sql .= "\n)"; diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index 60df616c..10924abe 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -146,16 +146,24 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $primary_keys = $this->db->_protect_identifiers($primary_keys); $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - + if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); foreach ($keys as $key) { - $sql .= ",\n\tFOREIGN KEY ($key)"; + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; } } - + $sql .= "\n)"; return $sql; diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index f8dfca8a..ef578345 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -134,13 +134,21 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $primary_keys = $this->db->_protect_identifiers($primary_keys); $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - + if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); foreach ($keys as $key) { - $sql .= ",\n\tFOREIGN KEY ($key)"; + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; } } diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 25c74a73..a6866c87 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -144,13 +144,24 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $primary_keys = $this->db->_protect_identifiers($primary_keys); $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - - if (count($keys) > 0) + + if (is_array($keys) && count($keys) > 0) { - $keys = $this->db->_protect_identifiers($keys); - $sql .= ",\n\tUNIQUE (" . implode(', ', $keys) . ")"; + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")"; + } } - + $sql .= "\n)"; return $sql; diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index df95788e..baa0a8dc 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -92,8 +92,8 @@ captcha_time int(10) unsigned NOT NULL, ip_address varchar(16) default '0' NOT NULL, word varchar(20) NOT NULL, - PRIMARY KEY (captcha_id), - KEY (word) + PRIMARY KEY `captcha_id` (`captcha_id`), + KEY `word` (`word`) ) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9e39cb4b..b59b9ef9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,8 @@

    Version 1.6.3

    • Database
        +
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • +
      • Added ability to set multiple column non-primary keys to the Forge class
      • Added ability to set additional database config values in DSN connections via the query string.
    • diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index f9363f4e..f679a4f2 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -164,11 +164,19 @@

      Creating an id field

      // gives id INT(9) NOT NULL AUTO_INCREMENT

      Adding Keys

      Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().

      +

      Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.

      $this->dbforge->add_key('blog_id', TRUE);
      - // gives PRIMARY KEY (blog_id)
      + // gives PRIMARY KEY `blog_id` (`blog_id`)

      + $this->dbforge->add_key('blog_id', TRUE);
      + $this->dbforge->add_key('site_id', TRUE);
      + // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
      +
      $this->dbforge->add_key('blog_name');
      - // gives KEY (blog_name)

      + // gives KEY `blog_name` (`blog_name`)
      +
      + $this->dbforge->add_key(array('blog_name', 'blog_label'));
      + // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)

      Creating a table

      After fields and keys have been declared, you can create a new table with

      $this->dbforge->create_table('table_name');
      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index f86ccca0..4f60f5ab 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -152,8 +152,8 @@

      Creating a Trackback Table

      blog_name varchar(100) NOT NULL, tb_date int(10) NOT NULL, ip_address varchar(16) NOT NULL, - PRIMARY KEY (tb_id), - KEY (entry_id) + PRIMARY KEY `tb_id` (`tb_id`), + KEY `entry_id` (`entry_id`) ); From 9f23e7c24c9786bbe576ca6df3dc362581216bef Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 30 May 2008 20:00:11 +0000 Subject: [PATCH 1181/2544] moved word compacting to a callback for clarity, added a few js event handlers for removal --- system/libraries/Input.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index cac05c71..5f066cc5 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -715,10 +715,10 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') { $temp .= substr($word, $i, 1)."\s*"; } - + // We only want to do this when it is followed by a non-word character // That way valid stuff like "dealer to" does not become "dealerto" - $str = preg_replace('#('.substr($temp, 0, -3).')(\W)#ise', "preg_replace('/\s+/s', '', '\\1').'\\2'", $str); + $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); } /* @@ -757,7 +757,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') * but it's unlikely to be a problem. * */ - $event_handlers = array('onblur','onchange','onclick','onended','onerror','onfocus','onkeydown','onkeypress','onkeyup','onload','onmousedown','onmouseover','onmouseup','onresize','onselect','onsubmit','onunload','xmlns'); + $event_handlers = array('onblur','onchange','onclick','ondblclick','onended','onerror','onfocus','onkeydown','onkeypress','onkeyup','onload','onmousedown','onmousemove','onmouseover','onmouseout','onmouseup','onresize','onselect','onsubmit','onunload','xmlns'); if ($is_image === TRUE) { @@ -874,6 +874,23 @@ function xss_hash() // -------------------------------------------------------------------- + /** + * Compact Exploded Words + * + * Callback function for xss_clean() to remove whitespace from + * things like j a v a s c r i p t + * + * @access public + * @param type + * @return type + */ + function _compact_exploded_words($matches) + { + return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; + } + + // -------------------------------------------------------------------- + /** * Sanitize Naughty HTML * From 92bb3e6ad6083b13213c4c3e71d0fbb6a7f83971 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 30 May 2008 21:22:27 +0000 Subject: [PATCH 1182/2544] decided just to kill all on*= event handlers, rather than trying to keep up with (and require users to do the same) with a blacklist. --- system/libraries/Input.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 5f066cc5..b111108e 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -757,7 +757,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') * but it's unlikely to be a problem. * */ - $event_handlers = array('onblur','onchange','onclick','ondblclick','onended','onerror','onfocus','onkeydown','onkeypress','onkeyup','onload','onmousedown','onmousemove','onmouseover','onmouseout','onmouseup','onresize','onselect','onsubmit','onunload','xmlns'); + $event_handlers = array('xmlns'); if ($is_image === TRUE) { @@ -768,7 +768,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') unset($event_handlers[array_search('xmlns', $event_handlers)]); } - $str = preg_replace("#<([^><]+)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); + $str = preg_replace("#<([^><]+)((?=on\w*)|".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); /* * Sanitize naughty HTML elements From 8039d4c217cd0324e191f3c7887803246070a194 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 31 May 2008 02:47:56 +0000 Subject: [PATCH 1183/2544] Charset information in the userguide has been moved above title for internationalization purposes (#4614) --- user_guide/changelog.html | 7 +- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/doc_style/template.html | 246 +++++++++---------- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/compatibility_helper.html | 234 +++++++++--------- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 114 files changed, 355 insertions(+), 354 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b59b9ef9..f37982cf 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -2,8 +2,6 @@ -Change Log : CodeIgniter User Guide - @@ -12,13 +10,15 @@ - + +Change Log : CodeIgniter User Guide + @@ -79,6 +79,7 @@

      Version 1.6.3

    • Added ability to use xss_clean() to test images for XSS, useful for upload security.
    • Improved security in xss_clean().
    • Considerably expanded list of mobile user-agents in config/user_agents.php.
    • +
    • Charset information in the userguide has been moved above title for internationalization purposes (#4614)
    diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 796d1b25..1a3c9b6e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -2,6 +2,7 @@ + Active Record : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index bc1cd0d8..d9b90621 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -2,6 +2,7 @@ + Database Caching Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 08b855b5..9ea2aba7 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -2,6 +2,7 @@ + Custom Function Calls : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b7780405..e14e1615 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -2,6 +2,7 @@ + Database Configuration : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index bc4b2e7e..8de04604 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -2,6 +2,7 @@ + Connecting to your Database : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index debecbf8..22d2eba5 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -2,6 +2,7 @@ + Database Quick Start : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 15631df4..06ee20e6 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -2,6 +2,7 @@ + Field Data : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index f679a4f2..cbe50384 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -2,6 +2,7 @@ + Database Forge Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 7d3d0e46..10598f8a 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -2,6 +2,7 @@ + Query Helper Functions : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 506efcc4..d67dfc20 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -2,6 +2,7 @@ + The Database Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 6c030059..e5f0a086 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -2,6 +2,7 @@ + Queries : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 50f32de9..468a8350 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -2,6 +2,7 @@ + Generating Query Results : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 6e4d7688..8c82a70f 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -2,6 +2,7 @@ + Table Data : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index b1187a04..5fcc8e39 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -2,6 +2,7 @@ + Transactions : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 3050801b..dd16f5c7 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -2,6 +2,7 @@ + Database Utility Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index ceb8beaa..3253ea7e 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -2,6 +2,7 @@ + Writing Documentation : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index bfec1a25..b267effe 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -1,124 +1,124 @@ - - - - -CodeIgniter Project Documentation Template - - - - - - - - - - - - - - - -
    -

    wm_type texttype, overlaytext, overlay Sets the type of watermarking that should be used.
    - - - - -

    Project Title

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Foo Class

    - -

    Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

    - -

    Important:  This is an important note with EMPHASIS.

    - -

    Features:

    - -
      -
    • Foo
    • -
    • Bar
    • -
    - -

    Usage Heading

    - -

    Description of using Foo. Highlight variables and filenames in regular text with the <var> tag, and code using the <dfn> tag.

    - - - $this->load->library('foo');
    -
    - $this->foo->bar('bat'); -
    - - -

    Table Preferences

    - -

    Use tables where appropriate for long lists of preferences.

    - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    fooFooNoneDescription of foo.
    barBarbat, bag, or bakDescription of bar.
    - -

    Foo Function Reference

    - -

    $this->foo->bar()

    -

    Description

    -$this->foo->bar('baz') - -
    - - - - - - + + + + + +CodeIgniter Project Documentation Template + + + + + + + + + + + + + + +
    + + + + + +

    Project Title

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Foo Class

    + +

    Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

    + +

    Important:  This is an important note with EMPHASIS.

    + +

    Features:

    + +
      +
    • Foo
    • +
    • Bar
    • +
    + +

    Usage Heading

    + +

    Description of using Foo. Highlight variables and filenames in regular text with the <var> tag, and code using the <dfn> tag.

    + + + $this->load->library('foo');
    +
    + $this->foo->bar('bat'); +
    + + +

    Table Preferences

    + +

    Use tables where appropriate for long lists of preferences.

    + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    fooFooNoneDescription of foo.
    barBarbat, bag, or bakDescription of bar.
    + +

    Foo Function Reference

    + +

    $this->foo->bar()

    +

    Description

    +$this->foo->bar('baz') + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 221109aa..1d9bd504 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -2,6 +2,7 @@ + Alternate PHP Syntax for View Files : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 75307668..6a896cc9 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -2,6 +2,7 @@ + Creating Ancillary Classes : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 3456fba2..6233fe17 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -2,6 +2,7 @@ + Auto-loading Resources : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 591fbb62..136f505c 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -2,6 +2,7 @@ + Web Page Caching : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index e7cf9e06..0daa36b6 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -2,6 +2,7 @@ + Common Functions : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 4c0c506a..034f1b23 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -2,6 +2,7 @@ + Controllers : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index ff9896c3..bc307ddd 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -2,6 +2,7 @@ + Creating Core System Classes : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index c1318709..eda7e574 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -2,6 +2,7 @@ + Creating Libraries : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index ed2d08dc..a0d2c469 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -2,6 +2,7 @@ + Credits : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 91bd3430..548f7cea 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -2,6 +2,7 @@ + Error Handling : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index aa14a2dd..30a114e0 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -2,6 +2,7 @@ + Helper Functions : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 60bdf023..d0ea96e1 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -2,6 +2,7 @@ + Hooks : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/index.html b/user_guide/general/index.html index 2b114421..a7bba69d 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -2,6 +2,7 @@ + Getting Started With CodeIgniter : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 395b9ea6..5d17a765 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -2,6 +2,7 @@ + Using CodeIgniter Libraries : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 7f65b79f..517c08ce 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -2,6 +2,7 @@ + Managing your Applications : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 52172570..8472cc5e 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -2,6 +2,7 @@ + Models : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 4b394f02..dcd3a6f9 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -2,6 +2,7 @@ + Plugins : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index e7d3a530..1cc9e882 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -2,6 +2,7 @@ + Profiling Your Application : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 71163a4f..91e549d7 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -2,6 +2,7 @@ + Quick Reference Chart : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index c45c1efd..5b536ecb 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -2,6 +2,7 @@ + Server Requirements : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 79e5940f..a5d8f5d9 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -2,6 +2,7 @@ + Reserved Names : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index e6642fb0..b282e18d 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -2,6 +2,7 @@ + URI Routing : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 7dc66d1d..417cb100 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -2,6 +2,7 @@ + Scaffolding : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 779292a8..979397c6 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -2,6 +2,7 @@ + Security : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 8ba46e3d..9230f98c 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -2,6 +2,7 @@ + CodeIgniter URLs : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 4aa2a1fc..3417f55b 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -2,6 +2,7 @@ + Views : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 474f9530..fbe75bbd 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -2,6 +2,7 @@ + Array Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index cc145a82..434c2741 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -1,118 +1,118 @@ - - - - -Compatibility Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.6.2

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Compatibility Helper

    - -

    The Compatibility Helper file contains PHP 4 implementations of some PHP 5 only native PHP functions and constants. This can be useful - if you'd like to take advantage of some of these native function but your application may end up running on a PHP 4 server. - In these cases, it may be advantageous to Auto-load the Compatibility Helper so you - do not have to load it in each controller.

    - -

    Note: There are a few compatibility functions that are in CodeIgniter's native Compat.php file. - You may use those functions without loading this helper. The functions are split between that file and this Helper so that only - functions required by the framework are included by default. This way, whether or not you load the additional functions in this Helper - remains your choice.

    - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('compatibility'); - -

    Available Constants

    -

    The following constants are available:

    - -

    PHP_EOL

    -

    The newline character for the server's current OS, e.g. on Windows systems "\r\n", on *nix "\n". - -

    Available Functions

    -

    The following functions are available (see linked PHP documentation for documentation):

    - -

    file_put_contents() - The fourth parameter, $context, is not supported.

    - -

    fputcsv()

    - -

    http_build_query()

    - -

    str_ireplace() - The fourth parameter, $count, is not supported, as PHP 4 would make it become required.

    - -

    stripos()

    - - - - - - - -
    - - - - - - + + + + + +Compatibility Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.2

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Compatibility Helper

    + +

    The Compatibility Helper file contains PHP 4 implementations of some PHP 5 only native PHP functions and constants. This can be useful + if you'd like to take advantage of some of these native function but your application may end up running on a PHP 4 server. + In these cases, it may be advantageous to Auto-load the Compatibility Helper so you + do not have to load it in each controller.

    + +

    Note: There are a few compatibility functions that are in CodeIgniter's native Compat.php file. + You may use those functions without loading this helper. The functions are split between that file and this Helper so that only + functions required by the framework are included by default. This way, whether or not you load the additional functions in this Helper + remains your choice.

    + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('compatibility'); + +

    Available Constants

    +

    The following constants are available:

    + +

    PHP_EOL

    +

    The newline character for the server's current OS, e.g. on Windows systems "\r\n", on *nix "\n". + +

    Available Functions

    +

    The following functions are available (see linked PHP documentation for documentation):

    + +

    file_put_contents() - The fourth parameter, $context, is not supported.

    + +

    fputcsv()

    + +

    http_build_query()

    + +

    str_ireplace() - The fourth parameter, $count, is not supported, as PHP 4 would make it become required.

    + +

    stripos()

    + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 8f86fb4a..7e589f4b 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -2,6 +2,7 @@ + Cookie Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index ae19f607..0b74ba1d 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -2,6 +2,7 @@ + Date Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index c677e2ed..38e06412 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -2,6 +2,7 @@ + Directory Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 778aafbc..61c64450 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -2,6 +2,7 @@ + Download Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 39bbdb36..8b72de41 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -2,6 +2,7 @@ + Email Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 2c3dba13..e1205f99 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -2,6 +2,7 @@ + File Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 32406846..5e556dca 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -2,6 +2,7 @@ + Form Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 3b68c399..1fea3ced 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -2,6 +2,7 @@ + HTML Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 464d129d..328b41d3 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -2,6 +2,7 @@ + Inflector Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 0fba20bb..c2aa3479 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -2,6 +2,7 @@ + Path Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 0e1b3e76..4dbd1653 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -2,6 +2,7 @@ + Security Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index a3444fff..7b59ec20 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -2,6 +2,7 @@ + Smiley Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 07c6cc8d..daa57356 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -2,6 +2,7 @@ + String Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 7697f887..231887ec 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -2,6 +2,7 @@ + Text Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 547338dc..18efb9d8 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -2,6 +2,7 @@ + Typography Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 1650fdbe..2c0b255d 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -2,6 +2,7 @@ + URL Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index b9dd818b..5d5360aa 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -2,6 +2,7 @@ + XML Helper : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/index.html b/user_guide/index.html index 7d69b33a..8200bf5c 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -2,6 +2,7 @@ + Welcome to CodeIgniter : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 661ec48a..3f42040e 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -2,6 +2,7 @@ + Downloading CodeIgniter : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index e6eaaab2..8628784f 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -2,6 +2,7 @@ + Installation Instructions : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 1f3875b2..fc267c30 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -2,6 +2,7 @@ + Troubleshooting : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 5a3373d5..0013784f 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 941aaf8b..9c91adae 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 13d2eeab..bc79fb34 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index b65e5023..94099b46 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 945f8eb9..d0e68c41 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 9c1b6b7c..bbd1f866 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index c2fe128a..b7dfe006 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index cb9d25c6..b5a2afdf 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 0310f12c..984ad216 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index ea545053..e86b306f 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 83ea6e26..96e133d9 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -2,6 +2,7 @@ + Upgrading from 1.5.3 to 1.5.4 : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index 88c66d10..d111069e 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -2,6 +2,7 @@ + Upgrading from 1.5.4 to 1.6.0 : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 88992a28..43b0c5c3 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -2,6 +2,7 @@ + Upgrading from 1.6.0 to 1.6.1 : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 20917e91..ea9f62b8 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -2,6 +2,7 @@ + Upgrading from 1.6.1 to 1.6.2 : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index d9e71e95..9e3e61da 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -2,6 +2,7 @@ + CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 307d6b7c..7b9eb651 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -2,6 +2,7 @@ + Upgrading From a Previous Version : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 8f8a33e0..0ffa5eab 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -2,6 +2,7 @@ + Benchmarking Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index a4eaac37..81cdc713 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -2,6 +2,7 @@ + Calendaring Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 3fe19123..4c6460b0 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -2,6 +2,7 @@ + Config Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index d4990dff..e8325431 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -2,6 +2,7 @@ + Email Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 25cb5155..47246be3 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -2,6 +2,7 @@ + Encryption Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 27787814..58317355 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -2,6 +2,7 @@ + File Uploading Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 1d55df20..1e2b7de4 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -2,6 +2,7 @@ + FTP Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 06e58696..59e26674 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -2,6 +2,7 @@ + Image Manipulation Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index c95ebbd9..2cf8b6d0 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -2,6 +2,7 @@ + Input Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 780f0451..eff7d32a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -2,6 +2,7 @@ + Language Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index ea347cb5..4f7d08e5 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -2,6 +2,7 @@ + Loader Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 7b778b80..1aac4d7a 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -2,6 +2,7 @@ + Output Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 5592bc22..65529be4 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -2,6 +2,7 @@ + Pagination Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 73838293..2924a386 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -2,6 +2,7 @@ + Template Parser Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index fbde7123..0949d98b 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -2,6 +2,7 @@ + Session Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index b699ceab..1c65372a 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -2,6 +2,7 @@ + HTML Table Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 4f60f5ab..b8284ea9 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -2,6 +2,7 @@ + Trackback Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index ee53d8c0..ef4d5672 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -2,6 +2,7 @@ + Unit Testing Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 44b8bb92..75f57545 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -2,6 +2,7 @@ + URI Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 3f52a9a1..aa6e3b80 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -2,6 +2,7 @@ + User Agent Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index a0be4d61..b04f9f6b 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -2,6 +2,7 @@ + Form Validation : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index ae863bb2..e426f700 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -2,6 +2,7 @@ + XML-RPC and XML-RPC Server Classes : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 17e2617c..46a82440 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -2,6 +2,7 @@ + Zip Encoding Class : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/license.html b/user_guide/license.html index a47f29d5..e8c05a59 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -2,6 +2,7 @@ + CodeIgniter License Agreement : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 8fc5e141..60c12c2a 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -2,6 +2,7 @@ + Application Flow Chart : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 9c9d98ee..a4d0f360 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -2,6 +2,7 @@ + CodeIgniter at a Glance : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 7fb46fb3..4ae1b0fe 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -2,6 +2,7 @@ + CodeIgniter Features : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index c2c19d3b..c8347aae 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -2,6 +2,7 @@ + Design and Architectural Goals : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 0c89b51e..4aa59f56 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -2,6 +2,7 @@ + CodeIgniter Overview : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index e1c1a72d..bac0a805 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -2,6 +2,7 @@ + Model-View-Controller : CodeIgniter User Guide @@ -12,7 +13,6 @@ - diff --git a/user_guide/toc.html b/user_guide/toc.html index 5a476349..2200550f 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -2,6 +2,7 @@ + Table of Contents : CodeIgniter User Guide @@ -12,7 +13,6 @@ - From a5481acfbee750e5295713ad250dbb2573d374b0 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 2 Jun 2008 18:11:50 +0000 Subject: [PATCH 1184/2544] added a missing word --- user_guide/database/caching.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index d9b90621..6d157abe 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -91,7 +91,7 @@

    How Does Caching Work?

    Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system permits you clear caches associated with individual pages, or you can delete the entire collection of cache files. -Typically you'll to use the housekeeping functions described below to delete cache files after certain +Typically you'll want to use the housekeeping functions described below to delete cache files after certain events take place, like when you've added new information to your database.

    Will Caching Improve Your Site's Performance?

    From 694096e5923057bec182726ef6fc8dbd2908978d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jun 2008 16:37:00 +0000 Subject: [PATCH 1185/2544] change AR behaviour so that blank values result in empty quotes --- system/database/DB_active_rec.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 05a04350..17cdc322 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -454,13 +454,11 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) $k .= ' ='; } - if ($v !== '' AND $v !== NULL) - { - if ($escape === TRUE) - { - $v = ' '.$this->escape($v); - } + if ($v !== NULL AND $escape === TRUE) + { + $v = ' '.$this->escape($v); } + } else { From d8364c4267ddccb64ac330067162a3ce0d4e08c2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jun 2008 17:01:00 +0000 Subject: [PATCH 1186/2544] bit of a code cleanup --- system/database/DB_active_rec.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 17cdc322..4eff400c 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -427,7 +427,7 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) { $prefix = (count($this->ar_where) == 0) ? '' : $type; - if ( ! $this->_has_operator($k) && is_null($key[$k])) + if (is_null($v) && ! $this->_has_operator($k)) { // value appears not to have been set, assign the test to IS NULL $k .= ' IS NULL'; @@ -447,6 +447,9 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) { $k = $this->_protect_identifiers($k); } + + $v = ' '.$this->escape($v); + } if ( ! $this->_has_operator($k)) @@ -454,11 +457,6 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) $k .= ' ='; } - if ($v !== NULL AND $escape === TRUE) - { - $v = ' '.$this->escape($v); - } - } else { @@ -471,6 +469,7 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) } $this->ar_where[] = $prefix.$k.$v; + if ($this->ar_caching === TRUE) { $this->ar_cache_where[] = $prefix.$k.$v; From c06f58e19ba52820ca400e3f1a139f8f86961724 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jun 2008 17:04:48 +0000 Subject: [PATCH 1187/2544] compacting some whitespace --- system/database/DB_active_rec.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 4eff400c..818c8dd8 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -435,7 +435,6 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) if ( ! is_null($v)) { - if ($escape === TRUE) { // exception for "field<=" keys @@ -456,16 +455,13 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) { $k .= ' ='; } - } else { - if ($escape === TRUE) { $k = $this->_protect_identifiers($k, TRUE); - } - + } } $this->ar_where[] = $prefix.$k.$v; From 7e98a2780131b01d7ecea5e3e4d363ae9601149d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jun 2008 17:05:44 +0000 Subject: [PATCH 1188/2544] whitespace, whitespace, schmeitespace --- system/database/DB_active_rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 818c8dd8..8d8b23c4 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -448,7 +448,6 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) } $v = ' '.$this->escape($v); - } if ( ! $this->_has_operator($k)) @@ -472,6 +471,7 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) } } + return $this; } From c04f0fc794c503ca957257f29fc6fc2bed7bd6fa Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jun 2008 18:20:18 +0000 Subject: [PATCH 1189/2544] emendation to on* event handler removal --- system/libraries/Input.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index b111108e..c2c28fb1 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -757,7 +757,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') * but it's unlikely to be a problem. * */ - $event_handlers = array('xmlns'); + $event_handlers = array('on\w*','xmlns'); if ($is_image === TRUE) { @@ -768,8 +768,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') unset($event_handlers[array_search('xmlns', $event_handlers)]); } - $str = preg_replace("#<([^><]+)((?=on\w*)|".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); - + $str = preg_replace("#<([^><]+)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); /* * Sanitize naughty HTML elements * From 144cb5b3c82ff9a25bd4e675385603675e3699d0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jun 2008 19:38:00 +0000 Subject: [PATCH 1190/2544] simplified and refactored input filtering and retrieval --- system/libraries/Input.php | 129 +++++++++---------------------------- 1 file changed, 32 insertions(+), 97 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index c2c28fb1..b0a39c59 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -133,32 +133,14 @@ function _sanitize_globals() } else { - if (is_array($_GET) AND count($_GET) > 0) - { - foreach($_GET as $key => $val) - { - $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - } + $_GET = $this->_clean_input_data($_GET); } // Clean $_POST Data - if (is_array($_POST) AND count($_POST) > 0) - { - foreach($_POST as $key => $val) - { - $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - } - + $_POST = $this->_clean_input_data($_POST); + // Clean $_COOKIE Data - if (is_array($_COOKIE) AND count($_COOKIE) > 0) - { - foreach($_COOKIE as $key => $val) - { - $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - } + $_COOKIE = $this->_clean_input_data($_COOKIE); log_message('debug', "Global POST and COOKIE data sanitized"); } @@ -232,38 +214,46 @@ function _clean_input_keys($str) } // -------------------------------------------------------------------- - + /** - * Fetch an item from the GET array + * Fetch from array * - * @access public + * This is a helper function to retrieve values from global arrays + * + * @access private + * @param array * @param string * @param bool * @return string */ - function get($index = '', $xss_clean = FALSE) + function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) { - if ( ! isset($_GET[$index])) + if ( ! isset($array[$index])) { return FALSE; } if ($xss_clean === TRUE) { - if (is_array($_GET[$index])) - { - foreach($_GET[$index] as $key => $val) - { - $_GET[$index][$key] = $this->xss_clean($val); - } - } - else - { - return $this->xss_clean($_GET[$index]); - } + return $this->xss_clean($array[$index]); } - return $_GET[$index]; + return $array[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the GET array + * + * @access public + * @param string + * @param bool + * @return string + */ + function get($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_GET, $index, $xss_clean); } // -------------------------------------------------------------------- @@ -278,27 +268,7 @@ function get($index = '', $xss_clean = FALSE) */ function post($index = '', $xss_clean = FALSE) { - if ( ! isset($_POST[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - if (is_array($_POST[$index])) - { - foreach($_POST[$index] as $key => $val) - { - $_POST[$index][$key] = $this->xss_clean($val); - } - } - else - { - return $this->xss_clean($_POST[$index]); - } - } - - return $_POST[$index]; + return $this->_fetch_from_array($_POST, $index, $xss_clean); } // -------------------------------------------------------------------- @@ -313,32 +283,7 @@ function post($index = '', $xss_clean = FALSE) */ function cookie($index = '', $xss_clean = FALSE) { - if ( ! isset($_COOKIE[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - if (is_array($_COOKIE[$index])) - { - $cookie = array(); - foreach($_COOKIE[$index] as $key => $val) - { - $cookie[$key] = $this->xss_clean($val); - } - - return $cookie; - } - else - { - return $this->xss_clean($_COOKIE[$index]); - } - } - else - { - return $_COOKIE[$index]; - } + return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); } // -------------------------------------------------------------------- @@ -353,17 +298,7 @@ function cookie($index = '', $xss_clean = FALSE) */ function server($index = '', $xss_clean = FALSE) { - if ( ! isset($_SERVER[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - return $this->xss_clean($_SERVER[$index]); - } - - return $_SERVER[$index]; + return $this->_fetch_from_array($_SERVER, $index, $xss_clean); } // -------------------------------------------------------------------- From c1acb410524414fa925c47834d124a3884b68dcb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 4 Jun 2008 20:58:03 +0000 Subject: [PATCH 1191/2544] a few tweaks for speed --- system/libraries/Input.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index b0a39c59..50b4d823 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -521,8 +521,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') * between ascii characters, like Java\0script. * */ - $str = preg_replace('/\0+/', '', $str); - $str = preg_replace('/(\\\\0)+/', '', $str); + $str = preg_replace(array('/\0+/', '/(\\\\0)+/'), '', $str); /* * Protect GET variables in URLs @@ -646,7 +645,9 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') foreach ($words as $word) { $temp = ''; - for ($i = 0; $i < strlen($word); $i++) + $wordlen = strlen($word); + + for ($i = 0; $i < $wordlen; $i++) { $temp .= substr($word, $i, 1)."\s*"; } From 7a3b96e27988deeebeeff4469f5de3b9fb50918f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jun 2008 21:01:56 +0000 Subject: [PATCH 1192/2544] picky picky Jones adjusts some syntax --- system/libraries/Input.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 50b4d823..8c08468b 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -645,9 +645,8 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') foreach ($words as $word) { $temp = ''; - $wordlen = strlen($word); - for ($i = 0; $i < $wordlen; $i++) + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) { $temp .= substr($word, $i, 1)."\s*"; } From 1e6ab99c692bb0337559d3303143838dff37d638 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 6 Jun 2008 11:37:34 +0000 Subject: [PATCH 1193/2544] Form helper refactored to allow form_open() and form_fieldset() to accept arrays or strings as arguments. --- system/helpers/form_helper.php | 70 +++++++++++++++++++++++++--------- user_guide/changelog.html | 5 +++ 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index c6aa0d2b..cc08f4fe 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -48,18 +48,7 @@ function form_open($action = '', $attributes = array(), $hidden = array()) $form = '
    0) - { - foreach ($attributes as $key => $val) - { - $form .= ' '.$key.'="'.$val.'"'; - } - } + $form .= _attributes_to_string($attributes, TRUE); $form .= '>'; @@ -467,13 +456,7 @@ function form_fieldset($legend_text = '', $attributes = array()) $fieldset = " 0) - { - foreach ($attributes as $key => $val) - { - $fieldset .= ' '.$key.'="'.$val.'"'; - } - } + $fieldset .= _attributes_to_string($attributes, FALSE); $fieldset .= ">\n"; @@ -610,6 +593,55 @@ function parse_form_attributes($attributes, $default) } } +// ------------------------------------------------------------------------ + +/** + * Attributes To String + * + * Helper function used by some of the form helpers + * + * @access private + * @param mixed + * @param bool + * @return string + */ +if ( ! function_exists('_attributes_to_string')) +{ + function _attributes_to_string($attributes, $formtag = FALSE) + { + if (is_string($attributes) AND strlen($attributes) > 0) + { + if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE) + { + $attributes .= ' method="post"'; + } + + return ' '.$attributes; + } + + if (is_object($attributes) AND count($attributes) > 0) + { + $attributes = (array)$attributes; + } + + if (is_array($attributes) AND count($attributes) > 0) + { + $atts = ''; + + if ( ! isset($attributes['method']) AND $formtag === TRUE) + { + $atts .= ' method="post"'; + } + + foreach ($attributes as $key => $val) + { + $atts .= ' '.$key.'="'.$val.'"'; + } + + return $atts; + } + } +} /* End of file form_helper.php */ /* Location: ./system/helpers/form_helper.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f37982cf..47e517dc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,11 @@

    Version 1.6.3

  • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
  • +
  • Helpers +
      +
    • Form helper refactored to allow form_open() and form_fieldset() to accept arrays or strings as arguments.
    • +
    +
  • Other changes
    • Added ability to use xss_clean() to test images for XSS, useful for upload security.
    • From f7623aab9c9d9c0d0dae5911857cf8ba8d7a462c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 6 Jun 2008 13:36:19 +0000 Subject: [PATCH 1194/2544] default to post method --- system/helpers/form_helper.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index cc08f4fe..37afc2da 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -40,7 +40,7 @@ */ if ( ! function_exists('form_open')) { - function form_open($action = '', $attributes = array(), $hidden = array()) + function form_open($action = '', $attributes = = 'method="post"', $hidden = array()) { $CI =& get_instance(); @@ -453,7 +453,6 @@ function form_label($label_text = '', $id = '', $attributes = array()) { function form_fieldset($legend_text = '', $attributes = array()) { - $fieldset = " Date: Fri, 6 Jun 2008 13:41:53 +0000 Subject: [PATCH 1195/2544] goofed. Fixed up. --- system/helpers/form_helper.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 37afc2da..d250d76e 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -40,10 +40,15 @@ */ if ( ! function_exists('form_open')) { - function form_open($action = '', $attributes = = 'method="post"', $hidden = array()) + function form_open($action = '', $attributes = '', $hidden = array()) { $CI =& get_instance(); + if ($attributes == '') + { + $attributes = 'method="post"'; + } + $action = ( strpos($action, '://') === FALSE) ? $CI->config->site_url($action) : $action; $form = ' Date: Fri, 6 Jun 2008 14:17:57 +0000 Subject: [PATCH 1196/2544] Removed an unused Router reference in _display_cache(). --- system/codeigniter/CodeIgniter.php | 2 +- system/libraries/Output.php | 4 +--- user_guide/changelog.html | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index da20c48a..74e5e8b4 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -103,7 +103,7 @@ if ($EXT->_call_hook('cache_override') === FALSE) { - if ($OUT->_display_cache($CFG, $RTR) == TRUE) + if ($OUT->_display_cache($CFG, $URI) == TRUE) { exit; } diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 49cfc0a2..cc88f40a 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -321,10 +321,8 @@ function _write_cache($output) * @access public * @return void */ - function _display_cache(&$CFG, &$RTR) + function _display_cache(&$CFG, &$URI) { - $URI =& load_class('URI'); - $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path)) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 47e517dc..110f1c27 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -81,6 +81,7 @@

      Version 1.6.3

    • Other changes
        +
      • Removed an unused Router reference in _display_cache().
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • Improved security in xss_clean().
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • From 27a5aa1f5c85fb7e53eda5ab0dd3efcbd70b2338 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 6 Jun 2008 18:51:59 +0000 Subject: [PATCH 1197/2544] added quoted-printable headers when $this->send_multipart has been manually changed to FALSE --- system/libraries/Email.php | 3 ++- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 8eb47dc8..e02c83d1 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -993,7 +993,8 @@ function _build_message() if ($this->send_multipart === FALSE) { - $hdr .= "Content-Type: text/html;". $this->newline; + $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; + $hdr .= "Content-Transfer-Encoding: quoted-printable"; } else { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 110f1c27..469a9508 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -102,6 +102,7 @@

        Bug fixes for 1.6.3

      • Removed some unused variables from the code (#4563).
      • Fixed a bug where having() was not adding an = into the statement (#4568).
      • Fixed assorted user guide typos or examples (#4574).
      • +
      • Added quoted-printable headers to Email class when the multi-part override is used.

      Version 1.6.2

      From 61860c92fc3bf693537837448b584f2c8485ee46 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 9 Jun 2008 03:09:12 +0000 Subject: [PATCH 1198/2544] Added a language key for valid_emails in validation_lang.php. --- system/language/english/validation_lang.php | 5 +++-- user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system/language/english/validation_lang.php b/system/language/english/validation_lang.php index f26115f4..7da801d1 100644 --- a/system/language/english/validation_lang.php +++ b/system/language/english/validation_lang.php @@ -3,6 +3,7 @@ $lang['required'] = "The %s field is required."; $lang['isset'] = "The %s field must have a value."; $lang['valid_email'] = "The %s field must contain a valid email address."; +$lang['valid_emails'] = "The %s field must contain all valid email addresses."; $lang['valid_url'] = "The %s field must contain a valid URL."; $lang['valid_ip'] = "The %s field must contain a valid IP."; $lang['min_length'] = "The %s field must be at least %s characters in length."; @@ -15,6 +16,6 @@ $lang['integer'] = "The %s field must contain an integer."; $lang['matches'] = "The %s field does not match the %s field."; - -/* End of file validation_lang.php */ + +/* End of file validation_lang.php */ /* Location: ./system/language/english/validation_lang.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 469a9508..db968b0c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,6 +94,7 @@

      Version 1.6.3

      Bug fixes for 1.6.3

        +
      • Added a language key for valid_emails in validation_lang.php.
      • Amended fixes for bug (#3419) with parsing DSN database connections.
      • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
      • Fixed a syntax error in upload_lang.php.
      • From 1249107af8bad0434b310bda51d2de0a429a366c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 13 Jun 2008 20:03:39 +0000 Subject: [PATCH 1199/2544] Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page. --- user_guide/changelog.html | 3 ++- user_guide/libraries/xmlrpc.html | 29 ++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index db968b0c..d004da64 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,7 +85,8 @@

        Version 1.6.3

      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • Improved security in xss_clean().
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • -
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614)
      • +
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • +
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index e426f700..e3d51903 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -398,9 +398,36 @@

    Try it!

    The client you created sends a message ("How's is going?") to the server, along with a request for the "Greetings" method. The Server receives the request and maps it to the "process" function, where a response is sent back.

    +

    Using Associative Arrays In a Request Parameter

    + +

    If you wish to use an associative array in your method parameters you will need to use a struct datatype:

    + +$request = array(
    +                  array(
    +                        // Param 0
    +                        array(
    +                              'name'=>'John'
    +                              ),
    +                              'struct'
    +                        ),
    +                        array(
    +                              // Param 1
    +                              array(
    +                                    'size'=>'large',
    +                                    'shape'=>'round'
    +                                    ),
    +                              'struct'
    +                        )
    +                  );
    + $this->xmlrpc->request($request);
    + +

    You can retrieve the associative array when processing the request in the Server.

    +$parameters = $request->output_parameters();
    + $name = $parameters['0']['name'];
    + $size = $parameters['1']['size'];
    + $size = $parameters['1']['shape'];
    -

     

    XML-RPC Function Reference

    $this->xmlrpc->server()

    From 810d5015dd535098cef3f7c16d997374d0d431ac Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Jun 2008 17:23:48 +0000 Subject: [PATCH 1200/2544] userguide typo fix --- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d004da64..a75e71ca 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -103,7 +103,7 @@

    Bug fixes for 1.6.3

  • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
  • Removed some unused variables from the code (#4563).
  • Fixed a bug where having() was not adding an = into the statement (#4568).
  • -
  • Fixed assorted user guide typos or examples (#4574).
  • +
  • Fixed assorted user guide typos or examples (#4574, #4706).
  • Added quoted-printable headers to Email class when the multi-part override is used.
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 1a3c9b6e..aaee21e9 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -699,7 +699,7 @@

     Method Chaining

     Active Record Caching

    While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse later. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.

    -

    Cached calls are cumulative.  If you makes 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

    +

    Cached calls are cumulative.  If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

    $this->db->start_cache()

    This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.

    $this->db->stop_cache()

    From 9736d3fb84260c24faa6c1538c99859441c0e2f8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 16 Jun 2008 21:36:01 +0000 Subject: [PATCH 1201/2544] correcting some docblock comments --- system/libraries/Email.php | 18 +++++++++--------- system/libraries/Loader.php | 4 ++-- system/libraries/Log.php | 3 --- system/libraries/Validation.php | 4 ++++ system/libraries/Zip.php | 1 - 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index e02c83d1..6ced2c5c 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -377,7 +377,7 @@ function attach($filename, $disposition = 'attachment') /** * Add a Header Item * - * @access public + * @access private * @param string * @param string * @return void @@ -392,7 +392,7 @@ function _set_header($header, $value) /** * Convert a String to an Array * - * @access public + * @access private * @param string * @return array */ @@ -646,7 +646,7 @@ function _get_content_type() /** * Set RFC 822 Date * - * @access public + * @access private * @return string */ function _set_date() @@ -902,7 +902,7 @@ function word_wrap($str, $charlim = '') /** * Build final headers * - * @access public + * @access private * @param string * @return string */ @@ -920,7 +920,7 @@ function _build_headers() /** * Write Headers as a string * - * @access public + * @access private * @return void */ function _write_headers() @@ -953,7 +953,7 @@ function _write_headers() /** * Build Final Body and attachments * - * @access public + * @access private * @return void */ function _build_message() @@ -1145,7 +1145,7 @@ function _build_message() * Prepares string for Quoted-Printable Content-Transfer-Encoding * Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt * - * @access public + * @access private * @param string * @param integer * @return string @@ -1525,7 +1525,7 @@ function _send_with_smtp() /** * SMTP Connect * - * @access public + * @access private * @param string * @return string */ @@ -1798,7 +1798,7 @@ function print_debugger() /** * Set Message * - * @access public + * @access private * @param string * @return string */ diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 3346f0a2..9b21bc31 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -100,9 +100,9 @@ function library($library = '', $params = NULL) * * This function lets users load and instantiate models. * - * @access public * @param string the name of the class - * @param mixed any initialization parameters + * @param string name for the model + * @param bool database connection * @return void */ function model($model, $name = '', $db_conn = FALSE) diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 4d64cd32..2ff2c2db 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -36,9 +36,6 @@ class CI_Log { * Constructor * * @access public - * @param string the log file path - * @param string the error threshold - * @param string the date formatting codes */ function CI_Log() { diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 9654b4f4..f5e4d222 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -402,6 +402,7 @@ function required($str) * * @access public * @param string + * @param field * @return bool */ function matches($str, $field) @@ -421,6 +422,7 @@ function matches($str, $field) * * @access public * @param string + * @param value * @return bool */ function min_length($str, $val) @@ -440,6 +442,7 @@ function min_length($str, $val) * * @access public * @param string + * @param value * @return bool */ function max_length($str, $val) @@ -459,6 +462,7 @@ function max_length($str, $val) * * @access public * @param string + * @param value * @return bool */ function exact_length($str, $val) diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index ed476ab4..8958b572 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -291,7 +291,6 @@ function get_zip() * * @access public * @param string the file name - * @param string the data to be encoded * @return bool */ function archive($filepath) From 3640a0b83b610c3e497efa5f739787e225e9b2ad Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 19 Jun 2008 07:46:22 +0000 Subject: [PATCH 1202/2544] removed maxlength and size as automatically added attributes in form helper --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index d250d76e..5b28d3de 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -135,7 +135,7 @@ function form_hidden($name, $value = '') { function form_input($data = '', $value = '', $extra = '') { - $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50'); + $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); return "\n"; } From fa47bc982d4f81d2bda0470fa3237c37f605c72a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 19 Jun 2008 07:52:37 +0000 Subject: [PATCH 1203/2544] changelog note that I removed maxlength and size as automatically added attributes in form helper --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a75e71ca..ab006e78 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -87,6 +87,7 @@

    Version 1.6.3

  • Considerably expanded list of mobile user-agents in config/user_agents.php.
  • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
  • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
  • +
  • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
  • From a935c3f0b0c733641c0b3b6cc8c2f4b2e3df71f2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 19 Jun 2008 17:42:55 +0000 Subject: [PATCH 1204/2544] added a Number helper --- system/helpers/number_helper.php | 68 ++++++++++++++++++++++++++++++++ user_guide/changelog.html | 1 + 2 files changed, 69 insertions(+) create mode 100644 system/helpers/number_helper.php diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php new file mode 100644 index 00000000..f158b1cd --- /dev/null +++ b/system/helpers/number_helper.php @@ -0,0 +1,68 @@ += 1000000000) + { + $num = round($num/107374182)/10; + $unit = 'GB'; + } + elseif ($num >= 1000000) + { + $num = round($num/104857)/10; + $unit = 'MB'; + } + elseif ($num >= 1000) + { + $num = round($num/102)/10; + $unit = 'KB'; + } + else + { + $unit = 'Bytes'; + } + + return number_format($num, 1).' '.$unit; + } +} + +/* End of file number_helper.php */ +/* Location: ./system/helpers/number_helper.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ab006e78..bf26a67a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -76,6 +76,7 @@

    Version 1.6.3

  • Helpers
      +
    • Added a Number helper.
    • Form helper refactored to allow form_open() and form_fieldset() to accept arrays or strings as arguments.
  • From 33f6c68026a3a6f5d77f6062a3ec0c2d9c04683b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 19 Jun 2008 18:08:04 +0000 Subject: [PATCH 1205/2544] added terabytes to number helper added number helper guide pages, menus, toc, etc --- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/number_helper.html | 102 +++++++++++++++++++++++ user_guide/helpers/path_helper.html | 2 +- user_guide/nav/nav.js | 1 + user_guide/toc.html | 1 + 5 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 user_guide/helpers/number_helper.html diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 328b41d3..4d6196e3 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -142,7 +142,7 @@

    humanize()

       ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Security Helper +Next Topic:  Number Helper

    CodeIgniter  ·  Copyright © 2006-2008  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html new file mode 100644 index 00000000..e4dab849 --- /dev/null +++ b/user_guide/helpers/number_helper.html @@ -0,0 +1,102 @@ + + + + + +Number Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.6.2

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Number Helper

    + +

    The Number Helper file contains functions that help you work with numeric data.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('number'); + +

    The following functions are available:

    + + +

    byte_format()

    + +

    Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:

    + + +echo byte_format(456); // Returns 456.0 Bytes
    +echo byte_format(4567); // Returns 4.5 KB
    +echo byte_format(45678); // Returns 44.8 KB
    +echo byte_format(456789); // Returns 447.8 KB
    +echo byte_format(3456789); // Returns 3.3 MB
    +echo byte_format(12345678912345); // Returns 1.8 GB
    +echo byte_format(123456789123456789); // Returns 11,228.3 TB +
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index c2aa3479..19979593 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -89,7 +89,7 @@

     

    From 7aae905cdfcc2113b7855585441d640cf665581f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 25 Jun 2008 16:02:06 +0000 Subject: [PATCH 1211/2544] Further improvements to xss_clean() --- system/libraries/Input.php | 130 +++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 47 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 0b05c54d..783446ae 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -511,7 +511,7 @@ function filename_security($str) * @param string * @return string */ - function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') + function xss_clean($str, $is_image = FALSE) { /* * Is the string an array? @@ -528,22 +528,9 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') } /* - * Runaway loop prevention. If the text has had to be examined this many times - * I think it's safe to say that it is best to simply ignore it. + * Remove Invisible Characters */ - if ($loops > 9) - { - return ''; - } - - /* - * Remove Null Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - */ - $str = preg_replace(array('/\0+/', '/(\\\\0)+/'), '', $str); + $str = $this->_remove_invisible_characters($str); /* * Protect GET variables in URLs @@ -600,6 +587,11 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_html_entity_decode_callback'), $str); + /* + * Remove Invisible Characters Again! + */ + $str = $this->_remove_invisible_characters($str); + /* * Convert all tabs to spaces * @@ -613,22 +605,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') if (strpos($str, "\t") !== FALSE) { $str = str_replace("\t", ' ', $str); - } - - /* - * Check and set converted string - */ - if ($looped_convert != '' && $looped_convert == $str) - { - // if we are in a loop, and the converted string is the same as the last pass, - // then this is going to repeat until we hit the runaway loop prevention, - // so we might as well stop now. - return ''; } - else - { - $converted_string = $str; - } /* * Not Allowed Under Any Conditions @@ -677,7 +654,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') // That way valid stuff like "dealer to" does not become "dealerto" $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); } - + /* * Remove disallowed Javascript in links or img tags * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared @@ -689,17 +666,17 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') if (preg_match("/|<|$)#si", array($this, '_js_link_removal'), $str); + $str = preg_replace_callback("#]*?)(>|$)#si", array($this, '_js_link_removal'), $str); } if (preg_match("/|<|$)#si", array($this, '_js_img_removal'), $str); + $str = preg_replace_callback("#]*?)(>|$)#si", array($this, '_js_img_removal'), $str); } if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) { - $str = preg_replace("##si", "", $str); + $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); } } while($original != $str); @@ -726,6 +703,7 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') } $str = preg_replace("#<([^><]+)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); + /* * Sanitize naughty HTML elements * @@ -790,16 +768,6 @@ function xss_clean($str, $is_image = FALSE, $loops = 0, $looped_convert = '') return FALSE; } } - - /* - * If something changed after character conversion, we can be fairly confident that something - * malicious was removed, so let's take no chances that the attacker is counting on specific - * mutations taking place to allow a new attack to reveal itself. So say we all. - */ - if ($converted_string != $str) - { - $str = $this->xss_clean($str, $is_image, ++$loops, $converted_string); - } log_message('debug', "XSS Filtering completed"); return $str; @@ -830,6 +798,44 @@ function xss_hash() // -------------------------------------------------------------------- + /** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ + function _remove_invisible_characters($str) + { + static $non_displayables; + + if ( ! isset($non_displayables)) + { + // every control character except newline (10), carriage return (13), and horizontal tab (09), + // both as a URL encoded character (::shakes fist at IE and WebKit::), and the actual character + $non_displayables = array( + '/%0[0-8]/', '/[\x00-\x08]/', // 00-08 + '/%11/', '/\x0b/', '/%12/', '/\x0c/', // 11, 12 + '/%1[4-9]/', '/%2[0-9]/', '/%3[0-1]/', // url encoded 14-31 + '/[\x0e-\x1f]/'); // 14-31 + + } + + do + { + $cleaned = $str; + $str = preg_replace($non_displayables, '', $str); + } + while ($cleaned != $str); + + return $str; + } + + // -------------------------------------------------------------------- + /** * Compact Exploded Words * @@ -883,7 +889,8 @@ function _sanitize_naughty_html($matches) */ function _js_link_removal($match) { - return preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie| Date: Wed, 25 Jun 2008 16:12:35 +0000 Subject: [PATCH 1212/2544] added a bit of leeway for images to avoid the more common false-positives that using xss_clean() on image files might trigger --- system/libraries/Input.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 783446ae..04b373e4 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -631,8 +631,17 @@ function xss_clean($str, $is_image = FALSE) * But it doesn't seem to pose a problem. * */ - $str = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); - + if ($is_image === TRUE) + { + // Images have a tendency to have the PHP short opening and closing tags every so often + // so we skip those and only do the long opening tags. + $str = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + } + /* * Compact any exploded words * From d6c69981ba89e52bec1240307b419806503e1283 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 25 Jun 2008 17:29:23 +0000 Subject: [PATCH 1213/2544] fixed accidental removal of $converted_string in xss_clean() for image comparison --- system/libraries/Input.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 04b373e4..5f47909a 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -607,6 +607,11 @@ function xss_clean($str, $is_image = FALSE) $str = str_replace("\t", ' ', $str); } + /* + * Capture converted string for later comparison + */ + $converted_string = $str; + /* * Not Allowed Under Any Conditions */ From 49ccc2327086fbb7d9736d98eabc1f6d1d853547 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 25 Jun 2008 19:01:12 +0000 Subject: [PATCH 1214/2544] guide linking to wrong pages fix --- user_guide/installation/troubleshooting.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index fc267c30..4061f5ed 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -42,7 +42,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Installation Instructions +Trouble Shooting
    Search User Guide   
    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index a4d0f360..6dc9287b 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -159,7 +159,7 @@

    CodeIgniter has a Friendly Community of Users

    diff --git a/user_guide/database/index.html b/user_guide/database/index.html index a6854b5b..5dcea988 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -76,7 +76,7 @@

    The Database Class

  • Custom Function Calls
  • Query Caching
  • Database manipulation with Database Forge
  • -
  • Database Utilities Class
  • +
  • Database Utilities Class
  • diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 3c9f1195..ea794f08 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -69,7 +69,7 @@

    Helper Functions

    CodeIgniter does not load Helper Files by default, so the first step in using a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

    -

    Helpers are typically stored in your system/helpers, or system/application/helpers directory. CodeIgniter will look first in your system/application/helpers +

    Helpers are typically stored in your system/helpers, or system/application/helpers directory. CodeIgniter will look first in your system/application/helpers directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global system/helpers folder.

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index a161fa01..bc086150 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -129,7 +129,7 @@

    Loading multiple views

       }

    }
    - ?>

    + ?>

    In the example above, we are using "dynamically added data", which you will see below.

    Storing Views within Sub-folders

    Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 83b97ab1..839f7251 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -258,7 +258,7 @@

    form_fieldset()

    </fieldset>

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    - echo form_fieldset('Address Information', $attributes);
    + echo form_fieldset('Address Information', $attributes);
    echo "<p>fieldset content here</p>\n";
    echo form_fieldset_close();

    @@ -269,7 +269,7 @@

    form_fieldset()

    </fieldset>

    form_fieldset_close()

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

    + which will be added below the tag. For example:

    $string = "</div></div>";

    echo fieldset_close($string);
    @@ -321,7 +321,7 @@

    form_submit()


    <input type="submit" name="mysubmit" value="Submit Post!" />

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

    + The third parameter lets you add extra data to your form, like JavaScript.

    form_label()

    Lets you generate a <label>. Simple example:

    echo form_label('What is your Name', 'username');
    @@ -329,13 +329,13 @@

    form_label()

    // Would produce:
    <label for="username">What is your Name</label>
    -

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    $attributes = array(
        'class' => 'mycustomclass',
        'style' => 'color: #000;',
    );
    - echo form_label('What is your Name', 'username', $attributes);
    -
    + echo form_label('What is your Name', 'username', $attributes);
    +
    // Would produce:
    <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    form_reset()

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index fcbcccdf..62898403 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -80,7 +80,7 @@

    heading()

    The above would produce: <h3>Welcome!</h3>

    img()

    Lets you create HTML <img /> tags. The first parameter contains the image source. There is data, the - second the size of the heading. Example:

    + second the size of the heading. Example:

    echo img('images/picture.jpg');
    // gives <img src="http://site.com/images/picture.jpg" />

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    @@ -88,17 +88,17 @@

    img()

    // gives <img src="http://site.com/index.php/images/picture.jpg" />

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    $image_properties = array(
    -           'src' => 'images/picture.jpg',
    -           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    -           'class' => 'post_images',
    -           'width' => '200',
    -           'height' => '200',
    -           'title' => 'That was quite a night',
    -           'rel' => 'lightbox',
    - );
    -
    - img($image_properties);
    - // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    +           'src' => 'images/picture.jpg',
    +           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    +           'class' => 'post_images',
    +           'width' => '200',
    +           'height' => '200',
    +           'title' => 'That was quite a night',
    +           'rel' => 'lightbox',
    + );
    +
    + img($image_properties);
    + // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    link_tag()

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. echo link_tag('css/mystyles.css');
    @@ -106,24 +106,24 @@

    link_tag()

    Further examples:

    - echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    - // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> -
    -
    - echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    - // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    + echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    + // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> +
    +
    + echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    + // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    - $link = array(
    -           'href' => 'css/printer.css',
    -           'rel' => 'stylesheet',
    -           'type' => 'text/css',
    -           'media' => 'print'
    - );
    -
    - echo link_tag($link);
    - // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    - + $link = array(
    +           'href' => 'css/printer.css',
    +           'rel' => 'stylesheet',
    +           'type' => 'text/css',
    +           'media' => 'print'
    + );
    +
    + echo link_tag($link);
    + // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    +

    nbs()

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    echo nbs(3); diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 025a4329..24a0a661 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -122,8 +122,8 @@

    reduce_double_slashes()

    echo reduce_double_slashes($string); // results in "http://example.com/index.php"

    trim_slashes()

    Removes any leading/trailing slashes from a string. Example:
    -
    - $string = "/this/that/theother/";
    +
    + $string = "/this/that/theother/";
    echo trim_slashes($string); // results in this/that/theother

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 90bc7d3c..01389f33 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -80,15 +80,15 @@

    Step 1: Update your CodeIgniter files

    Step 2: Add charset to your config.php

    Add the following to system/application/config/config.php

    /*
    - |--------------------------------------------------------------------------
    - | Default Character Set
    - |--------------------------------------------------------------------------
    - |
    - | This determines which character set is used by default in various methods
    - | that require a character set to be provided.
    - |
    - */
    - $config['charset'] = "UTF-8";
    + |--------------------------------------------------------------------------
    + | Default Character Set
    + |--------------------------------------------------------------------------
    + |
    + | This determines which character set is used by default in various methods
    + | that require a character set to be provided.
    + |
    + */
    + $config['charset'] = "UTF-8";

    Step 3: Autoloading language files

    If you want to autoload any language files, add this line to system/application/config/autoload.php

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index f4e703ee..b80a6881 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -83,16 +83,16 @@

    Step 2: Add time_to_update to your config.php

    Step 3: Add $autoload['model']

    Add the following to system/application/autoload.php

    /*
    - | -------------------------------------------------------------------
    - |  Auto-load Model files
    - | -------------------------------------------------------------------
    - | Prototype:
    - |
    - |    $autoload['model'] = array('my_model');
    - |
    - */
    -
    - $autoload['model'] = array();

    + | -------------------------------------------------------------------
    + |  Auto-load Model files
    + | -------------------------------------------------------------------
    + | Prototype:
    + |
    + |    $autoload['model'] = array('my_model');
    + |
    + */
    +
    + $autoload['model'] = array();

    Step 4: Add to your database.php

    Make the following changes to your system/application/config/database.php file:

    Add the following variable above the database configuration options, with $active_group

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index c8e64f82..7158ca76 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -60,35 +60,35 @@

    Session Class

    The Session class permits you maintain a user's "state" and track their activity while they browse your site. The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. -It can additionally store the session data in a database table for added security, as this permits the session ID in the +It can also store the session data in a database table for added security, as this permits the session ID in the user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to -use the database option you'll need to create the session table as indicated below. +use the database option you'll need to create the session table as indicated below.

    Note: The Session class does not utilize native PHP sessions. It -generates its own session data so you are not dependent on how a particular hosting environment is set up.

    +generates its own session data, offering more flexibility for developers.

    Initializing a Session

    -

    The Session routines must happen with each page load (and before anything is outputted to the browser), so the session class must either be +

    Sessions will typically run globally with each page load, so the session class must either be initialized in your controller constructors, or it can be auto-loaded by the system. -Once initialized, the Session class will run unattended in the background, reading, writing, and updating the session as needed.

    +For the most part the session class will run unattended in the background, so simply initializing the class +will cause it to read, create, and update sessions.

    To initialize the Session class manually in your controller constructor, use the $this->load->library function:

    $this->load->library('session'); - -

    You can access the Session library object using: $this->session

    +

    Once loaded, the Sessions library object will be available using: $this->session

    How do Sessions work?

    -

    When a page is loaded, the Session class will check to see if valid session data exists in the user's session cookie. +

    When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. -If a session does exist, its information and cookie will be updated automatically. With each update, the session_id will be regenerated for security.

    +If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

    It's important for you to understand that once initialized, the Session class runs automatically. There is nothing you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or @@ -141,7 +141,7 @@

    Retrieving Session Data

    Adding Custom Session Data

    -

    A useful aspect of the session array is that you can add your own data to it and it will be stored in the session array. +

    A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. Why would you want to do this? Here's one example:

    Let's say a particular user logs into your site. Once authenticated, @@ -156,20 +156,16 @@

    Adding Custom Session Data

    $newdata = array(
    -                    'username'  => 'johndoe',
    -                    'email'     => 'johndoe@some-site.com',
    -                    'logged_in' => TRUE
    -                );
    -
    - $this->session->set_userdata($newdata);

    - +                    'username'  => 'johndoe',
    +                    'email'     => 'johndoe@some-site.com',
    +                    'logged_in' => TRUE
    +                );
    +
    + $this->session->set_userdata($newdata);

    If you want to add userdata one value at a time, set_userdata() also supports this syntax.

    $this->session->set_userdata('some_name', 'some_value');

    - - -

    Note: By default, the session class stores your custom data in the session cookie. Cookies, however, can only hold -4KB of data, so it is easily possible to exceed the capacity, particularly if you use encryption, since it produces a longer data string than the original. -If you need to store a larger amount of data it is recommended that you store your session data in a database table. You'll find instructions for this below.

    +

    Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

    Removing Session Data

    Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

    @@ -194,12 +190,8 @@

    Saving Session Data to a Database

    security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

    When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed.

    - -

    An additional benefit of using a database is that it permits you to store custom data along with the session. Earlier in this page we described how to add -custom data to your session. When you use the database feature, your custom data will be stored automatically in the database instead of in -the user's cookie.

    - +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +be updated, they can only be generated when a new session is created.

    In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

    @@ -210,15 +202,12 @@

    Saving Session Data to a Database

    ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(50) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, -user_data text NOT NULL, PRIMARY KEY (session_id) ); -

    Note: By default the table is named ci_sessions, but you can name it anything you want -as long as you update the application/config/config.php file so that it contains the name you have chosen. The Session class, however, -expects the column names to be identical to the ones indicated above.

    - -

    Once you have created your database table you can enable the database option in your config.php file as follows:

    +

    Note: By default the table is called ci_sessions, but you can name it anything you want +as long as you update the application/config/config.php file so that it contains the name you have chosen. +Once you have created your database table you can enable the database option in your config.php file as follows:

    $config['sess_use_database'] = TRUE; @@ -228,7 +217,7 @@

    Saving Session Data to a Database

    $config['sess_table_name'] = 'ci_sessions"; -

    Note: The Session class has a built-in garbage collection routine which clears out expired sessions periodically so you +

    Note: The Session class has built-in garbage collection which clears out expired sessions so you do not need to write your own routine to do it.

    @@ -240,84 +229,64 @@

    Destroying a Session

    Session Preferences

    -

    Normally you will set the Session preferences in your application/config/config.php file.

    - -

    If you prefer to set any of the preferences manually you can do so when you load the session class, by passing an array of values you -wish to set in the second parameter as follows:

    - - -$session_vals = array(
    -                       'sess_expiration' = 10800,
    -                       'sess_match_ip'   = TRUE
    -                     );
    -
    -$this->load->library('session', $session_vals); -
    - -

    The following table lists the available preferences:

    +

    You'll find the following Session related preferences in your application/config/config.php file:

    - - - - - - - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
    PreferenceDefaultOptionsDescription
    sess_cookie_nameci_sessionNoneThe name you want the session cookie saved as.PreferenceDefaultOptionsDescription
    sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0sess_cookie_nameci_sessionNoneThe name you want the session cookie saved as.
    sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0
    sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
    sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
    sess_time_to_update300Time in secondsThis options controls how often the session class will regenerate itself and create a new session id.sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
    sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically - changes the IP, so if you want a non-expiring session you will likely set this to FALSE.sess_time_to_update300Time in secondsThis options controls how often the session class will regenerate itself and create a new session id.
    sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically + changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
    sess_cookie_nameci_sessionNoneThe name of the session cookiesess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
    diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 8b36e09b..55443060 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -576,64 +576,43 @@

    Rule Reference

    Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.   - -numeric -No -Returns FALSE if the form element contains anything other than numeric characters. -  + numeric + No + Returns FALSE if the form element contains anything other than numeric characters. +   - + integer No Returns FALSE if the form element contains anything other than an integer.   - - - -is_natural -No -Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. -  - - - -is_natural_no_zero -No -Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. -  - + - valid_email No Returns FALSE if the form element does not contain a valid email address.   - -valid_emails -No -Returns FALSE if any value provided in a comma separated list is not a valid email. -  + valid_emails + No + Returns FALSE if any value provided in a comma separated list is not a valid email. +   - valid_ip No Returns FALSE if the supplied IP is not valid.   - -valid_base64 -No -Returns FALSE if the supplied string contains anything other than valid Base64 characters. -  + valid_base64 + No + Returns FALSE if the supplied string contains anything other than valid Base64 characters. +   - -

    Note: These rules can also be called as discrete functions. For example:

    From 782f88be95bdb55238df071ee5ad2d8788c4b1f6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 21 Aug 2008 13:04:05 +0000 Subject: [PATCH 1282/2544] added user_data field to sessions userguide page --- user_guide/libraries/sessions.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 7158ca76..d4466b73 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -202,6 +202,7 @@

    Saving Session Data to a Database

    ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(50) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, +user_data text NOT NULL PRIMARY KEY (session_id) ); From 753ff321c6ae0b46a555337e651abe0241f82d6e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 21 Aug 2008 18:21:35 +0000 Subject: [PATCH 1283/2544] typo in xmlrpc --- user_guide/changelog.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ed10c475..2ff2b8c9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,7 +91,7 @@

    Version 1.6.4

    Bug fixes for 1.6.4

    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4840, #4862, #4864, #4899, #4930, #5006).
    • +
    • Fixed assorted user guide typos or examples (#4840, #4862, #4864, #4899, #4930, #5006, #5071).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 60609067..cec83d50 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -180,7 +180,7 @@

      Creating an XML-RPC Server

      $this->load->library('xmlrpc');
      $this->load->library('xmlrpcs');

      -$config['functions']['new_post'] = array('function' => 'My_blog.new_entry'),
      +$config['functions']['new_post'] = array('function' => 'My_blog.new_entry');
      $config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
      $config['object'] = $this;

      From 6ad532917aa69d86db70f0da4a3b196003926fe9 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 21 Aug 2008 18:31:28 +0000 Subject: [PATCH 1284/2544] Added the ability to assign a custom object name when loading a library. Added some code that looks to see if a library is in a subdirectory if the class is not found, and if the path was not specified --- system/libraries/Loader.php | 65 ++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index e5640b07..e090cc09 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -69,9 +69,10 @@ function CI_Loader() * @access public * @param string the name of the class * @param mixed the optional parameters + * @param string an optional object name * @return void */ - function library($library = '', $params = NULL) + function library($library = '', $params = NULL, $object_name = NULL) { if ($library == '') { @@ -87,7 +88,7 @@ function library($library = '', $params = NULL) } else { - $this->_ci_load_class($library, $params); + $this->_ci_load_class($library, $params, $object_name); } $this->_ci_assign_to_models(); @@ -329,8 +330,13 @@ function file($path, $return = FALSE) * @param array * @return void */ - function vars($vars = array()) + function vars($vars = array(), $val = '') { + if ($val != '' AND is_string($vars)) + { + $vars = array($vars => $val); + } + $vars = $this->_ci_object_to_array($vars); if (is_array($vars) AND count($vars) > 0) @@ -753,9 +759,10 @@ function _ci_load($_ci_data) * @access private * @param string the item that is being loaded * @param mixed any additional parameters + * @param string an optional object name * @return void */ - function _ci_load_class($class, $params = NULL) + function _ci_load_class($class, $params = NULL, $object_name = NULL) { // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, @@ -799,6 +806,18 @@ function _ci_load_class($class, $params = NULL) // Safety: Was the class already loaded by a previous call? if (in_array($subclass, $this->_ci_classes)) { + // Before we deem this to be a duplicate request, let's see + // if a custom object name is being supplied. If so, we'll + // return a new instance of the object + if ( ! is_null($object_name)) + { + $CI =& get_instance(); + if ( ! isset($CI->$object_name)) + { + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); + } + } + $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; @@ -808,7 +827,7 @@ function _ci_load_class($class, $params = NULL) include_once($subclass); $this->_ci_classes[] = $subclass; - return $this->_ci_init_class($class, config_item('subclass_prefix'), $params); + return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); } // Lets search for the requested library file and load it. @@ -827,6 +846,18 @@ function _ci_load_class($class, $params = NULL) // Safety: Was the class already loaded by a previous call? if (in_array($filepath, $this->_ci_classes)) { + // Before we deem this to be a duplicate request, let's see + // if a custom object name is being supplied. If so, we'll + // return a new instance of the object + if ( ! is_null($object_name)) + { + $CI =& get_instance(); + if ( ! isset($CI->$object_name)) + { + return $this->_ci_init_class($class, '', $params, $object_name); + } + } + $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; @@ -834,9 +865,16 @@ function _ci_load_class($class, $params = NULL) include_once($filepath); $this->_ci_classes[] = $filepath; - return $this->_ci_init_class($class, '', $params); + return $this->_ci_init_class($class, '', $params, $object_name); } } // END FOREACH + + // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? + if ($subdir == '') + { + $path = strtolower($class).'/'.$class; + return $this->_ci_load_class($path, $params); + } // If we got this far we were unable to find the requested class. // We do not issue errors if the load call failed due to a duplicate request @@ -855,9 +893,10 @@ function _ci_load_class($class, $params = NULL) * @access private * @param string * @param string + * @param string an optional object name * @return null */ - function _ci_init_class($class, $prefix = '', $config = FALSE) + function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { $class = strtolower($class); @@ -879,8 +918,16 @@ function _ci_init_class($class, $prefix = '', $config = FALSE) $name = $prefix.$class; } - // Set the variable name we will assign the class to - $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + // Set the variable name we will assign the class to + // Was a custom class name supplied? If so we'll use it + if (is_null($object_name)) + { + $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; + } + else + { + $classvar = $object_name; + } // Instantiate the class $CI =& get_instance(); From 65f46063afcebbe92a8ad67d9092bb073f79b8ce Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 21 Aug 2008 18:55:09 +0000 Subject: [PATCH 1285/2544] Added a bit more error trapping in the load() function --- system/libraries/Loader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index e090cc09..1d88841d 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -79,6 +79,11 @@ function library($library = '', $params = NULL, $object_name = NULL) return FALSE; } + if ( ! is_null($params) AND ! is_array($params)) + { + $params = NULL; + } + if (is_array($library)) { foreach ($library as $class) From a6543fa8f14ed8041b794f8df3934a007fdf075a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 21 Aug 2008 18:58:41 +0000 Subject: [PATCH 1286/2544] --- user_guide/libraries/loader.html | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 71f77650..05b7024d 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -90,7 +90,35 @@

      $this->load->library('class_name')

      You may nest the file in as many subdirectories as you want.

      -

      Each library is described in detail in its own page, so please read the information regarding each one you would like to use.

      +

      Setting options

      + +

      The second parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

      + + +$config = array (
      +                  'mailtype' => 'html',
      +                  'charset'  => 'utf-8,
      +                  'priority' => '1'
      +               );
      +
      +$this->load->library('email', $config);
      + +

      Config options can usually also be set via a config file. Each library is explained in detail in its own page, so please read the information regarding each one you would like to use.

      + +

      Assigning a Library to a different object name

      + +

      If the third parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it +will be assigned to a variable named $this->session.

      + +

      If you prefer to set your own class names you can pass its value to the third parameter:

      + +$this->load->library('session', '', 'my_session');

      + +// Session class is now accessed using:

      + +$this->my_session + +
      From 29efd1577cce0b44423e4606f5a17f23619c7151 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 21 Aug 2008 19:03:17 +0000 Subject: [PATCH 1287/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2ff2b8c9..4f9eab8d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

      Version 1.6.4

      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • +
      • Added the ability to assign library objects to your own variable names when you use this->load->library(). Please see the Loader class for more info.
      • Changed the output of the profiler to use style attribute rather then clear, and added the id "codeigniter_profiler" to the container div
      • Added is_natural() and is_natural_no_zero() to the Validation class.
      From f65308f36173d7924f1460e0383e5a6c46e626b5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 21 Aug 2008 23:11:23 +0000 Subject: [PATCH 1288/2544] fixed a missing semi colon --- system/database/DB.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database/DB.php b/system/database/DB.php index ef67c80c..2dd86e14 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -44,7 +44,8 @@ function &DB($params = '', $active_record_override = FALSE) show_error('You have specified an invalid database connection group.'); } - $params = $db[$active_group] } + $params = $db[$active_group]; + } elseif (is_string($params)) { From edc41b55c343af2f03fb6fce6fd707c8b1b986fc Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 22 Aug 2008 07:16:47 +0000 Subject: [PATCH 1289/2544] Fixed a comment typo --- system/libraries/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 9fad08cf..ab14bfe1 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -160,7 +160,7 @@ function sess_read() // Unserialize the session array $session = @unserialize(strip_slashes($session)); - // Is the session data we unserialized and array with the correct format? + // Is the session data we unserialized an array with the correct format? if ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity'])) { $this->sess_destroy(); From 5bcb838cff97500780d773c690870504727eda58 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 17:46:54 +0000 Subject: [PATCH 1290/2544] Fixed a typo --- user_guide/libraries/sessions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index d4466b73..f721e2b6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -202,7 +202,7 @@

      Saving Session Data to a Database

      ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(50) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, -user_data text NOT NULL +user_data text NOT NULL, PRIMARY KEY (session_id) ); From 9e3a73b3ac081756a29c55633471acb29c0a76f1 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 18:23:36 +0000 Subject: [PATCH 1291/2544] Adding images folder --- user_guide/images/nav_bg_darker.jpg | Bin 0 -> 445 bytes user_guide/images/nav_separator_darker.jpg | Bin 0 -> 304 bytes user_guide/images/nav_toggle_darker.jpg | Bin 0 -> 1917 bytes user_guide/images/smile.gif | Bin 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 user_guide/images/nav_bg_darker.jpg create mode 100644 user_guide/images/nav_separator_darker.jpg create mode 100644 user_guide/images/nav_toggle_darker.jpg mode change 100755 => 100644 user_guide/images/smile.gif diff --git a/user_guide/images/nav_bg_darker.jpg b/user_guide/images/nav_bg_darker.jpg new file mode 100644 index 0000000000000000000000000000000000000000..816efad6a19fb8b5ec891d50a30bf4436b5bdbc2 GIT binary patch literal 445 zcmex=T;Nd3XdtKm-mL zSy)*)*g5#QxcEi*`1s)BL^J*$U=ZYBFk&!fW)x@ci+Wc+`GArk0pW=5bZ5r7fs zE=E)#prioM%WTXDRX~3Q3Nl@05t$OoE+L4a{QoTm9-z5Qg3N*p_6$cHz#6Ty&)rQu zu_dlp4NC+A5a7wVT^e{8IF*YhQ9GKX!smXvtnE{y)LUtvDUH|_k03bzC A-v9sr literal 0 HcmV?d00001 diff --git a/user_guide/images/nav_separator_darker.jpg b/user_guide/images/nav_separator_darker.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a09bd5a6aa160ee93c46df805c479d4eb2343593 GIT binary patch literal 304 zcma)$I|{-;5QhKBK3z7OETr}-B1k~Jg~rOl%EI0gd4d#PLGaOd0PzazqzPymzhQoc zk71Z}O;41IdR~Jvpy5J#AGlCYt0Ig5 literal 0 HcmV?d00001 diff --git a/user_guide/images/nav_toggle_darker.jpg b/user_guide/images/nav_toggle_darker.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eff33de4fa4238b691742759098cfc1827c27f39 GIT binary patch literal 1917 zcma)$2T;>#8pi+W6+#L{rJR8X0s&M+qzs87L$LsYfQ%qZP&xyNOB3BdXhA_R;KG9b zrLCbVhK^EP6a;oDia>&>6h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CR_~QhI0?JowHf9);=8_I z;O2BLHCN9~o5Y}xl6)X@Ga0{G+`N4`w=AqAFneepRhwg8Tr8GK4)Eq0$i!ya``s7C zy_UMWo7nd$WARQ}-u#4n*Q_#4F{8Um#TV!jvg4JIc<4axRO|6ZpI{%A;CgO$y(7|G zgLE3B3jqGNX5TTQBRm$~#!n=6=14qyFSk80d(jp&`}<e_HKu)jHdfL_}qZIa|!1a6=9E@p3#RC>Ila3|{|4pjc$j*}JQjZo|--f2`2f+5Pi5Q{kH41gesG(2n=&g1+)$(!6%4f71_+g>KHh#F${;Fofvw zNNl-5M9q`$rEPS$wJ!TqyWeK4j|z9evf$h%LHvAGL~xLdtc+cG?U4+|ot(RK<;l9d z6*e4gy1A~^nEN(R^Ja6|)cx(YS{!4oXuxPYb!j%{EUI)lD0vsJhmF?WbD{}+&GN(7y+%Etc*U-&D6 literal 0 HcmV?d00001 diff --git a/user_guide/images/smile.gif b/user_guide/images/smile.gif old mode 100755 new mode 100644 From 4a5676004df37524ce1db8333ce54b50e5438ed0 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 18:25:04 +0000 Subject: [PATCH 1292/2544] --- user_guide/userguide.css | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/user_guide/userguide.css b/user_guide/userguide.css index a53aa012..45663882 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -3,18 +3,18 @@ body { padding: 0; font-family: Lucida Grande, Verdana, Geneva, Sans-serif; font-size: 14px; - color: #4F5155; + color: #333; background-color: #fff; } a { - color: #003399; + color: #0134c5; background-color: transparent; text-decoration: none; font-weight: normal; } a:visited { - color: #003399; + color: #0134c5; background-color: transparent; text-decoration: none; } @@ -42,13 +42,13 @@ a:hover { color: #666; } #nav { - background-color: #5d5d5d; + background-color: #494949; margin: 0; padding: 0; } #nav2 { - background: #fff url(images/nav_bg.jpg) repeat-x left top; - padding: 0 240px 0 0; + background: #fff url(images/nav_bg_darker.jpg) repeat-x left top; + padding: 0 310px 0 0; margin: 0; text-align: right; } @@ -68,7 +68,7 @@ a:hover { } #nav_inner .td_sep { - background: transparent url(images/nav_separator.jpg) repeat-y left top; + background: transparent url(images/nav_separator_darker.jpg) repeat-y left top; width: 25%; padding: 0 0 0 20px; } @@ -118,7 +118,7 @@ a:hover { #masthead h1 { background-color: transparent; -color: #003399; +color: #e13300; font-size: 18px; font-weight: normal; margin: 0; @@ -146,34 +146,35 @@ padding: 0 0 6px 0; } #content p { - margin: 10px 20px 12px 0; + margin: 12px 20px 12px 0; } #content h1 { -color: #333; -background-color: #efefef; +color: #e13300; +border-bottom: 1px solid #666; +background-color: transparent; font-weight: normal; -font-size: 22px; -margin: 0 0 15px 0; -padding: 3px 2px 3px 10px; +font-size: 24px; +margin: 0 0 20px 0; +padding: 3px 0 7px 3px; } #content h2 { background-color: transparent; - border-bottom: 1px solid #D0D0D0; - color: #444; - font-size: 16px; + border-bottom: 1px solid #999; + color: #000; + font-size: 18px; font-weight: bold; - margin: 24px 0 2px 0; + margin: 28px 0 16px 0; padding: 5px 0 6px 0; } #content h3 { background-color: transparent; color: #333; - font-size: 14px; + font-size: 16px; font-weight: bold; - margin: 22px 0 12px 0; + margin: 16px 0 15px 0; padding: 0 0 0 0; } @@ -249,13 +250,11 @@ padding: 3px 2px 3px 10px; #content ul { list-style-image: url(images/arrow.gif); - padding: 0 0 0 18px; - margin: 8px 0 12px 0; + margin: 10px 0 12px 0; } #content li { - padding: 0; - margin: 0 0 6px 0; + margin-bottom: 9px; } #content li p { @@ -377,7 +376,7 @@ form { background-color: #f9f9f9; border: 1px solid #B3B4BD; width: 100%; - padding: 0; + padding: 6px; margin: 0; } From 7cdef03633cf8cc40678fc837ccec2d2164caade Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 18:44:54 +0000 Subject: [PATCH 1293/2544] Made a Loader changes so that the new validation class will work. Made some doc style changes --- system/libraries/Loader.php | 14 +++++++++----- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/index.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/compatibility_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_164.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 118 files changed, 126 insertions(+), 122 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 1d88841d..b870ffba 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -35,6 +35,7 @@ class CI_Loader { var $_ci_is_instance = FALSE; // Whether we should use $this or $CI =& get_instance() var $_ci_cached_vars = array(); var $_ci_classes = array(); + var $_ci_loaded_files = array(); var $_ci_models = array(); var $_ci_helpers = array(); var $_ci_plugins = array(); @@ -809,7 +810,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) } // Safety: Was the class already loaded by a previous call? - if (in_array($subclass, $this->_ci_classes)) + if (in_array($subclass, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see // if a custom object name is being supplied. If so, we'll @@ -830,7 +831,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) include_once($baseclass); include_once($subclass); - $this->_ci_classes[] = $subclass; + $this->_ci_loaded_files[] = $subclass; return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); } @@ -849,7 +850,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) } // Safety: Was the class already loaded by a previous call? - if (in_array($filepath, $this->_ci_classes)) + if (in_array($filepath, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see // if a custom object name is being supplied. If so, we'll @@ -869,7 +870,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) } include_once($filepath); - $this->_ci_classes[] = $filepath; + $this->_ci_loaded_files[] = $filepath; return $this->_ci_init_class($class, '', $params, $object_name); } } // END FOREACH @@ -933,7 +934,10 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU { $classvar = $object_name; } - + + // Save the class name and object name + $this->_ci_classes[$class] = $object_name; + // Instantiate the class $CI =& get_instance(); if ($config !== NULL) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4f9eab8d..9c4a1840 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index f3bde15e..3b3dbf46 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 75adfc59..1034ee94 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index d60302a0..1fa6d182 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 6b8c6b53..4ae8f704 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 42678999..b59034fa 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 55da574e..966700c5 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 4137eb94..bc5bf49b 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index bc67436b..097d396b 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 5e06da20..e1dbef40 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 5dcea988..36e6ffd0 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index c6306cc3..bad2df86 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 2361e878..782cecc3 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 4bb000be..4e6c97b9 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 40630b9d..96570d34 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 02cd6301..4d04a1ca 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 3854efb0..3e44f304 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index ee6dedc0..02774016 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 2ad7e78c..3014d3ff 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index c1c29da2..0f8a2d46 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 9cc4ba53..4913ceab 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index b82b9a23..9261600e 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index c49ca113..31ad8662 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 6b3a6da4..e748eb00 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 540f1717..0f759d7e 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index ae6e1425..482fb71c 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index d801e650..8f4c09c0 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index ea794f08..e91d5a88 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 49131236..6af6ee99 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/index.html b/user_guide/general/index.html index e1459230..d94ec60b 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index a0f79e29..0d0c628e 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index bb13ea41..f3d69628 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 2411e279..3c490874 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 65c8d420..f0a769d1 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index ce1f9dee..804c9e0b 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 89106eaf..86aa568f 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 8818a7ae..ef238405 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 732b130a..58b0de2d 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 10bcb038..78da9c10 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index cedeb862..c17118f4 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/security.html b/user_guide/general/security.html index f647f1bf..b24edb9d 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 82617c97..7883528c 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index bc086150..7f987a5b 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index e67a9f2b..ffe796c7 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index 7b9d2964..d98332ae 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 85d4cd04..456a95ea 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index b6264586..0e174ccc 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index b89e8c81..97444291 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 11eb4516..42e8aba1 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 74f6a3a2..d8e522a4 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index b16cde50..05700ae8 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 839f7251..76ded1ee 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 62898403..aff896aa 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 4b061401..4a78287e 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 53a61148..7bf10688 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 929c9688..8d20cca3 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 6de4a467..ceb509c4 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index d56f7db4..627d9f98 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index fa7bc24b..fd337c5d 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 24a0a661..2a754a97 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index be189efe..fb58b837 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 38656103..3116c36a 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index c26bbcbf..95599a5d 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 376dc24d..2d3cd446 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/index.html b/user_guide/index.html index 2fb0681e..2d08fcc0 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 470377ef..f1ac5730 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 25953d98..a4a39f5c 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 62c75481..c6d77585 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 7671701e..0ed75c7e 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index fa78012e..db830e23 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index fc71b57a..2232e2fd 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 907d3e13..f5259efc 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index a37a2dfa..f2bc4b89 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index daff5cd7..c8c01418 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 3ce45201..65b9c42d 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 578241f2..7bdcff0a 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 09196f48..725e7a18 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 2ce0e9b8..26241ec4 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 01389f33..e10511aa 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index b80a6881..d5f1cc99 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 632d8c7d..14d51229 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 6c03574f..fa50c621 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 0449d520..31b309d1 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_164.html b/user_guide/installation/upgrade_164.html index a953e1cf..e71a0ad9 100644 --- a/user_guide/installation/upgrade_164.html +++ b/user_guide/installation/upgrade_164.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index b1ed6ba4..c81b6d48 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 9b745d17..82215f3a 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index c9f50b6b..c57df73a 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 22c55674..15737f1a 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index e0ce2025..59bc7d77 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index c9883b96..bd0fa569 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 407d82f1..372b1a34 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index e21a6779..24a7d394 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index d67df5f0..41397d39 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 2421c511..0c32710c 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 25749bb6..a0460228 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 4d93cf9d..3c376a40 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 05b7024d..f3ea64cb 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index a2a87d17..2a51f140 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 7ae396da..2dccd277 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index a8148778..fb29a8d9 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index f721e2b6..2de47d19 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 772e9582..4f4d6059 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index e8fcba74..5458065b 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 03adb587..7c3e7986 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 5543efa5..66919158 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index f5b0e998..d4a55040 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 55443060..3d01a3e2 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -23,7 +23,7 @@ - +
      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index cec83d50..7ecbe01a 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 07dd98d4..984c4d9c 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/license.html b/user_guide/license.html index 2cb636ed..66a0912f 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 250d11f6..5101f18a 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 113ce200..bedb903a 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 91d53a64..aa01ad31 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 3562ece6..ff125ecd 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index c2a69c96..4dbb7908 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 7af1681b..9d3373c5 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -24,7 +24,7 @@ - +
      diff --git a/user_guide/toc.html b/user_guide/toc.html index a6605b51..683106a2 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -25,7 +25,7 @@ - +
      From 6945097110d174950b13d3d8407f8c0282a178af Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 18:51:19 +0000 Subject: [PATCH 1294/2544] --- system/libraries/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index b870ffba..644c4934 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -89,7 +89,7 @@ function library($library = '', $params = NULL, $object_name = NULL) { foreach ($library as $class) { - $this->_ci_load_class($class, $params); + $this->_ci_load_class($class, $params, $object_name); } } else From 76c504e13bc03fa38823e32603706860727d341b Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 19:11:34 +0000 Subject: [PATCH 1295/2544] Made some changes for compatibility with the new form validation class --- system/libraries/Loader.php | 93 +++++++++++++------------------------ 1 file changed, 32 insertions(+), 61 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 644c4934..55023573 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -39,7 +39,6 @@ class CI_Loader { var $_ci_models = array(); var $_ci_helpers = array(); var $_ci_plugins = array(); - var $_ci_scripts = array(); var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); @@ -74,7 +73,7 @@ function CI_Loader() * @return void */ function library($library = '', $params = NULL, $object_name = NULL) - { + { if ($library == '') { return FALSE; @@ -107,6 +106,7 @@ function library($library = '', $params = NULL, $object_name = NULL) * * This function lets users load and instantiate models. * + * @access public * @param string the name of the class * @param string name for the model * @param bool database connection @@ -375,7 +375,7 @@ function helper($helpers = array()) foreach ($helpers as $helper) { $helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper'); - + if (isset($this->_ci_helpers[$helper])) { continue; @@ -413,10 +413,8 @@ function helper($helpers = array()) } $this->_ci_helpers[$helper] = TRUE; - - } - - log_message('debug', 'Helpers loaded: '.implode(', ', $helpers)); + log_message('debug', 'Helper loaded: '.$helper); + } } // -------------------------------------------------------------------- @@ -480,9 +478,8 @@ function plugin($plugins = array()) } $this->_ci_plugins[$plugin] = TRUE; - } - - log_message('debug', 'Plugins loaded: '.implode(', ', $plugins)); + log_message('debug', 'Plugin loaded: '.$plugin); + } } // -------------------------------------------------------------------- @@ -501,48 +498,6 @@ function plugins($plugins = array()) { $this->plugin($plugins); } - - // -------------------------------------------------------------------- - - /** - * Load Script - * - * This function loads the specified include file from the - * application/scripts/ folder. - * - * NOTE: This feature has been deprecated but it will remain available - * for legacy users. - * - * @access public - * @param array - * @return void - */ - function script($scripts = array()) - { - if ( ! is_array($scripts)) - { - $scripts = array($scripts); - } - - foreach ($scripts as $script) - { - $script = strtolower(str_replace(EXT, '', $script)); - - if (isset($this->_ci_scripts[$script])) - { - continue; - } - - if ( ! file_exists(APPPATH.'scripts/'.$script.EXT)) - { - show_error('Unable to load the requested script: scripts/'.$script.EXT); - } - - include_once(APPPATH.'scripts/'.$script.EXT); - } - - log_message('debug', 'Scripts loaded: '.implode(', ', $scripts)); - } // -------------------------------------------------------------------- @@ -822,8 +777,8 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) { return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); } - } - + } + $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; @@ -904,8 +859,6 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) */ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { - $class = strtolower($class); - // Is there an associated config file for this class? if ($config === NULL) { @@ -916,16 +869,36 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU } if ($prefix == '') - { - $name = (class_exists('CI_'.$class)) ? 'CI_'.$class : $class; + { + if (class_exists('CI_'.$class)) + { + $name = 'CI_'.$class; + } + elseif (class_exists(config_item('subclass_prefix').$class)) + { + $name = config_item('subclass_prefix').$class; + } + else + { + $name = $class; + } } else { $name = $prefix.$class; } + // Is the class name valid? + if ( ! class_exists($name)) + { + log_message('error', "Non-existant class: ".$name); + show_error("Non-existant class: ".$class); + } + // Set the variable name we will assign the class to // Was a custom class name supplied? If so we'll use it + $class = strtolower($class); + if (is_null($object_name)) { $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; @@ -990,8 +963,6 @@ function _ci_autoloader() } } - - // A little tweak to remain backward compatible // The $autoload['core'] item was deprecated if ( ! isset($autoload['libraries'])) @@ -1101,7 +1072,7 @@ function _ci_is_instance() global $CI; return (is_object($CI)) ? TRUE : FALSE; } - + } /* End of file Loader.php */ From ec1b70f47e2161cf98bf0cad3d57368d2ca762dc Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 19:21:27 +0000 Subject: [PATCH 1296/2544] --- system/libraries/Form_validation.php | 1220 ++++++++++++++++++++++++++ 1 file changed, 1220 insertions(+) create mode 100644 system/libraries/Form_validation.php diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php new file mode 100644 index 00000000..fd0c22ec --- /dev/null +++ b/system/libraries/Form_validation.php @@ -0,0 +1,1220 @@ +'; + var $_error_suffix = '

      '; + var $error_string = ''; + var $_safe_form_data = FALSE; + + + /** + * Constructor + * + */ + function CI_Form_validation($rules = array()) + { + $this->CI =& get_instance(); + + // Validation rules can be stored in a config file. + $this->_config_rules = $rules; + + // Automatically load the form helper + $this->CI->load->helper('form'); + + log_message('debug', "Validation Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Set Rules + * + * This function takes an array of field names and validation + * rules as input, validates the info, and stores it + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_rules($field, $label = '', $rules = '') + { + // No reason to set rules if we have no POST data + if (count($_POST) == 0) + { + return; + } + + // If an array was passed via the first parameter instead of indidual string + // values we cycle through it and recursively call this function. + if (is_array($field)) + { + foreach ($field as $row) + { + // Houston, we have a problem... + if ( ! isset($row['field']) OR ! isset($row['rules'])) + { + continue; + } + + // If the field label wasn't passed we use the field name + $label = ( ! isset($row['label'])) ? $row['field'] : $row['label']; + + // Here we go! + $this->set_rules($row['field'], $label, $row['rules']); + } + return; + } + + // No rules or fields? Nothing to do... + if ( ! is_string($field) OR ! is_string($rules) OR $field == '' OR $rules == '') + { + return; + } + + // If the field label wasn't passed we use the field name + $label = ($label == '') ? $field : $label; + + // Is the field name an array? We test for the existence of a bracket "[" in + // the field name to determine this. If it is an array, we break it apart + // into its components so that we can fetch the corresponding POST data later + if (strpos($field, '[') !== FALSE AND preg_match_all('/\[(.*?)\]/', $field, $matches)) + { + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $x = explode('[', $field); + $indexes[] = current($x); + + for ($i = 0; $i < count($matches['0']); $i++) + { + if ($matches['1'][$i] != '') + { + $indexes[] = $matches['1'][$i]; + } + } + + $is_array = TRUE; + } + else + { + $indexes = array(); + $is_array = FALSE; + } + + // Build our master array + $this->_field_data[$field] = array( + 'field' => $field, + 'label' => $label, + 'rules' => $rules, + 'is_array' => $is_array, + 'keys' => $indexes, + 'postdata' => NULL, + 'error' => '' + ); + } + + // -------------------------------------------------------------------- + + /** + * Set Error Message + * + * Lets users set their own error messages on the fly. Note: The key + * name has to match the function name that it corresponds to. + * + * @access public + * @param string + * @param string + * @return string + */ + function set_message($lang, $val = '') + { + if ( ! is_array($lang)) + { + $lang = array($lang => $val); + } + + $this->_error_messages = array_merge($this->_error_messages, $lang); + } + + // -------------------------------------------------------------------- + + /** + * Set The Error Delimiter + * + * Permits a prefix/suffix to be added to each error message + * + * @access public + * @param string + * @param string + * @return void + */ + function set_error_delimiters($prefix = '

      ', $suffix = '

      ') + { + $this->_error_prefix = $prefix; + $this->_error_suffix = $suffix; + } + + // -------------------------------------------------------------------- + + /** + * Get Error Message + * + * Gets the error message associated with a particular field + * + * @access public + * @param string the field name + * @return void + */ + function error($field = '', $prefix = '', $suffix = '') + { + if ( ! isset($this->_field_data[$field]['error'])) + { + return ''; + } + + if ($prefix == '') + { + $prefix = $this->_error_prefix; + } + + if ($suffix == '') + { + $suffix = $this->_error_suffix; + } + + return $prefix.$this->_field_data[$field]['error'].$suffix; + } + + // -------------------------------------------------------------------- + + /** + * Error String + * + * Returns the error messages as a string, wrapped in the error delimiters + * + * @access public + * @param string + * @param string + * @return str + */ + function error_string($prefix = '', $suffix = '') + { + // No errrors, validation passes! + if (count($this->_error_array) === 0) + { + return ''; + } + + if ($prefix == '') + { + $prefix = $this->_error_prefix; + } + + if ($suffix == '') + { + $suffix = $this->_error_suffix; + } + + // Generate the error string + $str = ''; + foreach ($this->_error_array as $val) + { + $str .= $prefix.$val.$suffix."\n"; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Run the Validator + * + * This function does all the work. + * + * @access public + * @return bool + */ + function run($group = '') + { + // Do we even have any data to process? Mm? + if (count($_POST) == 0) + { + return FALSE; + } + + // Does the _field_data array containing the validation rules exist? + // If not, we look to see if they were assigned via a config file + if (count($this->_field_data) == 0) + { + // No validation rules? We're done... + if (count($this->_config_rules) == 0) + { + return FALSE; + } + + // Is there a validation rule for the particular URI being accessed? + $uri = ($group == '') ? trim($this->CI->uri->ruri_string(), '/') : $group; + + if ($uri != '' AND isset($this->_config_rules[$uri])) + { + $this->set_rules($this->_config_rules[$uri]); + } + else + { + $this->set_rules($this->_config_rules); + } + + // We're we able to set the rules correctly? + if (count($this->_field_data) == 0) + { + log_message('debug', "Unable to find validation rules"); + return FALSE; + } + } + + // Load the language file containing error messages + $this->CI->lang->load('form_validation'); + + // Cycle through the rules for each field, match the + // corresponding $_POST item and test for errors + foreach ($this->_field_data as $field => $row) + { + // Fetch the data from the corresponding $_POST array and cache it in the _field_data array. + // Depending on whether the field name is an array or a string will determine where we get it from. + + if ($row['is_array'] == TRUE) + { + $this->_field_data[$field]['postdata'] = $this->_reduce_array($_POST, $row['keys']); + } + else + { + if (isset($_POST[$field])) + { + $this->_field_data[$field]['postdata'] = $_POST[$field]; + } + } + + $this->_execute($row, explode('|', $row['rules']), $this->_field_data[$field]['postdata']); + } + + // Did we end up with any errors? + $total_errors = count($this->_error_array); + + if ($total_errors > 0) + { + $this->_safe_form_data = TRUE; + } + + // Now we need to re-set the POST data with the new, processed data + $this->_reset_post_array(); + + // No errors, validation passes! + if ($total_errors == 0) + { + return TRUE; + } + + // Validation fails + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Traverse a multidimensional $_POST array index until the data is found + * + * @access private + * @param array + * @param array + * @param integer + * @return mixed + */ + function _reduce_array($array, $keys, $i = 0) + { + if (is_array($array)) + { + if (isset($keys[$i])) + { + if (isset($array[$keys[$i]])) + { + $array = $this->_reduce_array($array[$keys[$i]], $keys, ($i+1)); + } + else + { + return NULL; + } + } + else + { + return $array; + } + } + + return $array; + } + + // -------------------------------------------------------------------- + + /** + * Re-populate the _POST array with our finalized and processed data + * + * @access private + * @return null + */ + function _reset_post_array() + { + foreach ($this->_field_data as $field => $row) + { + if ( ! is_null($row['postdata'])) + { + if ($row['is_array'] == FALSE) + { + if (isset($_POST[$row['field']])) + { + $_POST[$row['field']] = $this->prep_for_form($row['postdata']); + } + } + else + { + $post = '$_POST["'; + + if (count($row['keys']) == 1) + { + $post .= current($row['keys']); + $post .= '"]'; + } + else + { + $i = 0; + foreach ($row['keys'] as $val) + { + if ($i == 0) + { + $post .= $val.'"]'; + $i++; + continue; + } + + $post .= '["'.$val.'"]'; + } + } + + if (is_array($row['postdata'])) + { + $array = array(); + foreach ($row['postdata'] as $k => $v) + { + $array[$k] = $this->prep_for_form($v); + } + + $post .= ' = $array;'; + } + else + { + $post .= ' = "'.$this->prep_for_form($row['postdata']).'";'; + } + + eval($post); + } + } + } + } + + // -------------------------------------------------------------------- + + /** + * Executes the Validation routines + * + * @access private + * @param array + * @param array + * @param mixed + * @param integer + * @return mixed + */ + function _execute($row, $rules, $postdata = NULL, $cycles = 0) + { + // If the $_POST data is an array we will run a recursive call + if (is_array($postdata)) + { + foreach ($postdata as $key => $val) + { + $this->_execute($row, $rules, $val, $cycles); + $cycles++; + } + + return; + } + + // -------------------------------------------------------------------- + + // If the field is blank, but NOT required, no further tests are necessary + if ( ! in_array('required', $rules, TRUE) AND is_null($postdata)) + { + return; + } + + // -------------------------------------------------------------------- + + // Isset Test. Typically this rule will only apply to checkboxes. + if (is_null($postdata)) + { + if (in_array('isset', $rules, TRUE) OR in_array('required', $rules)) + { + if ( ! isset($this->_error_messages['isset'])) + { + if (FALSE === ($line = $this->CI->lang->line('isset'))) + { + $line = 'The field was not set'; + } + } + else + { + $line = $this->_error_messages['isset']; + } + + // Build the error message + $message = sprintf($line, $row['label']); + + // Save the error message + $this->_field_data[$row['field']]['error'] = $message; + + if ( ! isset($this->_error_array[$row['field']])) + { + $this->_error_array[$row['field']] = $message; + } + } + + return; + } + + // -------------------------------------------------------------------- + + // Cycle through each rule and run it + foreach ($rules As $rule) + { + $_in_array = FALSE; + + // We set the $postdata variable with the current data in our master array so that + // each cycle of the loop is dealing with the processed data from the last cycle + if ($row['is_array'] == TRUE AND is_array($this->_field_data[$row['field']]['postdata'])) + { + // We shouldn't need this safety, but just in case there isn't an array index + // associated with this cycle we'll bail out + if ( ! isset($this->_field_data[$row['field']]['postdata'][$cycles])) + { + continue; + } + + $postdata = $this->_field_data[$row['field']]['postdata'][$cycles]; + $_in_array = TRUE; + } + else + { + $postdata = $this->_field_data[$row['field']]['postdata']; + } + + // -------------------------------------------------------------------- + + // Is the rule a callback? + $callback = FALSE; + if (substr($rule, 0, 9) == 'callback_') + { + $rule = substr($rule, 9); + $callback = TRUE; + } + + // Strip the parameter (if exists) from the rule + // Rules can contain a parameter: max_length[5] + $param = FALSE; + if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) + { + $rule = $match[1]; + $param = $match[2]; + } + + // Call the function that corresponds to the rule + if ($callback === TRUE) + { + if ( ! method_exists($this->CI, $rule)) + { + continue; + } + + // Run the function and grab the result + $result = $this->CI->$rule($postdata, $param); + + // Re-assign the result to the master data array + if ($_in_array == TRUE) + { + $this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result; + } + else + { + $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; + } + + // If the field isn't required and we just processed a callback we'll move on... + if ( ! in_array('required', $rules, TRUE) AND $result !== FALSE) + { + return; + } + } + else + { + if ( ! method_exists($this, $rule)) + { + /* + * Run the native PHP function if called for + * + * If our own wrapper function doesn't exist we see + * if a native PHP function does. Users can use + * any native PHP function call that has one param. + */ + if (function_exists($rule)) + { + $result = $rule($postdata); + + if ($_in_array == TRUE) + { + $this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result; + } + else + { + $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; + } + } + + continue; + } + + $result = $this->$rule($postdata, $param); + + if ($_in_array == TRUE) + { + $this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result; + } + else + { + $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; + } + } + + // Did the rule test negatively? If so, grab the error. + if ($result === FALSE) + { + if ( ! isset($this->_error_messages[$rule])) + { + if (FALSE === ($line = $this->CI->lang->line($rule))) + { + $line = 'Unable to access an error message corresponding to your field name.'; + } + } + else + { + $line = $this->_error_messages[$rule]; + } + + // Build the error message + $message = sprintf($line, $row['label'], $param); + + // Save the error message + $this->_field_data[$row['field']]['error'] = $message; + + if ( ! isset($this->_error_array[$row['field']])) + { + $this->_error_array[$row['field']] = $message; + } + + return; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Get the value from a form + * + * Permits you to repopulate a form field with the value it was submitted + * with, or, if that value doesn't exist, with the default + * + * @access public + * @param string the field name + * @param string + * @return void + */ + function set_value($field = '', $default = '') + { + if ( ! isset($this->_field_data[$field])) + { + return $default; + } + + return $this->_field_data[$field]['postdata']; + } + + // -------------------------------------------------------------------- + + /** + * Set Select + * + * Enables pull-down lists to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_select($field = '', $value = '', $default = FALSE) + { + if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) + { + if ($default === TRUE AND count($this->_field_data) === 0) + { + return ' selected="selected"'; + } + return ''; + } + + $field = $this->_field_data[$field]['postdata']; + + if (is_array($field)) + { + if ( ! in_array($value, $field, TRUE)) + { + return ''; + } + } + else + { + if (($field == '' OR $value == '') OR ($field != $value)) + { + return ''; + } + } + + return ' selected="selected"'; + } + + // -------------------------------------------------------------------- + + /** + * Set Radio + * + * Enables radio buttons to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_radio($field = '', $value = '', $default = FALSE) + { + if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) + { + if ($default === TRUE AND count($this->_field_data) === 0) + { + return ' checked="checked"'; + } + return ''; + } + + $field = $this->_field_data[$field]['postdata']; + + if (is_array($field)) + { + if ( ! in_array($value, $field, TRUE)) + { + return ''; + } + } + else + { + if (($field == '' OR $value == '') OR ($field != $value)) + { + return ''; + } + } + + return ' checked="checked"'; + } + + // -------------------------------------------------------------------- + + /** + * Set Checkbox + * + * Enables checkboxes to be set to the value the user + * selected in the event of an error + * + * @access public + * @param string + * @param string + * @return string + */ + function set_checkbox($field = '', $value = '', $default = FALSE) + { + if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) + { + if ($default === TRUE AND count($this->_field_data) === 0) + { + return ' checked="checked"'; + } + return ''; + } + + $field = $this->_field_data[$field]['postdata']; + + if (is_array($field)) + { + if ( ! in_array($value, $field, TRUE)) + { + return ''; + } + } + else + { + if (($field == '' OR $value == '') OR ($field != $value)) + { + return ''; + } + } + + return ' checked="checked"'; + } + + // -------------------------------------------------------------------- + + /** + * Required + * + * @access public + * @param string + * @return bool + */ + function required($str) + { + if ( ! is_array($str)) + { + return (trim($str) == '') ? FALSE : TRUE; + } + else + { + return ( ! empty($str)); + } + } + + // -------------------------------------------------------------------- + + /** + * Match one field to another + * + * @access public + * @param string + * @param field + * @return bool + */ + function matches($str, $field) + { + if ( ! isset($_POST[$field])) + { + return FALSE; + } + + $field = $_POST[$field]; + + return ($str !== $field) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Minimum Length + * + * @access public + * @param string + * @param value + * @return bool + */ + function min_length($str, $val) + { + if (preg_match("/[^0-9]/", $val)) + { + return FALSE; + } + + return (strlen($str) < $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Max Length + * + * @access public + * @param string + * @param value + * @return bool + */ + function max_length($str, $val) + { + if (preg_match("/[^0-9]/", $val)) + { + return FALSE; + } + + return (strlen($str) > $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Exact Length + * + * @access public + * @param string + * @param value + * @return bool + */ + function exact_length($str, $val) + { + if (preg_match("/[^0-9]/", $val)) + { + return FALSE; + } + + return (strlen($str) != $val) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Valid Email + * + * @access public + * @param string + * @return bool + */ + function valid_email($str) + { + return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Valid Emails + * + * @access public + * @param string + * @return bool + */ + function valid_emails($str) + { + if (strpos($str, ',') === FALSE) + { + return $this->valid_email(trim($str)); + } + + foreach(explode(',', $str) as $email) + { + if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + return $this->CI->input->valid_ip($ip); + } + + // -------------------------------------------------------------------- + + /** + * Alpha + * + * @access public + * @param string + * @return bool + */ + function alpha($str) + { + return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric + * + * @access public + * @param string + * @return bool + */ + function alpha_numeric($str) + { + return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Alpha-numeric with underscores and dashes + * + * @access public + * @param string + * @return bool + */ + function alpha_dash($str) + { + return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Numeric + * + * @access public + * @param string + * @return bool + */ + function numeric($str) + { + return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str); + + } + + // -------------------------------------------------------------------- + + /** + * Is Numeric + * + * @access public + * @param string + * @return bool + */ + function is_numeric($str) + { + return ( ! is_numeric($str)) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Integer + * + * @access public + * @param string + * @return bool + */ + function integer($str) + { + return (bool)preg_match( '/^[\-+]?[0-9]+$/', $str); + } + + // -------------------------------------------------------------------- + + /** + * Is a Natural number (0,1,2,3, etc.) + * + * @access public + * @param string + * @return bool + */ + function is_natural($str) + { + return (bool)preg_match( '/^[0-9]+$/', $str); + } + + // -------------------------------------------------------------------- + + /** + * Is a Natural number, but not a zero (1,2,3, etc.) + * + * @access public + * @param string + * @return bool + */ + function is_natural_no_zero($str) + { + if ( ! preg_match( '/^[0-9]+$/', $str)) + { + return FALSE; + } + + if ($str == 0) + { + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Valid Base64 + * + * Tests a string for characters outside of the Base64 alphabet + * as defined by RFC 2045 http://www.faqs.org/rfcs/rfc2045 + * + * @access public + * @param string + * @return bool + */ + function valid_base64($str) + { + return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str); + } + + // -------------------------------------------------------------------- + + /** + * Prep data for form + * + * This function allows HTML to be safely shown in a form. + * Special characters are converted. + * + * @access public + * @param string + * @return string + */ + function prep_for_form($data = '') + { + if (is_array($data)) + { + foreach ($data as $key => $val) + { + $data[$key] = $this->prep_for_form($val); + } + + return $data; + } + + if ($this->_safe_form_data == FALSE OR $data === '') + { + return $data; + } + + return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($data)); + } + + // -------------------------------------------------------------------- + + /** + * Prep URL + * + * @access public + * @param string + * @return string + */ + function prep_url($str = '') + { + if ($str == 'http://' OR $str == '') + { + return ''; + } + + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + { + $str = 'http://'.$str; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Strip Image Tags + * + * @access public + * @param string + * @return string + */ + function strip_image_tags($str) + { + return $this->CI->input->strip_image_tags($str); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * @access public + * @param string + * @return string + */ + function xss_clean($str) + { + return $this->CI->input->xss_clean($str); + } + + // -------------------------------------------------------------------- + + /** + * Convert PHP tags to entities + * + * @access public + * @param string + * @return string + */ + function encode_php_tags($str) + { + return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + } + +} +// END Form Validation Class + +/* End of file Form_validation.php */ +/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file From 43e0fbb650d05466cd2568b8a2cc1c38849a6b52 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 19:22:31 +0000 Subject: [PATCH 1297/2544] Added some new functions that work with the new form validation class --- system/helpers/form_helper.php | 335 +++++++++++++++++++++++++++++++-- 1 file changed, 321 insertions(+), 14 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 0c74ac0f..a96adb97 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -53,7 +53,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) $form = ' 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - return ""; + return ""; } } @@ -214,17 +214,17 @@ function form_textarea($data = '', $value = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - if ( ! is_array($data) OR ! isset($data['value'])) + if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } - else + else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } - return ""; + return ""; } } @@ -248,6 +248,16 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext { $selected = array($selected); } + + // If no selected state was submitted we will attempt to set it automatically + if (count($selected) === 0) + { + // If the form name appears in the $_POST array we have a winner! + if (isset($_POST[$name])) + { + $selected = array($_POST[$name]); + } + } if ($extra != '') $extra = ' '.$extra; @@ -312,7 +322,7 @@ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') unset($defaults['checked']); } - return ""; + return ""; } } @@ -359,7 +369,7 @@ function form_submit($data = '', $value = '', $extra = '') { $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - return ""; + return ""; } } @@ -380,7 +390,7 @@ function form_reset($data = '', $value = '', $extra = '') { $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - return ""; + return ""; } } @@ -407,7 +417,7 @@ function form_button($data = '', $content = '', $extra = '') unset($data['content']); // content is not an attribute } - return ""; + return ""; } } @@ -466,7 +476,7 @@ function form_fieldset($legend_text = '', $attributes = array()) { $fieldset = " $val) + { + $str[$key] = form_prep($val); + } + + return $str; + } + if ($str === '') { return ''; @@ -552,7 +573,256 @@ function form_prep($str = '') return $str; } } + +// ------------------------------------------------------------------------ + +/** + * Form Value + * + * Grabs a value from the POST array for the specified field so you can + * re-populate an input field or textarea. If Form Validation + * is active it retrieves the info from the validation class + * + * @access public + * @param string + * @return mixed + */ +if ( ! function_exists('set_value')) +{ + function set_value($field = '', $default = '') + { + if (FALSE === ($OBJ =& _get_validation_object())) + { + if ( ! isset($_POST[$field])) + { + return $default; + } + + return $_POST[$field]; + } + + return $OBJ->set_value($field, $default); + } +} + +// ------------------------------------------------------------------------ + +/** + * Set Select + * + * Let's you set the selected value of a
      - +

      CodeIgniter User Guide Version 1.6.3

      CodeIgniter User Guide Version 1.7

      @@ -57,7 +57,7 @@

      Change Log

      -

      Version 1.6.4

      +

      Version 1.7

      Release Date: In development
      SVN Revision: XXXX

      @@ -65,15 +65,16 @@

      Version 1.6.4

      • Libraries
          +
        • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
        • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
        • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
        • Added the ability to assign library objects to your own variable names when you use this->load->library(). Please see the Loader class for more info.
        • Changed the output of the profiler to use style attribute rather then clear, and added the id "codeigniter_profiler" to the container div
        • -
        • Added is_natural() and is_natural_no_zero() to the Validation class.
      • Helpers
          +
        • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
        • Added current_url() and uri_segments() to URL helper.
        • Improved accuracy of calculations in Number helper.
        • Removed added newlines ("\n") from most form and html helper functions.
        • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 3b3dbf46..3a40dc2c 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 1034ee94..9016ffe0 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 1fa6d182..8ecccce2 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 4ae8f704..2c16f360 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index b59034fa..246aa4e6 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 966700c5..4182390f 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index bc5bf49b..ed8f63d6 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 097d396b..3feb487d 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index e1dbef40..ac6ea11a 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 36e6ffd0..73f814c3 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index bad2df86..eb4d13e9 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 782cecc3..a6ca6219 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 4e6c97b9..7f8e461e 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 96570d34..7ff23ee6 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 4d04a1ca..e6847b37 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 3e44f304..1c0ca518 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 02774016..a8e86039 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 3014d3ff..9a1d6cd8 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 0f8a2d46..b4bfae50 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 4913ceab..0a6d9d65 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 9261600e..65058b9e 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 31ad8662..3b660d27 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index e748eb00..a8168239 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 0f759d7e..15dfcec1 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 482fb71c..be52fe83 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 8f4c09c0..07dc1b3d 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index e91d5a88..090456fc 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 6af6ee99..dcea24de 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/index.html b/user_guide/general/index.html index d94ec60b..f271b12b 100644 --- a/user_guide/general/index.html +++ b/user_guide/general/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 0d0c628e..29a2d62f 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index f3d69628..f1600d90 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 3c490874..b061d06c 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index f0a769d1..8471840a 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 804c9e0b..a9c2a646 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 86aa568f..edeced0a 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index ef238405..a6551970 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 58b0de2d..39e1a9f1 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 78da9c10..331161a4 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index c17118f4..f5925240 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/security.html b/user_guide/general/security.html index b24edb9d..301e24f9 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 7883528c..e0b130e4 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 7f987a5b..a5ffa08b 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index ffe796c7..2a6bad3e 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index d98332ae..7f32a557 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 456a95ea..f30528af 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 0e174ccc..41d65795 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 97444291..cbd743e3 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 42e8aba1..d9bf6938 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index d8e522a4..732e5154 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 05700ae8..e534f50d 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 76ded1ee..868cadb8 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          @@ -258,7 +258,7 @@

          form_fieldset()

          </fieldset>

          Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

          $attributes = array('id' => 'address_info', 'class' => 'address_info');
          - echo form_fieldset('Address Information', $attributes);
          + echo form_fieldset('Address Information', $attributes);
          echo "<p>fieldset content here</p>\n";
          echo form_fieldset_close();

          @@ -269,7 +269,7 @@

          form_fieldset()

          </fieldset>

          form_fieldset_close()

          Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

          + which will be added below the tag. For example:

          $string = "</div></div>";

          echo fieldset_close($string);
          @@ -321,7 +321,7 @@

          form_submit()


          <input type="submit" name="mysubmit" value="Submit Post!" />

          Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

          + The third parameter lets you add extra data to your form, like JavaScript.

          form_label()

          Lets you generate a <label>. Simple example:

          echo form_label('What is your Name', 'username');
          @@ -329,13 +329,13 @@

          form_label()

          // Would produce:
          <label for="username">What is your Name</label>
          -

          Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

          +

          Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

          $attributes = array(
              'class' => 'mycustomclass',
              'style' => 'color: #000;',
          );
          - echo form_label('What is your Name', 'username', $attributes);
          -
          + echo form_label('What is your Name', 'username', $attributes);
          +
          // Would produce:
          <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

          form_reset()

          @@ -411,6 +411,49 @@

          form_prep()

          creating your own form elements.

          +

          set_value()

          + +

          Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. +The second (optional) parameter allows you to set a default value for the form. Example:

          + +<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> + +

          The above form will show "0" when loaded for the firs time.

          + +

          set_select()

          + +

          If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

          + +

          Example:

          + + +<select name="myselect">
          +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
          +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
          +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
          +</select> +
          + + +

          set_checkbox()

          + +

          Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

          + +<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
          +<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
          + + +

          set_radio()

          + +

          Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

          + +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
          +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
          + +
          diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index aff896aa..ab26cbcc 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 4a78287e..b93a9c01 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 7bf10688..9c60759d 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 8d20cca3..fea4cbf6 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index ceb509c4..42f4713d 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 627d9f98..588cafef 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index fd337c5d..05f536e9 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 2a754a97..67318e8c 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index fb58b837..65b82d8b 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 3116c36a..538784d6 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 95599a5d..e5e35dfd 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 2d3cd446..6971115e 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/index.html b/user_guide/index.html index 2d08fcc0..8a806842 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f1ac5730..e0bf6129 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index a4a39f5c..701cdac7 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index c6d77585..abdf5194 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 0ed75c7e..e77d325e 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index db830e23..c2739777 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 2232e2fd..890e37dd 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index f5259efc..333d8ca9 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index f2bc4b89..41c131bc 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index c8c01418..1e593739 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 65b9c42d..c1b667a8 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 7bdcff0a..2a418087 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 725e7a18..789f21bf 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 26241ec4..66ca76e4 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index e10511aa..5e6dfb9c 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index d5f1cc99..a62ae57a 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 14d51229..24d34fd7 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index fa50c621..258df2a5 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 31b309d1..784ada8b 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_164.html b/user_guide/installation/upgrade_164.html index e71a0ad9..ea878fc0 100644 --- a/user_guide/installation/upgrade_164.html +++ b/user_guide/installation/upgrade_164.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html new file mode 100644 index 00000000..d74afff2 --- /dev/null +++ b/user_guide/installation/upgrade_170.html @@ -0,0 +1,121 @@ + + + + + +Upgrading from 1.6.3 to 1.6.4 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
          + + + + + +

          CodeIgniter User Guide Version 1.7

          +
          + + + + + + + + + +
          + + +
          + + + +
          + +

          Upgrading from 1.6.3 to 1.7.0 - In Development!

          + +

          Before performing an update you should take your site offline by replacing the index.php file with a static one.

          + + + +

          Step 1: Update your CodeIgniter files

          + +

          Replace these files and directories in your "system" folder with the new versions:

          + +
            + +
          • system/codeigniter
          • +
          • system/database
          • +
          • system/helpers
          • +
          • system/language
          • +
          • system/libraries
          • +
          + +

          Note: If you have any custom developed files in these folders please make copies of them first.

          + + +

          Step 2: Update your Session Table

          + +

          If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. +Here is an example of what this column might look like for MySQL: + +user_data text NOT NULL + +

          To add this column you will run a query similar to this:

          + +ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL + +

          You'll find more information regarding the new Session functionality in the Session class page.

          + + +

          Step 3: Update your Validation Syntax

          + +

          This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which +deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to +migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

          + + + +

          Step 4: Update your user guide

          +

          Please replace your local copy of the user guide with the new version, including the image files.

          + +
          + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index c81b6d48..8360a2b3 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 82215f3a..78b5433c 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          @@ -60,7 +60,7 @@

          Upgrading From a Previous Version

          Please read the upgrade notes corresponding to the version you are upgrading from.

            -
          • Upgrading from 1.6.3 to 1.6.4
          • +
          • Upgrading from 1.6.3 to 1.7.0
          • Upgrading from 1.6.2 to 1.6.3
          • Upgrading from 1.6.1 to 1.6.2
          • Upgrading from 1.6.0 to 1.6.1
          • diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index c57df73a..67c36135 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 15737f1a..1c849939 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 59bc7d77..41a89566 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index bd0fa569..64f56aca 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 372b1a34..092dad2a 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 24a7d394..baa179fb 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            @@ -401,7 +401,7 @@

            Explanation

            image_width Image width. -image_height +image_heigth Image height image_type @@ -423,7 +423,7 @@

            Explanation

               ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  FTP Class +Next Topic:  Form Validation Class

            CodeIgniter  ·  Copyright © 2006-2008  ·  Ellislab, Inc.

            diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html new file mode 100644 index 00000000..1bdc3a41 --- /dev/null +++ b/user_guide/libraries/form_validation.html @@ -0,0 +1,1144 @@ + + + + + +Form Validation : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
            + + + + + +

            CodeIgniter User Guide Version 1.7

            +
            + + + + + + + + + +
            + + +
            + + + +
            + +

            Form Validation

            + +

            CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you'll write.

            + +

            Note:  As of CodeIgniter 1.6.4, this Form Validation class supercedes the old Validation class, which is now deprecated. We +have left the old class in the library so applications currently using it will not break, but you are encouraged to migrate to this new version.

            + + + + + + + + +

             

            + + +

            Overview

            + + +

            Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

            + +
              +
            1. A form is displayed.
            2. +
            3. You fill it in and submit it.
            4. +
            5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data +along with an error message describing the problem.
            6. +
            7. This process continues until you have submitted a valid form.
            8. +
            + +

            On the receiving end, the script must:

            + +
              +
            1. Check for required data.
            2. +
            3. Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted +it must be validated to contain only permitted characters. It must be of a minimum length, +and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
            4. +
            5. Sanitize the data for security.
            6. +
            7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
            8. +
            9. Prep the data for insertion in the database.
            10. +
            + + +

            Although there is nothing terribly complex about the above process, it usually requires a significant +amount of code, and to display error messages, various control structures are usually placed within the form HTML. +Form validation, while simple to create, is generally very messy and tedious to implement.

            + +

             

            + + + +

            Form Validation Tutorial

            + +

            What follows is a "hands on" tutorial for implementing CodeIgniters Form Validation.

            + + +

            In order to implement form validation you'll need three things:

            + +
              +
            1. A View file containing a form.
            2. +
            3. A View file containing a "success" message to be displayed upon successful submission.
            4. +
            5. A controller function to receive and process the submitted data.
            6. +
            + +

            Let's create those three things, using a member sign-up form as the example.

            + + + + + +

            The Form

            + +

            Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +folder:

            + + + + + + + + +

            The Success Page

            + + +

            Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +folder:

            + + + + + + + +

            The Controller

            + +

            Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +folder:

            + + + + + +

            Try it!

            + +

            To try your form, visit your site using a URL similar to this one:

            + +example.com/index.php/form/ + +

            If you submit the form you should simply see the form reload. That's because you haven't set up any validation +rules yet.

            + +

            Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() +function only returns TRUE if it has successfully applied your rules without any of them failing.

            + + +

            Explanation

            + +

            You'll notice several things about the above pages:

            + +

            The form (myform.php) is a standard web form with a couple exceptions:

            + +
              +
            1. It uses a form helper to create the form opening. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
            2. + +
            3. At the top of the form you'll notice the following function call: +<?php echo validation_errors(); ?> + +

              This function will return any error messages sent back by the validator. If there are no messages it returns an empty string.

              +
            4. +
            + +

            The controller (form.php) has one function: index(). This function initializes the validation class and +loads the form helper and URL helper used by your view files. It also runs +the validation routine. Based on +whether the validation was successful it either presents the form or the success page.

            + + + + + + +

            Setting Validation Rules

            + +

            CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data +at the same time. To set validation rules you will use the set_rules() function:

            + +$this->form_validation->set_rules(); + +

            The above function takes three parameters as input:

            + +
              +
            1. The field name - the exact name you've given the form field.
            2. +
            3. A "human" name for this field, which will be inserted into the error message. For example, if your field is named "user" you might give it a human name of "Username".
            4. +
            5. The validation rules for this form field.
            6. +
            + + +


            Here is an example. In your controller (form.php), add this code just below the validation initialization function:

            + + +$this->form_validation->set_rules('username', 'Username', 'required');
            +$this->form_validation->set_rules('password', 'Password', 'required');
            +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
            +$this->form_validation->set_rules('email', 'Email', 'required');
            +
            + +

            Your controller should now look like this:

            + + + +

            Now submit the form with the fields blank and you should see the error messages. +If you submit the form with all the fields populated you'll see your success page.

            + +

            Note: The form fields are not yet being re-populated with the data when +there is an error. We'll get to that shortly.

            + + + + + +

            Setting Rules Using an Array

            + +

            Before moving on it should be noted that the rule setting function can be passed an array if you prefer to set all your rules in one action. +If you use this approach you must name your array keys as indicated:

            + + +$config = array(
            +               array(
            +                     'field'   => 'username',
            +                     'label'   => 'Username',
            +                     'rules'   => 'required'
            +                  ),
            +               array(
            +                     'field'   => 'password',
            +                     'label'   => 'Password',
            +                     'rules'   => 'required'
            +                  ),
            +               array(
            +                     'field'   => 'passconf',
            +                     'label'   => 'Password Confirmation',
            +                     'rules'   => 'required'
            +                  ),   
            +               array(
            +                     'field'   => 'email',
            +                     'label'   => 'Email',
            +                     'rules'   => 'required'
            +                  )
            +            );
            +
            +$this->form_validation->set_rules($config); +
            + + + + + + + +

            Cascading Rules

            + +

            CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

            + + +$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
            +$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
            +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
            +$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
            +
            + +

            The above code sets the following rules:

            + +
              +
            1. The username field be no shorter than 5 characters and no longer than 12.
            2. +
            3. The password field must match the password confirmation field.
            4. +
            5. The email field must contain a valid email address.
            6. +
            + +

            Give it a try! Submit your form without the proper data and you'll see new error messages that correspond to your new rules. +There are numerous rules available which you can read about in the validation reference.

            + + + + +

            Prepping Data

            + +

            In addition to the validation functions like the ones we used above, you can also prep your data in various ways. +For example, you can set up rules like this:

            + + +$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean');
            +$this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5');
            +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
            +$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
            +
            + + +

            In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through +the "xss_clean" function, which removes malicious data.

            + +

            Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, +trim, MD5, etc.

            + +

            Note: You will generally want to use the prepping functions after +the validation rules so if there is an error, the original data will be shown in the form.

            + + + + + +

            Re-populating the form

            + +

            Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions +that permit you to do this. The one you will use most commonly is:

            + +set_value('field name') + + +

            Open your myform.php view file and update the value in each field using the set_value() function:

            + +

            Don't forget to include each. field name in the set_value() functions!

            + + + + + +

            Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

            + +

            Note: The Function Reference section below contains functions that +permit you to re-populate <select> menus, radio buttons, and checkboxes.

            + + +

            Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

            + +<input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> + + + + + + +

            Callbacks: Your own Validation Functions

            + +

            The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a example of this.

            + +

            In your controller, change the "username" rule to this:

            + +$this->form_validation->set_rules('username', 'Username', 'callback_username_check'); + + +

            Then add a new function called username_check to your controller. Here's how your controller should now look:

            + + + + +

            Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +callback function for you to process.

            + +

            To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

            + +

            You can also process the form data that is passed to your callback and return it. If your callback returns anything other then a boolean TRUE/FALSE +it is assumed that the data is your newly processed form data.

            + + + + + +

            Setting Error Messages

            + + +

            All of the native error messages are located in the following language file: language/english/form_validation_lang.php

            + +

            To set your own custom message you can either edit that file, or use the following function:

            + +$this->form_validation->set_message('rule', 'Error Message'); + +

            Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

            + +

            If you include %s in your error string, it will be replaced with the "human" name you used for your field when you set your rules.

            + +

            In the "callback" example above, the error message was set by passing the name of the function:

            + +$this->form_validation->set_message('username_check') + +

            You can also override any error message found in the languge file. For example, to change the message for the "required" rule you will do this:

            + +$this->form_validation->set_message('required', 'Your custom message here'); + + + + +

            Changing the Error Delimiters

            + +

            By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or +individually.

            + +
              + +
            1. Changing delimiters Globally + +

              To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:

              + +<?php echo $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); + +

              In this example, we've switched to using div tags.

              + +
            2. + +
            3. Changing delimiters Individually

              + +

              Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:

              + +<?php echo form_error('field name', '<div class="error">', '</div>'); ?> + +

              Or:

              + +<?php echo validation_errors('<div class="error">', '</div>'); ?> + +
            4. +
            + + + + + +

            Showing Errors Individually

            + +

            If you prefer to show an error message next to each form field, rather than as a list, you can use the form_error() function.

            + +

            Try it! Change your form so that it looks like this:

            + + + +

            If there are no errors, nothing will be shown. If there is an error, the message will appear.

            + +

            Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

            + +<?php echo form_error('options[size]'); ?>
            +<input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> +
            + + + + + +

             

            + + + +

            Saving Sets of Validation Rules to a Config File

            + +

            A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You +can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or +you can manually call each set as needed.

            + +

            How to save your rules

            + +

            To store your validation rules, simply create a file named form_validation.php in your application/config/ folder. +In that file you will place an array named $config with your rules. As shown earlier, the validation array will have this prototype:

            + + +$config = array(
            +               array(
            +                     'field'   => 'username',
            +                     'label'   => 'Username',
            +                     'rules'   => 'required'
            +                  ),
            +               array(
            +                     'field'   => 'password',
            +                     'label'   => 'Password',
            +                     'rules'   => 'required'
            +                  ),
            +               array(
            +                     'field'   => 'passconf',
            +                     'label'   => 'Password Confirmation',
            +                     'rules'   => 'required'
            +                  ),   
            +               array(
            +                     'field'   => 'email',
            +                     'label'   => 'Email',
            +                     'rules'   => 'required'
            +                  )
            +            );
            +
            + +

            Your validation rule file will be loaded automatically and used when you call the run() function.

            + +

            Please note that you MUST name your array $config.

            + +

            Creating Sets of Rules

            + +

            In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. +We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

            + + +$config = array(
            +                 'signup' = array(
            +                                    array(
            +                                            'field' => 'username',
            +                                            'label' => 'Username',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'password',
            +                                            'label' => 'Password',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'passconf',
            +                                            'label' => 'PasswordConfirmation',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'email',
            +                                            'label' => 'Email',
            +                                            'rules' => 'required'
            +                                         )
            +                                    ),
            +                 'email' = array(
            +                                    array(
            +                                            'field' => 'emailaddress',
            +                                            'label' => 'EmailAddress',
            +                                            'rules' => 'required|valid_email'
            +                                         ),
            +                                    array(
            +                                            'field' => 'name',
            +                                            'label' => 'Name',
            +                                            'rules' => 'required|alpha'
            +                                         ),
            +                                    array(
            +                                            'field' => 'title',
            +                                            'label' => 'Title',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'message',
            +                                            'label' => 'MessageBody',
            +                                            'rules' => 'required'
            +                                         )
            +                                    )                          
            +               );
            +
            + + +

            Calling a Specific Rule Group

            + +

            In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

            + + +if ($this->form_validation->run('signup') == FALSE)
            +{
            +   $this->load->view('myform');
            +}
            +else
            +{
            +   $this->load->view('formsuccess');
            +}
            +
            + + + +

            Associating a Controller Function with a Rule Group

            + +

            An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you +have a controller named Member and a function named signup. Here's what your class might look like:

            + + +<?php

            +class Member extends Controller {
            +
            +   function signup()
            +   {      
            +      $this->load->library('form_validation');
            +            
            +      if ($this->form_validation->run() == FALSE)
            +      {
            +         $this->load->view('myform');
            +      }
            +      else
            +      {
            +         $this->load->view('formsuccess');
            +      }
            +   }
            +}
            +?>
            + +

            In your validation config file, you will name your rule group member/signup: + + +$config = array(
            +           'member/signup' = array(
            +                                    array(
            +                                            'field' => 'username',
            +                                            'label' => 'Username',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'password',
            +                                            'label' => 'Password',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'passconf',
            +                                            'label' => 'PasswordConfirmation',
            +                                            'rules' => 'required'
            +                                         ),
            +                                    array(
            +                                            'field' => 'email',
            +                                            'label' => 'Email',
            +                                            'rules' => 'required'
            +                                         )
            +                                    )
            +               );
            +
            + +

            When a rule group is named identically to a controller class/function it will be used automatically when the run() function is invoked from that class/function.

            + + + + + + + + +

             

            + + + +

            Rule Reference

            + +

            The following is a list of all the native rules that are available to use:

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            RuleParameterDescriptionExample
            requiredNoReturns FALSE if the form element is empty. 
            matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
            min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
            max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
            exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
            alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
            alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
            alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
            numericNoReturns FALSE if the form element contains anything other than numeric characters. 
            integerNoReturns FALSE if the form element contains anything other than an integer. 
            is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
            is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
            valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
            valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
            valid_ipNoReturns FALSE if the supplied IP is not valid. 
            valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
            + +

            Note: These rules can also be called as discrete functions. For example:

            + +$this->form_validation->required($string); + +

            Note: You can also use any native PHP functions that permit one parameter.

            + + + +

             

            + + +

            Prepping Reference

            + +

            The following is a list of all the prepping functions that are available to use:

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            NameParameterDescription
            xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
            prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
            prep_urlNoAdds "http://" to URLs if missing.
            strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
            encode_php_tagsNoConverts PHP tags to entities.
            + +

            Note: You can also use any native PHP functions that permit one parameter, +like trim, htmlspecialchars, urldecode, etc.

            + + + + + + + +

             

            + + +

            Function Reference

            + +

            $this->form_validation->set_rule();

            + +

            Permits you to set validation rules, as described in the tutorial sections above:

            + + + + +

            $this->form_validation->run();

            + +

            Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation +group via the function, as described in: Saving Groups of Validation Rules to a Config File.

            + + +

            $this->form_validation->set_message();

            + +

            Permits you to set custom error messages. See Setting Error Messages above.

            + + +

             

            + + +

            Helper Reference

            + +

            The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they +do not require you to prepend them with $this->form_validation.

            + +

            form_error()

            + +

            Shows an individual error message associated with the field name supplied to the function. Example:

            + +<?php echo form_error('username'); ?> + +

            The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

            + + + +

            validation_errors()

            +

            Shows all error messages as a string: Example:

            + +<?php echo validation_errors(); ?> + +

            The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

            + + + +

            set_value()

            + +

            Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. +The second (optional) parameter allows you to set a default value for the form. Example:

            + +<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> + +

            The above form will show "0" when loaded for the firs time.

            + +

            set_select()

            + +

            If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

            + +

            Example:

            + + +<select name="myselect">
            +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
            +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
            +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
            +</select> +
            + + +

            set_checkbox()

            + +

            Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

            + +<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
            +<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
            + + +

            set_radio()

            + +

            Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

            + +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
            +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
            + + + + + + + + + +
            + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 41397d39..1d52a290 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
            - +

            CodeIgniter User Guide Version 1.6.3

            CodeIgniter User Guide Version 1.7

            @@ -290,7 +290,7 @@

            $this->ftp->close();

          ' + diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 5101f18a..8850b63e 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index bedb903a..51f4a29c 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index aa01ad31..31f0c305 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index ff125ecd..67c6cdc6 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 4dbb7908..9bb1e6b7 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 9d3373c5..9a6267f9 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          diff --git a/user_guide/toc.html b/user_guide/toc.html index 683106a2..45a5df41 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
          - +

          CodeIgniter User Guide Version 1.6.3

          CodeIgniter User Guide Version 1.7

          @@ -130,6 +130,7 @@

          Class Reference

        • Email Class
        • Encryption Class
        • File Uploading Class
        • +
        • Form Validation Class
        • FTP Class
        • HTML Table Class
        • Image Manipulation Class
        • @@ -144,7 +145,6 @@

          Class Reference

        • Unit Testing Class
        • URI Class
        • User Agent Class
        • -
        • Validation Class
        • XML-RPC Class
        • Zip Encoding Class
        From b4855089a0beb5dce5f109205dd4fc29cb009ef5 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 19:48:41 +0000 Subject: [PATCH 1299/2544] File not needed --- user_guide/installation/upgrade_164.html | 113 ----------------------- 1 file changed, 113 deletions(-) delete mode 100644 user_guide/installation/upgrade_164.html diff --git a/user_guide/installation/upgrade_164.html b/user_guide/installation/upgrade_164.html deleted file mode 100644 index ea878fc0..00000000 --- a/user_guide/installation/upgrade_164.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - -Upgrading from 1.6.3 to 1.6.4 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
        - - - - - -

        CodeIgniter User Guide Version 1.7

        -
        - - - - - - - - - -
        - - -
        - - - -
        - -

        Upgrading from 1.6.3 to 1.6.4

        - -

        Before performing an update you should take your site offline by replacing the index.php file with a static one.

        - - - -

        Step 1: Update your CodeIgniter files

        - -

        Replace these files and directories in your "system" folder with the new versions:

        - -
          - -
        • system/codeigniter
        • -
        • system/database
        • -
        • system/helpers
        • -
        • system/language
        • -
        • system/libraries
        • -
        - -

        Note: If you have any custom developed files in these folders please make copies of them first.

        - - -

        Step 2: Update your Session Table

        - -

        If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. -Here is an example of what this column might look like for MySQL: - -user_data text NOT NULL - -

        To add this column you will run a query similar to this:

        - -ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL - -

        You'll find more information regarding the new Session functionality in the Session class page.

        - - -

        Step 3: Update your user guide

        -

        Please also replace your local copy of the user guide with the new version.

        - -
        - - - - - - - \ No newline at end of file From b1eee3502b1541b2430e4ef0b07fcf98c4f41d20 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 19:56:48 +0000 Subject: [PATCH 1300/2544] --- user_guide/libraries/form_validation.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 1bdc3a41..6ed0b1de 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1027,6 +1027,8 @@

        Prepping Reference

        Function Reference

        +

        The following functions are intended for use in your controller functions.

        +

        $this->form_validation->set_rule();

        Permits you to set validation rules, as described in the tutorial sections above:

        From 66bc2ad56cd7dcaab7f07d5357e25ea577460a8e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 20:18:17 +0000 Subject: [PATCH 1301/2544] --- user_guide/libraries/form_validation.html | 59 ++++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 6ed0b1de..3da5c31f 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -79,6 +79,7 @@

        Form Validation

      • Changing the Error Delimiters
      • Showing Errors Individually
      • Saving Sets of Validation Rules to a Config File
      • +
      • Using Arrays as Field Names
    • Rule Reference
    • @@ -830,9 +831,63 @@

      Associating a Controller Function with a Rule Group

      When a rule group is named identically to a controller class/function it will be used automatically when the run() function is invoked from that class/function.

      +

       

      + + + +

      Using Arrays as Field Names

      + +

      The Form Validation class supports the use of arrays as field names. Consider this example:

      + +<input type="text" name="options[]" value="" size="50" /> + +

      If you do use an array as a field name, you must use the EXACT array name in the Helper Functions that require the field name, +and as your Validation Rule field name.

      + +

      For example, to set a rule for the above field you would use:

      + +$this->form_validation->set_rules('options[]', 'Options', 'required'); + +

      Or, to show an error for the above field you would use:

      + +<?php echo form_error('options[]'); ?> + +

      Or to re-populate the field you would use:

      + +<input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> + +

      You can use multidimensional arrays as field names as well. For example:

      +<input type="text" name="options[size]" value="" size="50" /> + +

      Or even:

      + +<input type="text" name="sports[nba][basketball]" value="" size="50" /> + +

      As with our first example, you must use the exact array name in the helper functions:

      + +<?php echo form_error('sports[nba][basketball]'); ?> + +

      If you are using checkboxes (or other fields) that have multiple options, don't forget to leave an empty bracket after each option, so that all selections will be added to the +POST array:

      + + +<input type="checkbox" name="options[]" value="red" />
      +<input type="checkbox" name="options[]" value="blue" />
      +<input type="checkbox" name="options[]" value="green" /> +
      + +

      Or if you use a multidimensional array:

      + + +<input type="checkbox" name="options[color][]" value="red" />
      +<input type="checkbox" name="options[color][]" value="blue" />
      +<input type="checkbox" name="options[color][]" value="green" /> +
      +

      When you use a helper function you'll include the bracket as well:

      +<?php echo form_error('options[color][]'); ?> @@ -1108,8 +1163,8 @@

      set_checkbox()

      Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

      -<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
      -<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
      +<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
      +<input type="checkbox" name="mycheck[]" value="2" <?php echo set_checkbox('mycheck[]', '2'); ?> />

      set_radio()

      From 1706f606aee70f6e07bdc533f362a69a16856bb6 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 20:19:55 +0000 Subject: [PATCH 1302/2544] --- user_guide/libraries/form_validation.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 3da5c31f..cd5bc2a8 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -493,6 +493,8 @@

      Re-populating the form

      <input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> +

      For more info please see the Using Arrays as Field Names section below.

      + @@ -655,6 +657,7 @@

      Showing Errors Individually

      <input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> +

      For more info please see the Using Arrays as Field Names section below.

      From 126ca8c341f5a1082178e578a875b8e1f7c9e0b3 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 20:54:30 +0000 Subject: [PATCH 1303/2544] --- system/application/config/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/application/config/config.php b/system/application/config/config.php index 16cf6202..71ebd30d 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -11,7 +11,7 @@ | http://example.com/ | */ -$config['base_url'] = "http://127.0.0.1/EllisLab/_Development/CodeIgniter/"; +$config['base_url'] = ""; /* |-------------------------------------------------------------------------- @@ -238,7 +238,7 @@ $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = TRUE; -$config['sess_time_to_update'] = 300; +$config['sess_time_to_update'] = 300; /* |-------------------------------------------------------------------------- From c3907c629799c16d62c7fd1a72fb06cedba80d07 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 26 Aug 2008 20:55:47 +0000 Subject: [PATCH 1304/2544] Switched spaces to tabs --- system/helpers/form_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a96adb97..2f29f1a8 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -53,7 +53,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) $form = '
      (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - if ( ! is_array($data) OR ! isset($data['value'])) + if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } - else + else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute @@ -476,7 +476,7 @@ function form_fieldset($legend_text = '', $attributes = array()) { $fieldset = " 0) From 7926943c3d70c0f87beccd3fad95c23364483bc4 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 27 Aug 2008 06:25:08 +0000 Subject: [PATCH 1305/2544] Fixed a variable that was set wrong --- system/libraries/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 55023573..e5ae3f38 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -909,7 +909,7 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU } // Save the class name and object name - $this->_ci_classes[$class] = $object_name; + $this->_ci_classes[$class] = $classvar; // Instantiate the class $CI =& get_instance(); From 73589031c21a2d5eb05a5dfef0dca14d697ba2c5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 27 Aug 2008 14:03:09 +0000 Subject: [PATCH 1306/2544] Fixed the spelling of "respberry" in config/smileys.php --- system/application/config/smileys.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/application/config/smileys.php b/system/application/config/smileys.php index 9f38d2ca..cddc881c 100644 --- a/system/application/config/smileys.php +++ b/system/application/config/smileys.php @@ -30,7 +30,7 @@ ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), - ':P' => array('rasberry.gif', '19', '19', 'rasberry'), + ':P' => array('raspberry.gif', '19', '19', 'rasberry'), ':blank:' => array('blank.gif', '19', '19', 'blank stare'), ':long:' => array('longface.gif', '19', '19', 'long face'), ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3a19f7f9..afb83ff4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

      Version 1.7

    • Removed added newlines ("\n") from most form and html helper functions.
    • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
    • Updated Date Helper to match the world's current time zones and offsets.
    • +
    • Fixed the spelling of "respberry" in config/smileys.php
  • Other changes From 4f3e46129d4ed11c1a1d1570a6ec0580b0a10dc7 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 27 Aug 2008 14:03:47 +0000 Subject: [PATCH 1307/2544] "raspberry" no "respberry"... sheesh --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index afb83ff4..ee3ff253 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,7 +80,7 @@

    Version 1.7

  • Removed added newlines ("\n") from most form and html helper functions.
  • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
  • Updated Date Helper to match the world's current time zones and offsets.
  • -
  • Fixed the spelling of "respberry" in config/smileys.php
  • +
  • Fixed the spelling of "raspberry" in config/smileys.php
  • Other changes From 9dee6ec7bf77e15a1227785292e507f1a6126a8f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 27 Aug 2008 14:58:12 +0000 Subject: [PATCH 1308/2544] modified regex for image tag sanitization to retain trailing space and closing slash to remain valid XHTML --- system/libraries/Input.php | 2 +- user_guide/changelog.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index ff1dd9b1..dc5b5e5a 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -685,7 +685,7 @@ function xss_clean($str, $is_image = FALSE) if (preg_match("/]*?)(>|$)#si", array($this, '_js_img_removal'), $str); + $str = preg_replace_callback("#]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); } if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ee3ff253..b24b0810 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,13 +91,14 @@

    Version 1.7

  • -

    Bug fixes for 1.6.4

    +

    Bug fixes for 1.7.0

    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • Fixed assorted user guide typos or examples (#4840, #4862, #4864, #4899, #4930, #5006, #5071).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • +
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.

    Version 1.6.3

    From 0c734b52b648fd1c26546306ad578a90ef6f0f72 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 27 Aug 2008 20:24:17 +0000 Subject: [PATCH 1309/2544] added isindex to the list of naughty never allowed tags in xss_clean() --- system/libraries/Input.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index dc5b5e5a..2682ce31 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -728,7 +728,7 @@ function xss_clean($str, $is_image = FALSE) * Becomes: <blink> * */ - $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; + $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); /* diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b24b0810..8675d71b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -87,6 +87,7 @@

    Version 1.7

    • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
    • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
    • +
    • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
    From a5acb737a35215fca563899a7ba49be210706e30 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 27 Aug 2008 21:43:13 +0000 Subject: [PATCH 1310/2544] Fixed an empty string error --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index fd0c22ec..b658011b 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -319,7 +319,7 @@ function run($group = '') } else { - if (isset($_POST[$field])) + if (isset($_POST[$field]) AND $_POST[$field] != "") { $this->_field_data[$field]['postdata'] = $_POST[$field]; } From 7440273900619bee0acad36d20ba3dee22b3bfa3 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 27 Aug 2008 21:46:24 +0000 Subject: [PATCH 1311/2544] Clarified some of the lines of text --- system/language/english/form_validation_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 7ca762d7..2d5e5048 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -12,11 +12,11 @@ $lang['alpha'] = "The %s field may only contain alphabetical characters."; $lang['alpha_numeric'] = "The %s field may only contain alpha-numeric characters."; $lang['alpha_dash'] = "The %s field may only contain alpha-numeric characters, underscores, and dashes."; -$lang['numeric'] = "The %s field must contain a number."; -$lang['is_numeric'] = "The %s field must contain a number."; +$lang['numeric'] = "The %s field must contain only numbers."; +$lang['is_numeric'] = "The %s field must contain only numeric characters."; $lang['integer'] = "The %s field must contain an integer."; $lang['matches'] = "The %s field does not match the %s field."; -$lang['is_natural'] = "The %s field must contain a number."; +$lang['is_natural'] = "The %s field must contain only positive numbers."; $lang['is_natural_no_zero'] = "The %s field must contain a number greater than zero."; From e9ebe1ca6a78c537025d2db3614385fda804a51a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 29 Aug 2008 20:05:34 +0000 Subject: [PATCH 1312/2544] --- user_guide/doc_style/template.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index b267effe..84f559d5 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -64,7 +64,11 @@

    Foo Class

    Usage Heading

    -

    Description of using Foo. Highlight variables and filenames in regular text with the <var> tag, and code using the <dfn> tag.

    +

    Within a text string, highlight variables using <var></var> tags, and highlight code using the <dfn></dfn> tags.

    + +

    Sub-heading

    + +

    Put code examples within <code></code> tags:

    $this->load->library('foo');
    From 92203d685183b1f26ea662e300b5c44b0ed572f2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 31 Aug 2008 04:34:54 +0000 Subject: [PATCH 1313/2544] alt spelling fix --- system/application/config/smileys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/application/config/smileys.php b/system/application/config/smileys.php index cddc881c..b1988cd4 100644 --- a/system/application/config/smileys.php +++ b/system/application/config/smileys.php @@ -30,7 +30,7 @@ ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), - ':P' => array('raspberry.gif', '19', '19', 'rasberry'), + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), ':blank:' => array('blank.gif', '19', '19', 'blank stare'), ':long:' => array('longface.gif', '19', '19', 'long face'), ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), From 5a9fd7a7100535cf62fdffd9d86525d12f8ee09c Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 31 Aug 2008 05:58:32 +0000 Subject: [PATCH 1314/2544] --- user_guide/doc_style/index.html | 8 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 684 +++++++++++++++++++++++++++++ user_guide/nav/nav.js | 4 +- user_guide/toc.html | 3 +- 5 files changed, 697 insertions(+), 4 deletions(-) create mode 100644 user_guide/general/styleguide.html diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 1c0ca518..42ebdd1b 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -71,8 +71,14 @@

    Files

    + diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 301e24f9..036eb103 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -144,7 +144,7 @@

    Best Practices

       ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Benchmarking Class +Next Topic:  PHP Style Guide

    CodeIgniter  ·  Copyright © 2006-2008  ·  Ellislab, Inc.

    diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html new file mode 100644 index 00000000..9d49a9d0 --- /dev/null +++ b/user_guide/general/styleguide.html @@ -0,0 +1,684 @@ + + + + + +Security : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    General Style and Syntax

    + +

    The following page describes the coding rules use adhere to when developing CodeIgniter.

    + + +

    Table of Contents

    + + +

    PHP Closing Tag

    +
    +

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced + by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should + OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. + This allows you to still identify a file as being complete and not truncated.

    +INCORRECT: +<?php + +echo "Here's my code!"; + +?> + +CORRECT: +<?php + +echo "Here's my code!"; + +/* End of file myfile.php */ +/* Location: ./system/modules/mymodule/myfile.php */ + +
    + + +

    Class and Method Naming

    +
    +

    Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

    + + INCORRECT: +class superclass +class SuperClass + +CORRECT: +class Super_class + +

    Notice that the Class and constructor methods are identically named and cased:

    + + class Super_class { + + function Super_class() + { + + } +} + +

    Examples of improper and proper method naming:

    + + INCORRECT: +function fileproperties() // not descriptive and needs underscore separator +function fileProperties() // not descriptive and uses CamelCase +function getfileproperties() // Better! But still missing underscore separator +function getFileProperties() // uses CamelCase +function get_the_file_properties_from_the_file() // wordy + +CORRECT: +function get_file_properties() // descriptive, underscore separator, and all lowercase letters + +
    + + +

    Variable Names

    +
    +

    The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

    +INCORRECT: +$j = 'foo'; // single letter variables should only be used in for() loops +$Str // contains uppercase letters +$bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning +$groupid // multiple words, needs underscore separator +$name_of_last_city_used // too long + +CORRECT: +for ($j = 0; $j < 10; $j++) +$str +$buffer +$group_id +$last_city + +
    + + +

    Commenting

    +
    +

    In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

    + +

    DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:

    + +/** + * Super Class + * + * @package Package Name + * @subpackage Subpackage + * @category Category + * @author Author Name + * @link http://example.com + */ +class Super_class { + +/** + * Encodes string for use in XML + * + * @access public + * @param string + * @return string + */ +function xml_encode($str) + +

    Use single line comments within code, leaving a blank line between large comment blocks and code.

    + +// break up the string by newlines +$parts = explode("\n", $str); + +// A longer comment that needs to give greater detail on what is +// occurring and why can use multiple single-line comments. Try to +// keep the width reasonable, around 70 characters is the easiest to +// read. Don't hesitate to link to permanent external resources +// that may provide greater detail: +// +// http://example.com/information_about_something/in_particular/ + +$parts = $this->foo($parts); + +
    + + +

    Constants

    +
    +

    Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use ExpressionEngine constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

    +INCORRECT: +myConstant // missing underscore separator and not fully uppercase +N // no single-letter constants +S_C_VER // not descriptive +$str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants + +CORRECT: +MY_CONSTANT +NEWLINE +SUPER_CLASS_VERSION +$str = str_replace(LD.'foo'.RD, 'bar', $str); + +
    + + +

    TRUE, FALSE, and NULL

    +
    +

    TRUE, FALSE, and NULL keywords should always be fully uppercase.

    +INCORRECT: +if ($foo == true) +$bar = false; +function foo($bar = null) + +CORRECT: +if ($foo == TRUE) +$bar = FALSE; +function foo($bar = NULL) +
    + + + +

    Logical Operators

    +
    +

    Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). + && is preferred over AND but either are acceptable, and a space should always precede and follow !.

    +INCORRECT: +if ($foo || $bar) +if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications +if (!$foo) +if (! is_array($foo)) + +CORRECT: +if ($foo OR $bar) +if ($foo && $bar) // recommended +if ( ! $foo) +if ( ! is_array($foo)) + +
    + + + +

    Comparing Return Values and Typecasting

    +
    +

    Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

    +

    Use the same stringency in returning and checking your own variables. Use === and !== as necessary. + +INCORRECT: +// If 'foo' is at the beginning of the string, strpos will return a 0, +// resulting in this conditional evaluating as TRUE +if (strpos($str, 'foo') == FALSE) + +CORRECT: +if (strpos($str, 'foo') === FALSE) + + +INCORRECT: +function build_string($str = "") +{ + if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument? + { + + } +} + +CORRECT: +function build_string($str = "") +{ + if ($str === "") + { + + } +} + +

    See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":

    + +$str = (string) $str; // cast $str as a string + +
    + + +

    Debugging Code

    +
    +

    No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

    + +// print_r($foo); +
    + + + +

    Whitespace in Files

    +
    +

    No whitespace can precede the opening PHP tag or follow the closing PHP tag. ExpressionEngine output is buffered, so whitespace in your files can cause output to begin before ExpressionEngine outputs its content, leading to errors and an inability for ExpressionEngine to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

    + +

    INCORRECT:

    + +<?php + // ...there is whitespace and a linebreak above the opening PHP tag + // as well as whitespace after the closing PHP tag +?> + +

    CORRECT:

    +<?php + // this sample has no whitespace before or after the opening and closing PHP tags +?> + +
    + + +

    Compatibility

    +
    +

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    +
    + + +

    Use of $SESS->cache

    +
    +

    $SESS->cache is an array provided for you to use for "flash" content, i.e. values that you would like to persist during a page load, helping you eliminate redundant queries and PHP processing. To avoid conflicts with other first and third-party use of this array, always access it as a multi-dimensional array, using your class name as the primary array name, and your variables within. Naming conventions should follow that of other variables: lowercase letters, underscores for separators between words, and meaningful names.

    + +INCORRECT: +$SESS->cache['admins'] +$SESS->cache['Super_class']['admins'] + +CORRECT: +$SESS->cache['super_class']['admins'] + +

    Here is an example of how one might utilize the $SESS->cache array. This way, no matter how many times this method is called on a given page load (for instance, a tag being used twice on a template, or within a tag that might loop, such as a plugin within the Weblog entries tag), the query and loading of the array occurs only once.

    + +if ( ! isset($SESS->cache['super_class']['admins'])) +{ + $query = $DB->query("SELECT member_id FROM exp_super_class_admins"); + + if ($query->num_rows > 0) + { + foreach ($query->result as $row) + { + $SESS->cache['super_class']['admins'][] = $row['member_id']; + } + } +} + +// set a local variable from the cached global so it's easy to use in the code +$admins = $SESS->cache['super_class']['admins']; + +

    You can see an example of real-world usage of $SESS->cache in the Weblog module's fetch_custom_weblog_fields() and next_prev_entry() methods, and the IP to Nation module's get_country() method.

    + +
    + + + +

    Class and File Names using Common Words

    +
    +

    When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

    + +INCORRECT: +class Email pi.email.php +class Xml ext.xml.php +class Import mod.import.php + +CORRECT: +class Pre_email pi.pre_email.php +class Pre_xml ext.pre_xml.php +class Pre_import mod.pre_import.php + +
    + + +

    Database Table Names

    +
    +

    Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as ExpressionEngine's database class will automatically convert 'exp_' to what is actually being used.

    + +INCORRECT: +email_addresses // missing both prefixes +pre_email_addresses // missing exp_ prefix +exp_email_addresses // missing unique prefix + +CORRECT: +exp_pre_email_addresses + + +

    NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington +

    + + + +

    One File per Class

    +
    +

    Use separate files for each class your add-on uses, unless the classes are closely related. An example of ExpressionEngine files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

    +
    + + + +

    Whitespace

    +
    +

    Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

    +
    + + + +

    Line Breaks

    +
    +

    Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

    +
    + + + +

    Code Indenting

    +
    +

    Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

    + +INCORRECT: +function foo($bar) { + // ... +} + +foreach ($arr as $key => $val) { + // ... +} + +if ($foo == $bar) { + // ... +} else { + // ... +} + +for ($i = 0; $i < 10; $i++) + { + for ($j = 0; $j < 10; $j++) + { + // ... + } + } + +CORRECT: +function foo($bar) +{ + // ... +} + +foreach ($arr as $key => $val) +{ + // ... +} + +if ($foo == $bar) +{ + // ... +} +else +{ + // ... +} + +for ($i = 0; $i < 10; $i++) +{ + for ($j = 0; $j < 10; $j++) + { + // ... + } +} +
    + + +

    Bracket and Parenthetic Spacing

    +
    +

    In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

    + +INCORRECT: +$arr[ $foo ] = 'foo'; + +CORRECT: +$arr[$foo] = 'foo'; // no spaces around array keys + + +INCORRECT: +function foo ( $bar ) +{ + +} + +CORRECT: +function foo($bar) // no spaces around parenthesis in function declarations +{ + +} + + +INCORRECT: +foreach( $query->result as $row ) + +CORRECT: +foreach ($query->result as $row) // single space following PHP control structures, but not in interior parenthesis + +
    + + + +

    Localized Text in Control Panel

    +
    +

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    + +INCORRECT: +return "Invalid Selection"; + +CORRECT: +return $LANG->line('invalid_selection'); +
    + + + +

    Private Methods and Variables

    +
    +

    Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

    + +convert_text() // public method +_convert_text() // private method +
    + + + +

    PHP Errors

    +
    +

    Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

    + +

    Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:

    + +if (ini_get('display_errors') == 1) +{ + exit "Enabled"; +} + +

    On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:

    + +ini_set('display_errors', 1); + +

    NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

    +
    + + + +

    Short Open Tags

    +
    +

    Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

    + +INCORRECT: +<? echo $foo; ?> + +<?=$foo?> + +CORRECT: +<?php echo $foo; ?> +
    + + + +

    One Statement Per Line

    +
    +

    Never combine statements on one line.

    + +INCORRECT: +$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag); + +CORRECT: +$foo = 'this'; +$bar = 'that'; +$bat = str_replace($foo, $bar, $bag); + +
    + + + +

    Strings

    +
    +

    Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

    + +INCORRECT: +"My String" // no variable parsing, so no use for double quotes +"My string $foo" // needs braces +'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly + +CORRECT: +'My String' +"My string {$foo}" +"SELECT foo FROM bar WHERE baz = 'bag'" +
    + + + +

    SQL Queries

    +
    +

    MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

    + +

    Break up long queries into multiple lines for legibility, preferably breaking for each clause.

    + +INCORRECT: +// keywords are lowercase and query is too long for +// a single line (... indicates continuation of line) +$query = $DB->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses +...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); + +CORRECT: +$query = $DB->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz + FROM exp_pre_email_addresses + WHERE foo != 'oof' + AND baz != 'zab' + ORDER BY foobaz + LIMIT 5, 100"); +
    + + + +

    Default Function Arguments

    +
    +

    Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

    + +function foo($bar = '', $baz = FALSE) +
    + + + +

    Overlapping Tag Parameters

    +
    +

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    +
    + + +
    + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index 06f99168..ffcb4d15 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -35,6 +35,7 @@ function create_menu(basepath) '
  • Model-View-Controller
  • ' + '
  • Architectural Goals
  • ' + '' + + '' + @@ -62,6 +63,8 @@ function create_menu(basepath) '
  • Managing Applications
  • ' + '
  • Alternative PHP Syntax
  • ' + '
  • Security
  • ' + + '
  • PHP Style Guide
  • ' + + '
  • Writing Documentation
  • ' + '' + '' + @@ -128,7 +131,6 @@ function create_menu(basepath) '
  • Quick Reference Chart
  • ' + '
  • Community Forums
  • ' + '
  • Community Wiki
  • ' + - '
  • Writing Documentation
  • ' + '' + ''); diff --git a/user_guide/toc.html b/user_guide/toc.html index 45a5df41..9714ad89 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -115,6 +115,8 @@

    General Topics

  • Managing Applications
  • Alternative PHP Syntax
  • Security
  • +
  • PHP Style Guide
  • +
  • Writing Documentation
  • @@ -184,7 +186,6 @@

    Additional Resources

  • Quick Reference Chart
  • Community Forums
  • Community Wiki
  • -
  • Writing Documentation
  • From e08e63dc2e9159f674ab819281a5d03a9aca7d37 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 31 Aug 2008 06:00:09 +0000 Subject: [PATCH 1315/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8675d71b..5e9fc88c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -88,6 +88,7 @@

    Version 1.7

  • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
  • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
  • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
  • +
  • Added PHP Style Guide to docs.
  • From 36bf96b4b9fd0703236cd7cdd1f6027d1391a1fb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 31 Aug 2008 14:08:25 +0000 Subject: [PATCH 1316/2544] updated CI_VERSION --- system/codeigniter/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 39b593d8..32b4017a 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -28,7 +28,7 @@ */ // CI Version -define('CI_VERSION', '1.6.3'); +define('CI_VERSION', '1.7.0'); /* * ------------------------------------------------------ From 53653931de20b3cd41587d02659022e67d1a2d75 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 31 Aug 2008 14:21:46 +0000 Subject: [PATCH 1317/2544] typo fix --- user_guide/helpers/text_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 65b82d8b..28855f4d 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -97,7 +97,7 @@

    character_limiter()

    // Returns: Here is a nice text string…
    -

    The third parameter is an optional suffix added to the string. By default it add an ellipsis.

    +

    The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

    From cb36e34719bf60904bc7fa39dfbcb0fa86310e66 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 31 Aug 2008 14:24:56 +0000 Subject: [PATCH 1318/2544] grammar changes --- system/libraries/URI.php | 2 +- system/libraries/Unit_test.php | 2 +- user_guide/changelog.html | 6 +++--- user_guide/database/queries.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/libraries/input.html | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index c3dfef1d..668b1ee0 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -237,7 +237,7 @@ function _explode_segments() * Re-index Segments * * This function re-indexes the $this->segment array so that it - * starts at 1 rather then 0. Doing so makes it simpler to + * starts at 1 rather than 0. Doing so makes it simpler to * use functions like $this->uri->segment(n) since there is * a 1:1 relationship between the segment array and the actual segments. * diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index e53e04c1..de2ab730 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -150,7 +150,7 @@ function report($result = array()) /** * Use strict comparison * - * Causes the evaluation to use === rather then == + * Causes the evaluation to use === rather than == * * @access public * @param bool diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5e9fc88c..50a3bc78 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,7 +69,7 @@

    Version 1.7

  • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
  • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
  • Added the ability to assign library objects to your own variable names when you use this->load->library(). Please see the Loader class for more info.
  • -
  • Changed the output of the profiler to use style attribute rather then clear, and added the id "codeigniter_profiler" to the container div
  • +
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div
  • Helpers @@ -96,7 +96,7 @@

    Version 1.7

    Bug fixes for 1.7.0

    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4840, #4862, #4864, #4899, #4930, #5006, #5071).
    • +
    • Fixed assorted user guide typos or examples (#4807, #4840, #4862, #4864, #4899, #4930, #5006, #5071).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • @@ -545,7 +545,7 @@

      Version 1.5.2

      • Added subversion information to the downloads page.
      • Added support for captions in the Table Library
      • -
      • Fixed a bug in the download_helper that was causing Internet Explorer to load rather then download
      • +
      • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
      • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
      • Removed unescaped variables in error messages of Input and Router classes
      • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
      • diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index eb4d13e9..1411e65d 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -98,7 +98,7 @@

        Escaping Queries

        $sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
      • $this->db->escape_str() This function escapes the data passed to it, regardless of type. -Most of the time you'll use the above function rather then this one. Use the function like this: +Most of the time you'll use the above function rather than this one. Use the function like this: $sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
      • diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 7ff23ee6..8652aad1 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -62,7 +62,7 @@

        Transactions

        CodeIgniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need -to be running InnoDB or BDB table types rather then the more common MyISAM. Most other database platforms support transactions natively.

        +to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively.

        If you are not familiar with transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 331161a4..80c8ab0d 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -130,7 +130,7 @@

        Regular Expressions

        If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.

        -

        Note:  If you use back-references you must use the dollar syntax rather then the double backslash syntax.

        +

        Note:  If you use back-references you must use the dollar syntax rather than the double backslash syntax.

        A typical RegEx route might look something like this:

        diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index eae3a4d1..ad73dffb 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -120,7 +120,7 @@

        $this->input->xss_clean()

        Using POST, COOKIE, or SERVER Data

        CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided -functions rather then fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and +functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

        From 0134ca4d6be32009c7fb7d40cfdbd31e19b970c3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 31 Aug 2008 14:31:08 +0000 Subject: [PATCH 1319/2544] fixed incorrect example SQL output example --- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 50a3bc78..a54548ed 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -96,7 +96,7 @@

        Version 1.7

        Bug fixes for 1.7.0

        • Fixed bug in xss_clean() that could remove some desirable tag attributes.
        • -
        • Fixed assorted user guide typos or examples (#4807, #4840, #4862, #4864, #4899, #4930, #5006, #5071).
        • +
        • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071).
        • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
        • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
        • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
        • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 3a40dc2c..04e81d8c 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -228,7 +228,7 @@

          $this->db->where();

          $this->db->where('name', $name);
          $this->db->where('title', $title);
          $this->db->where('status', $status); -

          // WHERE = name 'Joe' AND title = 'boss' AND status = 'active'
          +

          // WHERE name 'Joe' AND title = 'boss' AND status = 'active'
        • Custom key/value method: From e0fc57bffe1220b149b3f4f9ed800c8dd356bd57 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 4 Sep 2008 19:29:17 +0000 Subject: [PATCH 1320/2544] removed random invisible character (ASCII 194) from HTML and PHP files --- system/libraries/Input.php | 6 ++--- user_guide/database/active_record.html | 2 +- user_guide/general/common_functions.html | 4 +-- user_guide/helpers/path_helper.html | 6 ++--- user_guide/installation/upgrade_160.html | 4 +-- user_guide/libraries/xmlrpc.html | 32 ++++++++++++------------ 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 2682ce31..8d68f699 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -489,14 +489,14 @@ function filename_security($str) * XSS Clean * * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented.  This function does a fair amount of work but + * prevented. This function does a fair amount of work but * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts.  Nothing is ever 100% foolproof, + * most obscure XSS attempts. Nothing is ever 100% foolproof, * of course, but I haven't been able to get anything passed * the filter. * * Note: This function should only be used to deal with data - * upon submission.  It's not something that should + * upon submission. It's not something that should * be used for general runtime processing. * * This function was based in part on some code and ideas I diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 04e81d8c..77a168fd 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -699,7 +699,7 @@

           Method Chaining

           Active Record Caching

          While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse later. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.

          -

          Cached calls are cumulative.  If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

          +

          Cached calls are cumulative. If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

          $this->db->start_cache()

          This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.

          $this->db->stop_cache()

          diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 65058b9e..432ba02c 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -62,11 +62,11 @@

          is_really_writable('path/to/file')

          is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

          if (is_really_writable('file.txt'))
          {
          -      echo "I could write to this if I wanted to";
          +    echo "I could write to this if I wanted to";
          }
          else
          {
          -      echo "File is not writable";
          +    echo "File is not writable";
          }

          config_item('item_key')

          The Config library is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.

          diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 42f4713d..78815a25 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -73,14 +73,14 @@

          set_realpath()

          Checks to see if the path exists. This function will return a server path without symbolic links or relative directory structures. An optional second argument will cause an error to be triggered if the path cannot be resolved.

          $directory = './../../etc/passwd';
          -echo set_realpath($directory);
          +echo set_realpath($directory);
          // returns "/etc/passwd"

          $non_existent_directory = './../../path/not/found';
          -echo set_realpath($non_existent_directory, TRUE);
          +echo set_realpath($non_existent_directory, TRUE);
          // returns "/path/not/found"

          -echo set_realpath($non_existent_directory, FALSE);
          +echo set_realpath($non_existent_directory, FALSE);
          // returns an error, as the path could not be resolved

           

  • diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index a62ae57a..f9b4c3b9 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -84,11 +84,11 @@

    Step 3: Add $autoload['model']

    Add the following to system/application/autoload.php

    /*
    | -------------------------------------------------------------------
    - |  Auto-load Model files
    + | Auto-load Model files
    | -------------------------------------------------------------------
    | Prototype:
    |
    - |    $autoload['model'] = array('my_model');
    + | $autoload['model'] = array('my_model');
    |
    */

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 7e57b551..9c1b7145 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -403,22 +403,22 @@

    Using Associative Arrays In a Request Parameter

    If you wish to use an associative array in your method parameters you will need to use a struct datatype:

    $request = array(
    -                  array(
    -                        // Param 0
    -                        array(
    -                              'name'=>'John'
    -                              ),
    -                              'struct'
    -                        ),
    -                        array(
    -                              // Param 1
    -                              array(
    -                                    'size'=>'large',
    -                                    'shape'=>'round'
    -                                    ),
    -                              'struct'
    -                        )
    -                  );
    +                  array(
    +                        // Param 0
    +                        array(
    +                              'name'=>'John'
    +                              ),
    +                              'struct'
    +                        ),
    +                        array(
    +                              // Param 1
    +                              array(
    +                                    'size'=>'large',
    +                                    'shape'=>'round'
    +                                    ),
    +                              'struct'
    +                        )
    +                  );
    $this->xmlrpc->request($request);

    You can retrieve the associative array when processing the request in the Server.

    From 088e42cbb9835b44aa0c55c858dadd58e1361c2a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 4 Sep 2008 22:15:04 +0000 Subject: [PATCH 1321/2544] removed superfluous "the" --- user_guide/libraries/pagination.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3e50084c..452a4d21 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -100,7 +100,7 @@

    Notes:

    Setting preferences in a config file

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the pagination.php, add the $config +Simply create a new file called pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

    From 1e50dca196e2fcadaf730b2b4e33d12fdc8e8d63 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Sep 2008 20:28:57 +0000 Subject: [PATCH 1322/2544] --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a54548ed..0f2d3ccc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,7 +68,7 @@

    Version 1.7

  • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
  • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
  • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
  • -
  • Added the ability to assign library objects to your own variable names when you use this->load->library(). Please see the Loader class for more info.
  • +
  • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div
  • From f06446e2d3d9def2e176260f68ce051c62ef7f87 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Sep 2008 20:36:27 +0000 Subject: [PATCH 1323/2544] --- user_guide/general/styleguide.html | 57 ++++++------------------------ 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 9d49a9d0..e3c41371 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -80,7 +80,6 @@

    Table of Contents

  • Debugging Code
  • Whitespace in Files
  • Compatibility
  • -
  • Use of $SESS->cache
  • Class and File Names using Common Words
  • Database Table Names
  • One File per Class
  • @@ -348,41 +347,7 @@

    Compatibility

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    - - -

    Use of $SESS->cache

    -
    -

    $SESS->cache is an array provided for you to use for "flash" content, i.e. values that you would like to persist during a page load, helping you eliminate redundant queries and PHP processing. To avoid conflicts with other first and third-party use of this array, always access it as a multi-dimensional array, using your class name as the primary array name, and your variables within. Naming conventions should follow that of other variables: lowercase letters, underscores for separators between words, and meaningful names.

    - -INCORRECT: -$SESS->cache['admins'] -$SESS->cache['Super_class']['admins'] - -CORRECT: -$SESS->cache['super_class']['admins'] - -

    Here is an example of how one might utilize the $SESS->cache array. This way, no matter how many times this method is called on a given page load (for instance, a tag being used twice on a template, or within a tag that might loop, such as a plugin within the Weblog entries tag), the query and loading of the array occurs only once.

    - -if ( ! isset($SESS->cache['super_class']['admins'])) -{ - $query = $DB->query("SELECT member_id FROM exp_super_class_admins"); - - if ($query->num_rows > 0) - { - foreach ($query->result as $row) - { - $SESS->cache['super_class']['admins'][] = $row['member_id']; - } - } -} - -// set a local variable from the cached global so it's easy to use in the code -$admins = $SESS->cache['super_class']['admins']; - -

    You can see an example of real-world usage of $SESS->cache in the Weblog module's fetch_custom_weblog_fields() and next_prev_entry() methods, and the IP to Nation module's get_country() method.

    -
    -

    Class and File Names using Common Words

    @@ -506,7 +471,7 @@

    Bracket and Parenthetic Spacing

    $arr[ $foo ] = 'foo'; CORRECT: -$arr[$foo] = 'foo'; // no spaces around array keys +$arr[$foo] = 'foo'; // no spaces around array keys INCORRECT: @@ -516,17 +481,17 @@

    Bracket and Parenthetic Spacing

    } CORRECT: -function foo($bar) // no spaces around parenthesis in function declarations +function foo($bar) // no spaces around parenthesis in function declarations { } INCORRECT: -foreach( $query->result as $row ) +foreach( $query->result() as $row ) CORRECT: -foreach ($query->result as $row) // single space following PHP control structures, but not in interior parenthesis +foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis
    @@ -632,16 +597,16 @@

    SQL Queries

    INCORRECT: // keywords are lowercase and query is too long for // a single line (... indicates continuation of line) -$query = $DB->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses +$query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses ...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); CORRECT: -$query = $DB->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz - FROM exp_pre_email_addresses - WHERE foo != 'oof' - AND baz != 'zab' - ORDER BY foobaz - LIMIT 5, 100"); +$query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz + FROM exp_pre_email_addresses + WHERE foo != 'oof' + AND baz != 'zab' + ORDER BY foobaz + LIMIT 5, 100");
    From 1b9ff10a6cfff72a69ebae1135987fd519b3335a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Sep 2008 20:38:33 +0000 Subject: [PATCH 1324/2544] Removed quick reference from table of contents, as it's from version 1.3. Much has changed since then. --- user_guide/nav/nav.js | 1 - 1 file changed, 1 deletion(-) diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ffcb4d15..99cc954b 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -128,7 +128,6 @@ function create_menu(basepath) '

    Additional Resources

    ' + '' + From 80228e3ac50d804b67f6664ecbcd73dd58452bc5 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Sep 2008 20:38:55 +0000 Subject: [PATCH 1325/2544] Removed quick reference from table of contents, as it's from version 1.3. Much has changed since then. --- user_guide/toc.html | 1 - 1 file changed, 1 deletion(-) diff --git a/user_guide/toc.html b/user_guide/toc.html index 9714ad89..5e2637ee 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -183,7 +183,6 @@

    Helper Reference

    Additional Resources

    From 9056b564b6c02e8e5246d94685e84d333641a009 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 9 Sep 2008 20:42:33 +0000 Subject: [PATCH 1326/2544] Allowed empty rules to be set, and fixed a bug that allows blank error messages to output the delimiters. --- system/libraries/Form_validation.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index b658011b..e8ba4e0d 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -96,8 +96,8 @@ function set_rules($field, $label = '', $rules = '') return; } - // No rules or fields? Nothing to do... - if ( ! is_string($field) OR ! is_string($rules) OR $field == '' OR $rules == '') + // No fields? Nothing to do... + if ( ! is_string($field) OR ! is_string($rules) OR $field == '') { return; } @@ -197,7 +197,7 @@ function set_error_delimiters($prefix = '

    ', $suffix = '

    ') */ function error($field = '', $prefix = '', $suffix = '') { - if ( ! isset($this->_field_data[$field]['error'])) + if ( ! isset($this->_field_data[$field]['error']) OR $this->_field_data[$field]['error'] == '') { return ''; } @@ -249,7 +249,10 @@ function error_string($prefix = '', $suffix = '') $str = ''; foreach ($this->_error_array as $val) { - $str .= $prefix.$val.$suffix."\n"; + if ($val != '') + { + $str .= $prefix.$val.$suffix."\n"; + } } return $str; From f5c7a6f44a46ab979dbf4e0b7eb336e32f26f93d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 10 Sep 2008 22:12:51 +0000 Subject: [PATCH 1327/2544] Did some reorganizing --- user_guide/general/controllers.html | 4 +- user_guide/general/index.html | 94 -------------------------- user_guide/general/reserved_names.html | 4 +- user_guide/general/urls.html | 4 +- user_guide/general/views.html | 2 +- user_guide/nav/nav.js | 4 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/toc.html | 4 +- 8 files changed, 11 insertions(+), 107 deletions(-) delete mode 100644 user_guide/general/index.html diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 3b660d27..cb7f80ea 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -373,11 +373,11 @@

    That's it!

    diff --git a/user_guide/general/index.html b/user_guide/general/index.html deleted file mode 100644 index f271b12b..00000000 --- a/user_guide/general/index.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - -Getting Started With CodeIgniter : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Getting Started With CodeIgniter

    - -

    Any software application requires some effort to learn. We've done our best to minimize the learning -curve while making the process as enjoyable as possible. -

    - -

    The first step is to install CodeIgniter, then read -all the topics in the Introduction section of the Table of Contents.

    - -

    Next, read each of the General Topics pages in order. -Each topic builds on the previous one, and includes code examples that you are encouraged to try.

    - -

    Once you understand the basics you'll be ready to explore the Class Reference and -Helper Reference pages to learn to utilize the native libraries and helper files.

    - -

    Feel free to take advantage of our Community Forums -if you have questions or problems, and -our Wiki to see code examples posted by other users.

    - - -
    - - - - - - - \ No newline at end of file diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 39e1a9f1..10c44747 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -143,11 +143,11 @@

    Constants

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index e0b130e4..36e19d6c 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -141,11 +141,9 @@

    Enabling Query Strings

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index a5ffa08b..e422c7eb 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -253,7 +253,7 @@

    Creating Loops

    From 277451a42c8fac9c4dfc8f4d4c54e0e7a19e0dc1 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 20 Sep 2008 03:42:20 +0000 Subject: [PATCH 1357/2544] Added the ability to set translatable field names --- system/libraries/Form_validation.php | 34 +++++++++++++++++++---- user_guide/libraries/form_validation.html | 25 ++++++++++++++++- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index c2749a0c..1ba98bef 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -504,11 +504,11 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } else { - $line = $this->_error_messages['isset']; + $line = $this->_translate_fieldname('isset'); } // Build the error message - $message = sprintf($line, $row['label']); + $message = sprintf($line, $this->_translate_fieldname($row['label'])); // Save the error message $this->_field_data[$row['field']]['error'] = $message; @@ -646,11 +646,11 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } else { - $line = $this->_error_messages[$rule]; + $line = $this->_translate_fieldname($rule); } // Build the error message - $message = sprintf($line, $row['label'], $param); + $message = sprintf($line, $this->_translate_fieldname($row['label']), $param); // Save the error message $this->_field_data[$row['field']]['error'] = $message; @@ -663,7 +663,31 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) return; } } - } + } + + // -------------------------------------------------------------------- + + /** + * Translate a field name + * + * @access private + * @param string the field name + * @return string + */ + function _translate_fieldname($fieldname) + { + // Do we need to translate the field name? + // We look for the prefix lang: to determine this + if (substr($fieldname, 0, 5) == 'lang:') + { + $label = $this->CI->lang->line(substr($fieldname, 5)); + + // Were we able to translate the field name? + $fieldname = ($label === FALSE) ? substr($fieldname, 5) : $label; + } + + return $fieldname; + } // -------------------------------------------------------------------- diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index cd5bc2a8..f7fede67 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -77,6 +77,7 @@

    Form Validation

  • Callbacks
  • Setting Error Messages
  • Changing the Error Delimiters
  • +
  • Translating Field Names
  • Showing Errors Individually
  • Saving Sets of Validation Rules to a Config File
  • Using Arrays as Field Names
  • @@ -296,7 +297,7 @@

    Setting Validation Rules

    1. The field name - the exact name you've given the form field.
    2. -
    3. A "human" name for this field, which will be inserted into the error message. For example, if your field is named "user" you might give it a human name of "Username".
    4. +
    5. A "human" name for this field, which will be inserted into the error message. For example, if your field is named "user" you might give it a human name of "Username". Note: If you would like the field name to be stored in a language file, please see Translating Field Names.
    6. The validation rules for this form field.
    @@ -590,6 +591,28 @@

    Setting Error Messages

    + +

    Translating Field Names

    + +

    If you would like to store the "human" name you passed to the set_rules() function in a language file, and therefore make the name able to be translated, here's how:

    + +

    First, prefix your "human" name with lang:, as in this example:

    + + +$this->form_validation->set_rules('first_name', 'lang:first_name', 'required');
    +
    + +

    Then, store the name in one of your language file arrays (without the prefix):

    + +$lang['first_name'] = 'First Name'; + +

    Note: If you store your array item in a language file that is not loaded automatically by CI, you'll need to remember to load it in your controller using:

    + +$this->lang->load('file_name'); + +

    See the Language Class page for more info regarding language files.

    + +

    Changing the Error Delimiters

    From 32f84f1a60a8db1d923f28c3a6afc54fa11edb6f Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 20 Sep 2008 04:21:27 +0000 Subject: [PATCH 1358/2544] Removed the strict param from in_array in some of the tests as this was causing problems --- system/libraries/Form_validation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 1ba98bef..fe750277 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -740,7 +740,7 @@ function set_select($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } @@ -784,7 +784,7 @@ function set_radio($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } @@ -828,7 +828,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } From 7129d4565a0a4e7b4899deb0aee1fb1d683a7bed Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 20 Sep 2008 04:22:25 +0000 Subject: [PATCH 1359/2544] Removed the strict param from in_array() as this was causing some trouble with numeric field names --- system/helpers/form_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 9bec8116..81331cda 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -640,7 +640,7 @@ function set_select($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } @@ -681,7 +681,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) $OBJ =& _get_validation_object(); if ($OBJ === FALSE) - { + { if ( ! isset($_POST[$field])) { if (count($_POST) === 0) @@ -695,7 +695,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } @@ -750,7 +750,7 @@ function set_radio($field = '', $value = '', $default = FALSE) if (is_array($field)) { - if ( ! in_array($value, $field, TRUE)) + if ( ! in_array($value, $field)) { return ''; } From 53b70e19ae8685a95a5d6b7651746279d350407e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 20 Sep 2008 04:48:14 +0000 Subject: [PATCH 1360/2544] Added the ability to use callbacks even when a field has no data --- system/libraries/Form_validation.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index fe750277..6ef11e34 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -479,19 +479,29 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) return; } - + // -------------------------------------------------------------------- // If the field is blank, but NOT required, no further tests are necessary - if ( ! in_array('required', $rules, TRUE) AND is_null($postdata)) + $callback = FALSE; + if ( ! in_array('required', $rules) AND is_null($postdata)) { - return; + // Before we bail out, does the rule contain a callback? + if (preg_match("/(callback_\w+)/", implode(' ', $rules), $match)) + { + $callback = TRUE; + $rules = (array('1' => $match[1])); + } + else + { + return; + } } // -------------------------------------------------------------------- // Isset Test. Typically this rule will only apply to checkboxes. - if (is_null($postdata)) + if (is_null($postdata) AND $callback == FALSE) { if (in_array('isset', $rules, TRUE) OR in_array('required', $rules)) { From 3204f1f9c5dc0fe687e824fa4ff1816484b8a18f Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 21 Sep 2008 19:06:53 +0000 Subject: [PATCH 1361/2544] removed a call to the validation class, as it's overkill for a simple preg_match --- system/libraries/Encrypt.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 6d0735a0..aabf90d0 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -141,9 +141,7 @@ function decode($string, $key = '') { $key = $this->get_key($key); - $this->CI->load->library('validation'); - - if ($this->CI->validation->valid_base64($string) === FALSE) + if ( ! preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) { return FALSE; } From d81eb9513bd983351024f1719455a32c5328bfb0 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 21 Sep 2008 19:33:43 +0000 Subject: [PATCH 1362/2544] Added line of text for new profiler block --- system/language/english/profiler_lang.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index e60304bb..ea6e4144 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -1,5 +1,6 @@ Date: Sun, 21 Sep 2008 19:34:01 +0000 Subject: [PATCH 1363/2544] Added controller class/method info to profiler --- system/libraries/Profiler.php | 43 +++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 94eef39a..55ad1e3c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008, EllisLab, Inc. + * @copyright Copyright (c) 2006, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 @@ -230,7 +230,6 @@ function _compile_post() $key = "'".$key."'"; } -// $output .= "$_POST[".$key."]  ".htmlspecialchars(stripslashes($val))."\n"; $output .= "$_POST[".$key."]   "; if (is_array($val)) { @@ -282,6 +281,29 @@ function _compile_uri_string() // -------------------------------------------------------------------- + /** + * Show the controller and function that were called + * + * @access private + * @return string + */ + function _compile_controller_info() + { + $output = "\n\n"; + $output .= '
    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_controller_info').'  '; + $output .= "\n"; + + $output .= "
    ".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."
    "; + + + $output .= "
    "; + + return $output; + } + // -------------------------------------------------------------------- + /** * Compile memory usage * @@ -293,18 +315,18 @@ function _compile_uri_string() function _compile_memory_usage() { $output = "\n\n"; - $output .= '
    '; + $output .= '
    '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; + $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; $output .= "\n"; if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') { - $output .= "
    ".number_format($usage).' bytes
    '; + $output .= "
    ".number_format($usage).' bytes
    '; } else { - $output .= "
    ".$this->CI->lang->line('profiler_no_memory_usage')."
    "; + $output .= "
    ".$this->CI->lang->line('profiler_no_memory_usage')."
    "; } $output .= "
    "; @@ -322,12 +344,13 @@ function _compile_memory_usage() */ function run() { - $output = '
    '; - $output .= "
    "; - + $output = '
    '; + $output .= "
    "; + + $output .= $this->_compile_uri_string(); + $output .= $this->_compile_controller_info(); $output .= $this->_compile_memory_usage(); $output .= $this->_compile_benchmarks(); - $output .= $this->_compile_uri_string(); $output .= $this->_compile_get(); $output .= $this->_compile_post(); $output .= $this->_compile_queries(); From beecd3221a5adb3f24fe7f06c0607091f75d0a5a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sun, 21 Sep 2008 19:36:30 +0000 Subject: [PATCH 1364/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3e9eb74f..9cae52f6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

    Version 1.7

  • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
  • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
  • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
  • +
  • Added controller class/method info to Profiler class.
  • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div
  • From aef13d9f7b6bd118cbf26cf27d98b18587572e2f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 22 Sep 2008 13:31:05 +0000 Subject: [PATCH 1365/2544] fix up file path reference in comment --- system/language/english/form_validation_lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 2d5e5048..c157fe4e 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -20,5 +20,5 @@ $lang['is_natural_no_zero'] = "The %s field must contain a number greater than zero."; -/* End of file validation_lang.php */ -/* Location: ./system/language/english/validation_lang.php */ \ No newline at end of file +/* End of file form_validation_lang.php */ +/* Location: ./system/language/english/form_validation_lang.php */ \ No newline at end of file From 968b6160fc214219e9f15fe8e47acbe066f41a35 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 22 Sep 2008 13:49:46 +0000 Subject: [PATCH 1366/2544] typos, html validation --- user_guide/libraries/form_validation.html | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index f7fede67..04074bfb 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -293,7 +293,7 @@

    Setting Validation Rules

    $this->form_validation->set_rules(); -

    The above function takes three parameters as input:

    +

    The above function takes three parameters as input:

    1. The field name - the exact name you've given the form field.
    2. @@ -625,19 +625,19 @@

      Changing the Error Delimiters

      To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:

      -<?php echo $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); +$this->form_validation->set_error_delimiters('<div class="error">', '</div>');

      In this example, we've switched to using div tags.

      -
    3. Changing delimiters Individually

      +
    4. Changing delimiters Individually

      Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:

      <?php echo form_error('field name', '<div class="error">', '</div>'); ?> -

      Or:

      +

      Or:

      <?php echo validation_errors('<div class="error">', '</div>'); ?> @@ -826,7 +826,7 @@

      Associating a Controller Function with a Rule Group

      }
      ?> -

      In your validation config file, you will name your rule group member/signup: +

      In your validation config file, you will name your rule group member/signup:

      $config = array(
      @@ -1202,12 +1202,6 @@

      set_radio()

      - - - - - -
    From 39f6f5a7eafe05b6388833149c23cad809de53f6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 22 Sep 2008 16:06:06 +0000 Subject: [PATCH 1367/2544] minor whitespace cleanup --- system/helpers/form_helper.php | 237 +++++++++++++++++---------------- 1 file changed, 119 insertions(+), 118 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 81331cda..fc259224 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -61,11 +61,11 @@ function form_open($action = '', $attributes = '', $hidden = array()) { $form .= form_hidden($hidden); } - + return $form; } } - + // ------------------------------------------------------------------------ /** @@ -78,7 +78,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) * @param array a key/value pair of attributes * @param array a key/value pair hidden data * @return string - */ + */ if ( ! function_exists('form_open_multipart')) { function form_open_multipart($action, $attributes = array(), $hidden = array()) @@ -87,7 +87,7 @@ function form_open_multipart($action, $attributes = array(), $hidden = array()) return form_open($action, $attributes, $hidden); } } - + // ------------------------------------------------------------------------ /** @@ -100,7 +100,7 @@ function form_open_multipart($action, $attributes = array(), $hidden = array()) * @param mixed * @param string * @return string - */ + */ if ( ! function_exists('form_hidden')) { function form_hidden($name, $value = '') @@ -111,17 +111,17 @@ function form_hidden($name, $value = '') } $form = ''; - + foreach ($name as $name => $value) { $form .= "\n"; $form .= ''; } - + return $form; } } - + // ------------------------------------------------------------------------ /** @@ -132,7 +132,7 @@ function form_hidden($name, $value = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_input')) { function form_input($data = '', $value = '', $extra = '') @@ -142,7 +142,7 @@ function form_input($data = '', $value = '', $extra = '') return ""; } } - + // ------------------------------------------------------------------------ /** @@ -155,7 +155,7 @@ function form_input($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_password')) { function form_password($data = '', $value = '', $extra = '') @@ -169,7 +169,7 @@ function form_password($data = '', $value = '', $extra = '') return form_input($data, $value, $extra); } } - + // ------------------------------------------------------------------------ /** @@ -182,7 +182,7 @@ function form_password($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_upload')) { function form_upload($data = '', $value = '', $extra = '') @@ -196,7 +196,7 @@ function form_upload($data = '', $value = '', $extra = '') return form_input($data, $value, $extra); } } - + // ------------------------------------------------------------------------ /** @@ -207,13 +207,13 @@ function form_upload($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_textarea')) { function form_textarea($data = '', $value = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - + if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; @@ -223,11 +223,11 @@ function form_textarea($data = '', $value = '', $extra = '') $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } - + return ""; } } - + // ------------------------------------------------------------------------ /** @@ -239,7 +239,7 @@ function form_textarea($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_dropdown')) { function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') @@ -248,7 +248,7 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext { $selected = array($selected); } - + // If no selected state was submitted we will attempt to set it automatically if (count($selected) === 0) { @@ -269,18 +269,18 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext { $key = (string) $key; $val = (string) $val; - + $sel = (in_array($key, $selected))?' selected="selected"':''; - + $form .= '\n"; } $form .= ''; - + return $form; } } - + // ------------------------------------------------------------------------ /** @@ -292,17 +292,17 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext * @param bool * @param string * @return string - */ + */ if ( ! function_exists('form_checkbox')) { function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - + if (is_array($data) AND array_key_exists('checked', $data)) { $checked = $data['checked']; - + if ($checked == FALSE) { unset($data['checked']); @@ -312,7 +312,7 @@ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') $data['checked'] = 'checked'; } } - + if ($checked == TRUE) { $defaults['checked'] = 'checked'; @@ -325,7 +325,7 @@ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') return ""; } } - + // ------------------------------------------------------------------------ /** @@ -337,7 +337,7 @@ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') * @param bool * @param string * @return string - */ + */ if ( ! function_exists('form_radio')) { function form_radio($data = '', $value = '', $checked = FALSE, $extra = '') @@ -351,7 +351,7 @@ function form_radio($data = '', $value = '', $checked = FALSE, $extra = '') return form_checkbox($data, $value, $checked, $extra); } } - + // ------------------------------------------------------------------------ /** @@ -383,7 +383,7 @@ function form_submit($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_reset')) { function form_reset($data = '', $value = '', $extra = '') @@ -404,19 +404,19 @@ function form_reset($data = '', $value = '', $extra = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_button')) { function form_button($data = '', $content = '', $extra = '') { $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit'); - + if ( is_array($data) AND isset($data['content'])) { $content = $data['content']; unset($data['content']); // content is not an attribute } - + return ""; } } @@ -431,19 +431,19 @@ function form_button($data = '', $content = '', $extra = '') * @param string The id the label applies to * @param string Additional attributes * @return string - */ + */ if ( ! function_exists('form_label')) { function form_label($label_text = '', $id = '', $attributes = array()) { $label = ' 0) { foreach ($attributes as $key => $val) @@ -469,7 +469,7 @@ function form_label($label_text = '', $id = '', $attributes = array()) * @param string The legend text * @param string Additional attributes * @return string - */ + */ if ( ! function_exists('form_fieldset')) { function form_fieldset($legend_text = '', $attributes = array()) @@ -477,9 +477,9 @@ function form_fieldset($legend_text = '', $attributes = array()) $fieldset = "".$extra; } } - + // ------------------------------------------------------------------------ /** @@ -514,7 +514,7 @@ function form_fieldset_close($extra = '') * @access public * @param string * @return string - */ + */ if ( ! function_exists('form_close')) { function form_close($extra = '') @@ -522,7 +522,7 @@ function form_close($extra = '') return "".$extra; } } - + // ------------------------------------------------------------------------ /** @@ -533,7 +533,7 @@ function form_close($extra = '') * @access public * @param string * @return string - */ + */ if ( ! function_exists('form_prep')) { function form_prep($str = '') @@ -545,17 +545,17 @@ function form_prep($str = '') { $str[$key] = form_prep($val); } - + return $str; } - + if ($str === '') { return ''; } $temp = '__TEMP_AMPERSANDS__'; - + // Replace entities to temporary markers so that // htmlspecialchars won't mess them up $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); @@ -564,13 +564,13 @@ function form_prep($str = '') $str = htmlspecialchars($str); // In case htmlspecialchars misses these. - $str = str_replace(array("'", '"'), array("'", """), $str); - + $str = str_replace(array("'", '"'), array("'", """), $str); + // Decode the temp markers back to entities $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;",$str); - - return $str; + $str = preg_replace("/$temp(\w+);/","&\\1;",$str); + + return $str; } } @@ -586,7 +586,7 @@ function form_prep($str = '') * @access public * @param string * @return mixed - */ + */ if ( ! function_exists('set_value')) { function set_value($field = '', $default = '') @@ -597,10 +597,10 @@ function set_value($field = '', $default = '') { return $default; } - + return $_POST[$field]; } - + return $OBJ->set_value($field, $default); } } @@ -618,7 +618,7 @@ function set_value($field = '', $default = '') * @param string * @param bool * @return string - */ + */ if ( ! function_exists('set_select')) { function set_select($field = '', $value = '', $default = FALSE) @@ -635,9 +635,9 @@ function set_select($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $_POST[$field]; - + if (is_array($field)) { if ( ! in_array($value, $field)) @@ -652,10 +652,10 @@ function set_select($field = '', $value = '', $default = FALSE) return ''; } } - + return ' selected="selected"'; } - + return $OBJ->set_select($field, $value, $default); } } @@ -673,7 +673,7 @@ function set_select($field = '', $value = '', $default = FALSE) * @param string * @param bool * @return string - */ + */ if ( ! function_exists('set_checkbox')) { function set_checkbox($field = '', $value = '', $default = FALSE) @@ -690,7 +690,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $_POST[$field]; if (is_array($field)) @@ -707,10 +707,10 @@ function set_checkbox($field = '', $value = '', $default = FALSE) return ''; } } - + return ' checked="checked"'; } - + return $OBJ->set_checkbox($field, $value, $default); } } @@ -728,7 +728,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) * @param string * @param bool * @return string - */ + */ if ( ! function_exists('set_radio')) { function set_radio($field = '', $value = '', $default = FALSE) @@ -745,7 +745,7 @@ function set_radio($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $_POST[$field]; if (is_array($field)) @@ -762,10 +762,10 @@ function set_radio($field = '', $value = '', $default = FALSE) return ''; } } - + return ' checked="checked"'; } - + return $OBJ->set_radio($field, $value, $default); } } @@ -783,7 +783,7 @@ function set_radio($field = '', $value = '', $default = FALSE) * @param string * @param string * @return string - */ + */ if ( ! function_exists('form_error')) { function form_error($field = '', $prefix = '', $suffix = '') @@ -792,7 +792,7 @@ function form_error($field = '', $prefix = '', $suffix = '') { return ''; } - + return $OBJ->error($field, $prefix, $suffix); } } @@ -809,7 +809,7 @@ function form_error($field = '', $prefix = '', $suffix = '') * @param string * @param string * @return string - */ + */ if ( ! function_exists('validation_errors')) { function validation_errors($prefix = '', $suffix = '') @@ -818,7 +818,7 @@ function validation_errors($prefix = '', $suffix = '') { return ''; } - + return $OBJ->error_string($prefix, $suffix); } } @@ -834,7 +834,7 @@ function validation_errors($prefix = '', $suffix = '') * @param array * @param array * @return string - */ + */ if ( ! function_exists('_parse_form_attributes')) { function _parse_form_attributes($attributes, $default) @@ -849,21 +849,22 @@ function _parse_form_attributes($attributes, $default) unset($attributes[$key]); } } - + if (count($attributes) > 0) - { + { $default = array_merge($default, $attributes); } } - + $att = ''; + foreach ($default as $key => $val) { if ($key == 'value') { $val = form_prep($val); } - + $att .= $key . '="' . $val . '" '; } @@ -882,43 +883,43 @@ function _parse_form_attributes($attributes, $default) * @param mixed * @param bool * @return string - */ + */ if ( ! function_exists('_attributes_to_string')) { function _attributes_to_string($attributes, $formtag = FALSE) { - if (is_string($attributes) AND strlen($attributes) > 0) - { - if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE) - { - $attributes .= ' method="post"'; - } - - return ' '.$attributes; - } - - if (is_object($attributes) AND count($attributes) > 0) - { - $attributes = (array)$attributes; - } - - if (is_array($attributes) AND count($attributes) > 0) - { - $atts = ''; - - if ( ! isset($attributes['method']) AND $formtag === TRUE) - { - $atts .= ' method="post"'; - } + if (is_string($attributes) AND strlen($attributes) > 0) + { + if ($formtag == TRUE AND strpos($attributes, 'method=') === FALSE) + { + $attributes .= ' method="post"'; + } + + return ' '.$attributes; + } - foreach ($attributes as $key => $val) - { - $atts .= ' '.$key.'="'.$val.'"'; - } - - return $atts; - } - } + if (is_object($attributes) AND count($attributes) > 0) + { + $attributes = (array)$attributes; + } + + if (is_array($attributes) AND count($attributes) > 0) + { + $atts = ''; + + if ( ! isset($attributes['method']) AND $formtag === TRUE) + { + $atts .= ' method="post"'; + } + + foreach ($attributes as $key => $val) + { + $atts .= ' '.$key.'="'.$val.'"'; + } + + return $atts; + } + } } // ------------------------------------------------------------------------ @@ -931,28 +932,28 @@ function _attributes_to_string($attributes, $formtag = FALSE) * * @access private * @return mixed - */ + */ if ( ! function_exists('_get_validation_object')) -{ +{ function &_get_validation_object() { $CI =& get_instance(); - + // We set this as a variable since we're returning by reference $return = FALSE; - + if ( ! isset($CI->load->_ci_classes) OR ! isset($CI->load->_ci_classes['form_validation'])) { return $return; } - + $object = $CI->load->_ci_classes['form_validation']; - + if ( ! isset($CI->$object) OR ! is_object($CI->$object)) { return $return; } - + return $CI->$object; } } From fe61d63138f4534125e2250cc2f6809613fe9e90 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 22 Sep 2008 21:55:12 +0000 Subject: [PATCH 1368/2544] Fixed a language bug when setting errors manually --- system/libraries/Form_validation.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 6ef11e34..42ce433c 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -690,13 +690,22 @@ function _translate_fieldname($fieldname) // We look for the prefix lang: to determine this if (substr($fieldname, 0, 5) == 'lang:') { - $label = $this->CI->lang->line(substr($fieldname, 5)); + $line = substr($fieldname, 5); + + $fieldname = $this->CI->lang->line($line); // Were we able to translate the field name? - $fieldname = ($label === FALSE) ? substr($fieldname, 5) : $label; + if ($fieldname === FALSE) + { + return $this->CI->lang->line($line); + } + else + { + return $label; + } } - return $fieldname; + return $this->CI->lang->line($fieldname); } // -------------------------------------------------------------------- From 193743a4a65cee93941022896be6791cbadb979a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 22 Sep 2008 21:55:41 +0000 Subject: [PATCH 1369/2544] Oops... fixed the fix I just fixed... --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 42ce433c..427e62f7 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -701,7 +701,7 @@ function _translate_fieldname($fieldname) } else { - return $label; + return $fieldname; } } From 066954088c74cc4eaa1d46a6193b2ed45dcf13ff Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 22 Sep 2008 21:58:10 +0000 Subject: [PATCH 1370/2544] One more tweak... --- system/libraries/Form_validation.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 427e62f7..643aecbc 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -690,14 +690,16 @@ function _translate_fieldname($fieldname) // We look for the prefix lang: to determine this if (substr($fieldname, 0, 5) == 'lang:') { + // Grab the variable $line = substr($fieldname, 5); - + + // Translate it $fieldname = $this->CI->lang->line($line); // Were we able to translate the field name? if ($fieldname === FALSE) { - return $this->CI->lang->line($line); + return $line; } else { From 96fabe576f4caf78d3c3af759d2d03bab64801f9 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 23 Sep 2008 01:18:36 +0000 Subject: [PATCH 1371/2544] Fixed a boneheaded mistake I made... --- system/libraries/Form_validation.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 643aecbc..f0c1500d 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -514,7 +514,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } else { - $line = $this->_translate_fieldname('isset'); + $line = $this->_error_messages[$rule]; } // Build the error message @@ -646,7 +646,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) // Did the rule test negatively? If so, grab the error. if ($result === FALSE) - { + { if ( ! isset($this->_error_messages[$rule])) { if (FALSE === ($line = $this->CI->lang->line($rule))) @@ -656,8 +656,8 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } else { - $line = $this->_translate_fieldname($rule); - } + $line = $this->_error_messages[$rule]; + } // Build the error message $message = sprintf($line, $this->_translate_fieldname($row['label']), $param); @@ -707,7 +707,7 @@ function _translate_fieldname($fieldname) } } - return $this->CI->lang->line($fieldname); + return $fieldname; } // -------------------------------------------------------------------- From 9b8bc35dbaf3aa0f37885122dccb24d1d7811f1e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 23 Sep 2008 01:21:23 +0000 Subject: [PATCH 1372/2544] --- system/libraries/Form_validation.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f0c1500d..df57f80f 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -691,20 +691,13 @@ function _translate_fieldname($fieldname) if (substr($fieldname, 0, 5) == 'lang:') { // Grab the variable - $line = substr($fieldname, 5); - - // Translate it - $fieldname = $this->CI->lang->line($line); + $line = substr($fieldname, 5); - // Were we able to translate the field name? - if ($fieldname === FALSE) + // Were we able to translate the field name? If not we use $line + if (FALSE === ($fieldname = $this->CI->lang->line($line))) { return $line; } - else - { - return $fieldname; - } } return $fieldname; From e5ad2c797162091fade9a809ccc4578d835027bd Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 23 Sep 2008 06:01:26 +0000 Subject: [PATCH 1373/2544] change of a false test --- system/libraries/Encrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index aabf90d0..16c9efe6 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -141,7 +141,7 @@ function decode($string, $key = '') { $key = $this->get_key($key); - if ( ! preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string) === FALSE) { return FALSE; } From 0c9e2700ee0950ada00205d60151224505203dd7 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 23 Sep 2008 06:06:21 +0000 Subject: [PATCH 1374/2544] mostly trivial whitespace adjustments --- system/libraries/Encrypt.php | 100 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 16c9efe6..bd74592d 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -27,14 +27,14 @@ * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_Encrypt { - + var $CI; var $encryption_key = ''; var $_hash_type = 'sha1'; var $_mcrypt_exists = FALSE; var $_mcrypt_cipher; var $_mcrypt_mode; - + /** * Constructor * @@ -47,7 +47,7 @@ function CI_Encrypt() $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE; log_message('debug', "Encrypt Class Initialized"); } - + // -------------------------------------------------------------------- /** @@ -63,12 +63,12 @@ function CI_Encrypt() function get_key($key = '') { if ($key == '') - { + { if ($this->encryption_key != '') { return $this->encryption_key; } - + $CI =& get_instance(); $key = $CI->config->item('encryption_key'); @@ -77,7 +77,7 @@ function get_key($key = '') show_error('In order to use the encryption class requires that you set an encryption key in your config file.'); } } - + return md5($key); } @@ -94,7 +94,7 @@ function set_key($key = '') { $this->encryption_key = $key; } - + // -------------------------------------------------------------------- /** @@ -122,9 +122,9 @@ function encode($string, $key = '') { $enc = $this->mcrypt_encode($enc, $key); } - return base64_encode($enc); + return base64_encode($enc); } - + // -------------------------------------------------------------------- /** @@ -155,10 +155,10 @@ function decode($string, $key = '') return FALSE; } } - + return $this->_xor_decode($dec, $key); } - + // -------------------------------------------------------------------- /** @@ -171,7 +171,7 @@ function decode($string, $key = '') * @param string * @param string * @return string - */ + */ function _xor_encode($string, $key) { $rand = ''; @@ -179,18 +179,18 @@ function _xor_encode($string, $key) { $rand .= mt_rand(0, mt_getrandmax()); } - + $rand = $this->hash($rand); - + $enc = ''; for ($i = 0; $i < strlen($string); $i++) { $enc .= substr($rand, ($i % strlen($rand)), 1).(substr($rand, ($i % strlen($rand)), 1) ^ substr($string, $i, 1)); } - + return $this->_xor_merge($enc, $key); } - + // -------------------------------------------------------------------- /** @@ -203,20 +203,20 @@ function _xor_encode($string, $key) * @param string * @param string * @return string - */ + */ function _xor_decode($string, $key) { $string = $this->_xor_merge($string, $key); - + $dec = ''; for ($i = 0; $i < strlen($string); $i++) { $dec .= (substr($string, $i++, 1) ^ substr($string, $i, 1)); } - + return $dec; } - + // -------------------------------------------------------------------- /** @@ -228,7 +228,7 @@ function _xor_decode($string, $key) * @param string * @param string * @return string - */ + */ function _xor_merge($string, $key) { $hash = $this->hash($key); @@ -237,10 +237,10 @@ function _xor_merge($string, $key) { $str .= substr($string, $i, 1) ^ substr($hash, ($i % strlen($hash)), 1); } - + return $str; } - + // -------------------------------------------------------------------- /** @@ -252,12 +252,12 @@ function _xor_merge($string, $key) * @return string */ function mcrypt_encode($data, $key) - { + { $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); $init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND); return $this->_add_cipher_noise($init_vect.mcrypt_encrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), $key); } - + // -------------------------------------------------------------------- /** @@ -267,22 +267,22 @@ function mcrypt_encode($data, $key) * @param string * @param string * @return string - */ + */ function mcrypt_decode($data, $key) { $data = $this->_remove_cipher_noise($data, $key); $init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode()); - + if ($init_size > strlen($data)) { return FALSE; } - + $init_vect = substr($data, 0, $init_size); $data = substr($data, $init_size); return rtrim(mcrypt_decrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), "\0"); } - + // -------------------------------------------------------------------- /** @@ -302,22 +302,22 @@ function _add_cipher_noise($data, $key) $keyhash = $this->hash($key); $keylen = strlen($keyhash); $str = ''; - + for ($i = 0, $j = 0, $len = strlen($data); $i < $len; ++$i, ++$j) - { + { if ($j >= $keylen) { $j = 0; } - + $str .= chr((ord($data[$i]) + ord($keyhash[$j])) % 256); } - + return $str; } // -------------------------------------------------------------------- - + /** * Removes permuted noise from the IV + encrypted data, reversing * _add_cipher_noise() @@ -340,9 +340,9 @@ function _remove_cipher_noise($data, $key) { $j = 0; } - + $temp = ord($data[$i]) - ord($keyhash[$j]); - + if ($temp < 0) { $temp = $temp + 256; @@ -350,7 +350,7 @@ function _remove_cipher_noise($data, $key) $str .= chr($temp); } - + return $str; } @@ -367,7 +367,7 @@ function set_cipher($cipher) { $this->_mcrypt_cipher = $cipher; } - + // -------------------------------------------------------------------- /** @@ -381,7 +381,7 @@ function set_mode($mode) { $this->_mcrypt_mode = $mode; } - + // -------------------------------------------------------------------- /** @@ -389,7 +389,7 @@ function set_mode($mode) * * @access private * @return string - */ + */ function _get_cipher() { if ($this->_mcrypt_cipher == '') @@ -407,7 +407,7 @@ function _get_cipher() * * @access private * @return string - */ + */ function _get_mode() { if ($this->_mcrypt_mode == '') @@ -417,7 +417,7 @@ function _get_mode() return $this->_mcrypt_mode; } - + // -------------------------------------------------------------------- /** @@ -426,12 +426,12 @@ function _get_mode() * @access public * @param string * @return string - */ + */ function set_hash($type = 'sha1') { $this->_hash_type = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type; } - + // -------------------------------------------------------------------- /** @@ -440,12 +440,12 @@ function set_hash($type = 'sha1') * @access public * @param string * @return string - */ + */ function hash($str) { return ($this->_hash_type == 'sha1') ? $this->sha1($str) : md5($str); } - + // -------------------------------------------------------------------- /** @@ -454,13 +454,13 @@ function hash($str) * @access public * @param string * @return string - */ + */ function sha1($str) { if ( ! function_exists('sha1')) { if ( ! function_exists('mhash')) - { + { require_once(BASEPATH.'libraries/Sha1'.EXT); $SH = new CI_SHA; return $SH->generate($str); @@ -473,9 +473,9 @@ function sha1($str) else { return sha1($str); - } + } } - + } // END CI_Encrypt class From faa6d09ad2347e31189134ab8e4cde7d0e84e81b Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 23 Sep 2008 20:01:33 +0000 Subject: [PATCH 1375/2544] Cleaned up a comment --- system/libraries/Form_validation.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index df57f80f..4bbb6f2d 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -608,13 +608,8 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) { if ( ! method_exists($this, $rule)) { - /* - * Run the native PHP function if called for - * - * If our own wrapper function doesn't exist we see - * if a native PHP function does. Users can use - * any native PHP function call that has one param. - */ + // If our own wrapper function doesn't exist we see if a native PHP function does. + // Users can use any native PHP function call that has one param. if (function_exists($rule)) { $result = $rule($postdata); From 9da2ee9155eb8694f06a125ac1bec166e9071ac8 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 23 Sep 2008 20:39:50 +0000 Subject: [PATCH 1376/2544] Fixed a bug that was adding too many blank paragraph tags under certain conditions --- system/libraries/Typography.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 13b36dd6..76160bfe 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -27,10 +27,10 @@ class CI_Typography { // Block level elements that should not be wrapped inside

    tags - var $block_elements = 'p|div|blockquote|pre|code|h\d|script|ol|ul'; + var $block_elements = 'p|div|blockquote|pre|code|h\d|script|ol|ul|dl|dt|dd'; // Elements that should not have

    and
    tags within them. - var $skip_elements = 'p|pre|ol|ul'; + var $skip_elements = 'p|pre|ol|ul|dl'; // Tags we want the parser to completely ignore when splitting the string. var $ignore_elements = 'a|b|i|em|strong|span|img|li'; @@ -154,7 +154,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea '/()

    /' => '$1', // )+#' => '

    ', + '#(

    )+#' => '

    ', '/(

    )+/' => '

    ', // Clean up stray paragraph tags that appear before block level elements @@ -260,11 +260,21 @@ function _format_newlines($str) { return $str; } - - $str = str_replace("\n\n", "

    \n\n

    ", $str); + + // Convert two consecutive newlines to paragraphs + $str = str_replace("\n\n", "

    \n\n

    ", $str); + + // Convert single spaces to
    tags $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
    \\2\\3", $str); - return '

    '.$str.'

    '; + // Wrap the whole enchilada in enclosing paragraphs + $str = '

    '.$str.'

    '; + + // Remove empty paragraphs if they are on the first line, as this + // is a potential unintended consequence of the previous code + $str = preg_replace("/

    <\/p>(.*)/", "\\1", $str, 1); + + return $str; } // ------------------------------------------------------------------------ From 57f9f39ca6edd4c9cea0f68b86da0ec7a9098f0b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 23 Sep 2008 20:59:14 +0000 Subject: [PATCH 1377/2544] change of a false test (yes, again) --- system/libraries/Encrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index bd74592d..656d51b4 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -141,7 +141,7 @@ function decode($string, $key = '') { $key = $this->get_key($key); - if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string) === FALSE) + if ( ! preg_match('/[a-zA-Z0-9\/\+=]/', $string)) { return FALSE; } From 4585159f8b39e58b22fa409a1e33e404cfe33777 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 23 Sep 2008 22:42:23 +0000 Subject: [PATCH 1378/2544] Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie. Also rewrote a bit of the cookie handling code to be a bit more efficient and understandable --- system/libraries/Session.php | 31 ++++++++++++++++++------------- user_guide/changelog.html | 1 + 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 7e50dce2..4fe44972 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -252,16 +252,17 @@ function sess_write() return; } - // We need two copies of the session data array. One will contain any custom data - // that might have been set. The other will contain the data that will be saved to the cookie - $cookie_userdata = $this->userdata; + // set the custom userdata, the session data we will set in a second $custom_userdata = $this->userdata; - + $cookie_userdata = array(); + // Before continuing, we need to determine if there is any custom data to deal with. // Let's determine this by removing the default indexes to see if there's anything left in the array + // and set the session data while we're at it foreach (array('session_id','ip_address','user_agent','last_activity') as $val) { unset($custom_userdata[$val]); + $cookie_userdata[$val] = $this->userdata[$val]; } // Did we find any custom data? If not, we turn the empty array into a string @@ -271,14 +272,7 @@ function sess_write() $custom_userdata = ''; } else - { - // Before we serialize the custom data array, let's remove that data from the - // main session array since we do not want to save that info to the cookie - foreach (array_keys($custom_userdata) as $val) - { - unset($cookie_userdata[$val]); - } - + { // Serialize the custom data array so we can store it $custom_userdata = serialize($custom_userdata); } @@ -365,14 +359,25 @@ function sess_update() $this->userdata['session_id'] = $new_sessid; $this->userdata['last_activity'] = $this->now; + // _set_cookie() will handle this for us if we aren't using database sessions + // by pushing all userdata to the cookie. + $cookie_data = NULL; + // Update the session ID and last_activity field in the DB if needed if ($this->sess_use_database === TRUE) { + // set cookie explicitly to only have our session data + $cookie_data = array(); + foreach (array('session_id','ip_address','user_agent','last_activity') as $val) + { + $cookie_data[$val] = $this->userdata[$val]; + } + $this->CI->db->query($this->CI->db->update_string($this->sess_table_name, array('last_activity' => $this->now, 'session_id' => $new_sessid), array('session_id' => $old_sessid))); } // Write the cookie - $this->_set_cookie(); + $this->_set_cookie($cookie_data); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9cae52f6..bad3d089 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -103,6 +103,7 @@

    Bug fixes for 1.7.0

  • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
  • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
  • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
  • +
  • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
  • Version 1.6.3

    From 9976587c01b21e96b0b98b4155d72287f8033118 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Sep 2008 17:19:44 +0000 Subject: [PATCH 1379/2544] put all valid block level elements into $block_elements array, added table to tags with which

    should not be directly contained within --- system/libraries/Typography.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 76160bfe..eeb507d3 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -27,10 +27,10 @@ class CI_Typography { // Block level elements that should not be wrapped inside

    tags - var $block_elements = 'p|div|blockquote|pre|code|h\d|script|ol|ul|dl|dt|dd'; + var $block_elements = 'address|blockquote|del|div|dl|fieldset|form|h\d|hr|ins|noscript|ol|p|pre|script|table|ul'; // Elements that should not have

    and
    tags within them. - var $skip_elements = 'p|pre|ol|ul|dl'; + var $skip_elements = 'p|pre|ol|ul|dl|table'; // Tags we want the parser to completely ignore when splitting the string. var $ignore_elements = 'a|b|i|em|strong|span|img|li'; @@ -126,7 +126,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea { if (preg_match("#".$this->skip_elements."#", $match[2])) { - $process = ($match[1] == '/') ? TRUE : FALSE; + $process = ($match[1] == '/') ? TRUE : FALSE; } $str .= $chunk; From c184b3beda28be9c5815fdfc1be7aa79c8b84b16 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Sep 2008 17:54:50 +0000 Subject: [PATCH 1380/2544] renamed $ignore_elements to $inline_elements, and made more robust by including all valid inline HTML elements --- system/libraries/Typography.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index eeb507d3..da100dc1 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -27,13 +27,13 @@ class CI_Typography { // Block level elements that should not be wrapped inside

    tags - var $block_elements = 'address|blockquote|del|div|dl|fieldset|form|h\d|hr|ins|noscript|ol|p|pre|script|table|ul'; + var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|ol|p|pre|script|table|ul'; // Elements that should not have

    and
    tags within them. var $skip_elements = 'p|pre|ol|ul|dl|table'; // Tags we want the parser to completely ignore when splitting the string. - var $ignore_elements = 'a|b|i|em|strong|span|img|li'; + var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|object|samp|select|span|strong|sub|sup|textarea|var'; /** * Nothing to do here... @@ -101,7 +101,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} - $str = preg_replace("#<(/*)(".$this->ignore_elements.")#i", "{@TAG}\\1\\2", $str); + $str = preg_replace("#<(/*)(".$this->inline_elements.")#i", "{@TAG}\\1\\2", $str); // Split the string at every tag. This expression creates an array with this prototype: // From d16bab12339fe2746e1ead72ba96351c3423c27c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Sep 2008 18:22:03 +0000 Subject: [PATCH 1381/2544] added removal of non-printing characters to escape_str() of drivers that do not have native PHP escaping mechanisms --- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- user_guide/changelog.html | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 98c03c56..5ac90b45 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -214,7 +214,7 @@ function trans_rollback() function escape_str($str) { // Escape single quotes - return str_replace("'", "''", $str); + return str_replace("'", "''", $this->input->_remove_invisible_characters($str)); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index d6bc512b..765c3f6c 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -366,7 +366,7 @@ function trans_rollback() */ function escape_str($str) { - return $str; + return $this->input->_remove_invisible_characters($str); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 64717169..f89000d8 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -235,7 +235,7 @@ function trans_rollback() function escape_str($str) { // ODBC doesn't require escaping - return $str; + return $this->input->_remove_invisible_characters($str); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bad3d089..94e41a89 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,12 @@

    Version 1.7

  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div
  • +
  • Database +
      +
    • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid + potential SQL errors, and possible sources of SQL injection.
    • +
    +
  • Helpers
    • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
    • From 92490684ef1b2a1b1417727c392ee28288fd41a9 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Sep 2008 20:44:34 +0000 Subject: [PATCH 1382/2544] fixed an issue where the last character before convert ... to an ellipsis was being dropped --- system/libraries/Typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index da100dc1..6b18a2df 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -225,7 +225,7 @@ function format_characters($str) // Em dash and ellipses dots '/\s?\-\-\s?/' => '—', - '/\w\.{3}/' => '…', + '/(\w)\.{3}/' => '$1…', // double space after sentences '/(\W) /' => '$1  ', From a7cf027235c92103118cf415d244447a6ea82b3a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 25 Sep 2008 12:56:02 +0000 Subject: [PATCH 1383/2544] postgre to postgres in a few documentation pages --- user_guide/changelog.html | 12 ++++++------ user_guide/database/configuration.html | 6 +++--- user_guide/database/helpers.html | 2 +- user_guide/general/requirements.html | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 94e41a89..7a59eaf6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -449,7 +449,7 @@

      Bug fixes for Version 1.6.0

    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • -
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgre and sqlite drivers.
    • +
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • @@ -545,7 +545,7 @@

      Version 1.5.3

    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • Fixed a bug in the redirect function of the url helper.
    • Fixed an undefined variable in Loader
    • -
    • Fixed a version bug in the Postgre driver
    • +
    • Fixed a version bug in the Postgres driver
    • Fixed a bug in the textarea function of the form helper for use with strings
    • Fixed doc typos.
    @@ -683,7 +683,7 @@

    Version 1.4.0

  • Added support for % character in URL.
  • Added the ability to supply full URLs using the anchor() helper function.
  • Added mode parameter to file_write() helper.
  • -
  • Added support for changing the port number in the Postgre driver.
  • +
  • Added support for changing the port number in the Postgres driver.
  • Moved the list of "allowed URI characters" out of the Router class and into the config file.
  • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
  • Updated the Upload class to allow the upload field name to be set when calling do_upload().
  • @@ -694,10 +694,10 @@

    Version 1.4.0

  • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
  • Updated the Models loader function to allow multiple loads of the same model.
  • Updated the MS SQL driver so that single quotes are escaped.
  • -
  • Updated the Postgre and ODBC drivers for better compatibility.
  • +
  • Updated the Postgres and ODBC drivers for better compatibility.
  • Removed a strtolower() call that was changing URL segments to lower case.
  • Removed some references that were interfering with PHP 4.4.1 compatibility.
  • -
  • Removed backticks from Postgre class since these are not needed.
  • +
  • Removed backticks from Postgres class since these are not needed.
  • Renamed display() to _display() in the Output class to make it clear that it's a private function.
  • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
  • Fixed an bug that was preventing the input class from unsetting GET variables.
  • @@ -790,7 +790,7 @@

    Version 1.3

    • Added support for Models.
    • -
    • Redesigned the database libraries to support additional RDBMs (Postgre, MySQLi, etc.).
    • +
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • Added a feature to the database class that lets you run custom function calls.
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 2c16f360..26bbe75e 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -121,7 +121,7 @@

      Explanation of Values:

    • 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, postgre, odcc, etc. Must be specified in lower case.
    • +
    • dbdriver - The database type. ie: mysql, postgres, odcc, etc. Must be specified in lower case.
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • @@ -129,10 +129,10 @@

      Explanation of Values:

    • cachedir - The absolute server path to your database query cache directory.
    • char_set - The character set used in communicating with the database.
    • dbcollat - The character collation used in communicating with the database.
    • -
    • port - The database port number. Currently only used with the Postgre driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    • +
    • port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    -

    Note: Depending on what database platform you are using (MySQL, Postgre, etc.) +

    Note: Depending on what database platform you are using (MySQL, Postgres, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL.

    diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index ac6ea11a..0647e2a8 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -80,7 +80,7 @@

    $this->db->count_all();

    $this->db->platform()

    -

    Outputs the database platform you are running (MySQL, MS SQL, Postgre, etc...):

    +

    Outputs the database platform you are running (MySQL, MS SQL, Postgres, etc...):

    echo $this->db->platform(); diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index a6551970..742cd193 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -59,7 +59,7 @@

    Server Requirements

    • PHP version 4.3.2 or newer.
    • -
    • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgre, Oracle, SQLite, and ODBC.
    • +
    • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
    From 69db8efaffadfc93ff0eec3a9733793e8b358dfb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 25 Sep 2008 13:04:12 +0000 Subject: [PATCH 1384/2544] Fixed incorrect parenthesis in form_open() function. (#5135) A few doc typo fixes --- system/helpers/form_helper.php | 2 +- user_guide/changelog.html | 13 +++++++------ user_guide/installation/upgrade_170.html | 2 +- user_guide/libraries/form_validation.html | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index fc259224..a45faf63 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -57,7 +57,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) $form .= '>'; - if (is_array($hidden) AND count($hidden > 0)) + if (is_array($hidden) AND count($hidden) > 0) { $form .= form_hidden($hidden); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7a59eaf6..f95afe30 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,11 +67,11 @@

    Version 1.7

    • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
    • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
    • -
    • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
    • -
    • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
    • +
    • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
    • +
    • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
    • Added controller class/method info to Profiler class.
    • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
    • -
    • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div
    • +
    • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
  • Database @@ -83,12 +83,13 @@

    Version 1.7

  • Helpers
    • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
    • -
    • Added current_url() and uri_segments() to URL helper.
    • -
    • Improved accuracy of calculations in Number helper.
    • +
    • Added current_url() and uri_segments() to URL helper..
    • +
    • Improved accuracy of calculations in Number helper..
    • Removed added newlines ("\n") from most form and html helper functions.
    • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
    • Updated Date Helper to match the world's current time zones and offsets.
    • Fixed the spelling of "raspberry" in config/smileys.php
    • +
    • Fixed incorrect parenthesis in form_open() function. (#5135)
  • Other changes @@ -104,7 +105,7 @@

    Version 1.7

    Bug fixes for 1.7.0

    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071).
    • +
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index d74afff2..33897d5d 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -3,7 +3,7 @@ -Upgrading from 1.6.3 to 1.6.4 : CodeIgniter User Guide +Upgrading from 1.6.3 to 1.7.0 : CodeIgniter User Guide diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 04074bfb..0f89fb81 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -58,7 +58,7 @@

      Form Validation

      CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you'll write.

      -

      Note:  As of CodeIgniter 1.6.4, this Form Validation class supercedes the old Validation class, which is now deprecated. We +

      Note:  As of CodeIgniter 1.7.0, this Form Validation class supercedes the old Validation class, which is now deprecated. We have left the old class in the library so applications currently using it will not break, but you are encouraged to migrate to this new version.

        @@ -585,7 +585,7 @@

        Setting Error Messages

        $this->form_validation->set_message('username_check') -

        You can also override any error message found in the languge file. For example, to change the message for the "required" rule you will do this:

        +

        You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

        $this->form_validation->set_message('required', 'Your custom message here'); From bc2bfa86bf7125608b7fc190993fafc654cb0da3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 25 Sep 2008 13:22:15 +0000 Subject: [PATCH 1385/2544] Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper. Added a missing quote in an example on the index page --- index.php | 2 +- user_guide/changelog.html | 3 ++- user_guide/helpers/date_helper.html | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 970f2922..39aeda5c 100644 --- a/index.php +++ b/index.php @@ -80,7 +80,7 @@ | | EXT - The file extension. Typically ".php" | FCPATH - The full server path to THIS file -| SELF - The name of THIS file (typically "index.php) +| SELF - The name of THIS file (typically "index.php") | BASEPATH - The full server path to the "system" folder | APPPATH - The full server path to the "application" folder | diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f95afe30..a1afab1c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -88,6 +88,7 @@

        Version 1.7

      • Removed added newlines ("\n") from most form and html helper functions.
      • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
      • Updated Date Helper to match the world's current time zones and offsets.
      • +
      • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
      • Fixed the spelling of "raspberry" in config/smileys.php
      • Fixed incorrect parenthesis in form_open() function. (#5135)
      @@ -105,7 +106,7 @@

      Version 1.7

      Bug fixes for 1.7.0

      • Fixed bug in xss_clean() that could remove some desirable tag attributes.
      • -
      • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158).
      • +
      • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229).
      • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
      • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
      • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
      • diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 41d65795..7a7b4d70 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -291,7 +291,7 @@

        timezone_menu()

        - + @@ -370,7 +370,7 @@

        Timezone Reference

        UP45(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi -UP6(UTC + 6:00) Almaty, Colomba, Dhakra +UP6(UTC + 6:00) Almaty, Colomba, Dhaka UP7(UTC + 7:00) Bangkok, Hanoi, Jakarta From cce31591f865bcf0130945fcfb44335bfd964018 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 25 Sep 2008 13:34:30 +0000 Subject: [PATCH 1386/2544] clarification --- user_guide/helpers/text_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 28855f4d..71047981 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -97,7 +97,7 @@

        character_limiter()

        // Returns: Here is a nice text string…
        -

        The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

        +

        The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.

        From e07ba013ad4ee70ff26ce6ee081cc0d5396a7e03 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Sep 2008 22:14:01 +0000 Subject: [PATCH 1387/2544] added check that content is surrounded by a valid block level element, and if not, wrapped in paragraph tags --- system/libraries/Typography.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 6b18a2df..94c9de01 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -143,6 +143,12 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea $str .= $this->_format_newlines($chunk); } + // is the whole of the content inside a block level element? + if ( ! preg_match("/^<(?:".$this->block_elements.")/i", $str, $match)) + { + $str = "

        {$str}

        "; + } + // Convert quotes, elipsis, and em-dashes $str = $this->format_characters($str); From af03e056ce1a479dc9f1d6b0a88a6bcb06a31d3c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 26 Sep 2008 15:59:28 +0000 Subject: [PATCH 1388/2544] fixed decode()'s validation of the string... --- system/libraries/Encrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 656d51b4..035ce8f6 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -141,7 +141,7 @@ function decode($string, $key = '') { $key = $this->get_key($key); - if ( ! preg_match('/[a-zA-Z0-9\/\+=]/', $string)) + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) { return FALSE; } From b3a3bf342903b32a79e8799860a61b93d7f28581 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 26 Sep 2008 17:20:53 +0000 Subject: [PATCH 1389/2544] removed some legacy escaping code from _backup() in the MySQL utility, fixing bug 4536 http://codeigniter.com/bug_tracker/bug/4536/ --- system/database/drivers/mysql/mysql_utility.php | 9 --------- user_guide/changelog.html | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 6fb1ab4b..e035e0cf 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -176,15 +176,6 @@ function _backup($params = array()) } else { - // Do a little formatting... - $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); - $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); - $v = str_replace('\\', '\\\\', $v); - $v = str_replace('\'', '\\\'', $v); - $v = str_replace('\\\n', '\n', $v); - $v = str_replace('\\\r', '\r', $v); - $v = str_replace('\\\t', '\t', $v); - // Escape the data if it's not an integer if ($is_int[$i] == FALSE) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a1afab1c..7a0a251b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -112,6 +112,7 @@

        Bug fixes for 1.7.0

      • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
      • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
      • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
      • +
      • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.

      Version 1.6.3

      From ba5c4ce31b0b2cbd3a5737a8a887a906bdc80b6d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 26 Sep 2008 19:12:50 +0000 Subject: [PATCH 1390/2544] typo fix --- user_guide/general/views.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 34b75c87..ff600602 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -90,7 +90,7 @@

      Loading a View

      $this->load->view('name'); -

      Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other then .php.

      +

      Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.

      Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

      From 07fa5664978b333f6fd84f4248c50cdbdfe9dc6b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 27 Sep 2008 00:06:19 +0000 Subject: [PATCH 1391/2544] tweak of inline_element regex so that it doesn't hit partial matches, i.e. viewing
      inline_elements.")#i", "{@TAG}\\1\\2", $str); + $str = preg_replace("#<(/*)(".$this->inline_elements.")[ >]#i", "{@TAG}\\1\\2", $str); // Split the string at every tag. This expression creates an array with this prototype: // @@ -132,7 +132,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea $str .= $chunk; continue; } - + if ($process == FALSE) { $str .= $chunk; From f2b7f62f79791cae890a84a4f7b0eeb46449a5d1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 27 Sep 2008 00:10:37 +0000 Subject: [PATCH 1392/2544] tweak tweak... --- system/libraries/Typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 57cb97c7..7eaa4057 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -101,7 +101,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} - $str = preg_replace("#<(/*)(".$this->inline_elements.")[ >]#i", "{@TAG}\\1\\2", $str); + $str = preg_replace("#<(/*)(".$this->inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str); // Split the string at every tag. This expression creates an array with this prototype: // From fa5c4101d4dc171824e222d4650e0ad15409fce0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 30 Sep 2008 00:47:54 +0000 Subject: [PATCH 1393/2544] moved object out of inline elements to the block elements and skip elements variables. Yes, I know it's technically an inline element, but it's common usage is as a block element, and the typography parser needs to know not to smash a bunch of paragraph tags and
      s inside of it, regardless of how it's used --- system/libraries/Typography.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 7eaa4057..7cdf7ddd 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -27,13 +27,13 @@ class CI_Typography { // Block level elements that should not be wrapped inside

      tags - var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|ol|p|pre|script|table|ul'; + var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'; // Elements that should not have

      and
      tags within them. - var $skip_elements = 'p|pre|ol|ul|dl|table'; + var $skip_elements = 'p|pre|ol|ul|dl|object|table'; // Tags we want the parser to completely ignore when splitting the string. - var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|object|samp|select|span|strong|sub|sup|textarea|var'; + var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var'; /** * Nothing to do here... From 52dc8ca4372eb36e9186cef0e34bf0cafe5b1cd8 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 19:53:52 +0000 Subject: [PATCH 1394/2544] Added backticks to column names when using insert_string and update_string. Relates to this bug report: http://codeigniter.com/bug_tracker/bug/4509/ --- system/database/DB_driver.php | 5 ++-- .../database/drivers/mssql/mssql_driver.php | 29 ++++++++++++------- .../database/drivers/mysql/mysql_driver.php | 16 ++++++++++ .../database/drivers/mysqli/mysqli_driver.php | 16 ++++++++++ system/database/drivers/oci8/oci8_driver.php | 17 +++++++++++ system/database/drivers/odbc/odbc_driver.php | 22 ++++++++++++-- .../drivers/postgre/postgre_driver.php | 18 +++++++++++- .../database/drivers/sqlite/sqlite_driver.php | 20 +++++++++++-- 8 files changed, 124 insertions(+), 19 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 1450a064..b937ffd6 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -911,11 +911,10 @@ function insert_string($table, $data) foreach($data as $key => $val) { - $fields[] = $key; + $fields[] = $this->_escape_column($key); $values[] = $this->escape($val); } - return $this->_insert($this->prep_tablename($table), $fields, $values); } @@ -940,7 +939,7 @@ function update_string($table, $data, $where) $fields = array(); foreach($data as $key => $val) { - $fields[$key] = $this->escape($val); + $fields[$this->_escape_column($key)] = $this->escape($val); } if ( ! is_array($where)) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 5ac90b45..9a912a32 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -390,7 +390,24 @@ function _error_number() // Are error numbers supported? return ''; } - + + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + // Not necessary with MS SQL so we simply return the value + return $column; + } + // -------------------------------------------------------------------- /** @@ -405,15 +422,7 @@ function _error_number() */ function _escape_table($table) { - // I don't believe this is necessary with MS SQL. Not sure, though. - Rick - - /* - if (strpos($table, '.') !== FALSE) - { - $table = '"' . str_replace('.', '"."', $table) . '"'; - } - */ - + // Not necessary with MS SQL so we simply return the value return $table; } diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 9d9b6512..de372e66 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -398,6 +398,22 @@ function _error_number() { return mysql_errno($this->conn_id); } + + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + return '`' .$column. '`'; + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index cd683dfe..35a7fc07 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -394,6 +394,22 @@ function _error_number() { return mysqli_errno($this->conn_id); } + + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + return '`' .$column. '`'; + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 765c3f6c..b45b0032 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -506,6 +506,23 @@ function _error_number() $error = ocierror($this->conn_id); return $error['code']; } + + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + // Probably not necessary with Oracle so we simply return the value + return $column; + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index f89000d8..ed8f81cb 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -371,7 +371,23 @@ function _error_number() { return odbc_error($this->conn_id); } - + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + // Not necessary with ODBC so we simply return the value + return $column; + } + // -------------------------------------------------------------------- /** @@ -386,9 +402,9 @@ function _error_number() */ function _escape_table($table) { - // used to add backticks in other db drivers + // Not necessary with ODBC so we simply return the value return $table; - } + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 7574ded1..3d006d3d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -391,7 +391,23 @@ function _error_number() { return ''; } - + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + // Probably not necessary with Postgres so we simply return the value + return $column; + } + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 5cac04df..46e0fae4 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -387,7 +387,24 @@ function _error_number() { return sqlite_last_error($this->conn_id); } - + + // -------------------------------------------------------------------- + + /** + * Escape Column Name + * + * This function adds backticks around supplied column name + * + * @access private + * @param string the column name + * @return string + */ + function _escape_column($column) + { + // Not necessary with SQLite so we simply return the value + return $column; + } + // -------------------------------------------------------------------- /** @@ -402,7 +419,6 @@ function _error_number() */ function _escape_table($table) { - // other database drivers use this to add backticks, hence this // function is simply going to return the tablename for sqlite return $table; From 8f99224e6c6d3ac51cb0f356e2e0feb10fa93f31 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 20:13:53 +0000 Subject: [PATCH 1395/2544] Added a case-sensitivity check to called controller methods, as per this bug report: http://codeigniter.com/bug_tracker/bug/4560/ --- system/codeigniter/CodeIgniter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 692d84a3..27094d24 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -169,11 +169,10 @@ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); - if ( ! class_exists($class) OR $method == 'controller' OR strncmp($method, '_', 1) == 0 - OR in_array($method, get_class_methods('Controller'), TRUE) + OR in_array(strtolower($method), array_map('strtolower', get_class_methods('Controller'))) ) { show_404("{$class}/{$method}"); From ff73401cdef0136c15c6dab95d4d722123668e7a Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 20:38:12 +0000 Subject: [PATCH 1396/2544] Did a little clean up. Nothing that affected functionality --- system/database/DB_active_rec.php | 3 +-- system/database/DB_forge.php | 10 +++++++++ .../database/drivers/mssql/mssql_driver.php | 2 +- .../database/drivers/mysql/mysql_driver.php | 3 +++ system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- .../drivers/postgre/postgre_driver.php | 2 +- .../database/drivers/sqlite/sqlite_driver.php | 20 +---------------- .../database/drivers/sqlite/sqlite_forge.php | 22 +++++++++++++++++-- 9 files changed, 39 insertions(+), 27 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index fccf1b0a..35586838 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -821,11 +821,10 @@ function or_having($key, $value = '', $escape = TRUE) /** * Sets the HAVING values * - * Called by having() or orhaving() + * Called by having() or or_having() * * @access private * @param string - * @param string * @return object */ diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index cc88c32f..d48165e2 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -97,6 +97,16 @@ function drop_database($db_name) */ function add_key($key = '', $primary = FALSE) { + if (is_array($key)) + { + foreach($key as $one) + { + $this->add_key($one, $primary); + } + + return; + } + if ($key == '') { show_error('Key information is required for that operation.'); diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 9a912a32..fd3f9638 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -87,7 +87,7 @@ function db_select() */ function db_set_charset($charset, $collation) { - // TODO - add support if needed + // @todo - add support if needed return TRUE; } diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index de372e66..52df1e59 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -314,6 +314,9 @@ function count_all($table = '') $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table)); + if ($query->num_rows() == 0) + return '0'; + $row = $query->row(); return (int)$row->numrows; } diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index b45b0032..9d919325 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -111,7 +111,7 @@ function db_select() */ function db_set_charset($charset, $collation) { - // TODO - add support if needed + // @todo - add support if needed return TRUE; } diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index ed8f81cb..06282e55 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -94,7 +94,7 @@ function db_select() */ function db_set_charset($charset, $collation) { - // TODO - add support if needed + // @todo - add support if needed return TRUE; } diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 3d006d3d..55f65028 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -92,7 +92,7 @@ function db_select() */ function db_set_charset($charset, $collation) { - // TODO - add support if needed + // @todo - add support if needed return TRUE; } diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 46e0fae4..78215694 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -113,7 +113,7 @@ function db_select() */ function db_set_charset($charset, $collation) { - // TODO - add support if needed + // @todo - add support if needed return TRUE; } @@ -651,24 +651,6 @@ function _close($conn_id) @sqlite_close($conn_id); } - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - } diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 05f366a6..631c9c77 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -144,7 +144,7 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $primary_keys = $this->db->_protect_identifiers($primary_keys); $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; } - + if (is_array($keys) && count($keys) > 0) { foreach ($keys as $key) @@ -161,7 +161,7 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")"; } } - + $sql .= "\n)"; return $sql; @@ -241,6 +241,24 @@ function _alter_table($alter_type, $table, $column_name, $column_definition = '' return $sql; } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } } /* End of file sqlite_forge.php */ From 1346aac56e4c5effee5a66780095ea9d4ea8cf52 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 20:46:58 +0000 Subject: [PATCH 1397/2544] Removed some spaces --- system/database/DB.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index 27eb336f..2b3ff3dc 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -73,7 +73,7 @@ function &DB($params = '', $active_record_override = FALSE) if (isset($dns['query'])) { parse_str($dns['query'], $extra); - + foreach($extra as $key => $val) { // booleans please @@ -85,12 +85,12 @@ function &DB($params = '', $active_record_override = FALSE) { $val = FALSE; } - + $params[$key] = $val; } } } - + // No DB specified yet? Beat them senseless... if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '') { From b2675159482af40004e32ec30fbf6f52cfe62a51 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:07:22 +0000 Subject: [PATCH 1398/2544] Fixed a routing bug that occurred when the default route pointed to a subfolder. Bug report: http://codeigniter.com/bug_tracker/bug/4661/ --- system/libraries/Router.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 4b90b4bd..f1923794 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -63,7 +63,7 @@ function CI_Router() * @return void */ function _set_routing() - { + { // Are query strings enabled in the config file? // If so, we're done since segment based URIs are not used with query strings. if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')])) @@ -97,16 +97,8 @@ function _set_routing() { show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); } - - $this->set_class($this->default_controller); - $this->set_method('index'); - $this->_set_request(array($this->default_controller, 'index')); - - // re-index the routed segments array so it starts with 1 rather than 0 - $this->uri->_reindex_segments(); - - log_message('debug', "No URI present. Default controller set."); - return; + + $this->uri->uri_string = $this->default_controller; } unset($this->routes['default_controller']); From 46c23637dcbdff4fab3f90ca81187729e606397f Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:10:58 +0000 Subject: [PATCH 1399/2544] --- user_guide/changelog.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7a0a251b..6763bf24 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -88,9 +88,6 @@

      Version 1.7

    • Removed added newlines ("\n") from most form and html helper functions.
    • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
    • Updated Date Helper to match the world's current time zones and offsets.
    • -
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • -
    • Fixed the spelling of "raspberry" in config/smileys.php
    • -
    • Fixed incorrect parenthesis in form_open() function. (#5135)
  • Other changes @@ -99,6 +96,7 @@

    Version 1.7

  • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
  • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
  • Added PHP Style Guide to docs.
  • +
  • Added backticks around column names in MySQL when using insert_string and update_string functions.
  • @@ -113,6 +111,11 @@

    Bug fixes for 1.7.0

  • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
  • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
  • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
  • +
  • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
  • +
  • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
  • +
  • Fixed the spelling of "raspberry" in config/smileys.php
  • +
  • Fixed incorrect parenthesis in form_open() function. (#5135)
  • +
  • Fixed a bug that was ignoring case when comparing controller methods (#4560)
  • Version 1.6.3

    From f08f655d4f3f63f66f8db3dbce6045939f304f03 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:16:03 +0000 Subject: [PATCH 1400/2544] Added smtp authorization settings to initialize function, as per this bug report: http://codeigniter.com/bug_tracker/bug/4615/ --- system/libraries/Email.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 592ead3d..8c56ccca 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -88,10 +88,12 @@ function CI_Email($config = array()) { $this->initialize($config); } - - $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; - + else + { + $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; + $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; + } + log_message('debug', "Email Class Initialized"); } @@ -123,6 +125,9 @@ function initialize($config = array()) } } } + + $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; + $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; } // -------------------------------------------------------------------- From f54d2100a4f154796a47f3216dc340fb26cd7a49 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:17:19 +0000 Subject: [PATCH 1401/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6763bf24..b6bd8998 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -116,6 +116,7 @@

    Bug fixes for 1.7.0

  • Fixed the spelling of "raspberry" in config/smileys.php
  • Fixed incorrect parenthesis in form_open() function. (#5135)
  • Fixed a bug that was ignoring case when comparing controller methods (#4560)
  • +
  • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function
  • Version 1.6.3

    From 2aa5a18635a8982b7318d0976ae5d00832fa71ca Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:23:58 +0000 Subject: [PATCH 1402/2544] Did a little cleanup for better readability --- system/libraries/Email.php | 42 +++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 8c56ccca..e9a5344f 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -59,7 +59,7 @@ class CI_Email { var $_atc_boundary = ""; var $_header_str = ""; var $_smtp_connect = ""; - var $_encoding = "8bit"; + var $_encoding = "8bit"; var $_IP = FALSE; var $_smtp_auth = FALSE; var $_replyto_flag = FALSE; @@ -74,16 +74,16 @@ class CI_Email { 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)'); + var $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)'); /** * Constructor - Sets Email Preferences * * The constructor can be passed an array of config values - */ + */ function CI_Email($config = array()) - { + { if (count($config) > 0) { $this->initialize($config); @@ -105,7 +105,7 @@ function CI_Email($config = array()) * @access public * @param array * @return void - */ + */ function initialize($config = array()) { $this->clear(); @@ -277,7 +277,9 @@ function cc($cc) $cc = $this->clean_email($cc); if ($this->validate) + { $this->validate_email($cc); + } $this->_set_header('Cc', implode(", ", $cc)); @@ -630,15 +632,15 @@ function _get_content_type() { if ($this->mailtype == 'html' && count($this->_attach_name) == 0) { - return 'html'; + return 'html'; } elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) { - return 'html-attach'; + return 'html-attach'; } elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) { - return 'plain-attach'; + return 'plain-attach'; } else { @@ -950,7 +952,9 @@ function _write_headers() } if ($this->_get_protocol() == 'mail') + { $this->_header_str = substr($this->_header_str, 0, -1); + } } // -------------------------------------------------------------------- @@ -1167,14 +1171,14 @@ function _prep_quoted_printable($str, $charlim = '') // Reduce multiple spaces $str = preg_replace("| +|", " ", $str); - + // kill nulls $str = preg_replace('/\x00+/', '', $str); // Standardize newlines if (strpos($str, "\r") !== FALSE) { - $str = str_replace(array("\r\n", "\r"), "\n", $str); + $str = str_replace(array("\r\n", "\r"), "\n", $str); } // We are intentionally wrapping so mail servers will encode characters @@ -1425,18 +1429,26 @@ function _send_with_mail() if ($this->_safe_mode == TRUE) { if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str)) + { return FALSE; + } else + { return TRUE; + } } 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; + } } } @@ -1487,14 +1499,18 @@ function _send_with_smtp() $this->_send_command('from', $this->clean_email($this->_headers['From'])); foreach($this->_recipients as $val) + { $this->_send_command('to', $val); + } if (count($this->_cc_array) > 0) { foreach($this->_cc_array as $val) { if ($val != "") - $this->_send_command('to', $val); + { + $this->_send_command('to', $val); + } } } @@ -1503,7 +1519,9 @@ function _send_with_smtp() foreach($this->_bcc_array as $val) { if ($val != "") - $this->_send_command('to', $val); + { + $this->_send_command('to', $val); + } } } From 9f02e3c852a38b4e17ac1ade26144d0b9d554693 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:51:01 +0000 Subject: [PATCH 1403/2544] Added backticks around column names in where clause. Bug report number: 4668 --- system/database/DB_active_rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 35586838..cd616336 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -440,7 +440,7 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE) // exception for "field<=" keys if ($this->_has_operator($k)) { - $k = preg_replace("/([A-Za-z_0-9]+)/", $this->_protect_identifiers('$1'), $k); + $k = preg_replace("/([A-Za-z_0-9]+)/", $this->_escape_column($this->_protect_identifiers('$1')), $k); } else { From 02d2a9cb400287e54c09f51b9027a99c779d7131 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:51:49 +0000 Subject: [PATCH 1404/2544] --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b6bd8998..2dcde946 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -96,7 +96,7 @@

    Version 1.7

  • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
  • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
  • Added PHP Style Guide to docs.
  • -
  • Added backticks around column names in MySQL when using insert_string and update_string functions.
  • +
  • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
  • From 852160a27ba330f9e47f4fb16d8042c6074f435c Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 30 Sep 2008 21:55:34 +0000 Subject: [PATCH 1405/2544] Swiched to escape() rather then escape_str(), as per bug report #4680 --- system/database/DB_active_rec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index cd616336..e7920d08 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -701,7 +701,7 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') $prefix = (count($this->ar_like) == 0) ? '' : $type; - $v = $this->escape_str($v); + $v = $this->escape($v); if ($side == 'before') { @@ -851,7 +851,7 @@ function _having($key, $value = '', $type = 'AND ', $escape = TRUE) if ($v != '') { - $v = ' '.$this->escape_str($v); + $v = ' '.$this->escape($v); } $this->ar_having[] = $prefix.$k.$v; From 91a091abc17714e00b870b36e5f1d2bb8f009fb2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:07:23 +0000 Subject: [PATCH 1406/2544] Removed some stray tabs --- system/libraries/Benchmark.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php index b5a9a652..4984bb15 100644 --- a/system/libraries/Benchmark.php +++ b/system/libraries/Benchmark.php @@ -47,7 +47,7 @@ function mark($name) { $this->marker[$name] = microtime(); } - + // -------------------------------------------------------------------- /** @@ -80,13 +80,13 @@ function elapsed_time($point1 = '', $point2 = '', $decimals = 4) { $this->marker[$point2] = microtime(); } - + list($sm, $ss) = explode(' ', $this->marker[$point1]); list($em, $es) = explode(' ', $this->marker[$point2]); return number_format(($em + $es) - ($sm + $ss), $decimals); } - + // -------------------------------------------------------------------- /** From ed339bc99ba2e7b26b3153cbf350a307fb4367c6 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:11:29 +0000 Subject: [PATCH 1407/2544] Removed some stray tabs --- system/libraries/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Config.php b/system/libraries/Config.php index ca12fde7..a9cf9f4e 100644 --- a/system/libraries/Config.php +++ b/system/libraries/Config.php @@ -46,7 +46,7 @@ function CI_Config() { $this->config =& get_config(); log_message('debug', "Config Class Initialized"); - } + } // -------------------------------------------------------------------- From 8d9b44ddb371846d458cef241c35ea5c196a5424 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:18:43 +0000 Subject: [PATCH 1408/2544] Made a small error trapping change to the delete_directory function --- system/libraries/Ftp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 6a957a18..0e3dd5ef 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -379,7 +379,7 @@ function delete_dir($filepath) $list = $this->list_files($filepath); - if ($list !== FALSE) + if ($list !== FALSE AND count($list) > 0) { foreach ($list as $item) { From b5c93ce3c63af4c4130d5b55a0f16cd022014e57 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:21:54 +0000 Subject: [PATCH 1409/2544] removed an errant tab --- system/libraries/Image_lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index c734c306..6b1e7e70 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -943,7 +943,7 @@ function overlay_watermark() { @imagealphablending($src_img, TRUE); } - + // Set RGB values for text and shadow $rgba = imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp); $alpha = ($rgba & 0x7F000000) >> 24; From c3b33befcbcc7846a638c8af8f08e1eafc7b79c2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:31:36 +0000 Subject: [PATCH 1410/2544] Added set_staus_header --- system/libraries/Output.php | 60 ++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 88a30469..2263fdfb 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -94,7 +94,7 @@ function append_output($output) } // -------------------------------------------------------------------- - + /** * Set Header * @@ -107,9 +107,55 @@ function append_output($output) * @param string * @return void */ - function set_header($header) + function set_header($header, $replace = TRUE) { - $this->headers[] = $header; + $this->headers[] = array($header, $replace); + } + + // -------------------------------------------------------------------- + + /** + * Set HTTP Status Header + * + * @access public + * @param int the status code + * @param string + * @return void + */ + function set_status_header($code, $text='') + { + if ( ! in_array($code, array(200, 304, 401, 404)) AND $text == '') + { + show_error('You must submit a status message and a status code'); + } + + if ($text == '') + { + switch($code) + { + case 200: $text = 'OK'; + break; + case 304: $text = 'Not Modified'; + break; + case 401: $text = 'Unauthorized'; + break; + case 404: $text = 'Not Found'; + break; + } + } + + if (substr(php_sapi_name(), 0, 3) == 'cgi') + { + @header("Status: {$code} {$text}", TRUE); + } + elseif ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' OR $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') + { + @header($_SERVER['SERVER_PROTOCOL']." {$code} {$text}", TRUE, $code); + } + else + { + @header("HTTP/1.1 {$code} {$text}", TRUE, $code); + } } // -------------------------------------------------------------------- @@ -183,7 +229,7 @@ function _display($output = '') // Parse out the elapsed time and memory usage, // then swap the pseudo-variables with the data - + $elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end'); $output = str_replace('{elapsed_time}', $elapsed, $output); @@ -211,7 +257,7 @@ function _display($output = '') { foreach ($this->headers as $header) { - @header($header); + @header($header[0], $header[1]); } } @@ -296,7 +342,7 @@ function _write_cache($output) $cache_path .= md5($uri); - if ( ! $fp = @fopen($cache_path, 'wb')) + if ( ! $fp = @fopen($cache_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) { log_message('error', "Unable to write cache file: ".$cache_path); return; @@ -342,7 +388,7 @@ function _display_cache(&$CFG, &$URI) return FALSE; } - if ( ! $fp = @fopen($filepath, 'rb')) + if ( ! $fp = @fopen($filepath, FOPEN_READ)) { return FALSE; } From a42f38709d4628ba7e93d62a26d405bfbc0eeb69 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:33:52 +0000 Subject: [PATCH 1411/2544] Removed some errant spaces --- system/libraries/Pagination.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 58a70650..95799448 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -88,7 +88,7 @@ function initialize($params = array()) { $this->$key = $val; } - } + } } } @@ -118,7 +118,7 @@ function create_links() } // Determine the current page number. - $CI =& get_instance(); + $CI =& get_instance(); if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) { From 4ebfb43dfebbcb59aac2b463dcc9561d1008fd0d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 1 Oct 2008 01:34:07 +0000 Subject: [PATCH 1412/2544] Fixed extra text in img() function description of the userguide --- user_guide/changelog.html | 2 +- user_guide/helpers/html_helper.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2dcde946..b98d9d5b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -104,7 +104,7 @@

    Version 1.7

    Bug fixes for 1.7.0

    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229).
    • +
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index ab26cbcc..e63a449b 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -79,8 +79,7 @@

      heading()

      echo heading('Welcome!', 3);

      The above would produce: <h3>Welcome!</h3>

      img()

      -

      Lets you create HTML <img /> tags. The first parameter contains the image source. There is data, the - second the size of the heading. Example:

      +

      Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

      echo img('images/picture.jpg');
      // gives <img src="http://site.com/images/picture.jpg" />

      There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

      From d6778fb261dedd1163d947295fd59970256a1f48 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:34:52 +0000 Subject: [PATCH 1413/2544] Updated copyright --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 55ad1e3c..13cb1cca 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006, EllisLab, Inc. + * @copyright Copyright (c) 2008, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 From 8ca943f0c550c9b2e7f0deabe2f3fdd269db544d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 01:37:59 +0000 Subject: [PATCH 1414/2544] Removed some errant spaces and tabs --- system/libraries/Typography.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 7cdf7ddd..59a96dfd 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -84,7 +84,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea if ($strip_js_event_handlers === TRUE) { $str = preg_replace("#<([^><]+?)([^a-z_\-]on\w*|xmlns)(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); - } + } // Convert quotes within tags to temporary markers. We don't want quotes converted // within tags so we'll temporarily convert them to {@DQ} and {@SQ} @@ -132,7 +132,7 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea $str .= $chunk; continue; } - + if ($process == FALSE) { $str .= $chunk; From 8e3869a90ae46c477ba1059a65fc480abea1cc03 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 1 Oct 2008 02:01:53 +0000 Subject: [PATCH 1415/2544] Tweaked the filter_uri function for better security --- system/libraries/URI.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index ce64f3c7..0e4ff50c 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -58,23 +58,23 @@ function CI_URI() * @return string */ function _fetch_uri_string() - { + { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // If the URL has a question mark then it's simplest to just // build the URI string from the zero index of the $_GET array. // This avoids having to deal with $_SERVER variables, which // can be unreliable in some environments - if (is_array($_GET) AND count($_GET) == 1 AND trim(key($_GET), '/') != '') + if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') { - $this->uri_string = key($_GET); + $this->uri_string = key($_GET); return; } // Is there a PATH_INFO variable? // Note: some servers seem to have trouble with getenv() so we'll test it two ways $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - if (trim($path, '/') != '' AND $path != "/".SELF) + if (trim($path, '/') != '' && $path != "/".SELF) { $this->uri_string = $path; return; @@ -90,7 +90,7 @@ function _fetch_uri_string() // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if (trim($path, '/') != '' AND $path != "/".SELF) + if (trim($path, '/') != '' && $path != "/".SELF) { // remove path and script information so we have good URI data $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); @@ -119,7 +119,7 @@ function _fetch_uri_string() $this->uri_string = ''; } } - + // -------------------------------------------------------------------- /** @@ -157,7 +157,7 @@ function _parse_request_uri() $i = 0; foreach(explode("/", $fc_path) as $segment) { - if (isset($parsed_uri[$i]) AND $segment == $parsed_uri[$i]) + if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i]) { $i++; } @@ -184,15 +184,19 @@ function _parse_request_uri() */ function _filter_uri($str) { - if ($str != '' AND $this->config->item('permitted_uri_chars') != '') + if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) { if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) { exit('The URI you submitted has disallowed characters.'); } - } - - return $str; + } + + // Convert programatic characters to entities + $bad = array('$', '(', ')', '%28', '%29'); + $good = array('$', '(', ')', '(', ')'); + + return str_replace($bad, $good, $str); } // -------------------------------------------------------------------- @@ -228,7 +232,9 @@ function _explode_segments() $val = trim($this->_filter_uri($val)); if ($val != '') + { $this->segments[] = $val; + } } } From d95ebca78e200cb325dcf934492c83090cf2b462 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 1 Oct 2008 23:57:38 +0000 Subject: [PATCH 1416/2544] added $protect_braced_quotes to Typography class, to prevent curly-quoting single and double quoted string within {curly "braces"} --- system/libraries/Typography.php | 18 +++++++++++++++++- user_guide/libraries/typography.html | 10 ++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 59a96dfd..2393e164 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -35,6 +35,9 @@ class CI_Typography { // Tags we want the parser to completely ignore when splitting the string. var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var'; + // whether or not to protect quotes within { curly braces } + var $protect_braced_quotes = FALSE; + /** * Nothing to do here... * @@ -97,7 +100,20 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea $str); } } - + + if ($this->protect_braced_quotes === TRUE) + { + if (preg_match_all("#\{.+?}#si", $str, $matches)) + { + for ($i = 0; $i < count($matches['0']); $i++) + { + $str = str_replace($matches['0'][$i], + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches['0'][$i]), + $str); + } + } + } + // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 359c590c..29219059 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -135,6 +135,16 @@

      nl2br_except_pre()

      $string = $this->typography->nl2br_except_pre($string); +

      protect_braced_quotes

      + +

      When using the Typography library in conjunction with the Template Parser library it can often be desirable to protect single + and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE. + +

      Usage example:

      + +$this->load->library('typography');
      +$this->typography->protect_braced_quotes = TRUE; +
    From 0dc925f7f30c008c50f8fa801e90203b82cf0542 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Thu, 2 Oct 2008 01:03:21 +0000 Subject: [PATCH 1417/2544] Added set_status_header function --- system/libraries/Output.php | 79 +++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 2263fdfb..781e368c 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -122,39 +122,78 @@ function set_header($header, $replace = TRUE) * @param string * @return void */ - function set_status_header($code, $text='') - { - if ( ! in_array($code, array(200, 304, 401, 404)) AND $text == '') + function set_status_header($code = '200', $text = '') + { + $stati = array( + '200' => 'OK', + '201' => 'Created', + '202' => 'Accepted', + '203' => 'Non-Authoritative Information', + '204' => 'No Content', + '205' => 'Reset Content', + '206' => 'Partial Content', + + '300' => 'Multiple Choices', + '301' => 'Moved Permanently', + '302' => 'Found', + '304' => 'Not Modified', + '305' => 'Use Proxy', + '307' => 'Temporary Redirect', + + '400' => 'Bad Request', + '401' => 'Unauthorized', + '403' => 'Forbidden', + '404' => 'Not Found', + '405' => 'Method Not Allowed', + '406' => 'Not Acceptable', + '407' => 'Proxy Authentication Required', + '408' => 'Request Timeout', + '409' => 'Conflict', + '410' => 'Gone', + '411' => 'Length Required', + '412' => 'Precondition Failed', + '413' => 'Request Entity Too Large', + '414' => 'Request-URI Too Long', + '415' => 'Unsupported Media Type', + '416' => 'Requested Range Not Satisfiable', + '417' => 'Expectation Failed', + + '500' => 'Internal Server Error', + '501' => 'Not Implemented', + '502' => 'Bad Gateway', + '503' => 'Service Unavailable', + '504' => 'Gateway Timeout', + '505' => 'HTTP Version Not Supported' + ); + + if ($code == '' OR ! is_numeric($code)) { - show_error('You must submit a status message and a status code'); + show_error('Status codes must be numeric'); } - + + if (isset($stati[$code]) AND $text == '') + { + $text = $stati[$code]; + } + if ($text == '') { - switch($code) - { - case 200: $text = 'OK'; - break; - case 304: $text = 'Not Modified'; - break; - case 401: $text = 'Unauthorized'; - break; - case 404: $text = 'Not Found'; - break; - } + show_error('No status text available. Please check your status code number or supply your own message text.'); } + + $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE; if (substr(php_sapi_name(), 0, 3) == 'cgi') { - @header("Status: {$code} {$text}", TRUE); + header("Status: {$code} {$text}", TRUE); } - elseif ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1' OR $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') + elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') { - @header($_SERVER['SERVER_PROTOCOL']." {$code} {$text}", TRUE, $code); + header($server_protocol." {$code} {$text}", TRUE, $code); } else { - @header("HTTP/1.1 {$code} {$text}", TRUE, $code); + header("HTTP/1.1 {$code} {$text}", TRUE, $code); } } From 02b0c399244435f0aeaa710b1992c75964fac88b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 2 Oct 2008 21:54:24 +0000 Subject: [PATCH 1418/2544] changed if ($this->cur_page > $this->num_links) to if ($this->cur_page > ($this-> num_links + 1)) so the "First" link only renders when the link for page 1 is now shown --- system/libraries/Pagination.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 95799448..4206f4e7 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -183,7 +183,7 @@ function create_links() $output = ''; // Render the "First" link - if ($this->cur_page > $this->num_links) + if ($this->cur_page > ($this->num_links + 1)) { $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b98d9d5b..39303bdd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -97,6 +97,7 @@

    Version 1.7

  • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
  • Added PHP Style Guide to docs.
  • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
  • +
  • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • From 26bde91ef36cacd22772102d3083277bd937a60d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 3 Oct 2008 02:29:56 +0000 Subject: [PATCH 1419/2544] When I fixed a bug that did not permit the default route to be in a sub-folder, I introducted a different bug (#5285), which this should fix --- system/libraries/Router.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/system/libraries/Router.php b/system/libraries/Router.php index f1923794..cf425163 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -98,7 +98,22 @@ function _set_routing() show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file."); } - $this->uri->uri_string = $this->default_controller; + // Turn the default route into an array. We explode it in the event that + // the controller is located in a subfolder + $segments = $this->_validate_request(explode('/', $this->default_controller)); + + // Set the class and method + $this->set_class($segments[0]); + $this->set_method('index'); + + // Assign the segments to the URI class + $this->uri->rsegments = $segments; + + // re-index the routed segments array so it starts with 1 rather than 0 + $this->uri->_reindex_segments(); + + log_message('debug', "No URI present. Default controller set."); + return; } unset($this->routes['default_controller']); From c0e72b0609827484dc822ded7fcd0a312ed4eb98 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 3 Oct 2008 18:56:06 +0000 Subject: [PATCH 1420/2544] modified how we're performing text highlighting to prevent extra or missing span tags. Namely, removed the start and ending markers, as if the code being highlighted would be styled the same, PHP would put it all in the same , so when we removed our own additions, it would remove the needed opening span style --- system/helpers/text_helper.php | 30 +++++++++++++++--------------- user_guide/changelog.html | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 954eb797..54ef1b58 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -274,27 +274,27 @@ function highlight_code($str) array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), $str); // The highlight_string function requires that the text be surrounded - // by PHP tags. Since we don't know if A) the submitted text has PHP tags, - // or B) whether the PHP tags enclose the entire string, we will add our - // own PHP tags around the string along with some markers to make replacement easier later - - $str = ''; - - // All the magic happens here, baby! + // by PHP tags, which we will remove later + $str = ''; // tags + // so we'll replace them with tags. + + if (abs(PHP_VERSION) < 5) { $str = str_replace(array(''), array(''), $str); $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); + $str = str_replace('<?php ', '', $str); } - - // Remove our artificially added PHP - $str = preg_replace("#\.+?tempstart\
    (?:\)?#is", "\n", $str); - $str = preg_replace("#tempend.+#is", "
    \n", $str); - + + // Remove our artificially added PHP, and the syntax highlighting that came with it + $str = str_replace('<?php ', '', $str); + $str = preg_replace('/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1\n\n", $str); + $str = preg_replace('/<\/span>/i', '', $str); + // Replace our markers back to PHP tags. $str = str_replace(array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), array('<?', '?>', '<%', '%>', '\\', '</script>'), $str); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 39303bdd..f08c94e8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -118,6 +118,7 @@

    Bug fixes for 1.7.0

  • Fixed incorrect parenthesis in form_open() function. (#5135)
  • Fixed a bug that was ignoring case when comparing controller methods (#4560)
  • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function
  • +
  • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
  • Version 1.6.3

    From 337c74ab2af0dec69659f8c68c82b12c878c1b88 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 3 Oct 2008 19:09:53 +0000 Subject: [PATCH 1421/2544] tweak of temp tag and highlighting replacement to accommodate environments with different colors specified for highlight_string() --- system/helpers/text_helper.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 54ef1b58..9f13896a 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -287,12 +287,11 @@ function highlight_code($str) { $str = str_replace(array(''), array(''), $str); $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); - $str = str_replace('<?php ', '', $str); } - + // Remove our artificially added PHP, and the syntax highlighting that came with it - $str = str_replace('<?php ', '', $str); - $str = preg_replace('/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1\n\n", $str); + $str = preg_replace('/<\?php( | )/i', '', $str); + $str = preg_replace('/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1\n\n", $str); $str = preg_replace('/<\/span>/i', '', $str); // Replace our markers back to PHP tags. From 2f26ba98c2ccda07fe2177d0b48b117ca8fddafe Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:38:01 +0000 Subject: [PATCH 1422/2544] Added function to optionally limit the length of the file name --- system/libraries/Upload.php | 57 +++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 13026bca..a2437d07 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -29,6 +29,7 @@ class CI_Upload { var $max_size = 0; var $max_width = 0; var $max_height = 0; + var $max_filename = 0; var $allowed_types = ""; var $file_temp = ""; var $file_name = ""; @@ -147,7 +148,7 @@ function do_upload($field = 'userfile') // errors will already be set by validate_upload_path() so just return FALSE return FALSE; } - + // Was the file able to be uploaded? If not, determine the reason why. if ( ! is_uploaded_file($_FILES[$field]['tmp_name'])) { @@ -221,6 +222,12 @@ function do_upload($field = 'userfile') // Sanitize the file name for security $this->file_name = $this->clean_file_name($this->file_name); + + // Truncate the file name if it's too long + if ($this->max_filename > 0) + { + $this->file_name = $this->limit_filename_length($this->file_name, $this->max_filename); + } // Remove white spaces in the name if ($this->remove_spaces == TRUE) @@ -325,7 +332,8 @@ function data() */ function set_upload_path($path) { - $this->upload_path = $path; + // Make sure it has a trailing slash + $this->upload_path = rtrim($path, '/').'/'; } // -------------------------------------------------------------------- @@ -347,7 +355,7 @@ function set_filename($path, $filename) if ($this->encrypt_name == TRUE) { mt_srand(); - $filename = md5(uniqid(mt_rand())).$this->file_ext; + $filename = md5(uniqid(mt_rand())).$this->file_ext; } if ( ! file_exists($path.$filename)) @@ -394,6 +402,20 @@ function set_max_filesize($n) // -------------------------------------------------------------------- + /** + * Set Maximum File Name Length + * + * @access public + * @param integer + * @return void + */ + function set_max_filename($n) + { + $this->max_filename = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + } + + // -------------------------------------------------------------------- + /** * Set Maximum Image Width * @@ -711,7 +733,34 @@ function clean_file_name($filename) return stripslashes($filename); } + + // -------------------------------------------------------------------- + /** + * Limit the File Name Length + * + * @access public + * @param string + * @return string + */ + function limit_filename_length($filename, $length) + { + if (strlen($filename) < $length) + { + return $filename; + } + + $ext = ''; + if (strpos($filename, '.') !== FALSE) + { + $parts = explode('.', $filename); + $ext = '.'.array_pop($parts); + $filename = implode('.', $parts); + } + + return substr($filename, 0, ($length - strlen($ext))).$ext; + } + // -------------------------------------------------------------------- /** @@ -832,6 +881,8 @@ function mimes_types($mime) return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; } + // -------------------------------------------------------------------- + /** * Prep Filename * From 0aac08e4a24b3fdad3af7f608f6861c18547a42b Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:39:44 +0000 Subject: [PATCH 1423/2544] Tweaked the last feature added to limit file name length --- system/libraries/Upload.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index a2437d07..42d02d94 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -81,6 +81,7 @@ function initialize($config = array()) 'max_size' => 0, 'max_width' => 0, 'max_height' => 0, + 'max_filename' => 0, 'allowed_types' => "", 'file_temp' => "", 'file_name' => "", From c9e14da82b2c0467912d841ce72099927a3e6881 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:42:12 +0000 Subject: [PATCH 1424/2544] Added description of the max_filename parameter --- user_guide/libraries/file_uploading.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index baa179fb..fb976975 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -288,6 +288,12 @@

    Preferences

    The maximum height (in pixels) that the file can be. Set to zero for no limit. + +max_filename +0 +None +The maximum length that a file name can be. Set to zero for no limit. + encrypt_name From 694f2c6474f924b2f22a1330d0c0b51757862274 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:43:45 +0000 Subject: [PATCH 1425/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f08c94e8..3bf065e2 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

    Version 1.7

  • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
  • Added controller class/method info to Profiler class.
  • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
  • +
  • Added max_filename option to set a file name length limit in the File Upload Class.
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
  • From 9af2ec4d32deb49282587b45d2a02446a6400b19 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Sat, 4 Oct 2008 01:47:48 +0000 Subject: [PATCH 1426/2544] removed some ereg() calls for better performance --- system/libraries/Upload.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 42d02d94..3832dab0 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -398,7 +398,7 @@ function set_filename($path, $filename) */ function set_max_filesize($n) { - $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_size = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -412,7 +412,7 @@ function set_max_filesize($n) */ function set_max_filename($n) { - $this->max_filename = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_filename = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -426,7 +426,7 @@ function set_max_filename($n) */ function set_max_width($n) { - $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_width = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- @@ -440,7 +440,7 @@ function set_max_width($n) */ function set_max_height($n) { - $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n; + $this->max_height = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- From dbc9e15c814ad2fc8a3fb10fbd1350d42b1f7f9c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 6 Oct 2008 14:41:47 +0000 Subject: [PATCH 1427/2544] Altered auto_link() in the URL helper so that email addresses with "+" included will be linked. --- system/helpers/url_helper.php | 2 +- user_guide/changelog.html | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 121b36b9..acf88900 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -400,7 +400,7 @@ function auto_link($str, $type = 'both', $popup = FALSE) if ($type != 'url') { - if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) + if (preg_match_all("/([a-zA-Z0-9_\.\-\+Ã…]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) { for ($i = 0; $i < sizeof($matches['0']); $i++) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3bf065e2..dfb11fbf 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,27 +77,28 @@

    Version 1.7

  • Database
      -
    • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid +
    • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
  • Helpers
    • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
    • -
    • Added current_url() and uri_segments() to URL helper..
    • -
    • Improved accuracy of calculations in Number helper..
    • +
    • Added current_url() and uri_segments() to URL helper.
    • +
    • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
    • +
    • Improved accuracy of calculations in Number helper.
    • Removed added newlines ("\n") from most form and html helper functions.
    • -
    • Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.
    • -
    • Updated Date Helper to match the world's current time zones and offsets.
    • +
    • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
    • +
    • Updated Date helper to match the world's current time zones and offsets.
  • Other changes
      -
    • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
    • +
    • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
    • +
    • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
    • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
    • -
    • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
    • Added PHP Style Guide to docs.
    • -
    • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
    • +
    • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
    • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • @@ -105,7 +106,7 @@

    Version 1.7

    Bug fixes for 1.7.0

      -
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • +
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254).
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • @@ -114,12 +115,12 @@

      Bug fixes for 1.7.0

    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • -
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • +
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • Fixed the spelling of "raspberry" in config/smileys.php
    • -
    • Fixed incorrect parenthesis in form_open() function. (#5135)
    • +
    • Fixed incorrect parenthesis in form_open() function. (#5135)
    • Fixed a bug that was ignoring case when comparing controller methods (#4560)
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function
    • -
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • +
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.

    Version 1.6.3

    From 3386c849e67ec9820ee1aef4bbfbb61da137b9b1 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 6 Oct 2008 18:10:59 +0000 Subject: [PATCH 1428/2544] Added set_status_header() function to docs --- user_guide/libraries/output.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 304cd0a2..efb3346c 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -99,6 +99,16 @@

    $this->output->set_header();

    $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
    $this->output->set_header("Pragma: no-cache"); + +

    $this->output->set_status_header();

    + +

    Permits you to manually set a server status header. Example:

    + +$this->output->set_status_header('401');
    +// Sets the header as: Unauthorized
    + +

    See here for a full list of headers.

    +

    $this->output->enable_profiler();

    Permits you to enable/disable the Profiler, which will display benchmark and other data From 7f528c34ba7599aa495139be64da78037af155bc Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 6 Oct 2008 18:12:01 +0000 Subject: [PATCH 1429/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index dfb11fbf..4d90f6fd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,6 +72,7 @@

    Version 1.7

  • Added controller class/method info to Profiler class.
  • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
  • Added max_filename option to set a file name length limit in the File Upload Class.
  • +
  • Added set_status_header() function to Output class
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
  • From b4a6cf35fe8c637cec5be811f109f6f841456283 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 6 Oct 2008 18:39:36 +0000 Subject: [PATCH 1430/2544] Added some code to ignore empty folders when deleting directories --- system/helpers/file_helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 58951823..6378784f 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -132,7 +132,11 @@ function delete_files($path, $del_dir = FALSE, $level = 0) { if (is_dir($path.'/'.$filename)) { - delete_files($path.'/'.$filename, $del_dir, $level + 1); + // Ignore empty folders + if (substr($filename, 0, 1) != '.') + { + delete_files($path.'/'.$filename, $del_dir, $level + 1); + } } else { From 2cad6e9da8b94833503d0d2f545bcaa29d50bd5d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 00:19:34 +0000 Subject: [PATCH 1431/2544] There was a call to $this->input->_remove_invisible_characters($str); It should have been: $this->input->CI->_remove_invisible_characters($str); --- system/database/DB_forge.php | 2 +- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index d48165e2..64f95d63 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -191,7 +191,7 @@ function create_table($table = '', $if_not_exists = FALSE) } $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); - + $this->_reset(); return $this->db->query($sql); } diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index fd3f9638..9d7e072a 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -214,7 +214,7 @@ function trans_rollback() function escape_str($str) { // Escape single quotes - return str_replace("'", "''", $this->input->_remove_invisible_characters($str)); + return str_replace("'", "''", $this->CI->input->_remove_invisible_characters($str)); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 9d919325..98c99329 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -366,7 +366,7 @@ function trans_rollback() */ function escape_str($str) { - return $this->input->_remove_invisible_characters($str); + return $this->input->CI->_remove_invisible_characters($str); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 06282e55..a64eb56b 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -235,7 +235,7 @@ function trans_rollback() function escape_str($str) { // ODBC doesn't require escaping - return $this->input->_remove_invisible_characters($str); + return $this->input->CI->_remove_invisible_characters($str); } // -------------------------------------------------------------------- From b6ba6a3a8ef3d594ff3f32f2d128a8211f1d2db3 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 00:44:41 +0000 Subject: [PATCH 1432/2544] Added support for empty connection strings, based on bug # 3135 --- .../drivers/postgre/postgre_driver.php | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 55f65028..aada164d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -38,6 +38,35 @@ class CI_DB_postgre_driver extends CI_DB { var $_count_string = "SELECT COUNT(*) AS "; var $_random_keyword = ' RANDOM()'; // database specific random keyword + /** + * Connection String + * + * @access private + * @return string + */ + function _connect_string() + { + $components = array( + 'hostname' => 'host', + 'port' => 'port', + 'database' => 'dbname', + 'username' => 'user', + 'password' => 'password' + ); + + $connect_string = ""; + foreach ($components as $key => $val) + { + if (isset($this->$key) && $this->$key != '') + { + $connect_string .= " $val=".$this->$key; + } + } + return trim($connect_string); + } + + // -------------------------------------------------------------------- + /** * Non-persistent database connection * @@ -45,10 +74,8 @@ class CI_DB_postgre_driver extends CI_DB { * @return resource */ function db_connect() - { - $port = ($this->port == '') ? '' : " port=".$this->port; - - return @pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); + { + return @pg_connect($this->_connect_string()); } // -------------------------------------------------------------------- @@ -61,9 +88,7 @@ function db_connect() */ function db_pconnect() { - $port = ($this->port == '') ? '' : " port=".$this->port; - - return @pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password); + return @pg_pconnect($this->_connect_string()); } // -------------------------------------------------------------------- From ceb6f0bfdeaad23bad419ff4e62519342cc03d05 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 00:48:19 +0000 Subject: [PATCH 1433/2544] Added $params to ODBC constructor, based on bug report #3374 --- system/database/drivers/odbc/odbc_driver.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index a64eb56b..7c59c306 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -39,8 +39,16 @@ class CI_DB_odbc_driver extends CI_DB { var $_random_keyword; - function CI_DB_odbc_driver() + function CI_DB_odbc_driver($params) { + if (is_array($params)) + { + foreach ($params as $key => $val) + { + $this->$key = $val; + } + } + $this->_random_keyword = ' RND('.time().')'; // database specific random keyword } From a2a240a87baa0cf6a425837158880f5235e3bca6 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 00:55:41 +0000 Subject: [PATCH 1434/2544] Fixed a bug (#2985) in which multiple queries using a single request were not being honored --- system/database/DB_driver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index b937ffd6..257f1ee9 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -382,6 +382,7 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $RES->stmt_id = $this->stmt_id; $RES->curs_id = NULL; $RES->limit_used = $this->limit_used; + $this->stmt_id = FALSE; } // Is query caching enabled? If so, we'll serialize the From 482ee4325894bb05b4f97bb9e9ded14e5fce93ba Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 00:59:08 +0000 Subject: [PATCH 1435/2544] Fixed Oracle bug (#3306) that was preventing multiple queries in one action --- system/database/drivers/oci8/oci8_driver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 98c99329..362da58f 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -141,6 +141,7 @@ 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); From 69f23c1964c8e7352c5a75702fce30de9d4bd227 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:00:23 +0000 Subject: [PATCH 1436/2544] --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4d90f6fd..d77ed089 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -122,6 +122,8 @@

    Bug fixes for 1.7.0

  • Fixed a bug that was ignoring case when comparing controller methods (#4560)
  • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function
  • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
  • +
  • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
  • +
  • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
  • Version 1.6.3

    From 06a2e74e8834e88e4639d17dc756403985ca00f8 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:04:15 +0000 Subject: [PATCH 1437/2544] Oops! Didn't realize that the CI super object was not being used by the main Driver. Fixed... --- system/database/drivers/mssql/mssql_driver.php | 7 +++++-- system/database/drivers/oci8/oci8_driver.php | 5 ++++- system/database/drivers/odbc/odbc_driver.php | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 9d7e072a..1c6249ae 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -212,9 +212,12 @@ function trans_rollback() * @return string */ function escape_str($str) - { + { + // Access the CI object + $CI->get_instance(); + // Escape single quotes - return str_replace("'", "''", $this->CI->input->_remove_invisible_characters($str)); + return str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 362da58f..82bc51bf 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -367,7 +367,10 @@ function trans_rollback() */ function escape_str($str) { - return $this->input->CI->_remove_invisible_characters($str); + // Access the CI object + $CI->get_instance(); + + return $CI->_remove_invisible_characters($str); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 7c59c306..985c975c 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -242,8 +242,11 @@ function trans_rollback() */ function escape_str($str) { + // Access the CI object + $CI->get_instance(); + // ODBC doesn't require escaping - return $this->input->CI->_remove_invisible_characters($str); + return $CI->_remove_invisible_characters($str); } // -------------------------------------------------------------------- From 9f0de7967cc2c5fe8140a3042bb900c43ab8336c Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:09:40 +0000 Subject: [PATCH 1438/2544] Added a file lock check during cache writing, as per suggestion at bug #3466 --- system/libraries/Output.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 781e368c..98a941af 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -389,9 +389,16 @@ function _write_cache($output) $expire = time() + ($this->cache_expiration * 60); - flock($fp, LOCK_EX); - fwrite($fp, $expire.'TS--->'.$output); - flock($fp, LOCK_UN); + if (flock($fp, LOCK_EX)) + { + fwrite($fp, $expire.'TS--->'.$output); + flock($fp, LOCK_UN); + } + else + { + log_message('error', "Unable to secure a file lock for file at: ".$cache_path); + return; + } fclose($fp); @chmod($cache_path, DIR_WRITE_MODE); From a94264a4e1c0d5b56be22fa6355b761d5c455371 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:10:52 +0000 Subject: [PATCH 1439/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d77ed089..4cb6266e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -101,6 +101,7 @@

    Version 1.7

  • Added PHP Style Guide to docs.
  • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
  • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • +
  • Added a file lock check during caching, before trying to write to the file.
  • From 218839a7f4910834e4e991c6650da05b1bd7f743 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:15:48 +0000 Subject: [PATCH 1440/2544] Fixed bug (#3472) that was adding quotes incorrectly. --- system/database/drivers/mssql/mssql_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 1c6249ae..d0e1092e 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -470,11 +470,11 @@ function _protect_identifiers($item, $first_word_only = FALSE) // This function may get "field >= 1", and need it to return ""field" >= 1" $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; - $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1"$2"$3', $item); + $item = preg_replace('/(^'.$lbound.')([\w\d\-\_]+?)(\s|\)|$)/iS', '$1$2$3', $item); } else { - return "\"{$item}\""; + return $item; } $exceptions = array('AS', '/', '-', '%', '+', '*', 'OR', 'IS'); From ca86a7cf108fe13b89ba22b727a10ab3ac58db19 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:16:57 +0000 Subject: [PATCH 1441/2544] --- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index d0e1092e..ed6eadbf 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -214,7 +214,7 @@ function trans_rollback() function escape_str($str) { // Access the CI object - $CI->get_instance(); + $CI =& get_instance(); // Escape single quotes return str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 82bc51bf..96a6a135 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -368,7 +368,7 @@ function trans_rollback() function escape_str($str) { // Access the CI object - $CI->get_instance(); + $CI =& get_instance(); return $CI->_remove_invisible_characters($str); } diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 985c975c..29928807 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -243,7 +243,7 @@ function trans_rollback() function escape_str($str) { // Access the CI object - $CI->get_instance(); + $CI =& get_instance(); // ODBC doesn't require escaping return $CI->_remove_invisible_characters($str); From 5aa8c60392a89140448691b838a90b7d1c644774 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:24:07 +0000 Subject: [PATCH 1442/2544] Explicitly added driver name variable in each DB driver, based on this bug report: #4436 --- system/database/drivers/mssql/mssql_driver.php | 3 ++- system/database/drivers/mysql/mysql_driver.php | 2 ++ system/database/drivers/mysqli/mysqli_driver.php | 2 ++ system/database/drivers/oci8/oci8_driver.php | 2 ++ system/database/drivers/odbc/odbc_driver.php | 2 ++ system/database/drivers/postgre/postgre_driver.php | 2 ++ system/database/drivers/sqlite/sqlite_driver.php | 2 ++ 7 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index ed6eadbf..02b975ad 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -37,7 +37,8 @@ class CI_DB_mssql_driver extends CI_DB { */ var $_count_string = "SELECT COUNT(*) AS "; var $_random_keyword = ' ASC'; // not currently supported - + var $dbdriver = 'mssql'; + /** * Non-persistent database connection * diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 52df1e59..db04c6de 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -30,6 +30,8 @@ */ class CI_DB_mysql_driver extends CI_DB { + var $dbdriver = 'mysql'; + /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 35a7fc07..a5d104cc 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -30,6 +30,8 @@ */ class CI_DB_mysqli_driver extends CI_DB { + var $dbdriver = 'mysqli'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 96a6a135..006e6ef1 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -43,6 +43,8 @@ class CI_DB_oci8_driver extends CI_DB { + var $dbdriver = 'oci8'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 29928807..cc8d3347 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -30,6 +30,8 @@ */ class CI_DB_odbc_driver extends CI_DB { + var $dbdriver = 'odbc'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index aada164d..c5c70a73 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -30,6 +30,8 @@ */ class CI_DB_postgre_driver extends CI_DB { + var $dbdriver = 'postgre'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 78215694..df19dba7 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -32,6 +32,8 @@ */ class CI_DB_sqlite_driver extends CI_DB { + var $dbdriver = 'sqlite'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is From 920b422881cd983c1e519852741ac324933437c2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 7 Oct 2008 01:25:11 +0000 Subject: [PATCH 1443/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4cb6266e..a822b6c4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -102,6 +102,7 @@

    Version 1.7

  • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
  • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • Added a file lock check during caching, before trying to write to the file.
  • +
  • Added driver name variable in each DB driver, based on this bug report: #4436
  • From 98e2532e5bd31dc8ec7c88e60b463436157ca011 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 7 Oct 2008 02:03:16 +0000 Subject: [PATCH 1444/2544] unset $Version, $Path, and $Domain cookie keys, to prevent Disallowed Key Characters from halting app execution on environments which improperly set these as keys --- system/libraries/Input.php | 8 ++++++++ user_guide/changelog.html | 2 ++ 2 files changed, 10 insertions(+) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 853b06d7..f840c433 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -140,6 +140,14 @@ function _sanitize_globals() $_POST = $this->_clean_input_data($_POST); // Clean $_COOKIE Data + // Also get rid of specially treated cookies that might be set by a server + // or silly application, that are of no use to a CI application anyway + // but that when present will trip our 'Disallowed Key Characters' alarm + // http://www.ietf.org/rfc/rfc2109.txt + // note that the key names below are single quoted strings, and are not PHP variables + unset($_COOKIE['$Version']); + unset($_COOKIE['$Path']); + unset($_COOKIE['$Domain']) $_COOKIE = $this->_clean_input_data($_COOKIE); log_message('debug', "Global POST and COOKIE data sanitized"); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a822b6c4..6595807b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -103,6 +103,8 @@

    Version 1.7

  • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • Added a file lock check during caching, before trying to write to the file.
  • Added driver name variable in each DB driver, based on this bug report: #4436
  • +
  • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, + preventing CI from halting execution.
  • From bfbe73500060cf1e3b5dd7901e78ca7c1474b84e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 7 Oct 2008 02:40:47 +0000 Subject: [PATCH 1445/2544] syntax error --- system/libraries/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index f840c433..4e312c7a 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -147,7 +147,7 @@ function _sanitize_globals() // note that the key names below are single quoted strings, and are not PHP variables unset($_COOKIE['$Version']); unset($_COOKIE['$Path']); - unset($_COOKIE['$Domain']) + unset($_COOKIE['$Domain']); $_COOKIE = $this->_clean_input_data($_COOKIE); log_message('debug', "Global POST and COOKIE data sanitized"); From d8ee6c86e4a3bbaf392679773e69f4791e3a3239 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 7 Oct 2008 13:32:40 +0000 Subject: [PATCH 1446/2544] minor formatting --- user_guide/changelog.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6595807b..ce940059 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,7 +72,7 @@

    Version 1.7

  • Added controller class/method info to Profiler class.
  • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
  • Added max_filename option to set a file name length limit in the File Upload Class.
  • -
  • Added set_status_header() function to Output class
  • +
  • Added set_status_header() function to Output class.
  • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
  • @@ -102,7 +102,7 @@

    Version 1.7

  • Added backticks around column names in MySQL when using insert_string and update_string functions, and in where() function.
  • Modified Pagination library to only output the "First" link when the link for page one would not be shown.
  • Added a file lock check during caching, before trying to write to the file.
  • -
  • Added driver name variable in each DB driver, based on this bug report: #4436
  • +
  • Added driver name variable in each DB driver, based on bug report #4436.
  • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
  • @@ -114,18 +114,18 @@

    Bug fixes for 1.7.0

  • Fixed bug in xss_clean() that could remove some desirable tag attributes.
  • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254).
  • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
  • -
  • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
  • +
  • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
  • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
  • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
  • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
  • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
  • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
  • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
  • -
  • Fixed the spelling of "raspberry" in config/smileys.php
  • -
  • Fixed incorrect parenthesis in form_open() function. (#5135)
  • -
  • Fixed a bug that was ignoring case when comparing controller methods (#4560)
  • -
  • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function
  • -
  • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
  • +
  • Fixed the spelling of "raspberry" in config/smileys.php.
  • +
  • Fixed incorrect parenthesis in form_open() function (#5135).
  • +
  • Fixed a bug that was ignoring case when comparing controller methods (#4560).
  • +
  • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
  • +
  • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
  • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
  • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
  • From a8664295b31968aa29556b93b13bb6a6080be19e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 8 Oct 2008 22:38:31 +0000 Subject: [PATCH 1447/2544] moved call to $RES->num_rows() further down in code so that oracle-specific class variables would be set properly as needed before executing --- system/database/DB_driver.php | 4 +++- user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 257f1ee9..572595f4 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -375,7 +375,6 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $RES = new $driver(); $RES->conn_id = $this->conn_id; $RES->result_id = $this->result_id; - $RES->num_rows = $RES->num_rows(); if ($this->dbdriver == 'oci8') { @@ -385,6 +384,9 @@ function query($sql, $binds = FALSE, $return_object = TRUE) $this->stmt_id = FALSE; } + // oci8 vars must be set before calling this + $RES->num_rows = $RES->num_rows(); + // Is query caching enabled? If so, we'll serialize the // result object and save it to a cache file. if ($this->cache_on == TRUE AND $this->_cache_init()) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ce940059..c6154f08 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -128,6 +128,7 @@

    Bug fixes for 1.7.0

  • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
  • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
  • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
  • +
  • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
  • Version 1.6.3

    From ccfe9139d574f37163c81d8c7d2c73d6a53d3ab1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 9 Oct 2008 18:46:13 +0000 Subject: [PATCH 1448/2544] fixed spelling of existant to existent --- system/libraries/Loader.php | 4 ++-- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 37cab318..b30798f6 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -891,8 +891,8 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU // Is the class name valid? if ( ! class_exists($name)) { - log_message('error', "Non-existant class: ".$name); - show_error("Non-existant class: ".$class); + log_message('error', "Non-existent class: ".$name); + show_error("Non-existent class: ".$class); } // Set the variable name we will assign the class to diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c6154f08..10c35e75 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -129,6 +129,7 @@

    Bug fixes for 1.7.0

  • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
  • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
  • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
  • +
  • Fixed a spelling error in a Loader error message.
  • Version 1.6.3

    From fd275707f6c1a5a63feb8708731d7c97683df765 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 10 Oct 2008 22:37:06 +0000 Subject: [PATCH 1449/2544] modifications to url_title() --- system/helpers/url_helper.php | 19 ++++++++++--------- user_guide/changelog.html | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index acf88900..002090df 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -479,19 +479,20 @@ function url_title($str, $separator = 'dash') } $trans = array( - $search => $replace, - "\s+" => $replace, - "[^a-z0-9".$replace."]" => '', - $replace."+" => $replace, - $replace."$" => '', - "^".$replace => '' - ); + '&\#\d+?;' => '', + '&\S+?;' => '', + '\s+' => $replace, + '[^a-z0-9\-\._]' => '', + $replace.'+' => $replace, + $replace.'$' => $replace, + '^'.$replace => $replace + ); - $str = strip_tags(strtolower($str)); + $str = strip_tags($str); foreach ($trans as $key => $val) { - $str = preg_replace("#".$key."#", $val, $str); + $str = preg_replace("#".$key."#i", $val, $str); } return trim(stripslashes($str)); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 10c35e75..75cb819b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,6 +91,8 @@

    Version 1.7

  • Removed added newlines ("\n") from most form and html helper functions.
  • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
  • Updated Date helper to match the world's current time zones and offsets.
  • +
  • Modified url_title() in the URL helper to remove characters and digits that are part of + character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
  • Other changes From 42597a107d799fa86ebc706bf8cbac4f9471d08c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 15 Oct 2008 14:10:44 +0000 Subject: [PATCH 1450/2544] Added support for arbitrary attributes in anchor_popup() of the URL helper. --- system/helpers/url_helper.php | 112 ++++++++++++++++++---------------- user_guide/changelog.html | 1 + 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 002090df..744295f4 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -36,7 +36,7 @@ * @access public * @param string * @return string - */ + */ if ( ! function_exists('site_url')) { function site_url($uri = '') @@ -55,7 +55,7 @@ function site_url($uri = '') * * @access public * @return string - */ + */ if ( ! function_exists('base_url')) { function base_url() @@ -75,7 +75,7 @@ function base_url() * * @access public * @return string - */ + */ if ( ! function_exists('current_url')) { function current_url() @@ -89,11 +89,11 @@ function current_url() /** * URL String * - * Returns the URI segments. + * Returns the URI segments. * * @access public * @return string - */ + */ if ( ! function_exists('uri_string')) { function uri_string() @@ -112,7 +112,7 @@ function uri_string() * * @access public * @return string - */ + */ if ( ! function_exists('index_page')) { function index_page() @@ -121,7 +121,7 @@ function index_page() return $CI->config->item('index_page'); } } - + // ------------------------------------------------------------------------ /** @@ -134,13 +134,13 @@ function index_page() * @param string the link title * @param mixed any attributes * @return string - */ + */ if ( ! function_exists('anchor')) { function anchor($uri = '', $title = '', $attributes = '') { $title = (string) $title; - + if ( ! is_array($uri)) { $site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri; @@ -149,7 +149,7 @@ function anchor($uri = '', $title = '', $attributes = '') { $site_url = site_url($uri); } - + if ($title == '') { $title = $site_url; @@ -163,7 +163,7 @@ function anchor($uri = '', $title = '', $attributes = '') return ''.$title.''; } } - + // ------------------------------------------------------------------------ /** @@ -181,35 +181,41 @@ function anchor($uri = '', $title = '', $attributes = '') if ( ! function_exists('anchor_popup')) { function anchor_popup($uri = '', $title = '', $attributes = FALSE) - { + { $title = (string) $title; - + $site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri; - + if ($title == '') { $title = $site_url; } - + if ($attributes === FALSE) { return "".$title.""; } - + if ( ! is_array($attributes)) { $attributes = array(); } - + foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val) { $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key]; + unset($attributes[$key]); + } + + if ($attributes != '') + { + $attributes = _parse_attributes($attributes); } - return "".$title.""; + return "".$title.""; } } - + // ------------------------------------------------------------------------ /** @@ -226,18 +232,18 @@ function anchor_popup($uri = '', $title = '', $attributes = FALSE) function mailto($email, $title = '', $attributes = '') { $title = (string) $title; - + if ($title == "") { $title = $email; } - + $attributes = _parse_attributes($attributes); - + return ''.$title.''; } } - + // ------------------------------------------------------------------------ /** @@ -256,17 +262,17 @@ function mailto($email, $title = '', $attributes = '') function safe_mailto($email, $title = '', $attributes = '') { $title = (string) $title; - + if ($title == "") { $title = $email; } - + for ($i = 0; $i < 16; $i++) { $x[] = substr(' - - - - - - - - - - - -Change Log : CodeIgniter User Guide - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Change Log

    - -

    Version 1.7.1

    -

    Release Date: not yet released
    -SVN Revision:

    - -
      -
    • Libraries -
        -
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • -
      -
    • -
    - -

    Bug fixes for 1.7.1

    -
      -
    • Fixed a bug in the MySQLi driver when no port is specified
    • -
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • -
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • -
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.

      -
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • -
    - - -

    Version 1.7

    -

    Release Date: October 23, 2008
    -SVN Revision: 1541

    - -
      -
    • Libraries -
        -
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • -
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • -
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • -
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • -
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • -
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • -
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • -
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • -
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • -
      • Added set_status_header() function to Output class.
      • -
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • -
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • -
      -
    • -
    • Database -
        -
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • -
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • -
      • Added Active Record caching feature to "update" and "delete" functions.
      • -
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • -
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • -
      • Added driver name variable in each DB driver, based on bug report #4436.
      • -
      -
    • -
    • Helpers -
        -
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • -
      • Added current_url() and uri_segments() to URL helper.
      • -
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • -
      • Added meta() function to HTML helper.
      • -
      • Improved accuracy of calculations in Number helper.
      • -
      • Removed added newlines ("\n") from most form and html helper functions.
      • -
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • -
      • Updated Date helper to match the world's current time zones and offsets.
      • -
      • Modified url_title() in the URL helper to remove characters and digits that are part of - character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • -
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • -
      -
    • -
    • Other Changes -
        -
      • Added PHP Style Guide to docs.
      • -
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • -
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • -
      • Added a file lock check during caching, before trying to write to the file.
      • -
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • -
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • -
      -
    • -
    - -

    Bug fixes for 1.7.0

    -
      -
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • -
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • -
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • -
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • -
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • -
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • -
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • -
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • -
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • -
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • -
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • -
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • -
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • -
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • -
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • -
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • -
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • -
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • -
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • -
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • -
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • -
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • -
    • Fixed DB backup bug in which field names were not being escaped.
    • -
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • -
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • -
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • -
    • Fixed a spelling error in a Loader error message.
    • -
    • Fixed a bug (5050) with IP validation with empty segments.
    • -
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • -
    - -

    Version 1.6.3

    -

    Release Date: June 26, 2008
    -SVN Revision: 1238

    -

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    -
      -
    • Database -
        -
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • -
      • Added ability to set multiple column non-primary keys to the Forge class
      • -
      • Added ability to set additional database config values in DSN connections via the query string.
      • -
      -
    • -
    • Libraries -
        -
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • -
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • -
      • Added get_post() to the Input class.
      • -
      • Documented get() in the Input class.
      • -
      • Added the ability to automatically output language items as form labels in the Language class.
      • -
      -
    • -
    • Helpers - -
    • -
    • Other changes -
        -
      • Improved security in xss_clean().
      • -
      • Removed an unused Router reference in _display_cache().
      • -
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • -
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • -
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • -
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • -
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • -
      • Documented the language file use of byte_format() in the number helper.
      • -
      -
    • -
    - - -

    Bug fixes for 1.6.3

    - -
      -
    • Added a language key for valid_emails in validation_lang.php.
    • -
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • -
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • -
    • Fixed a syntax error in upload_lang.php.
    • -
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • -
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • -
    • Removed some unused variables from the code (#4563).
    • -
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • -
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • -
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • -
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • -
    - -

    Version 1.6.2

    -

    Release Date: May 13, 2008
    -SVN Revision: 1155

    -
      -
    • Active Record -
        -
      • Added the ability to prevent escaping in having() clauses.
      • -
      • Added rename_table() into DBForge.
      • -
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • -
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • -
      -
    • -
    • Database -
        -
      • Added Strict Mode to database transactions.
      • -
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • -
      -
    • -
    • Config -
        -
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • -
      • Added 'audio/mpg' to list of mime types.
      • -
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      -
    • -
    • Libraries -
        -
      • Added increased security for filename handling in the Upload library.
      • -
      • Added increased security for sessions for client-side data tampering.
      • -
      • The MySQLi forge class is now in sync with MySQL forge.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • -
      • Added a valid_emails rule to the Validation class.
      • -
      • The Zip class now exits within download().
      • -
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • -
      -
    • -
    • Helpers -
        -
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • -
      • Added form_button() in the Form helper.
      • -
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • -
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • -
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • -
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • -
      • The Download helper now exits within force_download().
      • -
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • -
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • -
      -
    • -
    • Plugins -
        -
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • -
      -
    • -
    • Other - Changes -
        -
      • Added ability for xss_clean() to accept arrays.
      • -
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • -
      • Removed "scripts" from the auto-load search path. Scripts were deprecated - in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • -
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • -
      • Added a Common Functions page to the userguide for globally available functions.
      • -
      • Improved security and performance of xss_clean().
      • -
      -
    • -
    - -

    Bugfixes for 1.6.2

    -
      -
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • -
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • -
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • -
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • -
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • -
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • -
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • -
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • -
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • -
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • -
    • Fixed an AR bug with or_where_not_in() (#4171).
    • -
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • -
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • -
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • -
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • -
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • -
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • -
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • -
    • Fixed a bug in the DB class testing the $params argument.
    • -
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • -
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • -
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • -
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • -
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • -
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • -
    • Fixed an array to string conversion error in the Validation library (#4425)
    • -
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • -
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • -
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • -
    - -

    Version 1.6.1

    -

    Release Date: February 12, 2008
    - SVN Revision: 984

    -
      -
    • Active Record - -
    • -
    • Database drivers -
        -
      • Added support for setting client character set and collation for MySQLi.
      • -
      -
    • -
    • Core Changes -
        -
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • -
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • -
      • Added a 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 characters to the end of the default expression.
      • -
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • -
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • -
      -
    • -
    • Helpers -
        -
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • -
      -
    • -
    - - -

    Bugfixes for 1.6.1

    -
      -
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • -
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • -
    • Made Active Record fully database prefix aware (#3384).
    • -
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • -
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • -
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • -
    • Fixed a bug in query binding (#3402).
    • -
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • -
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • -
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • -
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • -
    • Fixed assorted user guide typos.
    • -
    - - - -

    Version 1.6.0

    -

    Release Date: January 30, 2008

    -
      -
    • DBForge -
        -
      • Added DBForge to the database tools.
      • -
      • Moved create_database() and drop_database() into DBForge.
      • -
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • -
      -
    • - -
    • Active Record -
        -
      • Added protect_identifiers() in Active Record.
      • -
      • All AR queries are backticked if appropriate to the database.
      • -
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • -
      • Added support for limit() into update() and delete() statements in Active Record.
      • -
      • Added empty_table() and truncate_table() to Active Record.
      • -
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • -
      • Added count_all_results() function to Active Record.
      • -
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • -
      • Added the ability to use aliases with joins in Active Record.
      • -
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • -
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • -
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • -
      -
    • - -
    • Other Database Related -
        -
      • MySQL driver now requires MySQL 4.1+
      • -
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • -
      • Added $this->db->dbprefix() to manually add database prefixes.
      • -
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • -
      • Added a check for NULL fields in the MySQL database backup utility.
      • -
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • -
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • -
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • -
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • -
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more - in harmony with the global nature of the behavior (#1834).
      • -
      -
    • - -
    • Core changes -
        -
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • -
      • Added the ability to auto-load Models.
      • -
      • Reorganized the URI and Routes classes for better clarity.
      • -
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • -
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • -
      • Deprecated Scaffolding.
      • -
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • -
      -
    • - -
    • Libraries -
        -
      • Changed the load protocol of Models to allow for extension.
      • -
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • -
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • -
      • Removed 'last_visit' from the Session class.
      • -
      • Added a language entry for valid_ip validation error.
      • -
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • -
      • Added an "integer" rule into the Validation library.
      • -
      • Added valid_base64() to the Validation library.
      • -
      • Documented clear() in the Image Processing library.
      • -
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • -
      • Modified Upload class $_FILES error messages to be more precise.
      • -
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • -
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • -
      • Added a few additional mime type variations for CSV.
      • -
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • -
      -
    • - -
    • Helpers & Plugins -
        -
      • Added link_tag() to the HTML helper.
      • -
      • Added img() to the HTML helper.
      • -
      • Added ability to "extend" Helpers.
      • -
      • Added an email helper into core helpers.
      • -
      • Added strip_quotes() function to string helper.
      • -
      • Added reduce_multiples() function to string helper.
      • -
      • Added quotes_to_entities() function to string helper.
      • -
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • -
      • Added support for external urls in form_open().
      • -
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • -
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • -
      -
    • - - -
    • Documentation Changes -
        -
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • -
      • Added titles to all user manual pages.
      • -
      • Added attributes into <html> of userguide for valid html.
      • -
      • Added Zip Encoding Class to the table of contents of the userguide.
      • -
      • Moved part of the userguide menu javascript to an external file.
      • -
      • Documented distinct() in Active Record.
      • -
      • Documented the timezones() function in the Date Helper.
      • -
      • Documented unset_userdata in the Session class.
      • -
      • Documented 2 config options to the Database configuration page.
      • -
      -
    • -
    - -

    Bug fixes for Version 1.6.0

    - -
      -
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • -
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • -
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • -
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • -
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • -
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • -
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • -
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • -
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • -
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • -
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • -
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • -
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • -
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • -
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • -
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • -
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • -
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • -
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • -
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • -
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • -
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • -
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • -
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • -
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • -
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • -
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • -
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • -
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • -
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • -
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • -
    • Removed an extraneous call to loading models (#3286).
    • -
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • -
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • -
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • -
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • -
    • Removed an unused parameter from Profiler (#3332).
    • -
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • -
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • -
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • -
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • -
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • -
    • Fixed a bug in captcha calling an invalid PHP function.
    • -
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • -
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • -
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • -
    • Fixed an example of comma-separated emails in the email library documentation.
    • -
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • -
    • Fixed a typo in the database language file.
    • -
    • Fixed a typo in the image language file "suppor" to "support".
    • -
    • Fixed an example for XML RPC.
    • -
    • Fixed an example of accept_charset() in the User Agent Library.
    • -
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • -
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • -
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • -
    • Added a stripslashes() into the Upload Library.
    • -
    • Fixed a series of grammatical and spelling errors in the language files.
    • -
    • Fixed assorted user guide typos.
    • -
    -

    Version 1.5.4

    -

    Release Date: July 12, 2007

    -
      -
    • Added custom Language files to the autoload options.
    • -
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • -
    • Added array to string into the profiler.
    • -
    • Added some additional mime types in application/config/mimes.php.
    • -
    • Added filename_security() method to Input library.
    • -
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • -
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • -
    • Fixed MSSQL insert_id().
    • -
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • -
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • -
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • -
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • -
    • Fixed a typo in the Calendar library
    • -
    • Fixed a typo in rpcs.php library
    • -
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • -
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • -
    • Fixed an IP validation bug.
    • -
    • Fixed a bug in display of POST keys in the Profiler output
    • -
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • -
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • -
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • -
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • -
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • -
    • Fixed various doc typos.
    • -
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • -
    • Docs now validate to XHTML 1 transitional
    • -
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • -
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • -
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • -
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • -
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • -
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • -
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • -
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • -
    -

    Version 1.5.3

    -

    Release Date: April 15, 2007

    -
      -
    • Added array to string into the profiler
    • -
    • Code Igniter references updated to CodeIgniter
    • -
    • pMachine references updated to EllisLab
    • -
    • Fixed a bug in the repeater function of string helper.
    • -
    • Fixed a bug in ODBC driver
    • -
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • -
    • Fixed a bug in the redirect function of the url helper.
    • -
    • Fixed an undefined variable in Loader
    • -
    • Fixed a version bug in the Postgres driver
    • -
    • Fixed a bug in the textarea function of the form helper for use with strings
    • -
    • Fixed doc typos.
    • -
    -

    Version 1.5.2

    -

    Release Date: February 13, 2007

    -
      -
    • Added subversion information to the downloads page.
    • -
    • Added support for captions in the Table Library
    • -
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • -
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • -
    • Removed unescaped variables in error messages of Input and Router classes
    • -
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • -
    • Fixed a bug in the form helper that gave textarea a value attribute
    • -
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • -
    • Fixed some doc typos.
    • -
    - - -

    Version 1.5.1

    -

    Release Date: November 23, 2006

    -
      -
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • -
    • Added support for naming custom library files in lower or uppercase.
    • -
    • Fixed a bug related to output buffering.
    • -
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • -
    • Fixed a bug that was suppressing errors in controllers.
    • -
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • -
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • -
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • -
    • Fixed some bugs in the Oracle DB driver.
    • -
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • -
    • Fixed some doc typos.
    • -
    -

    Version 1.5.0.1

    -

    Release Date: October 31, 2006

    -
      -
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • -
    • Fixed a bug in the word_wrap() helper function.
    • -
    • Fixed an invalid color Hex number in the Profiler class.
    • -
    • Fixed a corrupted image in the user guide.
    • -
    - - - -

    Version 1.5.0

    -

    Release Date: October 30, 2006

    - -
      -
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • -
    • Added Database Caching Class.
    • -
    • Added transaction support to the database classes.
    • -
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • -
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • -
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • -
    • Added Zip Encoding Library.
    • -
    • Added FTP Library.
    • -
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • -
    • Added support for storing models within sub-folders.
    • -
    • Added Download Helper.
    • -
    • Added simple_query() function to the database classes
    • -
    • Added standard_date() function to the Date Helper.
    • -
    • Added $query->free_result() to database class.
    • -
    • Added $query->list_fields() function to database class
    • -
    • Added $this->db->platform() function
    • -
    • Added new File Helper: get_filenames()
    • -
    • Added new helper: Smiley Helper
    • -
    • Added support for <ul> and <ol> lists in the HTML Helper
    • -
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • -
    • Added the ability to rename or relocate the "application" folder.
    • -
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • -
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • -
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • -
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • -
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • -
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • -
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • -
    • Fixed a bug in the Email class related to SMTP Helo data.
    • -
    • Fixed a bug in the word wrapping helper and function in the email class.
    • -
    • Fixed a bug in the validation class.
    • -
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • -
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • -
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • -
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • -
    • Fixed a pagination bug that was permitting negative values in the URL.
    • -
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • -
    • Changed _get_config() to get_config() since the function is not a private one.
    • -
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • -
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • -
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • -
    - - - - -

    Version 1.4.1

    -

    Release Date: September 21, 2006

    - -
      -
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • -
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • -
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • -
    • Added $this->output->set_header() function, which allows you to set server headers.
    • -
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • -
    • Added Inflector helper.
    • -
    • Added element() function in the array helper.
    • -
    • Added RAND() to active record orderby() function.
    • -
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • -
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • -
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • -
    • Added output compression option to the config file.
    • -
    • Removed the is_numeric test from the db->escape() function.
    • -
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • -
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • -
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • -
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • -
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • -
    • Added some code to allow email attachments to be reset when sending batches of email.
    • -
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • -
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • -
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • -
    - - - -

    Version 1.4.0

    -

    Release Date: September 17, 2006

    - -
      -
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • -
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • -
    • Added regular expressions support for routing rules.
    • -
    • Added the ability to remap function calls within your controllers.
    • -
    • Added the ability to replace core system classes with your own classes.
    • -
    • Added support for % character in URL.
    • -
    • Added the ability to supply full URLs using the anchor() helper function.
    • -
    • Added mode parameter to file_write() helper.
    • -
    • Added support for changing the port number in the Postgres driver.
    • -
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • -
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • -
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • -
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • -
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • -
    • Updated the form_open() helper to allow the GET method to be used.
    • -
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • -
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • -
    • Updated the Models loader function to allow multiple loads of the same model.
    • -
    • Updated the MS SQL driver so that single quotes are escaped.
    • -
    • Updated the Postgres and ODBC drivers for better compatibility.
    • -
    • Removed a strtolower() call that was changing URL segments to lower case.
    • -
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • -
    • Removed backticks from Postgres class since these are not needed.
    • -
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • -
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • -
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • -
    • Fixed a router bug that was making it too greedy when matching end segments.
    • -
    • Fixed a bug that was preventing multiple discrete database calls.
    • -
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • -
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • -
    • Fixed some missing prefixes when using the database prefix feature.
    • -
    • Fixed a typo in the Calendar class (cal_november).
    • -
    • Fixed a bug in the form_checkbox() helper.
    • -
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • -
    • Fixed an evaluation bug in the database initialization function.
    • -
    • Fixed a minor bug in one of the error messages in the language class.
    • -
    • Fixed a bug in the date helper timespan function.
    • -
    • Fixed an undefined variable in the DB Driver class.
    • -
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • -
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • -
    • Fixed a couple bugs in the Unit Testing class.
    • -
    • Fixed an incorrectly named variable in the Validation class.
    • -
    • Fixed an incorrectly named variable in the URI class.
    • -
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • -
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • -
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • -
    • Fixed some MS SQL bugs.
    • -
    • Fixed some doc typos.
    • -
    - - - -

    Version 1.3.3

    -

    Release Date: June 1, 2006

    - -
      - -
    • Models do not connect automatically to the database as of this version. More info here.
    • -
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • -
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • -
    • Fixed a bug in the active record "having" function.
    • -
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • -
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • -
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • -
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • -
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • -
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • -
    • Fixed a bug in the hash() security helper.
    • -
    • Fixed some typos.
    • -
    - - - - -

    Version 1.3.2

    -

    Release Date: April 17, 2006

    - -
      -
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • -
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • -
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • -
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • -
    • Fixed a couple bugs in the Model class.
    • -
    • Fixed some documentation typos and errata.
    • -
    - - - -

    Version 1.3.1

    -

    Release Date: April 11, 2006

    - -
      -
    • Added a Unit Testing Library.
    • -
    • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • -
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • -
    • Added getwhere function to Active Record class.
    • -
    • Added count_all function to Active Record class.
    • -
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • -
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • -
    • Added a new mime type to the upload class for better compatibility.
    • -
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • -
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • -
    • Fixed a bug in the image library when realpath() returns false.
    • -
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • -
    • Fixed a bug in the "exact_length" function of the validation class.
    • -
    • Fixed some typos in the user guide
    • -
    - - -

    Version 1.3

    -

    Release Date: April 3, 2006

    - -
      -
    • Added support for Models.
    • -
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • -
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • -
    • Added a feature to the database class that lets you run custom function calls.
    • -
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • -
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • -
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • -
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • -
    • Added a new error template for use with native PHP errors.
    • -
    • Added "alternator" function in the string helpers.
    • -
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • -
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • -
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and -all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • -
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • -
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • -
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • -
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • -
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • -
    • Fixed some typos in the default calendar template
    • -
    • Fixed some typos in the user guide
    • -
    - - - - - - - - -

    Version 1.2

    -

    Release Date: March 21, 2006

    - -
      -
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • -
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • -
    • Added new File Helper: delete_files()
    • -
    • Added new URL Helpers: base_url(), index_page()
    • -
    • Added the ability to create your own core libraries and store them in your local application directory.
    • -
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • -
    • Added Javascript Calendar plugin.
    • -
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • -
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • -
    • Fixed a bug in the DB "where" function.
    • -
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • -
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • -
    • Fixed some bugs in the xss_clean function
    • -
    - - - - - -

    Version Beta 1.1

    -

    Release Date: March 10, 2006

    - -
      -
    • Added a Calendaring class.
    • -
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • -
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • -
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • -
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • -
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • -
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • -
    • Fixed a data type error in the form_radio function (form helper)
    • -
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • -
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • -
    • Fixed a pagination problem in the scaffolding.
    • -
    • Fixed a bug in the mysql class "where" function.
    • -
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • -
    • Fixed a bug in the br() function in the HTML helper
    • -
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • -
    • Removed the "style" attributes form the form helpers.
    • -
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • -
    - -

    Version Beta 1.0

    -

    Release Date: February 28, 2006

    -

    First publicly released version.

    - -
    - - - - - - - + + + + + + + + + + + + + + + + + + + +Change Log : CodeIgniter User Guide + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Change Log

    + +

    Version 1.7.1

    +

    Release Date: not yet released
    +SVN Revision:

    + +
      +
    • Libraries +
        +
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • +
      +
    • +
    • Helpers + +
    • +
    + +

    Bug fixes for 1.7.1

    +
      +
    • Fixed a bug in the MySQLi driver when no port is specified
    • +
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • +
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • +
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.

      +
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • +
    + + +

    Version 1.7

    +

    Release Date: October 23, 2008
    +SVN Revision: 1541

    + +
      +
    • Libraries +
        +
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • +
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • +
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • +
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • +
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • +
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • +
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • +
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • +
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • +
      • Added set_status_header() function to Output class.
      • +
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • +
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • +
      +
    • +
    • Database +
        +
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • +
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • +
      • Added Active Record caching feature to "update" and "delete" functions.
      • +
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • +
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • +
      • Added driver name variable in each DB driver, based on bug report #4436.
      • +
      +
    • +
    • Helpers +
        +
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • +
      • Added current_url() and uri_segments() to URL helper.
      • +
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • +
      • Added meta() function to HTML helper.
      • +
      • Improved accuracy of calculations in Number helper.
      • +
      • Removed added newlines ("\n") from most form and html helper functions.
      • +
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • +
      • Updated Date helper to match the world's current time zones and offsets.
      • +
      • Modified url_title() in the URL helper to remove characters and digits that are part of + character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • +
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • +
      +
    • +
    • Other Changes +
        +
      • Added PHP Style Guide to docs.
      • +
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • +
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • +
      • Added a file lock check during caching, before trying to write to the file.
      • +
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • +
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • +
      +
    • +
    + +

    Bug fixes for 1.7.0

    +
      +
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • +
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • +
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • +
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • +
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • +
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • +
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • +
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • +
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • +
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • +
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • +
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • +
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • +
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • +
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • +
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • +
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • +
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • +
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • +
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • +
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • +
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • +
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • +
    • Fixed DB backup bug in which field names were not being escaped.
    • +
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • +
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • +
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • +
    • Fixed a spelling error in a Loader error message.
    • +
    • Fixed a bug (5050) with IP validation with empty segments.
    • +
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • +
    + +

    Version 1.6.3

    +

    Release Date: June 26, 2008
    +SVN Revision: 1238

    +

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    +
      +
    • Database +
        +
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • +
      • Added ability to set multiple column non-primary keys to the Forge class
      • +
      • Added ability to set additional database config values in DSN connections via the query string.
      • +
      +
    • +
    • Libraries +
        +
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • +
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • +
      • Added get_post() to the Input class.
      • +
      • Documented get() in the Input class.
      • +
      • Added the ability to automatically output language items as form labels in the Language class.
      • +
      +
    • +
    • Helpers + +
    • +
    • Other changes +
        +
      • Improved security in xss_clean().
      • +
      • Removed an unused Router reference in _display_cache().
      • +
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • +
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • +
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • +
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • +
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • +
      • Documented the language file use of byte_format() in the number helper.
      • +
      +
    • +
    + + +

    Bug fixes for 1.6.3

    + +
      +
    • Added a language key for valid_emails in validation_lang.php.
    • +
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • +
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • +
    • Fixed a syntax error in upload_lang.php.
    • +
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • +
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • +
    • Removed some unused variables from the code (#4563).
    • +
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • +
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • +
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • +
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • +
    + +

    Version 1.6.2

    +

    Release Date: May 13, 2008
    +SVN Revision: 1155

    +
      +
    • Active Record +
        +
      • Added the ability to prevent escaping in having() clauses.
      • +
      • Added rename_table() into DBForge.
      • +
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • +
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • +
      +
    • +
    • Database +
        +
      • Added Strict Mode to database transactions.
      • +
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • +
      +
    • +
    • Config +
        +
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • +
      • Added 'audio/mpg' to list of mime types.
      • +
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      +
    • +
    • Libraries +
        +
      • Added increased security for filename handling in the Upload library.
      • +
      • Added increased security for sessions for client-side data tampering.
      • +
      • The MySQLi forge class is now in sync with MySQL forge.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • +
      • Added a valid_emails rule to the Validation class.
      • +
      • The Zip class now exits within download().
      • +
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • +
      +
    • +
    • Helpers +
        +
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • +
      • Added form_button() in the Form helper.
      • +
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • +
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • +
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • +
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • +
      • The Download helper now exits within force_download().
      • +
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • +
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • +
      +
    • +
    • Plugins +
        +
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • +
      +
    • +
    • Other + Changes +
        +
      • Added ability for xss_clean() to accept arrays.
      • +
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • +
      • Removed "scripts" from the auto-load search path. Scripts were deprecated + in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • +
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • +
      • Added a Common Functions page to the userguide for globally available functions.
      • +
      • Improved security and performance of xss_clean().
      • +
      +
    • +
    + +

    Bugfixes for 1.6.2

    +
      +
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • +
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • +
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • +
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • +
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • +
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • +
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • +
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • +
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • +
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • +
    • Fixed an AR bug with or_where_not_in() (#4171).
    • +
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • +
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • +
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • +
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • +
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • +
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • +
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • +
    • Fixed a bug in the DB class testing the $params argument.
    • +
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • +
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • +
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • +
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • +
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • +
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • +
    • Fixed an array to string conversion error in the Validation library (#4425)
    • +
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • +
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • +
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • +
    + +

    Version 1.6.1

    +

    Release Date: February 12, 2008
    + SVN Revision: 984

    +
      +
    • Active Record + +
    • +
    • Database drivers +
        +
      • Added support for setting client character set and collation for MySQLi.
      • +
      +
    • +
    • Core Changes +
        +
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • +
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • +
      • Added a 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 characters to the end of the default expression.
      • +
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • +
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • +
      +
    • +
    • Helpers +
        +
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • +
      +
    • +
    + + +

    Bugfixes for 1.6.1

    +
      +
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • +
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • +
    • Made Active Record fully database prefix aware (#3384).
    • +
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • +
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • +
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • +
    • Fixed a bug in query binding (#3402).
    • +
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • +
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • +
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • +
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • +
    • Fixed assorted user guide typos.
    • +
    + + + +

    Version 1.6.0

    +

    Release Date: January 30, 2008

    +
      +
    • DBForge +
        +
      • Added DBForge to the database tools.
      • +
      • Moved create_database() and drop_database() into DBForge.
      • +
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • +
      +
    • + +
    • Active Record +
        +
      • Added protect_identifiers() in Active Record.
      • +
      • All AR queries are backticked if appropriate to the database.
      • +
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • +
      • Added support for limit() into update() and delete() statements in Active Record.
      • +
      • Added empty_table() and truncate_table() to Active Record.
      • +
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • +
      • Added count_all_results() function to Active Record.
      • +
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • +
      • Added the ability to use aliases with joins in Active Record.
      • +
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • +
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • +
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • +
      +
    • + +
    • Other Database Related +
        +
      • MySQL driver now requires MySQL 4.1+
      • +
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • +
      • Added $this->db->dbprefix() to manually add database prefixes.
      • +
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • +
      • Added a check for NULL fields in the MySQL database backup utility.
      • +
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • +
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • +
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • +
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • +
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more + in harmony with the global nature of the behavior (#1834).
      • +
      +
    • + +
    • Core changes +
        +
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • +
      • Added the ability to auto-load Models.
      • +
      • Reorganized the URI and Routes classes for better clarity.
      • +
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • +
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • +
      • Deprecated Scaffolding.
      • +
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • +
      +
    • + +
    • Libraries +
        +
      • Changed the load protocol of Models to allow for extension.
      • +
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • +
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • +
      • Removed 'last_visit' from the Session class.
      • +
      • Added a language entry for valid_ip validation error.
      • +
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • +
      • Added an "integer" rule into the Validation library.
      • +
      • Added valid_base64() to the Validation library.
      • +
      • Documented clear() in the Image Processing library.
      • +
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • +
      • Modified Upload class $_FILES error messages to be more precise.
      • +
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • +
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • +
      • Added a few additional mime type variations for CSV.
      • +
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • +
      +
    • + +
    • Helpers & Plugins +
        +
      • Added link_tag() to the HTML helper.
      • +
      • Added img() to the HTML helper.
      • +
      • Added ability to "extend" Helpers.
      • +
      • Added an email helper into core helpers.
      • +
      • Added strip_quotes() function to string helper.
      • +
      • Added reduce_multiples() function to string helper.
      • +
      • Added quotes_to_entities() function to string helper.
      • +
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • +
      • Added support for external urls in form_open().
      • +
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • +
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • +
      +
    • + + +
    • Documentation Changes +
        +
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • +
      • Added titles to all user manual pages.
      • +
      • Added attributes into <html> of userguide for valid html.
      • +
      • Added Zip Encoding Class to the table of contents of the userguide.
      • +
      • Moved part of the userguide menu javascript to an external file.
      • +
      • Documented distinct() in Active Record.
      • +
      • Documented the timezones() function in the Date Helper.
      • +
      • Documented unset_userdata in the Session class.
      • +
      • Documented 2 config options to the Database configuration page.
      • +
      +
    • +
    + +

    Bug fixes for Version 1.6.0

    + +
      +
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • +
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • +
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • +
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • +
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • +
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • +
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • +
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • +
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • +
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • +
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • +
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • +
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • +
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • +
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • +
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • +
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • +
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • +
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • +
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • +
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • +
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • +
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • +
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • +
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • +
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • +
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • +
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • +
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • +
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • +
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • +
    • Removed an extraneous call to loading models (#3286).
    • +
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • +
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • +
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • +
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • +
    • Removed an unused parameter from Profiler (#3332).
    • +
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • +
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • +
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • +
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • +
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • +
    • Fixed a bug in captcha calling an invalid PHP function.
    • +
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • +
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • +
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • +
    • Fixed an example of comma-separated emails in the email library documentation.
    • +
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • +
    • Fixed a typo in the database language file.
    • +
    • Fixed a typo in the image language file "suppor" to "support".
    • +
    • Fixed an example for XML RPC.
    • +
    • Fixed an example of accept_charset() in the User Agent Library.
    • +
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • +
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • +
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • +
    • Added a stripslashes() into the Upload Library.
    • +
    • Fixed a series of grammatical and spelling errors in the language files.
    • +
    • Fixed assorted user guide typos.
    • +
    +

    Version 1.5.4

    +

    Release Date: July 12, 2007

    +
      +
    • Added custom Language files to the autoload options.
    • +
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • +
    • Added array to string into the profiler.
    • +
    • Added some additional mime types in application/config/mimes.php.
    • +
    • Added filename_security() method to Input library.
    • +
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • +
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • +
    • Fixed MSSQL insert_id().
    • +
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • +
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • +
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • +
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • +
    • Fixed a typo in the Calendar library
    • +
    • Fixed a typo in rpcs.php library
    • +
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • +
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • +
    • Fixed an IP validation bug.
    • +
    • Fixed a bug in display of POST keys in the Profiler output
    • +
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • +
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • +
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • +
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • +
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • +
    • Fixed various doc typos.
    • +
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • +
    • Docs now validate to XHTML 1 transitional
    • +
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • +
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • +
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • +
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • +
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • +
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • +
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • +
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • +
    +

    Version 1.5.3

    +

    Release Date: April 15, 2007

    +
      +
    • Added array to string into the profiler
    • +
    • Code Igniter references updated to CodeIgniter
    • +
    • pMachine references updated to EllisLab
    • +
    • Fixed a bug in the repeater function of string helper.
    • +
    • Fixed a bug in ODBC driver
    • +
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • +
    • Fixed a bug in the redirect function of the url helper.
    • +
    • Fixed an undefined variable in Loader
    • +
    • Fixed a version bug in the Postgres driver
    • +
    • Fixed a bug in the textarea function of the form helper for use with strings
    • +
    • Fixed doc typos.
    • +
    +

    Version 1.5.2

    +

    Release Date: February 13, 2007

    +
      +
    • Added subversion information to the downloads page.
    • +
    • Added support for captions in the Table Library
    • +
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • +
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • +
    • Removed unescaped variables in error messages of Input and Router classes
    • +
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • +
    • Fixed a bug in the form helper that gave textarea a value attribute
    • +
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • +
    • Fixed some doc typos.
    • +
    + + +

    Version 1.5.1

    +

    Release Date: November 23, 2006

    +
      +
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • +
    • Added support for naming custom library files in lower or uppercase.
    • +
    • Fixed a bug related to output buffering.
    • +
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • +
    • Fixed a bug that was suppressing errors in controllers.
    • +
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • +
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • +
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • +
    • Fixed some bugs in the Oracle DB driver.
    • +
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • +
    • Fixed some doc typos.
    • +
    +

    Version 1.5.0.1

    +

    Release Date: October 31, 2006

    +
      +
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • +
    • Fixed a bug in the word_wrap() helper function.
    • +
    • Fixed an invalid color Hex number in the Profiler class.
    • +
    • Fixed a corrupted image in the user guide.
    • +
    + + + +

    Version 1.5.0

    +

    Release Date: October 30, 2006

    + +
      +
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • +
    • Added Database Caching Class.
    • +
    • Added transaction support to the database classes.
    • +
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • +
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • +
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • +
    • Added Zip Encoding Library.
    • +
    • Added FTP Library.
    • +
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • +
    • Added support for storing models within sub-folders.
    • +
    • Added Download Helper.
    • +
    • Added simple_query() function to the database classes
    • +
    • Added standard_date() function to the Date Helper.
    • +
    • Added $query->free_result() to database class.
    • +
    • Added $query->list_fields() function to database class
    • +
    • Added $this->db->platform() function
    • +
    • Added new File Helper: get_filenames()
    • +
    • Added new helper: Smiley Helper
    • +
    • Added support for <ul> and <ol> lists in the HTML Helper
    • +
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • +
    • Added the ability to rename or relocate the "application" folder.
    • +
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • +
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • +
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • +
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • +
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • +
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • +
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • +
    • Fixed a bug in the Email class related to SMTP Helo data.
    • +
    • Fixed a bug in the word wrapping helper and function in the email class.
    • +
    • Fixed a bug in the validation class.
    • +
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • +
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • +
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • +
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • +
    • Fixed a pagination bug that was permitting negative values in the URL.
    • +
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • +
    • Changed _get_config() to get_config() since the function is not a private one.
    • +
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • +
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • +
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • +
    + + + + +

    Version 1.4.1

    +

    Release Date: September 21, 2006

    + +
      +
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • +
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • +
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • +
    • Added $this->output->set_header() function, which allows you to set server headers.
    • +
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • +
    • Added Inflector helper.
    • +
    • Added element() function in the array helper.
    • +
    • Added RAND() to active record orderby() function.
    • +
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • +
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • +
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • +
    • Added output compression option to the config file.
    • +
    • Removed the is_numeric test from the db->escape() function.
    • +
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • +
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • +
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • +
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • +
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • +
    • Added some code to allow email attachments to be reset when sending batches of email.
    • +
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • +
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • +
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • +
    + + + +

    Version 1.4.0

    +

    Release Date: September 17, 2006

    + +
      +
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added regular expressions support for routing rules.
    • +
    • Added the ability to remap function calls within your controllers.
    • +
    • Added the ability to replace core system classes with your own classes.
    • +
    • Added support for % character in URL.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • +
    • Added mode parameter to file_write() helper.
    • +
    • Added support for changing the port number in the Postgres driver.
    • +
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • +
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • +
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • +
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • +
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • +
    • Updated the form_open() helper to allow the GET method to be used.
    • +
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • +
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • +
    • Updated the Models loader function to allow multiple loads of the same model.
    • +
    • Updated the MS SQL driver so that single quotes are escaped.
    • +
    • Updated the Postgres and ODBC drivers for better compatibility.
    • +
    • Removed a strtolower() call that was changing URL segments to lower case.
    • +
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • +
    • Removed backticks from Postgres class since these are not needed.
    • +
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • +
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • +
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • +
    • Fixed a router bug that was making it too greedy when matching end segments.
    • +
    • Fixed a bug that was preventing multiple discrete database calls.
    • +
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • +
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • +
    • Fixed some missing prefixes when using the database prefix feature.
    • +
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed a bug in the form_checkbox() helper.
    • +
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • +
    • Fixed an evaluation bug in the database initialization function.
    • +
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed a bug in the date helper timespan function.
    • +
    • Fixed an undefined variable in the DB Driver class.
    • +
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • +
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • +
    • Fixed a couple bugs in the Unit Testing class.
    • +
    • Fixed an incorrectly named variable in the Validation class.
    • +
    • Fixed an incorrectly named variable in the URI class.
    • +
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • +
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • +
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • +
    • Fixed some MS SQL bugs.
    • +
    • Fixed some doc typos.
    • +
    + + + +

    Version 1.3.3

    +

    Release Date: June 1, 2006

    + +
      + +
    • Models do not connect automatically to the database as of this version. More info here.
    • +
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • +
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • +
    • Fixed a bug in the active record "having" function.
    • +
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • +
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • +
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • +
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • +
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • +
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • +
    • Fixed a bug in the hash() security helper.
    • +
    • Fixed some typos.
    • +
    + + + + +

    Version 1.3.2

    +

    Release Date: April 17, 2006

    + +
      +
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • +
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • +
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • +
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • +
    • Fixed a couple bugs in the Model class.
    • +
    • Fixed some documentation typos and errata.
    • +
    + + + +

    Version 1.3.1

    +

    Release Date: April 11, 2006

    + +
      +
    • Added a Unit Testing Library.
    • +
    • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • +
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • +
    • Added getwhere function to Active Record class.
    • +
    • Added count_all function to Active Record class.
    • +
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • +
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • +
    • Added a new mime type to the upload class for better compatibility.
    • +
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • +
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • +
    • Fixed a bug in the image library when realpath() returns false.
    • +
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • +
    • Fixed a bug in the "exact_length" function of the validation class.
    • +
    • Fixed some typos in the user guide
    • +
    + + +

    Version 1.3

    +

    Release Date: April 3, 2006

    + +
      +
    • Added support for Models.
    • +
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • +
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • +
    • Added a feature to the database class that lets you run custom function calls.
    • +
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • +
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • +
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • +
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • +
    • Added a new error template for use with native PHP errors.
    • +
    • Added "alternator" function in the string helpers.
    • +
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • +
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • +
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and +all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • +
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • +
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • +
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • +
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • +
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • +
    • Fixed some typos in the default calendar template
    • +
    • Fixed some typos in the user guide
    • +
    + + + + + + + + +

    Version 1.2

    +

    Release Date: March 21, 2006

    + +
      +
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • +
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • +
    • Added new File Helper: delete_files()
    • +
    • Added new URL Helpers: base_url(), index_page()
    • +
    • Added the ability to create your own core libraries and store them in your local application directory.
    • +
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • +
    • Added Javascript Calendar plugin.
    • +
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • +
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • +
    • Fixed a bug in the DB "where" function.
    • +
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • +
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • +
    • Fixed some bugs in the xss_clean function
    • +
    + + + + + +

    Version Beta 1.1

    +

    Release Date: March 10, 2006

    + +
      +
    • Added a Calendaring class.
    • +
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • +
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • +
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • +
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • +
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • +
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • +
    • Fixed a data type error in the form_radio function (form helper)
    • +
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • +
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • +
    • Fixed a pagination problem in the scaffolding.
    • +
    • Fixed a bug in the mysql class "where" function.
    • +
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • +
    • Fixed a bug in the br() function in the HTML helper
    • +
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • +
    • Removed the "style" attributes form the form helpers.
    • +
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • +
    + +

    Version Beta 1.0

    +

    Release Date: February 28, 2006

    +

    First publicly released version.

    + +
    + + + + + + + diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 99041ed7..3b4ffb13 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -1,313 +1,368 @@ - - - - - -HTML Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    HTML Helper

    - -

    The HTML Helper file contains functions that assist in working with HTML.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('html'); - -

    The following functions are available:

    - -

    br()

    -

    Generates line break tags (<br />) based on the number you submit. Example:

    -echo br(3); -

    The above would produce: <br /><br /><br />

    - -

    heading()

    -

    Lets you create HTML <h1> tags. The first parameter will contain the data, the -second the size of the heading. Example:

    -echo heading('Welcome!', 3); -

    The above would produce: <h3>Welcome!</h3>

    -

    img()

    -

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    -echo img('images/picture.jpg');
    -// gives <img src="http://site.com/images/picture.jpg" />
    -

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    -

    echo img('images/picture.jpg', TRUE);
    -// gives <img src="http://site.com/index.php/images/picture.jpg" />

    -

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    -

    $image_properties = array(
    -           'src' => 'images/picture.jpg',
    -           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    -           'class' => 'post_images',
    -           'width' => '200',
    -           'height' => '200',
    -           'title' => 'That was quite a night',
    -           'rel' => 'lightbox',
    - );
    -
    - img($image_properties);
    - // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    -

    link_tag()

    -

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. -echo link_tag('css/mystyles.css');
    -// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    -

    Further examples:

    - - - echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    - // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> -
    -
    - echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    - // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    -

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    -

    - $link = array(
    -           'href' => 'css/printer.css',
    -           'rel' => 'stylesheet',
    -           'type' => 'text/css',
    -           'media' => 'print'
    - );
    -
    - echo link_tag($link);
    - // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    - -

    nbs()

    -

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    -echo nbs(3); -

    The above would produce: &nbsp;&nbsp;&nbsp;

    - -

    ol()  and  ul()

    - -

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'red',
    -            'blue',
    -            'green',
    -            'yellow'
    -            );
    -
    -$attributes = array(
    -                    'class' => 'boldlist',
    -                    'id'    => 'mylist'
    -                    );
    -
    -echo ul($list, $attributes);
    -
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>red</li>
    -  <li>blue</li>
    -  <li>green</li>
    -  <li>yellow</li>
    -</ul> -
    - -

    Here is a more complex example, using a multi-dimensional array:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'colors' => array(
    -                                'red',
    -                                'blue',
    -                                'green'
    -                            ),
    -            'shapes' => array(
    -                                'round',
    -                                'square',
    -                                'circles' => array(
    -                                                    'ellipse',
    -                                                    'oval',
    -                                                    'sphere'
    -                                                    )
    -                            ),
    -            'moods'    => array(
    -                                'happy',
    -                                'upset' => array(
    -                                                    'defeated' => array(
    -                                                                        'dejected',
    -                                                                        'disheartened',
    -                                                                        'depressed'
    -                                                                        ),
    -                                                    'annoyed',
    -                                                    'cross',
    -                                                    'angry'
    -                                                )
    -                            )
    -            );
    -
    -
    -echo ul($list);
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>colors
    -    <ul>
    -      <li>red</li>
    -      <li>blue</li>
    -      <li>green</li>
    -    </ul>
    -  </li>
    -  <li>shapes
    -    <ul>
    -      <li>round</li>
    -      <li>suare</li>
    -      <li>circles
    -        <ul>
    -          <li>elipse</li>
    -          <li>oval</li>
    -          <li>sphere</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -  <li>moods
    -    <ul>
    -      <li>happy</li>
    -      <li>upset
    -        <ul>
    -          <li>defeated
    -            <ul>
    -              <li>dejected</li>
    -              <li>disheartened</li>
    -              <li>depressed</li>
    -            </ul>
    -          </li>
    -          <li>annoyed</li>
    -          <li>cross</li>
    -          <li>angry</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -</ul> -
    - - - -

    meta()

    - -

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    - - -echo meta('description', 'My Great site');
    -// Generates: <meta name="description" content="My Great Site" />
    -

    - -echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    -// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    - -

    - -echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    -// Generates: <meta name="robots" content="no-cache" />
    - -

    - -$meta = array(
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'description', 'content' => 'My Great Site'),
    -        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    -    );
    -
    -echo meta($meta); -
    -// Generates:
    -// <meta name="robots" content="no-cache" />
    -// <meta name="description" content="My Great Site" />
    -// <meta name="keywords" content="love, passion, intrigue, deception" />
    -// <meta name="robots" content="no-cache" />
    -// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> -
    - - - - - - - - - - - - -
    - - - - - - + + + + + +HTML Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    HTML Helper

    + +

    The HTML Helper file contains functions that assist in working with HTML.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('html'); + +

    The following functions are available:

    + +

    br()

    +

    Generates line break tags (<br />) based on the number you submit. Example:

    +echo br(3); +

    The above would produce: <br /><br /><br />

    + +

    heading()

    +

    Lets you create HTML <h1> tags. The first parameter will contain the data, the +second the size of the heading. Example:

    +echo heading('Welcome!', 3); +

    The above would produce: <h3>Welcome!</h3>

    +

    img()

    +

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    +echo img('images/picture.jpg');
    +// gives <img src="http://site.com/images/picture.jpg" />
    +

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    +

    echo img('images/picture.jpg', TRUE);
    +// gives <img src="http://site.com/index.php/images/picture.jpg" />

    +

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    +

    $image_properties = array(
    +           'src' => 'images/picture.jpg',
    +           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    +           'class' => 'post_images',
    +           'width' => '200',
    +           'height' => '200',
    +           'title' => 'That was quite a night',
    +           'rel' => 'lightbox',
    + );
    +
    + img($image_properties);
    + // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    +

    link_tag()

    +

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. +echo link_tag('css/mystyles.css');
    +// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    +

    Further examples:

    + + + echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    + // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> +
    +
    + echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    + // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    +

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    +

    + $link = array(
    +           'href' => 'css/printer.css',
    +           'rel' => 'stylesheet',
    +           'type' => 'text/css',
    +           'media' => 'print'
    + );
    +
    + echo link_tag($link);
    + // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    + +

    nbs()

    +

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    +echo nbs(3); +

    The above would produce: &nbsp;&nbsp;&nbsp;

    + +

    ol()  and  ul()

    + +

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'red',
    +            'blue',
    +            'green',
    +            'yellow'
    +            );
    +
    +$attributes = array(
    +                    'class' => 'boldlist',
    +                    'id'    => 'mylist'
    +                    );
    +
    +echo ul($list, $attributes);
    +
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>red</li>
    +  <li>blue</li>
    +  <li>green</li>
    +  <li>yellow</li>
    +</ul> +
    + +

    Here is a more complex example, using a multi-dimensional array:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'colors' => array(
    +                                'red',
    +                                'blue',
    +                                'green'
    +                            ),
    +            'shapes' => array(
    +                                'round',
    +                                'square',
    +                                'circles' => array(
    +                                                    'ellipse',
    +                                                    'oval',
    +                                                    'sphere'
    +                                                    )
    +                            ),
    +            'moods'    => array(
    +                                'happy',
    +                                'upset' => array(
    +                                                    'defeated' => array(
    +                                                                        'dejected',
    +                                                                        'disheartened',
    +                                                                        'depressed'
    +                                                                        ),
    +                                                    'annoyed',
    +                                                    'cross',
    +                                                    'angry'
    +                                                )
    +                            )
    +            );
    +
    +
    +echo ul($list);
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>colors
    +    <ul>
    +      <li>red</li>
    +      <li>blue</li>
    +      <li>green</li>
    +    </ul>
    +  </li>
    +  <li>shapes
    +    <ul>
    +      <li>round</li>
    +      <li>suare</li>
    +      <li>circles
    +        <ul>
    +          <li>elipse</li>
    +          <li>oval</li>
    +          <li>sphere</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +  <li>moods
    +    <ul>
    +      <li>happy</li>
    +      <li>upset
    +        <ul>
    +          <li>defeated
    +            <ul>
    +              <li>dejected</li>
    +              <li>disheartened</li>
    +              <li>depressed</li>
    +            </ul>
    +          </li>
    +          <li>annoyed</li>
    +          <li>cross</li>
    +          <li>angry</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +</ul> +
    + + + +

    meta()

    + +

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    + + +echo meta('description', 'My Great site');
    +// Generates: <meta name="description" content="My Great Site" />
    +

    + +echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    +// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    + +

    + +echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    +// Generates: <meta name="robots" content="no-cache" />
    + +

    + +$meta = array(
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'description', 'content' => 'My Great Site'),
    +        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    +    );
    +
    +echo meta($meta); +
    +// Generates:
    +// <meta name="robots" content="no-cache" />
    +// <meta name="description" content="My Great Site" />
    +// <meta name="keywords" content="love, passion, intrigue, deception" />
    +// <meta name="robots" content="no-cache" />
    +// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +
    + + +

    doctype()

    + +

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    + + +echo docytype();
    +// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    +
    +echo doctype('html4-trans');
    +// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +
    + +

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DoctypeOptionResult
    XHTML 1.1doctype('xhtml11')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    XHTML 1.0 Strictdoctype('xhtml1-strict')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    XHTML 1.0 Transitionaldoctype('xhtml1-trans')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 Framesetdoctype('xhtml1-frame')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    HTML 5doctype('html5')<!DOCTYPE html>
    HTML 4 Strictdoctype('html4-strict')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    HTML 4 Transitionaldoctype('html4-trans')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTML 4 Framesetdoctype('html4-frame')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    + + + + +
    + + + + + + \ No newline at end of file From 1bf63e459baf22ab9fc3bade9697577a09054b80 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 3 Nov 2008 15:33:28 +0000 Subject: [PATCH 1545/2544] A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered. --- system/libraries/URI.php | 1167 +++++++++++++++++++------------------ user_guide/changelog.html | 1 + 2 files changed, 585 insertions(+), 583 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 0e4ff50c..aa2d71e8 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -1,584 +1,585 @@ -config =& load_class('Config'); - log_message('debug', "URI Class Initialized"); - } - - - // -------------------------------------------------------------------- - - /** - * Get the URI String - * - * @access private - * @return string - */ - function _fetch_uri_string() - { - if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') - { - // If the URL has a question mark then it's simplest to just - // build the URI string from the zero index of the $_GET array. - // This avoids having to deal with $_SERVER variables, which - // can be unreliable in some environments - if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') - { - $this->uri_string = key($_GET); - return; - } - - // Is there a PATH_INFO variable? - // Note: some servers seem to have trouble with getenv() so we'll test it two ways - $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - if (trim($path, '/') != '' && $path != "/".SELF) - { - $this->uri_string = $path; - return; - } - - // No PATH_INFO?... What about QUERY_STRING? - $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - if (trim($path, '/') != '') - { - $this->uri_string = $path; - return; - } - - // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if (trim($path, '/') != '' && $path != "/".SELF) - { - // remove path and script information so we have good URI data - $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); - return; - } - - // We've exhausted all our options... - $this->uri_string = ''; - } - else - { - $uri = strtoupper($this->config->item('uri_protocol')); - - if ($uri == 'REQUEST_URI') - { - $this->uri_string = $this->_parse_request_uri(); - return; - } - - $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); - } - - // If the URI contains only a slash we'll kill it - if ($this->uri_string == '/') - { - $this->uri_string = ''; - } - } - - // -------------------------------------------------------------------- - - /** - * Parse the REQUEST_URI - * - * Due to the way REQUEST_URI works it usually contains path info - * that makes it unusable as URI data. We'll trim off the unnecessary - * data, hopefully arriving at a valid URI that we can use. - * - * @access private - * @return string - */ - function _parse_request_uri() - { - if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') - { - return ''; - } - - $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - - if ($request_uri == '' OR $request_uri == SELF) - { - return ''; - } - - $fc_path = FCPATH; - if (strpos($request_uri, '?') !== FALSE) - { - $fc_path .= '?'; - } - - $parsed_uri = explode("/", $request_uri); - - $i = 0; - foreach(explode("/", $fc_path) as $segment) - { - if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i]) - { - $i++; - } - } - - $parsed_uri = implode("/", array_slice($parsed_uri, $i)); - - if ($parsed_uri != '') - { - $parsed_uri = '/'.$parsed_uri; - } - - return $parsed_uri; - } - - // -------------------------------------------------------------------- - - /** - * Filter segments for malicious characters - * - * @access private - * @param string - * @return string - */ - function _filter_uri($str) - { - if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) - { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) - { - exit('The URI you submitted has disallowed characters.'); - } - } - - // Convert programatic characters to entities - $bad = array('$', '(', ')', '%28', '%29'); - $good = array('$', '(', ')', '(', ')'); - - return str_replace($bad, $good, $str); - } - - // -------------------------------------------------------------------- - - /** - * Remove the suffix from the URL if needed - * - * @access private - * @return void - */ - function _remove_url_suffix() - { - if ($this->config->item('url_suffix') != "") - { - $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); - } - } - - // -------------------------------------------------------------------- - - /** - * Explode the URI Segments. The individual segments will - * be stored in the $this->segments array. - * - * @access private - * @return void - */ - function _explode_segments() - { - foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) - { - // Filter segments for security - $val = trim($this->_filter_uri($val)); - - if ($val != '') - { - $this->segments[] = $val; - } - } - } - - // -------------------------------------------------------------------- - /** - * Re-index Segments - * - * This function re-indexes the $this->segment array so that it - * starts at 1 rather than 0. Doing so makes it simpler to - * use functions like $this->uri->segment(n) since there is - * a 1:1 relationship between the segment array and the actual segments. - * - * @access private - * @return void - */ - function _reindex_segments() - { - array_unshift($this->segments, NULL); - array_unshift($this->rsegments, NULL); - unset($this->segments[0]); - unset($this->rsegments[0]); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment - * - * This function returns the URI segment based on the number provided. - * - * @access public - * @param integer - * @param bool - * @return string - */ - function segment($n, $no_result = FALSE) - { - return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI "routed" Segment - * - * This function returns the re-routed URI segment (assuming routing rules are used) - * based on the number provided. If there is no routing this function returns the - * same result as $this->segment() - * - * @access public - * @param integer - * @param bool - * @return string - */ - function rsegment($n, $no_result = FALSE) - { - return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string - * - * This function generates and associative array of URI data starting - * at the supplied segment. For example, if this is your URI: - * - * example.com/user/search/name/joe/location/UK/gender/male - * - * You can use this function to generate an array with this prototype: - * - * array ( - * name => joe - * location => UK - * gender => male - * ) - * - * @access public - * @param integer the starting segment number - * @param array an array of default values - * @return array - */ - function uri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'segment'); - } - /** - * Identical to above only it uses the re-routed segment array - * - */ - function ruri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string or Re-routed URI string - * - * @access private - * @param integer the starting segment number - * @param array an array of default values - * @param string which array we should use - * @return array - */ - function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') - { - if ($which == 'segment') - { - $total_segments = 'total_segments'; - $segment_array = 'segment_array'; - } - else - { - $total_segments = 'total_rsegments'; - $segment_array = 'rsegment_array'; - } - - if ( ! is_numeric($n)) - { - return $default; - } - - if (isset($this->keyval[$n])) - { - return $this->keyval[$n]; - } - - if ($this->$total_segments() < $n) - { - if (count($default) == 0) - { - return array(); - } - - $retval = array(); - foreach ($default as $val) - { - $retval[$val] = FALSE; - } - return $retval; - } - - $segments = array_slice($this->$segment_array(), ($n - 1)); - - $i = 0; - $lastval = ''; - $retval = array(); - foreach ($segments as $seg) - { - if ($i % 2) - { - $retval[$lastval] = $seg; - } - else - { - $retval[$seg] = FALSE; - $lastval = $seg; - } - - $i++; - } - - if (count($default) > 0) - { - foreach ($default as $val) - { - if ( ! array_key_exists($val, $retval)) - { - $retval[$val] = FALSE; - } - } - } - - // Cache the array for reuse - $this->keyval[$n] = $retval; - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Generate a URI string from an associative array - * - * - * @access public - * @param array an associative array of key/values - * @return array - */ - function assoc_to_uri($array) - { - $temp = array(); - foreach ((array)$array as $key => $val) - { - $temp[] = $key; - $temp[] = $val; - } - - return implode('/', $temp); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_segment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'segment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_rsegment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - helper function - * - * @access private - * @param integer - * @param string - * @param string - * @return string - */ - function _slash_segment($n, $where = 'trailing', $which = 'segment') - { - if ($where == 'trailing') - { - $trailing = '/'; - $leading = ''; - } - elseif ($where == 'leading') - { - $leading = '/'; - $trailing = ''; - } - else - { - $leading = '/'; - $trailing = '/'; - } - return $leading.$this->$which($n).$trailing; - } - - // -------------------------------------------------------------------- - - /** - * Segment Array - * - * @access public - * @return array - */ - function segment_array() - { - return $this->segments; - } - - // -------------------------------------------------------------------- - - /** - * Routed Segment Array - * - * @access public - * @return array - */ - function rsegment_array() - { - return $this->rsegments; - } - - // -------------------------------------------------------------------- - - /** - * Total number of segments - * - * @access public - * @return integer - */ - function total_segments() - { - return count($this->segments); - } - - // -------------------------------------------------------------------- - - /** - * Total number of routed segments - * - * @access public - * @return integer - */ - function total_rsegments() - { - return count($this->rsegments); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the entire URI string - * - * @access public - * @return string - */ - function uri_string() - { - return $this->uri_string; - } - - - // -------------------------------------------------------------------- - - /** - * Fetch the entire Re-routed URI string - * - * @access public - * @return string - */ - function ruri_string() - { - return '/'.implode('/', $this->rsegment_array()).'/'; - } - -} -// END URI Class - -/* End of file URI.php */ +config =& load_class('Config'); + log_message('debug', "URI Class Initialized"); + } + + + // -------------------------------------------------------------------- + + /** + * Get the URI String + * + * @access private + * @return string + */ + function _fetch_uri_string() + { + if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') + { + // If the URL has a question mark then it's simplest to just + // build the URI string from the zero index of the $_GET array. + // This avoids having to deal with $_SERVER variables, which + // can be unreliable in some environments + if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') + { + $this->uri_string = key($_GET); + return; + } + + // Is there a PATH_INFO variable? + // Note: some servers seem to have trouble with getenv() so we'll test it two ways + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if (trim($path, '/') != '' && $path != "/".SELF) + { + $this->uri_string = $path; + return; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if (trim($path, '/') != '') + { + $this->uri_string = $path; + return; + } + + // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? + $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + if (trim($path, '/') != '' && $path != "/".SELF) + { + // remove path and script information so we have good URI data + $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); + return; + } + + // We've exhausted all our options... + $this->uri_string = ''; + } + else + { + $uri = strtoupper($this->config->item('uri_protocol')); + + if ($uri == 'REQUEST_URI') + { + $this->uri_string = $this->_parse_request_uri(); + return; + } + + $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); + } + + // If the URI contains only a slash we'll kill it + if ($this->uri_string == '/') + { + $this->uri_string = ''; + } + } + + // -------------------------------------------------------------------- + + /** + * Parse the REQUEST_URI + * + * Due to the way REQUEST_URI works it usually contains path info + * that makes it unusable as URI data. We'll trim off the unnecessary + * data, hopefully arriving at a valid URI that we can use. + * + * @access private + * @return string + */ + function _parse_request_uri() + { + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') + { + return ''; + } + + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '' OR $request_uri == SELF) + { + return ''; + } + + $fc_path = FCPATH; + if (strpos($request_uri, '?') !== FALSE) + { + $fc_path .= '?'; + } + + $parsed_uri = explode("/", $request_uri); + + $i = 0; + foreach(explode("/", $fc_path) as $segment) + { + if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i]) + { + $i++; + } + } + + $parsed_uri = implode("/", array_slice($parsed_uri, $i)); + + if ($parsed_uri != '') + { + $parsed_uri = '/'.$parsed_uri; + } + + return $parsed_uri; + } + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) + { + if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + { + header('HTTP/1.1 400 Bad Request'); + exit('The URI you submitted has disallowed characters.'); + } + } + + // Convert programatic characters to entities + $bad = array('$', '(', ')', '%28', '%29'); + $good = array('$', '(', ')', '(', ')'); + + return str_replace($bad, $good, $str); + } + + // -------------------------------------------------------------------- + + /** + * Remove the suffix from the URL if needed + * + * @access private + * @return void + */ + function _remove_url_suffix() + { + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + } + + // -------------------------------------------------------------------- + + /** + * Explode the URI Segments. The individual segments will + * be stored in the $this->segments array. + * + * @access private + * @return void + */ + function _explode_segments() + { + foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + { + $this->segments[] = $val; + } + } + } + + // -------------------------------------------------------------------- + /** + * Re-index Segments + * + * This function re-indexes the $this->segment array so that it + * starts at 1 rather than 0. Doing so makes it simpler to + * use functions like $this->uri->segment(n) since there is + * a 1:1 relationship between the segment array and the actual segments. + * + * @access private + * @return void + */ + function _reindex_segments() + { + array_unshift($this->segments, NULL); + array_unshift($this->rsegments, NULL); + unset($this->segments[0]); + unset($this->rsegments[0]); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment + * + * This function returns the URI segment based on the number provided. + * + * @access public + * @param integer + * @param bool + * @return string + */ + function segment($n, $no_result = FALSE) + { + return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI "routed" Segment + * + * This function returns the re-routed URI segment (assuming routing rules are used) + * based on the number provided. If there is no routing this function returns the + * same result as $this->segment() + * + * @access public + * @param integer + * @param bool + * @return string + */ + function rsegment($n, $no_result = FALSE) + { + return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string + * + * This function generates and associative array of URI data starting + * at the supplied segment. For example, if this is your URI: + * + * example.com/user/search/name/joe/location/UK/gender/male + * + * You can use this function to generate an array with this prototype: + * + * array ( + * name => joe + * location => UK + * gender => male + * ) + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + */ + function uri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'segment'); + } + /** + * Identical to above only it uses the re-routed segment array + * + */ + function ruri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string or Re-routed URI string + * + * @access private + * @param integer the starting segment number + * @param array an array of default values + * @param string which array we should use + * @return array + */ + function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') + { + if ($which == 'segment') + { + $total_segments = 'total_segments'; + $segment_array = 'segment_array'; + } + else + { + $total_segments = 'total_rsegments'; + $segment_array = 'rsegment_array'; + } + + if ( ! is_numeric($n)) + { + return $default; + } + + if (isset($this->keyval[$n])) + { + return $this->keyval[$n]; + } + + if ($this->$total_segments() < $n) + { + if (count($default) == 0) + { + return array(); + } + + $retval = array(); + foreach ($default as $val) + { + $retval[$val] = FALSE; + } + return $retval; + } + + $segments = array_slice($this->$segment_array(), ($n - 1)); + + $i = 0; + $lastval = ''; + $retval = array(); + foreach ($segments as $seg) + { + if ($i % 2) + { + $retval[$lastval] = $seg; + } + else + { + $retval[$seg] = FALSE; + $lastval = $seg; + } + + $i++; + } + + if (count($default) > 0) + { + foreach ($default as $val) + { + if ( ! array_key_exists($val, $retval)) + { + $retval[$val] = FALSE; + } + } + } + + // Cache the array for reuse + $this->keyval[$n] = $retval; + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Generate a URI string from an associative array + * + * + * @access public + * @param array an associative array of key/values + * @return array + */ + function assoc_to_uri($array) + { + $temp = array(); + foreach ((array)$array as $key => $val) + { + $temp[] = $key; + $temp[] = $val; + } + + return implode('/', $temp); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_segment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'segment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_rsegment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash - helper function + * + * @access private + * @param integer + * @param string + * @param string + * @return string + */ + function _slash_segment($n, $where = 'trailing', $which = 'segment') + { + if ($where == 'trailing') + { + $trailing = '/'; + $leading = ''; + } + elseif ($where == 'leading') + { + $leading = '/'; + $trailing = ''; + } + else + { + $leading = '/'; + $trailing = '/'; + } + return $leading.$this->$which($n).$trailing; + } + + // -------------------------------------------------------------------- + + /** + * Segment Array + * + * @access public + * @return array + */ + function segment_array() + { + return $this->segments; + } + + // -------------------------------------------------------------------- + + /** + * Routed Segment Array + * + * @access public + * @return array + */ + function rsegment_array() + { + return $this->rsegments; + } + + // -------------------------------------------------------------------- + + /** + * Total number of segments + * + * @access public + * @return integer + */ + function total_segments() + { + return count($this->segments); + } + + // -------------------------------------------------------------------- + + /** + * Total number of routed segments + * + * @access public + * @return integer + */ + function total_rsegments() + { + return count($this->rsegments); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the entire URI string + * + * @access public + * @return string + */ + function uri_string() + { + return $this->uri_string; + } + + + // -------------------------------------------------------------------- + + /** + * Fetch the entire Re-routed URI string + * + * @access public + * @return string + */ + function ruri_string() + { + return '/'.implode('/', $this->rsegment_array()).'/'; + } + +} +// END URI Class + +/* End of file URI.php */ /* Location: ./system/libraries/URI.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3e207e2b..55bcbf03 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,6 +65,7 @@

    Version 1.7.1

  • Libraries
    • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
    • +
    • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
  • Helpers From cc13d49e83757cf540082eaddf0483153c027c83 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 4 Nov 2008 19:20:36 +0000 Subject: [PATCH 1546/2544] added protection against non-breaking spaces within tags --- system/libraries/Typography.php | 6 ++++-- user_guide/changelog.html | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 317208f2..8ae47a1b 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -85,12 +85,13 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // Convert quotes within tags to temporary markers. We don't want quotes converted // within tags so we'll temporarily convert them to {@DQ} and {@SQ} // and we don't want double dashes converted to emdash entities, so they are marked with {@DD} + // likewise double spaces are converted to {@NBS} to prevent entity conversion if (preg_match_all("#\<.+?>#si", $str, $matches)) { for ($i = 0, $total = count($matches[0]); $i < $total; $i++) { $str = str_replace($matches[0][$i], - str_replace(array("'",'"','--'), array('{@SQ}', '{@DQ}', '{@DD}'), $matches[0][$i]), + str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $matches[0][$i]), $str); } } @@ -180,7 +181,8 @@ function auto_typography($str, $reduce_linebreaks = FALSE) '/\{@TAG\}/' => '<', '/\{@DQ\}/' => '"', '/\{@SQ\}/' => "'", - '/\{@DD\}/' => '--' + '/\{@DD\}/' => '--', + '/\{@NBS\}/' => ' ' ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 55bcbf03..8fafcc76 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,6 +82,7 @@

    Bug fixes for 1.7.1

  • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
  • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.

  • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
  • +
  • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
  • From 4b84a42cabee34d8daddf096881a04afc1240371 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 5 Nov 2008 01:21:21 +0000 Subject: [PATCH 1547/2544] Finessed the code in a few places for better accuracy --- system/libraries/Typography.php | 59 +++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 8ae47a1b..0fa7d661 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -33,7 +33,7 @@ class CI_Typography { var $skip_elements = 'p|pre|ol|ul|dl|object|table'; // Tags we want the parser to completely ignore when splitting the string. - var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var'; + var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var|big|small|q'; // whether or not to protect quotes within { curly braces } var $protect_braced_quotes = FALSE; @@ -143,6 +143,18 @@ function auto_typography($str, $reduce_linebreaks = FALSE) $str .= $chunk; continue; } + elseif (preg_match('/<(\/?)([a-z]*).*?>/s', $chunk, $tagmatch)) + { + if ($tagmatch[1] == '/' && $tagmatch[2] == $this->last_tag) + { + $process = FALSE; + } + else + { + $process = TRUE; + $this->last_tag = $tagmatch[2]; + } + } if ($process == FALSE) { @@ -151,7 +163,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE) } // Convert Newlines into

    and
    tags - $str .= $this->_format_newlines($chunk); + $str .= $this->format_characters($this->_format_newlines($chunk)); } // is the whole of the content inside a block level element? @@ -160,22 +172,33 @@ function auto_typography($str, $reduce_linebreaks = FALSE) $str = "

    {$str}

    "; } - // Convert quotes, elipsis, and em-dashes - $str = $this->format_characters($str); + // some special linebreak cleanup + $str = preg_replace_callback('#<(?!/|'.$this->block_elements.')([^>]*)>

    (.*?)

    <(\w*)#si', array($this, '_linebreak_cleanup'), $str); + + // and cleanup empty paragraph tags sitting between two closing tags + $str = preg_replace('#()

    (\s*)

    ()#si', '$1$2$3', $str); + // Final clean up $table = array( // If the user submitted their own paragraph tags within the text // we will retain them instead of using our tags. - '/(*?]>)

    /' => '$1', // *?]>)

    /' => '$1', // )+#' => '

    ', '/(

    )+/' => '

    ', + '/(

    \W+

    )+/' => '

    ', // Clean up stray paragraph tags that appear before block level elements '#

    <('.$this->block_elements.')#' => '<$1', + + // Clean up open paragraph tags that appear before block level elements + '#

    (\W)<('.$this->block_elements.')#' => '

    $1<$2', + + // Clean up stray non-breaking spaces preceeding block elements + '#[  ]+<('.$this->block_elements.')#' => ' <$1', // Replace the temporary markers we added earlier '/\{@TAG\}/' => '<', @@ -185,7 +208,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE) '/\{@NBS\}/' => ' ' ); - + // Do we need to reduce empty lines? if ($reduce_linebreaks === TRUE) { @@ -203,7 +226,31 @@ function auto_typography($str, $reduce_linebreaks = FALSE) } // -------------------------------------------------------------------- + + /** + * Linebreak Cleanup + * + * Removes paragraph and line break tags inserted inbetween + * inline content and a new opening block level element + * + * @access private + * @param array + * @return string + */ + function _linebreak_cleanup($match) + { + if (in_array($match[3], explode('|', $this->block_elements))) + { + return "<{$match[1]}>".str_replace('
    ', '', $match[2])."<{$match[3]}"; + } + else + { + return $match[0]; + } + } + // -------------------------------------------------------------------- + /** * Format Characters * From 9b42253effd4f9e87774cacd9eb710a936bfe3df Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Wed, 5 Nov 2008 01:21:51 +0000 Subject: [PATCH 1548/2544] Oops... forgot to add "tt" as in inline element --- system/libraries/Typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 0fa7d661..fad018fd 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -33,7 +33,7 @@ class CI_Typography { var $skip_elements = 'p|pre|ol|ul|dl|object|table'; // Tags we want the parser to completely ignore when splitting the string. - var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var|big|small|q'; + var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var|big|small|q|tt'; // whether or not to protect quotes within { curly braces } var $protect_braced_quotes = FALSE; From 396a2a62006fd58d385d53e6b8cadd9d152abe76 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 5 Nov 2008 16:11:30 +0000 Subject: [PATCH 1549/2544] moved the newly added inline elements so the list would remain in alphabetical order, added corresponding changelog note --- system/libraries/Typography.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index fad018fd..6a0f2ec3 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -33,7 +33,7 @@ class CI_Typography { var $skip_elements = 'p|pre|ol|ul|dl|object|table'; // Tags we want the parser to completely ignore when splitting the string. - var $inline_elements = 'a|abbr|acronym|b|bdo|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|samp|select|span|strong|sub|sup|textarea|var|big|small|q|tt'; + var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; // whether or not to protect quotes within { curly braces } var $protect_braced_quotes = FALSE; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8fafcc76..f690c919 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

    Version 1.7.1

    • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
    • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
    • +
    • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
  • Helpers From 5f02da0fccd2123b82dc79053e6c86c2918cf37b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 5 Nov 2008 16:20:01 +0000 Subject: [PATCH 1550/2544] whitespace --- system/libraries/Input.php | 2116 ++++++++++++++++++------------------ 1 file changed, 1058 insertions(+), 1058 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index e66d4814..f26df755 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -1,1059 +1,1059 @@ - '[removed]', - 'document.write' => '[removed]', - '.parentNode' => '[removed]', - '.innerHTML' => '[removed]', - 'window.location' => '[removed]', - '-moz-binding' => '[removed]', - '' => '-->', - ' '<![CDATA[' - ); - /* never allowed, regex replacement */ - var $never_allowed_regex = array( - "javascript\s*:" => '[removed]', - "expression\s*\(" => '[removed]', // CSS and IE - "Redirect\s+302" => '[removed]' - ); - - /** - * Constructor - * - * Sets whether to globally enable the XSS processing - * and whether to allow the $_GET array - * - * @access public - */ - function CI_Input() - { - log_message('debug', "Input Class Initialized"); - - $CFG =& load_class('Config'); - $this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; - $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; - $this->_sanitize_globals(); - } - - // -------------------------------------------------------------------- - - /** - * Sanitize Globals - * - * This function does the following: - * - * Unsets $_GET data (if query strings are not enabled) - * - * Unsets all globals if register_globals is enabled - * - * Standardizes newline characters to \n - * - * @access private - * @return void - */ - function _sanitize_globals() - { - // Would kind of be "wrong" to unset any of these GLOBALS - $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', - 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); - - // Unset globals for security. - // This is effectively the same as register_globals = off - foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global) - { - if ( ! is_array($global)) - { - if ( ! in_array($global, $protected)) - { - unset($GLOBALS[$global]); - } - } - else - { - foreach ($global as $key => $val) - { - if ( ! in_array($key, $protected)) - { - unset($GLOBALS[$key]); - } - - if (is_array($val)) - { - foreach($val as $k => $v) - { - if ( ! in_array($k, $protected)) - { - unset($GLOBALS[$k]); - } - } - } - } - } - } - - // Is $_GET data allowed? If not we'll set the $_GET to an empty array - if ($this->allow_get_array == FALSE) - { - $_GET = array(); - } - else - { - $_GET = $this->_clean_input_data($_GET); - } - - // Clean $_POST Data - $_POST = $this->_clean_input_data($_POST); - - // Clean $_COOKIE Data - // Also get rid of specially treated cookies that might be set by a server - // or silly application, that are of no use to a CI application anyway - // but that when present will trip our 'Disallowed Key Characters' alarm - // http://www.ietf.org/rfc/rfc2109.txt - // note that the key names below are single quoted strings, and are not PHP variables - unset($_COOKIE['$Version']); - unset($_COOKIE['$Path']); - unset($_COOKIE['$Domain']); - $_COOKIE = $this->_clean_input_data($_COOKIE); - - log_message('debug', "Global POST and COOKIE data sanitized"); - } - - // -------------------------------------------------------------------- - - /** - * Clean Input Data - * - * This is a helper function. It escapes data and - * standardizes newline characters to \n - * - * @access private - * @param string - * @return string - */ - function _clean_input_data($str) - { - if (is_array($str)) - { - $new_array = array(); - foreach ($str as $key => $val) - { - $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - return $new_array; - } - - // We strip slashes if magic quotes is on to keep things consistent - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } - - // Should we filter the input data? - if ($this->use_xss_clean === TRUE) - { - $str = $this->xss_clean($str); - } - - // Standardize newlines - if (strpos($str, "\r") !== FALSE) - { - $str = str_replace(array("\r\n", "\r"), "\n", $str); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Clean Keys - * - * This is a helper function. To prevent malicious users - * from trying to exploit keys we make sure that keys are - * only named with alpha-numeric text and a few other items. - * - * @access private - * @param string - * @return string - */ - function _clean_input_keys($str) - { - if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) - { - exit('Disallowed Key Characters.'); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Fetch from array - * - * This is a helper function to retrieve values from global arrays - * - * @access private - * @param array - * @param string - * @param bool - * @return string - */ - function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) - { - if ( ! isset($array[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - return $this->xss_clean($array[$index]); - } - - return $array[$index]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the GET array - * - * @access public - * @param string - * @param bool - * @return string - */ - function get($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_GET, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the POST array - * - * @access public - * @param string - * @param bool - * @return string - */ - function post($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_POST, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from either the GET array or the POST - * - * @access public - * @param string The index key - * @param bool XSS cleaning - * @return string - */ - function get_post($index = '', $xss_clean = FALSE) - { - if ( ! isset($_POST[$index]) ) - { - return $this->get($index, $xss_clean); - } - else - { - return $this->post($index, $xss_clean); - } - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the COOKIE array - * - * @access public - * @param string - * @param bool - * @return string - */ - function cookie($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the SERVER array - * - * @access public - * @param string - * @param bool - * @return string - */ - function server($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_SERVER, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the IP Address - * - * @access public - * @return string - */ - function ip_address() - { - if ($this->ip_address !== FALSE) - { - return $this->ip_address; - } - - if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('REMOTE_ADDR')) - { - $this->ip_address = $_SERVER['REMOTE_ADDR']; - } - elseif ($this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('HTTP_X_FORWARDED_FOR')) - { - $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; - } - - if ($this->ip_address === FALSE) - { - $this->ip_address = '0.0.0.0'; - return $this->ip_address; - } - - if (strstr($this->ip_address, ',')) - { - $x = explode(',', $this->ip_address); - $this->ip_address = end($x); - } - - if ( ! $this->valid_ip($this->ip_address)) - { - $this->ip_address = '0.0.0.0'; - } - - return $this->ip_address; - } - - // -------------------------------------------------------------------- - - /** - * Validate IP Address - * - * Updated version suggested by Geert De Deckere - * - * @access public - * @param string - * @return string - */ - function valid_ip($ip) - { - $ip_segments = explode('.', $ip); - - // Always 4 segments needed - if (count($ip_segments) != 4) - { - return FALSE; - } - // IP can not start with 0 - if ($ip_segments[0][0] == '0') - { - return FALSE; - } - // Check each segment - foreach ($ip_segments as $segment) - { - // IP segments must be digits and can not be - // longer than 3 digits or greater then 255 - if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3) - { - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * User Agent - * - * @access public - * @return string - */ - function user_agent() - { - if ($this->user_agent !== FALSE) - { - return $this->user_agent; - } - - $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; - - return $this->user_agent; - } - - // -------------------------------------------------------------------- - - /** - * Filename Security - * - * @access public - * @param string - * @return string - */ - function filename_security($str) - { - $bad = array( - "../", - "./", - "", - "<", - ">", - "'", - '"', - '&', - '$', - '#', - '{', - '}', - '[', - ']', - '=', - ';', - '?', - "%20", - "%22", - "%3c", // < - "%253c", // < - "%3e", // > - "%0e", // > - "%28", // ( - "%29", // ) - "%2528", // ( - "%26", // & - "%24", // $ - "%3f", // ? - "%3b", // ; - "%3d" // = - ); - - return stripslashes(str_replace($bad, '', $str)); - } - - // -------------------------------------------------------------------- - - /** - * XSS Clean - * - * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented. This function does a fair amount of work but - * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts. Nothing is ever 100% foolproof, - * of course, but I haven't been able to get anything passed - * the filter. - * - * Note: This function should only be used to deal with data - * upon submission. It's not something that should - * be used for general runtime processing. - * - * This function was based in part on some code and ideas I - * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention - * - * To help develop this script I used this great list of - * vulnerabilities along with a few other hacks I've - * harvested from examining vulnerabilities in other programs: - * http://ha.ckers.org/xss.html - * - * @access public - * @param string - * @return string - */ - function xss_clean($str, $is_image = FALSE) - { - /* - * Is the string an array? - * - */ - if (is_array($str)) - { - while (list($key) = each($str)) - { - $str[$key] = $this->xss_clean($str[$key]); - } - - return $str; - } - - /* - * Remove Invisible Characters - */ - $str = $this->_remove_invisible_characters($str); - - /* - * Protect GET variables in URLs - */ - - // 901119URL5918AMP18930PROTECT8198 - - $str = preg_replace('|\&([a-z\_0-9]+)\=([a-z\_0-9]+)|i', $this->xss_hash()."\\1=\\2", $str); - - /* - * Validate standard character entities - * - * Add a semicolon if missing. We do this to enable - * the conversion of entities to ASCII later. - * - */ - $str = preg_replace('#(&\#?[0-9a-z]{2,})[\x00-\x20]*;?#i', "\\1;", $str); - - /* - * Validate UTF16 two byte encoding (x00) - * - * Just as above, adds a semicolon if missing. - * - */ - $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); - - /* - * Un-Protect GET variables in URLs - */ - $str = str_replace($this->xss_hash(), '&', $str); - - /* - * URL Decode - * - * Just in case stuff like this is submitted: - * - * Google - * - * Note: Use rawurldecode() so it does not remove plus signs - * - */ - $str = rawurldecode($str); - - /* - * Convert character entities to ASCII - * - * This permits our tests below to work reliably. - * We only convert entities that are within tags since - * these are the ones that will pose security problems. - * - */ - - $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - - $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_html_entity_decode_callback'), $str); - - /* - * Remove Invisible Characters Again! - */ - $str = $this->_remove_invisible_characters($str); - - /* - * Convert all tabs to spaces - * - * This prevents strings like this: ja vascript - * NOTE: we deal with spaces between characters later. - * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, - * so we use str_replace. - * - */ - - if (strpos($str, "\t") !== FALSE) - { - $str = str_replace("\t", ' ', $str); - } - - /* - * Capture converted string for later comparison - */ - $converted_string = $str; - - /* - * Not Allowed Under Any Conditions - */ - - foreach ($this->never_allowed_str as $key => $val) - { - $str = str_replace($key, $val, $str); - } - - foreach ($this->never_allowed_regex as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - /* - * Makes PHP tags safe - * - * Note: XML tags are inadvertently replaced too: - * - * '), array('<?php', '<?PHP', '<?', '?>'), $str); - } - - /* - * Compact any exploded words - * - * This corrects words like: j a v a s c r i p t - * These words are compacted back to their correct state. - * - */ - $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); - foreach ($words as $word) - { - $temp = ''; - - for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) - { - $temp .= substr($word, $i, 1)."\s*"; - } - - // We only want to do this when it is followed by a non-word character - // That way valid stuff like "dealer to" does not become "dealerto" - $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); - } - - /* - * Remove disallowed Javascript in links or img tags - * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared - * to these simplified non-capturing preg_match(), especially if the pattern exists in the string - */ - do - { - $original = $str; - - if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); - } - - if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); - } - - if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) - { - $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); - } - } - while($original != $str); - - unset($original); - - /* - * Remove JavaScript Event Handlers - * - * Note: This code is a little blunt. It removes - * the event handler and anything up to the closing >, - * but it's unlikely to be a problem. - * - */ - $event_handlers = array('[^a-z_\-]on\w*','xmlns'); - - if ($is_image === TRUE) - { - /* - * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, - * so we have to allow this for images. -Paul - */ - unset($event_handlers[array_search('xmlns', $event_handlers)]); - } - - $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); - - /* - * Sanitize naughty HTML elements - * - * If a tag containing any of the words in the list - * below is found, the tag gets converted to entities. - * - * So this: - * Becomes: <blink> - * - */ - $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; - $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); - - /* - * Sanitize naughty scripting elements - * - * Similar to above, only instead of looking for - * tags it looks for PHP and JavaScript commands - * that are disallowed. Rather than removing the - * code, it simply converts the parenthesis to entities - * rendering the code un-executable. - * - * For example: eval('some code') - * Becomes: eval('some code') - * - */ - $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); - - /* - * Final clean up - * - * This adds a bit of extra precaution in case - * something got through the above filters - * - */ - foreach ($this->never_allowed_str as $key => $val) - { - $str = str_replace($key, $val, $str); - } - - foreach ($this->never_allowed_regex as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - /* - * Images are Handled in a Special Way - * - Essentially, we want to know that after all of the character conversion is done whether - * any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. - * However, if the string post-conversion does not matched the string post-removal of XSS, - * then it fails, as there was unwanted XSS code found and removed/changed during processing. - */ - - if ($is_image === TRUE) - { - if ($str == $converted_string) - { - return TRUE; - } - else - { - return FALSE; - } - } - - log_message('debug', "XSS Filtering completed"); - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Random Hash for protecting URLs - * - * @access public - * @return string - */ - function xss_hash() - { - if ($this->xss_hash == '') - { - if (phpversion() >= 4.2) - mt_srand(); - else - mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); - - $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); - } - - return $this->xss_hash; - } - - // -------------------------------------------------------------------- - - /** - * Remove Invisible Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - * @access public - * @param string - * @return string - */ - function _remove_invisible_characters($str) - { - static $non_displayables; - - if ( ! isset($non_displayables)) - { - // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), - $non_displayables = array( - '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 - '/%1[0-9a-f]/', // url encoded 16-31 - '/[\x00-\x08]/', // 00-08 - '/\x0b/', '/\x0c/', // 11, 12 - '/[\x0e-\x1f]/' // 14-31 - ); - } - - do - { - $cleaned = $str; - $str = preg_replace($non_displayables, '', $str); - } - while ($cleaned != $str); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Compact Exploded Words - * - * Callback function for xss_clean() to remove whitespace from - * things like j a v a s c r i p t - * - * @access public - * @param type - * @return type - */ - function _compact_exploded_words($matches) - { - return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; - } - - // -------------------------------------------------------------------- - - /** - * Sanitize Naughty HTML - * - * Callback function for xss_clean() to remove naughty HTML elements - * - * @access private - * @param array - * @return string - */ - function _sanitize_naughty_html($matches) - { - // encode opening brace - $str = '<'.$matches[1].$matches[2].$matches[3]; - - // encode captured opening or closing brace to prevent recursive vectors - $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * JS Link Removal - * - * Callback function for xss_clean() to sanitize links - * This limits the PCRE backtracks, making it more performance friendly - * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in - * PHP 5.2+ on link-heavy strings - * - * @access private - * @param array - * @return string - */ - function _js_link_removal($match) - { - $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<'), array('>', '<'), $match[0]); - } - - // -------------------------------------------------------------------- - - /** - * HTML Entity Decode Callback - * - * Used as a callback for XSS Clean - * - * @access public - * @param array - * @return string - */ - function _html_entity_decode_callback($match) - { - $CFG =& load_class('Config'); - $charset = $CFG->item('charset'); - - return $this->_html_entity_decode($match[0], strtoupper($charset)); - } - - // -------------------------------------------------------------------- - - /** - * HTML Entities Decode - * - * This function is a replacement for html_entity_decode() - * - * In some versions of PHP the native function does not work - * when UTF-8 is the specified character set, so this gives us - * a work-around. More info here: - * http://bugs.php.net/bug.php?id=25670 - * - * @access private - * @param string - * @param string - * @return string - */ - /* ------------------------------------------------- - /* Replacement for html_entity_decode() - /* -------------------------------------------------*/ - - /* - NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the - character set, and the PHP developers said they were not back porting the - fix to versions other than PHP 5.x. - */ - function _html_entity_decode($str, $charset='UTF-8') - { - if (stristr($str, '&') === FALSE) return $str; - - // 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. - - if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) - { - $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); - } - - // Numeric Entities - $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); - - // Literal Entities - Slightly slow so we do another check - if (stristr($str, '&') === FALSE) - { - $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Filter Attributes - * - * Filters tag attributes for consistency and safety - * - * @access public - * @param string - * @return string - */ - function _filter_attributes($str) - { - $out = ''; - - if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) - { - foreach ($matches[0] as $match) - { - $out .= "{$match}"; - } - } - - return $out; - } - - // -------------------------------------------------------------------- - -} -// END Input class - -/* End of file Input.php */ + '[removed]', + 'document.write' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', + 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '' => '-->', + ' '<![CDATA[' + ); + /* never allowed, regex replacement */ + var $never_allowed_regex = array( + "javascript\s*:" => '[removed]', + "expression\s*\(" => '[removed]', // CSS and IE + "Redirect\s+302" => '[removed]' + ); + + /** + * Constructor + * + * Sets whether to globally enable the XSS processing + * and whether to allow the $_GET array + * + * @access public + */ + function CI_Input() + { + log_message('debug', "Input Class Initialized"); + + $CFG =& load_class('Config'); + $this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; + $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; + $this->_sanitize_globals(); + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Globals + * + * This function does the following: + * + * Unsets $_GET data (if query strings are not enabled) + * + * Unsets all globals if register_globals is enabled + * + * Standardizes newline characters to \n + * + * @access private + * @return void + */ + function _sanitize_globals() + { + // Would kind of be "wrong" to unset any of these GLOBALS + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', + 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); + + // Unset globals for security. + // This is effectively the same as register_globals = off + foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global) + { + if ( ! is_array($global)) + { + if ( ! in_array($global, $protected)) + { + unset($GLOBALS[$global]); + } + } + else + { + foreach ($global as $key => $val) + { + if ( ! in_array($key, $protected)) + { + unset($GLOBALS[$key]); + } + + if (is_array($val)) + { + foreach($val as $k => $v) + { + if ( ! in_array($k, $protected)) + { + unset($GLOBALS[$k]); + } + } + } + } + } + } + + // Is $_GET data allowed? If not we'll set the $_GET to an empty array + if ($this->allow_get_array == FALSE) + { + $_GET = array(); + } + else + { + $_GET = $this->_clean_input_data($_GET); + } + + // Clean $_POST Data + $_POST = $this->_clean_input_data($_POST); + + // Clean $_COOKIE Data + // Also get rid of specially treated cookies that might be set by a server + // or silly application, that are of no use to a CI application anyway + // but that when present will trip our 'Disallowed Key Characters' alarm + // http://www.ietf.org/rfc/rfc2109.txt + // note that the key names below are single quoted strings, and are not PHP variables + unset($_COOKIE['$Version']); + unset($_COOKIE['$Path']); + unset($_COOKIE['$Domain']); + $_COOKIE = $this->_clean_input_data($_COOKIE); + + log_message('debug', "Global POST and COOKIE data sanitized"); + } + + // -------------------------------------------------------------------- + + /** + * Clean Input Data + * + * This is a helper function. It escapes data and + * standardizes newline characters to \n + * + * @access private + * @param string + * @return string + */ + function _clean_input_data($str) + { + if (is_array($str)) + { + $new_array = array(); + foreach ($str as $key => $val) + { + $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + return $new_array; + } + + // We strip slashes if magic quotes is on to keep things consistent + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + + // Should we filter the input data? + if ($this->use_xss_clean === TRUE) + { + $str = $this->xss_clean($str); + } + + // Standardize newlines + if (strpos($str, "\r") !== FALSE) + { + $str = str_replace(array("\r\n", "\r"), "\n", $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Clean Keys + * + * This is a helper function. To prevent malicious users + * from trying to exploit keys we make sure that keys are + * only named with alpha-numeric text and a few other items. + * + * @access private + * @param string + * @return string + */ + function _clean_input_keys($str) + { + if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) + { + exit('Disallowed Key Characters.'); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Fetch from array + * + * This is a helper function to retrieve values from global arrays + * + * @access private + * @param array + * @param string + * @param bool + * @return string + */ + function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) + { + if ( ! isset($array[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + return $this->xss_clean($array[$index]); + } + + return $array[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the GET array + * + * @access public + * @param string + * @param bool + * @return string + */ + function get($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_GET, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the POST array + * + * @access public + * @param string + * @param bool + * @return string + */ + function post($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_POST, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from either the GET array or the POST + * + * @access public + * @param string The index key + * @param bool XSS cleaning + * @return string + */ + function get_post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_POST[$index]) ) + { + return $this->get($index, $xss_clean); + } + else + { + return $this->post($index, $xss_clean); + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return string + */ + function cookie($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the SERVER array + * + * @access public + * @param string + * @param bool + * @return string + */ + function server($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_SERVER, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the IP Address + * + * @access public + * @return string + */ + function ip_address() + { + if ($this->ip_address !== FALSE) + { + return $this->ip_address; + } + + if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('REMOTE_ADDR')) + { + $this->ip_address = $_SERVER['REMOTE_ADDR']; + } + elseif ($this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('HTTP_X_FORWARDED_FOR')) + { + $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + + if ($this->ip_address === FALSE) + { + $this->ip_address = '0.0.0.0'; + return $this->ip_address; + } + + if (strstr($this->ip_address, ',')) + { + $x = explode(',', $this->ip_address); + $this->ip_address = end($x); + } + + if ( ! $this->valid_ip($this->ip_address)) + { + $this->ip_address = '0.0.0.0'; + } + + return $this->ip_address; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * Updated version suggested by Geert De Deckere + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + $ip_segments = explode('.', $ip); + + // Always 4 segments needed + if (count($ip_segments) != 4) + { + return FALSE; + } + // IP can not start with 0 + if ($ip_segments[0][0] == '0') + { + return FALSE; + } + // Check each segment + foreach ($ip_segments as $segment) + { + // IP segments must be digits and can not be + // longer than 3 digits or greater then 255 + if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * User Agent + * + * @access public + * @return string + */ + function user_agent() + { + if ($this->user_agent !== FALSE) + { + return $this->user_agent; + } + + $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; + + return $this->user_agent; + } + + // -------------------------------------------------------------------- + + /** + * Filename Security + * + * @access public + * @param string + * @return string + */ + function filename_security($str) + { + $bad = array( + "../", + "./", + "", + "<", + ">", + "'", + '"', + '&', + '$', + '#', + '{', + '}', + '[', + ']', + '=', + ';', + '?', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + return stripslashes(str_replace($bad, '', $str)); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented. This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts. Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission. It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @access public + * @param string + * @return string + */ + function xss_clean($str, $is_image = FALSE) + { + /* + * Is the string an array? + * + */ + if (is_array($str)) + { + while (list($key) = each($str)) + { + $str[$key] = $this->xss_clean($str[$key]); + } + + return $str; + } + + /* + * Remove Invisible Characters + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Protect GET variables in URLs + */ + + // 901119URL5918AMP18930PROTECT8198 + + $str = preg_replace('|\&([a-z\_0-9]+)\=([a-z\_0-9]+)|i', $this->xss_hash()."\\1=\\2", $str); + + /* + * Validate standard character entities + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#?[0-9a-z]{2,})[\x00-\x20]*;?#i', "\\1;", $str); + + /* + * Validate UTF16 two byte encoding (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); + + /* + * Un-Protect GET variables in URLs + */ + $str = str_replace($this->xss_hash(), '&', $str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * Google + * + * Note: Use rawurldecode() so it does not remove plus signs + * + */ + $str = rawurldecode($str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + + $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); + + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_html_entity_decode_callback'), $str); + + /* + * Remove Invisible Characters Again! + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * NOTE: we deal with spaces between characters later. + * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, + * so we use str_replace. + * + */ + + if (strpos($str, "\t") !== FALSE) + { + $str = str_replace("\t", ' ', $str); + } + + /* + * Capture converted string for later comparison + */ + $converted_string = $str; + + /* + * Not Allowed Under Any Conditions + */ + + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * '), array('<?php', '<?PHP', '<?', '?>'), $str); + } + + /* + * Compact any exploded words + * + * This corrects words like: j a v a s c r i p t + * These words are compacted back to their correct state. + * + */ + $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); + foreach ($words as $word) + { + $temp = ''; + + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) + { + $temp .= substr($word, $i, 1)."\s*"; + } + + // We only want to do this when it is followed by a non-word character + // That way valid stuff like "dealer to" does not become "dealerto" + $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); + } + + /* + * Remove disallowed Javascript in links or img tags + * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared + * to these simplified non-capturing preg_match(), especially if the pattern exists in the string + */ + do + { + $original = $str; + + if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); + } + + if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); + } + + if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) + { + $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); + } + } + while($original != $str); + + unset($original); + + /* + * Remove JavaScript Event Handlers + * + * Note: This code is a little blunt. It removes + * the event handler and anything up to the closing >, + * but it's unlikely to be a problem. + * + */ + $event_handlers = array('[^a-z_\-]on\w*','xmlns'); + + if ($is_image === TRUE) + { + /* + * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, + * so we have to allow this for images. -Paul + */ + unset($event_handlers[array_search('xmlns', $event_handlers)]); + } + + $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: + * Becomes: <blink> + * + */ + $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; + $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code un-executable. + * + * For example: eval('some code') + * Becomes: eval('some code') + * + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + /* + * Final clean up + * + * This adds a bit of extra precaution in case + * something got through the above filters + * + */ + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Images are Handled in a Special Way + * - Essentially, we want to know that after all of the character conversion is done whether + * any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. + * However, if the string post-conversion does not matched the string post-removal of XSS, + * then it fails, as there was unwanted XSS code found and removed/changed during processing. + */ + + if ($is_image === TRUE) + { + if ($str == $converted_string) + { + return TRUE; + } + else + { + return FALSE; + } + } + + log_message('debug', "XSS Filtering completed"); + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Random Hash for protecting URLs + * + * @access public + * @return string + */ + function xss_hash() + { + if ($this->xss_hash == '') + { + if (phpversion() >= 4.2) + mt_srand(); + else + mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); + + $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); + } + + return $this->xss_hash; + } + + // -------------------------------------------------------------------- + + /** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ + function _remove_invisible_characters($str) + { + static $non_displayables; + + if ( ! isset($non_displayables)) + { + // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', '/\x0c/', // 11, 12 + '/[\x0e-\x1f]/' // 14-31 + ); + } + + do + { + $cleaned = $str; + $str = preg_replace($non_displayables, '', $str); + } + while ($cleaned != $str); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Compact Exploded Words + * + * Callback function for xss_clean() to remove whitespace from + * things like j a v a s c r i p t + * + * @access public + * @param type + * @return type + */ + function _compact_exploded_words($matches) + { + return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Naughty HTML + * + * Callback function for xss_clean() to remove naughty HTML elements + * + * @access private + * @param array + * @return string + */ + function _sanitize_naughty_html($matches) + { + // encode opening brace + $str = '<'.$matches[1].$matches[2].$matches[3]; + + // encode captured opening or closing brace to prevent recursive vectors + $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * JS Link Removal + * + * Callback function for xss_clean() to sanitize links + * This limits the PCRE backtracks, making it more performance friendly + * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in + * PHP 5.2+ on link-heavy strings + * + * @access private + * @param array + * @return string + */ + function _js_link_removal($match) + { + $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<'), array('>', '<'), $match[0]); + } + + // -------------------------------------------------------------------- + + /** + * HTML Entity Decode Callback + * + * Used as a callback for XSS Clean + * + * @access public + * @param array + * @return string + */ + function _html_entity_decode_callback($match) + { + $CFG =& load_class('Config'); + $charset = $CFG->item('charset'); + + return $this->_html_entity_decode($match[0], strtoupper($charset)); + } + + // -------------------------------------------------------------------- + + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * @access private + * @param string + * @param string + * @return string + */ + /* ------------------------------------------------- + /* Replacement for html_entity_decode() + /* -------------------------------------------------*/ + + /* + NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + character set, and the PHP developers said they were not back porting the + fix to versions other than PHP 5.x. + */ + function _html_entity_decode($str, $charset='UTF-8') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) + { + $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); + } + + // Numeric Entities + $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Filter Attributes + * + * Filters tag attributes for consistency and safety + * + * @access public + * @param string + * @return string + */ + function _filter_attributes($str) + { + $out = ''; + + if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) + { + foreach ($matches[0] as $match) + { + $out .= "{$match}"; + } + } + + return $out; + } + + // -------------------------------------------------------------------- + +} +// END Input class + +/* End of file Input.php */ /* Location: ./system/libraries/Input.php */ \ No newline at end of file From b5ce5aa366937163da47074ac1da430953d34660 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 6 Nov 2008 13:36:44 +0000 Subject: [PATCH 1551/2544] corrected a few docblock comments to accurately reflect return values removed some unneeded whitespace --- system/libraries/Email.php | 3906 ++++++++++++++++---------------- system/libraries/Ftp.php | 1234 +++++----- system/libraries/Hooks.php | 450 ++-- system/libraries/Image_lib.php | 3092 ++++++++++++------------- system/libraries/Language.php | 245 +- system/libraries/Session.php | 1514 ++++++------- user_guide/changelog.html | 3 +- 7 files changed, 5224 insertions(+), 5220 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index e9a5344f..ac968824 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1,1953 +1,1955 @@ - 0) - { - $this->initialize($config); - } - else - { - $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; - } - - log_message('debug', "Email Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize preferences - * - * @access public - * @param array - * @return void - */ - function initialize($config = array()) - { - $this->clear(); - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $method = 'set_'.$key; - - if (method_exists($this, $method)) - { - $this->$method($val); - } - else - { - $this->$key = $val; - } - } - } - - $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Initialize the Email Data - * - * @access public - * @return void - */ - function clear($clear_attachments = FALSE) - { - $this->_subject = ""; - $this->_body = ""; - $this->_finalbody = ""; - $this->_header_str = ""; - $this->_replyto_flag = FALSE; - $this->_recipients = array(); - $this->_headers = array(); - $this->_debug_msg = array(); - - $this->_set_header('User-Agent', $this->useragent); - $this->_set_header('Date', $this->_set_date()); - - if ($clear_attachments !== FALSE) - { - $this->_attach_name = array(); - $this->_attach_type = array(); - $this->_attach_disp = array(); - } - } - - // -------------------------------------------------------------------- - - /** - * Set FROM - * - * @access public - * @param string - * @param string - * @return void - */ - function from($from, $name = '') - { - if (preg_match( '/\<(.*)\>/', $from, $match)) - { - $from = $match['1']; - } - - if ($this->validate) - { - $this->validate_email($this->_str_to_array($from)); - } - - if ($name != '' && strncmp($name, '"', 1) != 0) - { - $name = '"'.$name.'"'; - } - - $this->_set_header('From', $name.' <'.$from.'>'); - $this->_set_header('Return-Path', '<'.$from.'>'); - } - - // -------------------------------------------------------------------- - - /** - * Set Reply-to - * - * @access public - * @param string - * @param string - * @return void - */ - function reply_to($replyto, $name = '') - { - if (preg_match( '/\<(.*)\>/', $replyto, $match)) - { - $replyto = $match['1']; - } - - if ($this->validate) - { - $this->validate_email($this->_str_to_array($replyto)); - } - - if ($name == '') - { - $name = $replyto; - } - - if (strncmp($name, '"', 1) != 0) - { - $name = '"'.$name.'"'; - } - - $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); - $this->_replyto_flag = TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Recipients - * - * @access public - * @param string - * @return void - */ - function to($to) - { - $to = $this->_str_to_array($to); - $to = $this->clean_email($to); - - if ($this->validate) - { - $this->validate_email($to); - } - - if ($this->_get_protocol() != 'mail') - { - $this->_set_header('To', implode(", ", $to)); - } - - switch ($this->_get_protocol()) - { - case 'smtp' : $this->_recipients = $to; - break; - case 'sendmail' : $this->_recipients = implode(", ", $to); - break; - case 'mail' : $this->_recipients = implode(", ", $to); - break; - } - } - - // -------------------------------------------------------------------- - - /** - * Set CC - * - * @access public - * @param string - * @return void - */ - function cc($cc) - { - $cc = $this->_str_to_array($cc); - $cc = $this->clean_email($cc); - - if ($this->validate) - { - $this->validate_email($cc); - } - - $this->_set_header('Cc', implode(", ", $cc)); - - if ($this->_get_protocol() == "smtp") - { - $this->_cc_array = $cc; - } - } - - // -------------------------------------------------------------------- - - /** - * Set BCC - * - * @access public - * @param string - * @param string - * @return void - */ - function bcc($bcc, $limit = '') - { - if ($limit != '' && is_numeric($limit)) - { - $this->bcc_batch_mode = TRUE; - $this->bcc_batch_size = $limit; - } - - $bcc = $this->_str_to_array($bcc); - $bcc = $this->clean_email($bcc); - - if ($this->validate) - { - $this->validate_email($bcc); - } - - if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) - { - $this->_bcc_array = $bcc; - } - else - { - $this->_set_header('Bcc', implode(", ", $bcc)); - } - } - - // -------------------------------------------------------------------- - - /** - * Set Email Subject - * - * @access public - * @param string - * @return void - */ - function subject($subject) - { - if (strpos($subject, "\r") !== FALSE OR strpos($subject, "\n") !== FALSE) - { - $subject = str_replace(array("\r\n", "\r", "\n"), '', $subject); - } - - if (strpos($subject, "\t")) - { - $subject = str_replace("\t", ' ', $subject); - } - - $this->_set_header('Subject', trim($subject)); - } - - // -------------------------------------------------------------------- - - /** - * Set Body - * - * @access public - * @param string - * @return void - */ - function message($body) - { - $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); - } - - // -------------------------------------------------------------------- - - /** - * Assign file attachments - * - * @access public - * @param string - * @return string - */ - function attach($filename, $disposition = 'attachment') - { - $this->_attach_name[] = $filename; - $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename)))); - $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters - } - - // -------------------------------------------------------------------- - - /** - * Add a Header Item - * - * @access private - * @param string - * @param string - * @return void - */ - function _set_header($header, $value) - { - $this->_headers[$header] = $value; - } - - // -------------------------------------------------------------------- - - /** - * Convert a String to an Array - * - * @access private - * @param string - * @return array - */ - function _str_to_array($email) - { - if ( ! is_array($email)) - { - if (strpos($email, ',') !== FALSE) - { - $email = preg_split('/[\s,]/', $email, -1, PREG_SPLIT_NO_EMPTY); - } - else - { - $email = trim($email); - settype($email, "array"); - } - } - return $email; - } - - // -------------------------------------------------------------------- - - /** - * Set Multipart Value - * - * @access public - * @param string - * @return void - */ - function set_alt_message($str = '') - { - $this->alt_message = ($str == '') ? '' : $str; - } - - // -------------------------------------------------------------------- - - /** - * Set Mailtype - * - * @access public - * @param string - * @return void - */ - function set_mailtype($type = 'text') - { - $this->mailtype = ($type == 'html') ? 'html' : 'text'; - } - - // -------------------------------------------------------------------- - - /** - * Set Wordwrap - * - * @access public - * @param string - * @return void - */ - function set_wordwrap($wordwrap = TRUE) - { - $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set Protocol - * - * @access public - * @param string - * @return void - */ - function set_protocol($protocol = 'mail') - { - $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); - } - - // -------------------------------------------------------------------- - - /** - * Set Priority - * - * @access public - * @param integer - * @return void - */ - function set_priority($n = 3) - { - if ( ! is_numeric($n)) - { - $this->priority = 3; - return; - } - - if ($n < 1 OR $n > 5) - { - $this->priority = 3; - return; - } - - $this->priority = $n; - } - - // -------------------------------------------------------------------- - - /** - * Set Newline Character - * - * @access public - * @param string - * @return void - */ - function set_newline($newline = "\n") - { - if ($newline != "\n" AND $newline != "\r\n" AND $newline != "\r") - { - $this->newline = "\n"; - return; - } - - $this->newline = $newline; - } - - // -------------------------------------------------------------------- - - /** - * Set CRLF - * - * @access public - * @param string - * @return void - */ - function set_crlf($crlf = "\n") - { - if ($crlf != "\n" AND $crlf != "\r\n" AND $crlf != "\r") - { - $this->crlf = "\n"; - return; - } - - $this->crlf = $crlf; - } - - // -------------------------------------------------------------------- - - /** - * Set Message Boundary - * - * @access private - * @return void - */ - function _set_boundaries() - { - $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative - $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary - } - - // -------------------------------------------------------------------- - - /** - * Get the Message ID - * - * @access private - * @return string - */ - function _get_message_id() - { - $from = $this->_headers['Return-Path']; - $from = str_replace(">", "", $from); - $from = str_replace("<", "", $from); - - return "<".uniqid('').strstr($from, '@').">"; - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Protocol - * - * @access private - * @param bool - * @return string - */ - function _get_protocol($return = TRUE) - { - $this->protocol = strtolower($this->protocol); - $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol; - - if ($return == TRUE) - { - return $this->protocol; - } - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Encoding - * - * @access private - * @param bool - * @return string - */ - function _get_encoding($return = TRUE) - { - $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '8bit' : $this->_encoding; - - foreach ($this->_base_charsets as $charset) - { - if (strncmp($charset, $this->charset, strlen($charset)) == 0) - { - $this->_encoding = '7bit'; - } - } - - if ($return == TRUE) - { - return $this->_encoding; - } - } - - // -------------------------------------------------------------------- - - /** - * Get content type (text/html/attachment) - * - * @access private - * @return string - */ - function _get_content_type() - { - if ($this->mailtype == 'html' && count($this->_attach_name) == 0) - { - return 'html'; - } - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) - { - return 'html-attach'; - } - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) - { - return 'plain-attach'; - } - else - { - return 'plain'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set RFC 822 Date - * - * @access private - * @return string - */ - function _set_date() - { - $timezone = date("Z"); - $operator = (strncmp($timezone, '-', 1) == 0) ? '-' : '+'; - $timezone = abs($timezone); - $timezone = floor($timezone/3600) * 100 + ($timezone % 3600 ) / 60; - - return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); - } - - // -------------------------------------------------------------------- - - /** - * Mime message - * - * @access private - * @return string - */ - function _get_mime_message() - { - return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; - } - - // -------------------------------------------------------------------- - - /** - * Validate Email Address - * - * @access public - * @param string - * @return bool - */ - function validate_email($email) - { - if ( ! is_array($email)) - { - $this->_set_error_message('email_must_be_array'); - return FALSE; - } - - foreach ($email as $val) - { - if ( ! $this->valid_email($val)) - { - $this->_set_error_message('email_invalid_address', $val); - return FALSE; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Email Validation - * - * @access public - * @param string - * @return bool - */ - function valid_email($address) - { - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Clean Extended Email Address: Joe Smith - * - * @access public - * @param string - * @return string - */ - function clean_email($email) - { - if ( ! is_array($email)) - { - if (preg_match('/\<(.*)\>/', $email, $match)) - { - return $match['1']; - } - else - { - return $email; - } - } - - $clean_email = array(); - - foreach ($email as $addy) - { - if (preg_match( '/\<(.*)\>/', $addy, $match)) - { - $clean_email[] = $match['1']; - } - else - { - $clean_email[] = $addy; - } - } - - return $clean_email; - } - - // -------------------------------------------------------------------- - - /** - * Build alternative plain text message - * - * This function provides the raw message for use - * in plain-text headers of HTML-formatted emails. - * If the user hasn't specified his own alternative message - * it creates one by stripping the HTML - * - * @access private - * @return string - */ - function _get_alt_message() - { - if ($this->alt_message != "") - { - return $this->word_wrap($this->alt_message, '76'); - } - - if (preg_match('/\(.*)\<\/body\>/si', $this->_body, $match)) - { - $body = $match['1']; - } - else - { - $body = $this->_body; - } - - $body = trim(strip_tags($body)); - $body = preg_replace( '#' => '-->', - ' '<![CDATA[' - ); - /* never allowed, regex replacement */ - var $never_allowed_regex = array( - "javascript\s*:" => '[removed]', - "expression\s*\(" => '[removed]', // CSS and IE - "Redirect\s+302" => '[removed]' - ); - - /** - * Constructor - * - * Sets whether to globally enable the XSS processing - * and whether to allow the $_GET array - * - * @access public - */ - function CI_Input() - { - log_message('debug', "Input Class Initialized"); - - $CFG =& load_class('Config'); - $this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; - $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; - $this->_sanitize_globals(); - } - - // -------------------------------------------------------------------- - - /** - * Sanitize Globals - * - * This function does the following: - * - * Unsets $_GET data (if query strings are not enabled) - * - * Unsets all globals if register_globals is enabled - * - * Standardizes newline characters to \n - * - * @access private - * @return void - */ - function _sanitize_globals() - { - // Would kind of be "wrong" to unset any of these GLOBALS - $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', - 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); - - // Unset globals for security. - // This is effectively the same as register_globals = off - foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global) - { - if ( ! is_array($global)) - { - if ( ! in_array($global, $protected)) - { - unset($GLOBALS[$global]); - } - } - else - { - foreach ($global as $key => $val) - { - if ( ! in_array($key, $protected)) - { - unset($GLOBALS[$key]); - } - - if (is_array($val)) - { - foreach($val as $k => $v) - { - if ( ! in_array($k, $protected)) - { - unset($GLOBALS[$k]); - } - } - } - } - } - } - - // Is $_GET data allowed? If not we'll set the $_GET to an empty array - if ($this->allow_get_array == FALSE) - { - $_GET = array(); - } - else - { - $_GET = $this->_clean_input_data($_GET); - } - - // Clean $_POST Data - $_POST = $this->_clean_input_data($_POST); - - // Clean $_COOKIE Data - // Also get rid of specially treated cookies that might be set by a server - // or silly application, that are of no use to a CI application anyway - // but that when present will trip our 'Disallowed Key Characters' alarm - // http://www.ietf.org/rfc/rfc2109.txt - // note that the key names below are single quoted strings, and are not PHP variables - unset($_COOKIE['$Version']); - unset($_COOKIE['$Path']); - unset($_COOKIE['$Domain']); - $_COOKIE = $this->_clean_input_data($_COOKIE); - - log_message('debug', "Global POST and COOKIE data sanitized"); - } - - // -------------------------------------------------------------------- - - /** - * Clean Input Data - * - * This is a helper function. It escapes data and - * standardizes newline characters to \n - * - * @access private - * @param string - * @return string - */ - function _clean_input_data($str) - { - if (is_array($str)) - { - $new_array = array(); - foreach ($str as $key => $val) - { - $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); - } - return $new_array; - } - - // We strip slashes if magic quotes is on to keep things consistent - if (get_magic_quotes_gpc()) - { - $str = stripslashes($str); - } - - // Should we filter the input data? - if ($this->use_xss_clean === TRUE) - { - $str = $this->xss_clean($str); - } - - // Standardize newlines - if (strpos($str, "\r") !== FALSE) - { - $str = str_replace(array("\r\n", "\r"), "\n", $str); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Clean Keys - * - * This is a helper function. To prevent malicious users - * from trying to exploit keys we make sure that keys are - * only named with alpha-numeric text and a few other items. - * - * @access private - * @param string - * @return string - */ - function _clean_input_keys($str) - { - if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) - { - exit('Disallowed Key Characters.'); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Fetch from array - * - * This is a helper function to retrieve values from global arrays - * - * @access private - * @param array - * @param string - * @param bool - * @return string - */ - function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) - { - if ( ! isset($array[$index])) - { - return FALSE; - } - - if ($xss_clean === TRUE) - { - return $this->xss_clean($array[$index]); - } - - return $array[$index]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the GET array - * - * @access public - * @param string - * @param bool - * @return string - */ - function get($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_GET, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the POST array - * - * @access public - * @param string - * @param bool - * @return string - */ - function post($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_POST, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from either the GET array or the POST - * - * @access public - * @param string The index key - * @param bool XSS cleaning - * @return string - */ - function get_post($index = '', $xss_clean = FALSE) - { - if ( ! isset($_POST[$index]) ) - { - return $this->get($index, $xss_clean); - } - else - { - return $this->post($index, $xss_clean); - } - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the COOKIE array - * - * @access public - * @param string - * @param bool - * @return string - */ - function cookie($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch an item from the SERVER array - * - * @access public - * @param string - * @param bool - * @return string - */ - function server($index = '', $xss_clean = FALSE) - { - return $this->_fetch_from_array($_SERVER, $index, $xss_clean); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the IP Address - * - * @access public - * @return string - */ - function ip_address() - { - if ($this->ip_address !== FALSE) - { - return $this->ip_address; - } - - if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('REMOTE_ADDR')) - { - $this->ip_address = $_SERVER['REMOTE_ADDR']; - } - elseif ($this->server('HTTP_CLIENT_IP')) - { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; - } - elseif ($this->server('HTTP_X_FORWARDED_FOR')) - { - $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; - } - - if ($this->ip_address === FALSE) - { - $this->ip_address = '0.0.0.0'; - return $this->ip_address; - } - - if (strstr($this->ip_address, ',')) - { - $x = explode(',', $this->ip_address); - $this->ip_address = end($x); - } - - if ( ! $this->valid_ip($this->ip_address)) - { - $this->ip_address = '0.0.0.0'; - } - - return $this->ip_address; - } - - // -------------------------------------------------------------------- - - /** - * Validate IP Address - * - * Updated version suggested by Geert De Deckere - * - * @access public - * @param string - * @return string - */ - function valid_ip($ip) - { - $ip_segments = explode('.', $ip); - - // Always 4 segments needed - if (count($ip_segments) != 4) - { - return FALSE; - } - // IP can not start with 0 - if ($ip_segments[0][0] == '0') - { - return FALSE; - } - // Check each segment - foreach ($ip_segments as $segment) - { - // IP segments must be digits and can not be - // longer than 3 digits or greater then 255 - if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3) - { - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * User Agent - * - * @access public - * @return string - */ - function user_agent() - { - if ($this->user_agent !== FALSE) - { - return $this->user_agent; - } - - $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; - - return $this->user_agent; - } - - // -------------------------------------------------------------------- - - /** - * Filename Security - * - * @access public - * @param string - * @return string - */ - function filename_security($str) - { - $bad = array( - "../", - "./", - "", - "<", - ">", - "'", - '"', - '&', - '$', - '#', - '{', - '}', - '[', - ']', - '=', - ';', - '?', - "%20", - "%22", - "%3c", // < - "%253c", // < - "%3e", // > - "%0e", // > - "%28", // ( - "%29", // ) - "%2528", // ( - "%26", // & - "%24", // $ - "%3f", // ? - "%3b", // ; - "%3d" // = - ); - - return stripslashes(str_replace($bad, '', $str)); - } - - // -------------------------------------------------------------------- - - /** - * XSS Clean - * - * Sanitizes data so that Cross Site Scripting Hacks can be - * prevented. This function does a fair amount of work but - * it is extremely thorough, designed to prevent even the - * most obscure XSS attempts. Nothing is ever 100% foolproof, - * of course, but I haven't been able to get anything passed - * the filter. - * - * Note: This function should only be used to deal with data - * upon submission. It's not something that should - * be used for general runtime processing. - * - * This function was based in part on some code and ideas I - * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention - * - * To help develop this script I used this great list of - * vulnerabilities along with a few other hacks I've - * harvested from examining vulnerabilities in other programs: - * http://ha.ckers.org/xss.html - * - * @access public - * @param string - * @return string - */ - function xss_clean($str, $is_image = FALSE) - { - /* - * Is the string an array? - * - */ - if (is_array($str)) - { - while (list($key) = each($str)) - { - $str[$key] = $this->xss_clean($str[$key]); - } - - return $str; - } - - /* - * Remove Invisible Characters - */ - $str = $this->_remove_invisible_characters($str); - - /* - * Protect GET variables in URLs - */ - - // 901119URL5918AMP18930PROTECT8198 - - $str = preg_replace('|\&([a-z\_0-9]+)\=([a-z\_0-9]+)|i', $this->xss_hash()."\\1=\\2", $str); - - /* - * Validate standard character entities - * - * Add a semicolon if missing. We do this to enable - * the conversion of entities to ASCII later. - * - */ - $str = preg_replace('#(&\#?[0-9a-z]{2,})[\x00-\x20]*;?#i', "\\1;", $str); - - /* - * Validate UTF16 two byte encoding (x00) - * - * Just as above, adds a semicolon if missing. - * - */ - $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); - - /* - * Un-Protect GET variables in URLs - */ - $str = str_replace($this->xss_hash(), '&', $str); - - /* - * URL Decode - * - * Just in case stuff like this is submitted: - * - * Google - * - * Note: Use rawurldecode() so it does not remove plus signs - * - */ - $str = rawurldecode($str); - - /* - * Convert character entities to ASCII - * - * This permits our tests below to work reliably. - * We only convert entities that are within tags since - * these are the ones that will pose security problems. - * - */ - - $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - - $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_html_entity_decode_callback'), $str); - - /* - * Remove Invisible Characters Again! - */ - $str = $this->_remove_invisible_characters($str); - - /* - * Convert all tabs to spaces - * - * This prevents strings like this: ja vascript - * NOTE: we deal with spaces between characters later. - * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, - * so we use str_replace. - * - */ - - if (strpos($str, "\t") !== FALSE) - { - $str = str_replace("\t", ' ', $str); - } - - /* - * Capture converted string for later comparison - */ - $converted_string = $str; - - /* - * Not Allowed Under Any Conditions - */ - - foreach ($this->never_allowed_str as $key => $val) - { - $str = str_replace($key, $val, $str); - } - - foreach ($this->never_allowed_regex as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - /* - * Makes PHP tags safe - * - * Note: XML tags are inadvertently replaced too: - * - * '), array('<?php', '<?PHP', '<?', '?>'), $str); - } - - /* - * Compact any exploded words - * - * This corrects words like: j a v a s c r i p t - * These words are compacted back to their correct state. - * - */ - $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); - foreach ($words as $word) - { - $temp = ''; - - for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) - { - $temp .= substr($word, $i, 1)."\s*"; - } - - // We only want to do this when it is followed by a non-word character - // That way valid stuff like "dealer to" does not become "dealerto" - $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); - } - - /* - * Remove disallowed Javascript in links or img tags - * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared - * to these simplified non-capturing preg_match(), especially if the pattern exists in the string - */ - do - { - $original = $str; - - if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); - } - - if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); - } - - if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) - { - $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); - } - } - while($original != $str); - - unset($original); - - /* - * Remove JavaScript Event Handlers - * - * Note: This code is a little blunt. It removes - * the event handler and anything up to the closing >, - * but it's unlikely to be a problem. - * - */ - $event_handlers = array('[^a-z_\-]on\w*','xmlns'); - - if ($is_image === TRUE) - { - /* - * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, - * so we have to allow this for images. -Paul - */ - unset($event_handlers[array_search('xmlns', $event_handlers)]); - } - - $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); - - /* - * Sanitize naughty HTML elements - * - * If a tag containing any of the words in the list - * below is found, the tag gets converted to entities. - * - * So this: - * Becomes: <blink> - * - */ - $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; - $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); - - /* - * Sanitize naughty scripting elements - * - * Similar to above, only instead of looking for - * tags it looks for PHP and JavaScript commands - * that are disallowed. Rather than removing the - * code, it simply converts the parenthesis to entities - * rendering the code un-executable. - * - * For example: eval('some code') - * Becomes: eval('some code') - * - */ - $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); - - /* - * Final clean up - * - * This adds a bit of extra precaution in case - * something got through the above filters - * - */ - foreach ($this->never_allowed_str as $key => $val) - { - $str = str_replace($key, $val, $str); - } - - foreach ($this->never_allowed_regex as $key => $val) - { - $str = preg_replace("#".$key."#i", $val, $str); - } - - /* - * Images are Handled in a Special Way - * - Essentially, we want to know that after all of the character conversion is done whether - * any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. - * However, if the string post-conversion does not matched the string post-removal of XSS, - * then it fails, as there was unwanted XSS code found and removed/changed during processing. - */ - - if ($is_image === TRUE) - { - if ($str == $converted_string) - { - return TRUE; - } - else - { - return FALSE; - } - } - - log_message('debug', "XSS Filtering completed"); - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Random Hash for protecting URLs - * - * @access public - * @return string - */ - function xss_hash() - { - if ($this->xss_hash == '') - { - if (phpversion() >= 4.2) - mt_srand(); - else - mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); - - $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); - } - - return $this->xss_hash; - } - - // -------------------------------------------------------------------- - - /** - * Remove Invisible Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - * @access public - * @param string - * @return string - */ - function _remove_invisible_characters($str) - { - static $non_displayables; - - if ( ! isset($non_displayables)) - { - // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), - $non_displayables = array( - '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 - '/%1[0-9a-f]/', // url encoded 16-31 - '/[\x00-\x08]/', // 00-08 - '/\x0b/', '/\x0c/', // 11, 12 - '/[\x0e-\x1f]/' // 14-31 - ); - } - - do - { - $cleaned = $str; - $str = preg_replace($non_displayables, '', $str); - } - while ($cleaned != $str); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Compact Exploded Words - * - * Callback function for xss_clean() to remove whitespace from - * things like j a v a s c r i p t - * - * @access public - * @param type - * @return type - */ - function _compact_exploded_words($matches) - { - return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; - } - - // -------------------------------------------------------------------- - - /** - * Sanitize Naughty HTML - * - * Callback function for xss_clean() to remove naughty HTML elements - * - * @access private - * @param array - * @return string - */ - function _sanitize_naughty_html($matches) - { - // encode opening brace - $str = '<'.$matches[1].$matches[2].$matches[3]; - - // encode captured opening or closing brace to prevent recursive vectors - $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * JS Link Removal - * - * Callback function for xss_clean() to sanitize links - * This limits the PCRE backtracks, making it more performance friendly - * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in - * PHP 5.2+ on link-heavy strings - * - * @access private - * @param array - * @return string - */ - function _js_link_removal($match) - { - $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<'), array('>', '<'), $match[0]); - } - - // -------------------------------------------------------------------- - - /** - * HTML Entity Decode Callback - * - * Used as a callback for XSS Clean - * - * @access public - * @param array - * @return string - */ - function _html_entity_decode_callback($match) - { - $CFG =& load_class('Config'); - $charset = $CFG->item('charset'); - - return $this->_html_entity_decode($match[0], strtoupper($charset)); - } - - // -------------------------------------------------------------------- - - /** - * HTML Entities Decode - * - * This function is a replacement for html_entity_decode() - * - * In some versions of PHP the native function does not work - * when UTF-8 is the specified character set, so this gives us - * a work-around. More info here: - * http://bugs.php.net/bug.php?id=25670 - * - * @access private - * @param string - * @param string - * @return string - */ - /* ------------------------------------------------- - /* Replacement for html_entity_decode() - /* -------------------------------------------------*/ - - /* - NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the - character set, and the PHP developers said they were not back porting the - fix to versions other than PHP 5.x. - */ - function _html_entity_decode($str, $charset='UTF-8') - { - if (stristr($str, '&') === FALSE) return $str; - - // 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. - - if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) - { - $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); - } - - // Numeric Entities - $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); - - // Literal Entities - Slightly slow so we do another check - if (stristr($str, '&') === FALSE) - { - $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Filter Attributes - * - * Filters tag attributes for consistency and safety - * - * @access public - * @param string - * @return string - */ - function _filter_attributes($str) - { - $out = ''; - - if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) - { - foreach ($matches[0] as $match) - { - $out .= "{$match}"; - } - } - - return $out; - } - - // -------------------------------------------------------------------- - -} -// END Input class - -/* End of file Input.php */ + '[removed]', + 'document.write' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', + 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '' => '-->', + ' '<![CDATA[' + ); + /* never allowed, regex replacement */ + var $never_allowed_regex = array( + "javascript\s*:" => '[removed]', + "expression\s*\(" => '[removed]', // CSS and IE + "Redirect\s+302" => '[removed]' + ); + + /** + * Constructor + * + * Sets whether to globally enable the XSS processing + * and whether to allow the $_GET array + * + * @access public + */ + function CI_Input() + { + log_message('debug', "Input Class Initialized"); + + $CFG =& load_class('Config'); + $this->use_xss_clean = ($CFG->item('global_xss_filtering') === TRUE) ? TRUE : FALSE; + $this->allow_get_array = ($CFG->item('enable_query_strings') === TRUE) ? TRUE : FALSE; + $this->_sanitize_globals(); + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Globals + * + * This function does the following: + * + * Unsets $_GET data (if query strings are not enabled) + * + * Unsets all globals if register_globals is enabled + * + * Standardizes newline characters to \n + * + * @access private + * @return void + */ + function _sanitize_globals() + { + // Would kind of be "wrong" to unset any of these GLOBALS + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', + 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); + + // Unset globals for security. + // This is effectively the same as register_globals = off + foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global) + { + if ( ! is_array($global)) + { + if ( ! in_array($global, $protected)) + { + unset($GLOBALS[$global]); + } + } + else + { + foreach ($global as $key => $val) + { + if ( ! in_array($key, $protected)) + { + unset($GLOBALS[$key]); + } + + if (is_array($val)) + { + foreach($val as $k => $v) + { + if ( ! in_array($k, $protected)) + { + unset($GLOBALS[$k]); + } + } + } + } + } + } + + // Is $_GET data allowed? If not we'll set the $_GET to an empty array + if ($this->allow_get_array == FALSE) + { + $_GET = array(); + } + else + { + $_GET = $this->_clean_input_data($_GET); + } + + // Clean $_POST Data + $_POST = $this->_clean_input_data($_POST); + + // Clean $_COOKIE Data + // Also get rid of specially treated cookies that might be set by a server + // or silly application, that are of no use to a CI application anyway + // but that when present will trip our 'Disallowed Key Characters' alarm + // http://www.ietf.org/rfc/rfc2109.txt + // note that the key names below are single quoted strings, and are not PHP variables + unset($_COOKIE['$Version']); + unset($_COOKIE['$Path']); + unset($_COOKIE['$Domain']); + $_COOKIE = $this->_clean_input_data($_COOKIE); + + log_message('debug', "Global POST and COOKIE data sanitized"); + } + + // -------------------------------------------------------------------- + + /** + * Clean Input Data + * + * This is a helper function. It escapes data and + * standardizes newline characters to \n + * + * @access private + * @param string + * @return string + */ + function _clean_input_data($str) + { + if (is_array($str)) + { + $new_array = array(); + foreach ($str as $key => $val) + { + $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); + } + return $new_array; + } + + // We strip slashes if magic quotes is on to keep things consistent + if (get_magic_quotes_gpc()) + { + $str = stripslashes($str); + } + + // Should we filter the input data? + if ($this->use_xss_clean === TRUE) + { + $str = $this->xss_clean($str); + } + + // Standardize newlines + if (strpos($str, "\r") !== FALSE) + { + $str = str_replace(array("\r\n", "\r"), "\n", $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Clean Keys + * + * This is a helper function. To prevent malicious users + * from trying to exploit keys we make sure that keys are + * only named with alpha-numeric text and a few other items. + * + * @access private + * @param string + * @return string + */ + function _clean_input_keys($str) + { + if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) + { + exit('Disallowed Key Characters.'); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Fetch from array + * + * This is a helper function to retrieve values from global arrays + * + * @access private + * @param array + * @param string + * @param bool + * @return string + */ + function _fetch_from_array(&$array, $index = '', $xss_clean = FALSE) + { + if ( ! isset($array[$index])) + { + return FALSE; + } + + if ($xss_clean === TRUE) + { + return $this->xss_clean($array[$index]); + } + + return $array[$index]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the GET array + * + * @access public + * @param string + * @param bool + * @return string + */ + function get($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_GET, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the POST array + * + * @access public + * @param string + * @param bool + * @return string + */ + function post($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_POST, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from either the GET array or the POST + * + * @access public + * @param string The index key + * @param bool XSS cleaning + * @return string + */ + function get_post($index = '', $xss_clean = FALSE) + { + if ( ! isset($_POST[$index]) ) + { + return $this->get($index, $xss_clean); + } + else + { + return $this->post($index, $xss_clean); + } + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return string + */ + function cookie($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch an item from the SERVER array + * + * @access public + * @param string + * @param bool + * @return string + */ + function server($index = '', $xss_clean = FALSE) + { + return $this->_fetch_from_array($_SERVER, $index, $xss_clean); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the IP Address + * + * @access public + * @return string + */ + function ip_address() + { + if ($this->ip_address !== FALSE) + { + return $this->ip_address; + } + + if ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('REMOTE_ADDR')) + { + $this->ip_address = $_SERVER['REMOTE_ADDR']; + } + elseif ($this->server('HTTP_CLIENT_IP')) + { + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + } + elseif ($this->server('HTTP_X_FORWARDED_FOR')) + { + $this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + + if ($this->ip_address === FALSE) + { + $this->ip_address = '0.0.0.0'; + return $this->ip_address; + } + + if (strstr($this->ip_address, ',')) + { + $x = explode(',', $this->ip_address); + $this->ip_address = end($x); + } + + if ( ! $this->valid_ip($this->ip_address)) + { + $this->ip_address = '0.0.0.0'; + } + + return $this->ip_address; + } + + // -------------------------------------------------------------------- + + /** + * Validate IP Address + * + * Updated version suggested by Geert De Deckere + * + * @access public + * @param string + * @return string + */ + function valid_ip($ip) + { + $ip_segments = explode('.', $ip); + + // Always 4 segments needed + if (count($ip_segments) != 4) + { + return FALSE; + } + // IP can not start with 0 + if ($ip_segments[0][0] == '0') + { + return FALSE; + } + // Check each segment + foreach ($ip_segments as $segment) + { + // IP segments must be digits and can not be + // longer than 3 digits or greater then 255 + if ($segment == '' OR preg_match("/[^0-9]/", $segment) OR $segment > 255 OR strlen($segment) > 3) + { + return FALSE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * User Agent + * + * @access public + * @return string + */ + function user_agent() + { + if ($this->user_agent !== FALSE) + { + return $this->user_agent; + } + + $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT']; + + return $this->user_agent; + } + + // -------------------------------------------------------------------- + + /** + * Filename Security + * + * @access public + * @param string + * @return string + */ + function filename_security($str) + { + $bad = array( + "../", + "./", + "", + "<", + ">", + "'", + '"', + '&', + '$', + '#', + '{', + '}', + '[', + ']', + '=', + ';', + '?', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + return stripslashes(str_replace($bad, '', $str)); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented. This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts. Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission. It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://blog.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @access public + * @param string + * @return string + */ + function xss_clean($str, $is_image = FALSE) + { + /* + * Is the string an array? + * + */ + if (is_array($str)) + { + while (list($key) = each($str)) + { + $str[$key] = $this->xss_clean($str[$key]); + } + + return $str; + } + + /* + * Remove Invisible Characters + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Protect GET variables in URLs + */ + + // 901119URL5918AMP18930PROTECT8198 + + $str = preg_replace('|\&([a-z\_0-9]+)\=([a-z\_0-9]+)|i', $this->xss_hash()."\\1=\\2", $str); + + /* + * Validate standard character entities + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#?[0-9a-z]{2,})[\x00-\x20]*;?#i', "\\1;", $str); + + /* + * Validate UTF16 two byte encoding (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); + + /* + * Un-Protect GET variables in URLs + */ + $str = str_replace($this->xss_hash(), '&', $str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * Google + * + * Note: Use rawurldecode() so it does not remove plus signs + * + */ + $str = rawurldecode($str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + + $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); + + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_html_entity_decode_callback'), $str); + + /* + * Remove Invisible Characters Again! + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * NOTE: we deal with spaces between characters later. + * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, + * so we use str_replace. + * + */ + + if (strpos($str, "\t") !== FALSE) + { + $str = str_replace("\t", ' ', $str); + } + + /* + * Capture converted string for later comparison + */ + $converted_string = $str; + + /* + * Not Allowed Under Any Conditions + */ + + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * '), array('<?php', '<?PHP', '<?', '?>'), $str); + } + + /* + * Compact any exploded words + * + * This corrects words like: j a v a s c r i p t + * These words are compacted back to their correct state. + * + */ + $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); + foreach ($words as $word) + { + $temp = ''; + + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) + { + $temp .= substr($word, $i, 1)."\s*"; + } + + // We only want to do this when it is followed by a non-word character + // That way valid stuff like "dealer to" does not become "dealerto" + $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); + } + + /* + * Remove disallowed Javascript in links or img tags + * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared + * to these simplified non-capturing preg_match(), especially if the pattern exists in the string + */ + do + { + $original = $str; + + if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); + } + + if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); + } + + if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) + { + $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); + } + } + while($original != $str); + + unset($original); + + /* + * Remove JavaScript Event Handlers + * + * Note: This code is a little blunt. It removes + * the event handler and anything up to the closing >, + * but it's unlikely to be a problem. + * + */ + $event_handlers = array('[^a-z_\-]on\w*','xmlns'); + + if ($is_image === TRUE) + { + /* + * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, + * so we have to allow this for images. -Paul + */ + unset($event_handlers[array_search('xmlns', $event_handlers)]); + } + + $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: + * Becomes: <blink> + * + */ + $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; + $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code un-executable. + * + * For example: eval('some code') + * Becomes: eval('some code') + * + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + /* + * Final clean up + * + * This adds a bit of extra precaution in case + * something got through the above filters + * + */ + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Images are Handled in a Special Way + * - Essentially, we want to know that after all of the character conversion is done whether + * any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. + * However, if the string post-conversion does not matched the string post-removal of XSS, + * then it fails, as there was unwanted XSS code found and removed/changed during processing. + */ + + if ($is_image === TRUE) + { + if ($str == $converted_string) + { + return TRUE; + } + else + { + return FALSE; + } + } + + log_message('debug', "XSS Filtering completed"); + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Random Hash for protecting URLs + * + * @access public + * @return string + */ + function xss_hash() + { + if ($this->xss_hash == '') + { + if (phpversion() >= 4.2) + mt_srand(); + else + mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); + + $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); + } + + return $this->xss_hash; + } + + // -------------------------------------------------------------------- + + /** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ + function _remove_invisible_characters($str) + { + static $non_displayables; + + if ( ! isset($non_displayables)) + { + // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', '/\x0c/', // 11, 12 + '/[\x0e-\x1f]/' // 14-31 + ); + } + + do + { + $cleaned = $str; + $str = preg_replace($non_displayables, '', $str); + } + while ($cleaned != $str); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Compact Exploded Words + * + * Callback function for xss_clean() to remove whitespace from + * things like j a v a s c r i p t + * + * @access public + * @param type + * @return type + */ + function _compact_exploded_words($matches) + { + return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Naughty HTML + * + * Callback function for xss_clean() to remove naughty HTML elements + * + * @access private + * @param array + * @return string + */ + function _sanitize_naughty_html($matches) + { + // encode opening brace + $str = '<'.$matches[1].$matches[2].$matches[3]; + + // encode captured opening or closing brace to prevent recursive vectors + $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * JS Link Removal + * + * Callback function for xss_clean() to sanitize links + * This limits the PCRE backtracks, making it more performance friendly + * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in + * PHP 5.2+ on link-heavy strings + * + * @access private + * @param array + * @return string + */ + function _js_link_removal($match) + { + $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<'), array('>', '<'), $match[0]); + } + + // -------------------------------------------------------------------- + + /** + * HTML Entity Decode Callback + * + * Used as a callback for XSS Clean + * + * @access public + * @param array + * @return string + */ + function _html_entity_decode_callback($match) + { + $CFG =& load_class('Config'); + $charset = $CFG->item('charset'); + + return $this->_html_entity_decode($match[0], strtoupper($charset)); + } + + // -------------------------------------------------------------------- + + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * @access private + * @param string + * @param string + * @return string + */ + /* ------------------------------------------------- + /* Replacement for html_entity_decode() + /* -------------------------------------------------*/ + + /* + NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + character set, and the PHP developers said they were not back porting the + fix to versions other than PHP 5.x. + */ + function _html_entity_decode($str, $charset='UTF-8') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) + { + $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); + } + + // Numeric Entities + $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Filter Attributes + * + * Filters tag attributes for consistency and safety + * + * @access public + * @param string + * @return string + */ + function _filter_attributes($str) + { + $out = ''; + + if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) + { + foreach ($matches[0] as $match) + { + $out .= "{$match}"; + } + } + + return $out; + } + + // -------------------------------------------------------------------- + +} +// END Input class + +/* End of file Input.php */ /* Location: ./system/libraries/Input.php */ \ No newline at end of file diff --git a/system/libraries/Language.php b/system/libraries/Language.php index 78f4143a..bc237e75 100644 --- a/system/libraries/Language.php +++ b/system/libraries/Language.php @@ -1,123 +1,123 @@ -is_loaded, TRUE)) - { - return; - } - - if ($idiom == '') - { - $CI =& get_instance(); - $deft_lang = $CI->config->item('language'); - $idiom = ($deft_lang == '') ? 'english' : $deft_lang; - } - - // Determine where the language file is and load it - if (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile)) - { - include(APPPATH.'language/'.$idiom.'/'.$langfile); - } - else - { - if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) - { - include(BASEPATH.'language/'.$idiom.'/'.$langfile); - } - else - { - show_error('Unable to load the requested language file: language/'.$langfile); - } - } - - if ( ! isset($lang)) - { - log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); - return; - } - - if ($return == TRUE) - { - return $lang; - } - - $this->is_loaded[] = $langfile; - $this->language = array_merge($this->language, $lang); - unset($lang); - - log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a single line of text from the language array - * - * @access public - * @param string $line the language line - * @return string - */ - function line($line = '') - { - $line = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; - return $line; - } - -} -// END Language Class - -/* End of file Language.php */ +is_loaded, TRUE)) + { + return; + } + + if ($idiom == '') + { + $CI =& get_instance(); + $deft_lang = $CI->config->item('language'); + $idiom = ($deft_lang == '') ? 'english' : $deft_lang; + } + + // Determine where the language file is and load it + if (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile)) + { + include(APPPATH.'language/'.$idiom.'/'.$langfile); + } + else + { + if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) + { + include(BASEPATH.'language/'.$idiom.'/'.$langfile); + } + else + { + show_error('Unable to load the requested language file: language/'.$langfile); + } + } + + if ( ! isset($lang)) + { + log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); + return; + } + + if ($return == TRUE) + { + return $lang; + } + + $this->is_loaded[] = $langfile; + $this->language = array_merge($this->language, $lang); + unset($lang); + + log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a single line of text from the language array + * + * @access public + * @param string $line the language line + * @return string + */ + function line($line = '') + { + $line = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; + return $line; + } + +} +// END Language Class + +/* End of file Language.php */ /* Location: ./system/libraries/Language.php */ \ No newline at end of file diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 660ce8f1..25bf21fb 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -1,758 +1,758 @@ -CI =& get_instance(); - - // Set all the session preferences, which can either be set - // manually via the $params array above or via the config file - foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) - { - $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key); - } - - // Load the string helper so we can use the strip_slashes() function - $this->CI->load->helper('string'); - - // Do we need encryption? If so, load the encryption class - if ($this->sess_encrypt_cookie == TRUE) - { - $this->CI->load->library('encrypt'); - } - - // Are we using a database? If so, load it - if ($this->sess_use_database === TRUE AND $this->sess_table_name != '') - { - $this->CI->load->database(); - } - - // Set the "now" time. Can either be GMT or server time, based on the - // config prefs. We use this to set the "last activity" time - $this->now = $this->_get_time(); - - // Set the session length. If the session expiration is - // set to zero we'll set the expiration two years from now. - if ($this->sess_expiration == 0) - { - $this->sess_expiration = (60*60*24*365*2); - } - - // Set the cookie name - $this->sess_cookie_name = $this->cookie_prefix.$this->sess_cookie_name; - - // Run the Session routine. If a session doesn't exist we'll - // create a new one. If it does, we'll update it. - if ( ! $this->sess_read()) - { - $this->sess_create(); - } - else - { - $this->sess_update(); - } - - // Delete 'old' flashdata (from last request) - $this->_flashdata_sweep(); - - // Mark all new flashdata as old (data will be deleted before next request) - $this->_flashdata_mark(); - - // Delete expired sessions if necessary - $this->_sess_gc(); - - log_message('debug', "Session routines successfully run"); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the current session data if it exists - * - * @access public - * @return bool - */ - function sess_read() - { - // Fetch the cookie - $session = $this->CI->input->cookie($this->sess_cookie_name); - - // No cookie? Goodbye cruel world!... - if ($session === FALSE) - { - log_message('debug', 'A session cookie was not found.'); - return FALSE; - } - - // Decrypt the cookie data - if ($this->sess_encrypt_cookie == TRUE) - { - $session = $this->CI->encrypt->decode($session); - } - else - { - // encryption was not used, so we need to check the md5 hash - $hash = substr($session, strlen($session)-32); // get last 32 chars - $session = substr($session, 0, strlen($session)-32); - - // Does the md5 hash match? This is to prevent manipulation of session data in userspace - if ($hash !== md5($session.$this->encryption_key)) - { - log_message('error', 'The session cookie data did not match what was expected. This could be a possible hacking attempt.'); - $this->sess_destroy(); - return FALSE; - } - } - - // Unserialize the session array - $session = $this->_unserialize($session); - - // Is the session data we unserialized an array with the correct format? - if ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity'])) - { - $this->sess_destroy(); - return FALSE; - } - - // Is the session current? - if (($session['last_activity'] + $this->sess_expiration) < $this->now) - { - $this->sess_destroy(); - return FALSE; - } - - // Does the IP Match? - if ($this->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address()) - { - $this->sess_destroy(); - return FALSE; - } - - // Does the User Agent Match? - if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) - { - $this->sess_destroy(); - return FALSE; - } - - // Is there a corresponding session in the DB? - if ($this->sess_use_database === TRUE) - { - $this->CI->db->where('session_id', $session['session_id']); - - if ($this->sess_match_ip == TRUE) - { - $this->CI->db->where('ip_address', $session['ip_address']); - } - - if ($this->sess_match_useragent == TRUE) - { - $this->CI->db->where('user_agent', $session['user_agent']); - } - - $query = $this->CI->db->get($this->sess_table_name); - - // No result? Kill it! - if ($query->num_rows() == 0) - { - $this->sess_destroy(); - return FALSE; - } - - // Is there custom data? If so, add it to the main session array - $row = $query->row(); - if (isset($row->user_data) AND $row->user_data != '') - { - $custom_data = $this->_unserialize($row->user_data); - - if (is_array($custom_data)) - { - foreach ($custom_data as $key => $val) - { - $session[$key] = $val; - } - } - } - } - - // Session is valid! - $this->userdata = $session; - unset($session); - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Write the session data - * - * @access public - * @return void - */ - function sess_write() - { - // Are we saving custom data to the DB? If not, all we do is update the cookie - if ($this->sess_use_database === FALSE) - { - $this->_set_cookie(); - return; - } - - // set the custom userdata, the session data we will set in a second - $custom_userdata = $this->userdata; - $cookie_userdata = array(); - - // Before continuing, we need to determine if there is any custom data to deal with. - // Let's determine this by removing the default indexes to see if there's anything left in the array - // and set the session data while we're at it - foreach (array('session_id','ip_address','user_agent','last_activity') as $val) - { - unset($custom_userdata[$val]); - $cookie_userdata[$val] = $this->userdata[$val]; - } - - // Did we find any custom data? If not, we turn the empty array into a string - // since there's no reason to serialize and store an empty array in the DB - if (count($custom_userdata) === 0) - { - $custom_userdata = ''; - } - else - { - // Serialize the custom data array so we can store it - $custom_userdata = $this->_serialize($custom_userdata); - } - - // Run the update query - $this->CI->db->where('session_id', $this->userdata['session_id']); - $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); - - // Write the cookie. Notice that we manually pass the cookie data array to the - // _set_cookie() function. Normally that function will store $this->userdata, but - // in this case that array contains custom data, which we do not want in the cookie. - $this->_set_cookie($cookie_userdata); - } - - // -------------------------------------------------------------------- - - /** - * Create a new session - * - * @access public - * @return void - */ - function sess_create() - { - $sessid = ''; - while (strlen($sessid) < 32) - { - $sessid .= mt_rand(0, mt_getrandmax()); - } - - // To make the session ID even more secure we'll combine it with the user's IP - $sessid .= $this->CI->input->ip_address(); - - $this->userdata = array( - 'session_id' => md5(uniqid($sessid, TRUE)), - 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), - 'last_activity' => $this->now - ); - - - // Save the data to the DB if needed - if ($this->sess_use_database === TRUE) - { - $this->CI->db->query($this->CI->db->insert_string($this->sess_table_name, $this->userdata)); - } - - // Write the cookie - $this->_set_cookie(); - } - - // -------------------------------------------------------------------- - - /** - * Update an existing session - * - * @access public - * @return void - */ - function sess_update() - { - // We only update the session every five minutes by default - if (($this->userdata['last_activity'] + $this->sess_time_to_update) >= $this->now) - { - return; - } - - // Save the old session id so we know which record to - // update in the database if we need it - $old_sessid = $this->userdata['session_id']; - $new_sessid = ''; - while (strlen($new_sessid) < 32) - { - $new_sessid .= mt_rand(0, mt_getrandmax()); - } - - // To make the session ID even more secure we'll combine it with the user's IP - $new_sessid .= $this->CI->input->ip_address(); - - // Turn it into a hash - $new_sessid = md5(uniqid($new_sessid, TRUE)); - - // Update the session data in the session data array - $this->userdata['session_id'] = $new_sessid; - $this->userdata['last_activity'] = $this->now; - - // _set_cookie() will handle this for us if we aren't using database sessions - // by pushing all userdata to the cookie. - $cookie_data = NULL; - - // Update the session ID and last_activity field in the DB if needed - if ($this->sess_use_database === TRUE) - { - // set cookie explicitly to only have our session data - $cookie_data = array(); - foreach (array('session_id','ip_address','user_agent','last_activity') as $val) - { - $cookie_data[$val] = $this->userdata[$val]; - } - - $this->CI->db->query($this->CI->db->update_string($this->sess_table_name, array('last_activity' => $this->now, 'session_id' => $new_sessid), array('session_id' => $old_sessid))); - } - - // Write the cookie - $this->_set_cookie($cookie_data); - } - - // -------------------------------------------------------------------- - - /** - * Destroy the current session - * - * @access public - * @return void - */ - function sess_destroy() - { - // Kill the session DB row - if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id'])) - { - $this->CI->db->where('session_id', $this->userdata['session_id']); - $this->CI->db->delete($this->sess_table_name); - } - - // Kill the cookie - setcookie( - $this->sess_cookie_name, - addslashes(serialize(array())), - ($this->now - 31500000), - $this->cookie_path, - $this->cookie_domain, - 0 - ); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a specific item from the session array - * - * @access public - * @param string - * @return string - */ - function userdata($item) - { - return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch all session data - * - * @access public - * @return mixed - */ - function all_userdata() - { - return ( ! isset($this->userdata)) ? FALSE : $this->userdata; - } - - // -------------------------------------------------------------------- - - /** - * Add or change data in the "userdata" array - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_userdata($newdata = array(), $newval = '') - { - if (is_string($newdata)) - { - $newdata = array($newdata => $newval); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - $this->userdata[$key] = $val; - } - } - - $this->sess_write(); - } - - // -------------------------------------------------------------------- - - /** - * Delete a session variable from the "userdata" array - * - * @access array - * @return void - */ - function unset_userdata($newdata = array()) - { - if (is_string($newdata)) - { - $newdata = array($newdata => ''); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - unset($this->userdata[$key]); - } - } - - $this->sess_write(); - } - - // ------------------------------------------------------------------------ - - /** - * Add or change flashdata, only available - * until the next request - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_flashdata($newdata = array(), $newval = '') - { - if (is_string($newdata)) - { - $newdata = array($newdata => $newval); - } - - if (count($newdata) > 0) - { - foreach ($newdata as $key => $val) - { - $flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($flashdata_key, $val); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Keeps existing flashdata available to next request. - * - * @access public - * @param string - * @return void - */ - function keep_flashdata($key) - { - // 'old' flashdata gets removed. Here we mark all - // flashdata as 'new' to preserve it from _flashdata_sweep() - // Note the function will return FALSE if the $key - // provided cannot be found - $old_flashdata_key = $this->flashdata_key.':old:'.$key; - $value = $this->userdata($old_flashdata_key); - - $new_flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($new_flashdata_key, $value); - } - - // ------------------------------------------------------------------------ - - /** - * Fetch a specific flashdata item from the session array - * - * @access public - * @param string - * @return string - */ - function flashdata($key) - { - $flashdata_key = $this->flashdata_key.':old:'.$key; - return $this->userdata($flashdata_key); - } - - // ------------------------------------------------------------------------ - - /** - * Identifies flashdata as 'old' for removal - * when _flashdata_sweep() runs. - * - * @access private - * @return void - */ - function _flashdata_mark() - { - $userdata = $this->all_userdata(); - foreach ($userdata as $name => $value) - { - $parts = explode(':new:', $name); - if (is_array($parts) && count($parts) === 2) - { - $new_name = $this->flashdata_key.':old:'.$parts[1]; - $this->set_userdata($new_name, $value); - $this->unset_userdata($name); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Removes all flashdata marked as 'old' - * - * @access private - * @return void - */ - - function _flashdata_sweep() - { - $userdata = $this->all_userdata(); - foreach ($userdata as $key => $value) - { - if (strpos($key, ':old:')) - { - $this->unset_userdata($key); - } - } - - } - - // -------------------------------------------------------------------- - - /** - * Get the "now" time - * - * @access private - * @return string - */ - function _get_time() - { - if (strtolower($this->time_reference) == 'gmt') - { - $now = time(); - $time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); - } - else - { - $time = time(); - } - - return $time; - } - - // -------------------------------------------------------------------- - - /** - * Write the session cookie - * - * @access public - * @return void - */ - function _set_cookie($cookie_data = NULL) - { - if (is_null($cookie_data)) - { - $cookie_data = $this->userdata; - } - - // Serialize the userdata for the cookie - $cookie_data = $this->_serialize($cookie_data); - - if ($this->sess_encrypt_cookie == TRUE) - { - $cookie_data = $this->CI->encrypt->encode($cookie_data); - } - else - { - // if encryption is not used, we provide an md5 hash to prevent userside tampering - $cookie_data = $cookie_data.md5($cookie_data.$this->encryption_key); - } - - // Set the cookie - setcookie( - $this->sess_cookie_name, - $cookie_data, - $this->sess_expiration + time(), - $this->cookie_path, - $this->cookie_domain, - 0 - ); - } - - // -------------------------------------------------------------------- - - /** - * Serialize an array - * - * This function first converts any slashes found in the array to a temporary - * marker, so when it gets unserialized the slashes will be preserved - * - * @access private - * @param array - * @return string - */ - function _serialize($data) - { - if (is_array($data)) - { - foreach ($data as $key => $val) - { - $data[$key] = str_replace('\\', '{{slash}}', $val); - } - } - else - { - $data = str_replace('\\', '{{slash}}', $data); - } - - return serialize($data); - } - - // -------------------------------------------------------------------- - - /** - * Unserialize - * - * This function unserializes a data string, then converts any - * temporary slash markers back to actual slashes - * - * @access private - * @param array - * @return string - */ - function _unserialize($data) - { - $data = @unserialize(strip_slashes($data)); - - if (is_array($data)) - { - foreach ($data as $key => $val) - { - $data[$key] = str_replace('{{slash}}', '\\', $val); - } - - return $data; - } - - return str_replace('{{slash}}', '\\', $data); - } - - // -------------------------------------------------------------------- - - /** - * Garbage collection - * - * This deletes expired session rows from database - * if the probability percentage is met - * - * @access public - * @return void - */ - function _sess_gc() - { - if ($this->sess_use_database != TRUE) - { - return; - } - - srand(time()); - if ((rand() % 100) < $this->gc_probability) - { - $expire = $this->now - $this->sess_expiration; - - $this->CI->db->where("last_activity < {$expire}"); - $this->CI->db->delete($this->sess_table_name); - - log_message('debug', 'Session garbage collection performed.'); - } - } - - -} -// END Session Class - -/* End of file Session.php */ +CI =& get_instance(); + + // Set all the session preferences, which can either be set + // manually via the $params array above or via the config file + foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) + { + $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key); + } + + // Load the string helper so we can use the strip_slashes() function + $this->CI->load->helper('string'); + + // Do we need encryption? If so, load the encryption class + if ($this->sess_encrypt_cookie == TRUE) + { + $this->CI->load->library('encrypt'); + } + + // Are we using a database? If so, load it + if ($this->sess_use_database === TRUE AND $this->sess_table_name != '') + { + $this->CI->load->database(); + } + + // Set the "now" time. Can either be GMT or server time, based on the + // config prefs. We use this to set the "last activity" time + $this->now = $this->_get_time(); + + // Set the session length. If the session expiration is + // set to zero we'll set the expiration two years from now. + if ($this->sess_expiration == 0) + { + $this->sess_expiration = (60*60*24*365*2); + } + + // Set the cookie name + $this->sess_cookie_name = $this->cookie_prefix.$this->sess_cookie_name; + + // Run the Session routine. If a session doesn't exist we'll + // create a new one. If it does, we'll update it. + if ( ! $this->sess_read()) + { + $this->sess_create(); + } + else + { + $this->sess_update(); + } + + // Delete 'old' flashdata (from last request) + $this->_flashdata_sweep(); + + // Mark all new flashdata as old (data will be deleted before next request) + $this->_flashdata_mark(); + + // Delete expired sessions if necessary + $this->_sess_gc(); + + log_message('debug', "Session routines successfully run"); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the current session data if it exists + * + * @access public + * @return bool + */ + function sess_read() + { + // Fetch the cookie + $session = $this->CI->input->cookie($this->sess_cookie_name); + + // No cookie? Goodbye cruel world!... + if ($session === FALSE) + { + log_message('debug', 'A session cookie was not found.'); + return FALSE; + } + + // Decrypt the cookie data + if ($this->sess_encrypt_cookie == TRUE) + { + $session = $this->CI->encrypt->decode($session); + } + else + { + // encryption was not used, so we need to check the md5 hash + $hash = substr($session, strlen($session)-32); // get last 32 chars + $session = substr($session, 0, strlen($session)-32); + + // Does the md5 hash match? This is to prevent manipulation of session data in userspace + if ($hash !== md5($session.$this->encryption_key)) + { + log_message('error', 'The session cookie data did not match what was expected. This could be a possible hacking attempt.'); + $this->sess_destroy(); + return FALSE; + } + } + + // Unserialize the session array + $session = $this->_unserialize($session); + + // Is the session data we unserialized an array with the correct format? + if ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity'])) + { + $this->sess_destroy(); + return FALSE; + } + + // Is the session current? + if (($session['last_activity'] + $this->sess_expiration) < $this->now) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the IP Match? + if ($this->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address()) + { + $this->sess_destroy(); + return FALSE; + } + + // Does the User Agent Match? + if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) + { + $this->sess_destroy(); + return FALSE; + } + + // Is there a corresponding session in the DB? + if ($this->sess_use_database === TRUE) + { + $this->CI->db->where('session_id', $session['session_id']); + + if ($this->sess_match_ip == TRUE) + { + $this->CI->db->where('ip_address', $session['ip_address']); + } + + if ($this->sess_match_useragent == TRUE) + { + $this->CI->db->where('user_agent', $session['user_agent']); + } + + $query = $this->CI->db->get($this->sess_table_name); + + // No result? Kill it! + if ($query->num_rows() == 0) + { + $this->sess_destroy(); + return FALSE; + } + + // Is there custom data? If so, add it to the main session array + $row = $query->row(); + if (isset($row->user_data) AND $row->user_data != '') + { + $custom_data = $this->_unserialize($row->user_data); + + if (is_array($custom_data)) + { + foreach ($custom_data as $key => $val) + { + $session[$key] = $val; + } + } + } + } + + // Session is valid! + $this->userdata = $session; + unset($session); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Write the session data + * + * @access public + * @return void + */ + function sess_write() + { + // Are we saving custom data to the DB? If not, all we do is update the cookie + if ($this->sess_use_database === FALSE) + { + $this->_set_cookie(); + return; + } + + // set the custom userdata, the session data we will set in a second + $custom_userdata = $this->userdata; + $cookie_userdata = array(); + + // Before continuing, we need to determine if there is any custom data to deal with. + // Let's determine this by removing the default indexes to see if there's anything left in the array + // and set the session data while we're at it + foreach (array('session_id','ip_address','user_agent','last_activity') as $val) + { + unset($custom_userdata[$val]); + $cookie_userdata[$val] = $this->userdata[$val]; + } + + // Did we find any custom data? If not, we turn the empty array into a string + // since there's no reason to serialize and store an empty array in the DB + if (count($custom_userdata) === 0) + { + $custom_userdata = ''; + } + else + { + // Serialize the custom data array so we can store it + $custom_userdata = $this->_serialize($custom_userdata); + } + + // Run the update query + $this->CI->db->where('session_id', $this->userdata['session_id']); + $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); + + // Write the cookie. Notice that we manually pass the cookie data array to the + // _set_cookie() function. Normally that function will store $this->userdata, but + // in this case that array contains custom data, which we do not want in the cookie. + $this->_set_cookie($cookie_userdata); + } + + // -------------------------------------------------------------------- + + /** + * Create a new session + * + * @access public + * @return void + */ + function sess_create() + { + $sessid = ''; + while (strlen($sessid) < 32) + { + $sessid .= mt_rand(0, mt_getrandmax()); + } + + // To make the session ID even more secure we'll combine it with the user's IP + $sessid .= $this->CI->input->ip_address(); + + $this->userdata = array( + 'session_id' => md5(uniqid($sessid, TRUE)), + 'ip_address' => $this->CI->input->ip_address(), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'last_activity' => $this->now + ); + + + // Save the data to the DB if needed + if ($this->sess_use_database === TRUE) + { + $this->CI->db->query($this->CI->db->insert_string($this->sess_table_name, $this->userdata)); + } + + // Write the cookie + $this->_set_cookie(); + } + + // -------------------------------------------------------------------- + + /** + * Update an existing session + * + * @access public + * @return void + */ + function sess_update() + { + // We only update the session every five minutes by default + if (($this->userdata['last_activity'] + $this->sess_time_to_update) >= $this->now) + { + return; + } + + // Save the old session id so we know which record to + // update in the database if we need it + $old_sessid = $this->userdata['session_id']; + $new_sessid = ''; + while (strlen($new_sessid) < 32) + { + $new_sessid .= mt_rand(0, mt_getrandmax()); + } + + // To make the session ID even more secure we'll combine it with the user's IP + $new_sessid .= $this->CI->input->ip_address(); + + // Turn it into a hash + $new_sessid = md5(uniqid($new_sessid, TRUE)); + + // Update the session data in the session data array + $this->userdata['session_id'] = $new_sessid; + $this->userdata['last_activity'] = $this->now; + + // _set_cookie() will handle this for us if we aren't using database sessions + // by pushing all userdata to the cookie. + $cookie_data = NULL; + + // Update the session ID and last_activity field in the DB if needed + if ($this->sess_use_database === TRUE) + { + // set cookie explicitly to only have our session data + $cookie_data = array(); + foreach (array('session_id','ip_address','user_agent','last_activity') as $val) + { + $cookie_data[$val] = $this->userdata[$val]; + } + + $this->CI->db->query($this->CI->db->update_string($this->sess_table_name, array('last_activity' => $this->now, 'session_id' => $new_sessid), array('session_id' => $old_sessid))); + } + + // Write the cookie + $this->_set_cookie($cookie_data); + } + + // -------------------------------------------------------------------- + + /** + * Destroy the current session + * + * @access public + * @return void + */ + function sess_destroy() + { + // Kill the session DB row + if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id'])) + { + $this->CI->db->where('session_id', $this->userdata['session_id']); + $this->CI->db->delete($this->sess_table_name); + } + + // Kill the cookie + setcookie( + $this->sess_cookie_name, + addslashes(serialize(array())), + ($this->now - 31500000), + $this->cookie_path, + $this->cookie_domain, + 0 + ); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a specific item from the session array + * + * @access public + * @param string + * @return string + */ + function userdata($item) + { + return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch all session data + * + * @access public + * @return mixed + */ + function all_userdata() + { + return ( ! isset($this->userdata)) ? FALSE : $this->userdata; + } + + // -------------------------------------------------------------------- + + /** + * Add or change data in the "userdata" array + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_userdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $this->userdata[$key] = $val; + } + } + + $this->sess_write(); + } + + // -------------------------------------------------------------------- + + /** + * Delete a session variable from the "userdata" array + * + * @access array + * @return void + */ + function unset_userdata($newdata = array()) + { + if (is_string($newdata)) + { + $newdata = array($newdata => ''); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + unset($this->userdata[$key]); + } + } + + $this->sess_write(); + } + + // ------------------------------------------------------------------------ + + /** + * Add or change flashdata, only available + * until the next request + * + * @access public + * @param mixed + * @param string + * @return void + */ + function set_flashdata($newdata = array(), $newval = '') + { + if (is_string($newdata)) + { + $newdata = array($newdata => $newval); + } + + if (count($newdata) > 0) + { + foreach ($newdata as $key => $val) + { + $flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($flashdata_key, $val); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Keeps existing flashdata available to next request. + * + * @access public + * @param string + * @return void + */ + function keep_flashdata($key) + { + // 'old' flashdata gets removed. Here we mark all + // flashdata as 'new' to preserve it from _flashdata_sweep() + // Note the function will return FALSE if the $key + // provided cannot be found + $old_flashdata_key = $this->flashdata_key.':old:'.$key; + $value = $this->userdata($old_flashdata_key); + + $new_flashdata_key = $this->flashdata_key.':new:'.$key; + $this->set_userdata($new_flashdata_key, $value); + } + + // ------------------------------------------------------------------------ + + /** + * Fetch a specific flashdata item from the session array + * + * @access public + * @param string + * @return string + */ + function flashdata($key) + { + $flashdata_key = $this->flashdata_key.':old:'.$key; + return $this->userdata($flashdata_key); + } + + // ------------------------------------------------------------------------ + + /** + * Identifies flashdata as 'old' for removal + * when _flashdata_sweep() runs. + * + * @access private + * @return void + */ + function _flashdata_mark() + { + $userdata = $this->all_userdata(); + foreach ($userdata as $name => $value) + { + $parts = explode(':new:', $name); + if (is_array($parts) && count($parts) === 2) + { + $new_name = $this->flashdata_key.':old:'.$parts[1]; + $this->set_userdata($new_name, $value); + $this->unset_userdata($name); + } + } + } + + // ------------------------------------------------------------------------ + + /** + * Removes all flashdata marked as 'old' + * + * @access private + * @return void + */ + + function _flashdata_sweep() + { + $userdata = $this->all_userdata(); + foreach ($userdata as $key => $value) + { + if (strpos($key, ':old:')) + { + $this->unset_userdata($key); + } + } + + } + + // -------------------------------------------------------------------- + + /** + * Get the "now" time + * + * @access private + * @return string + */ + function _get_time() + { + if (strtolower($this->time_reference) == 'gmt') + { + $now = time(); + $time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + } + else + { + $time = time(); + } + + return $time; + } + + // -------------------------------------------------------------------- + + /** + * Write the session cookie + * + * @access public + * @return void + */ + function _set_cookie($cookie_data = NULL) + { + if (is_null($cookie_data)) + { + $cookie_data = $this->userdata; + } + + // Serialize the userdata for the cookie + $cookie_data = $this->_serialize($cookie_data); + + if ($this->sess_encrypt_cookie == TRUE) + { + $cookie_data = $this->CI->encrypt->encode($cookie_data); + } + else + { + // if encryption is not used, we provide an md5 hash to prevent userside tampering + $cookie_data = $cookie_data.md5($cookie_data.$this->encryption_key); + } + + // Set the cookie + setcookie( + $this->sess_cookie_name, + $cookie_data, + $this->sess_expiration + time(), + $this->cookie_path, + $this->cookie_domain, + 0 + ); + } + + // -------------------------------------------------------------------- + + /** + * Serialize an array + * + * This function first converts any slashes found in the array to a temporary + * marker, so when it gets unserialized the slashes will be preserved + * + * @access private + * @param array + * @return string + */ + function _serialize($data) + { + if (is_array($data)) + { + foreach ($data as $key => $val) + { + $data[$key] = str_replace('\\', '{{slash}}', $val); + } + } + else + { + $data = str_replace('\\', '{{slash}}', $data); + } + + return serialize($data); + } + + // -------------------------------------------------------------------- + + /** + * Unserialize + * + * This function unserializes a data string, then converts any + * temporary slash markers back to actual slashes + * + * @access private + * @param array + * @return string + */ + function _unserialize($data) + { + $data = @unserialize(strip_slashes($data)); + + if (is_array($data)) + { + foreach ($data as $key => $val) + { + $data[$key] = str_replace('{{slash}}', '\\', $val); + } + + return $data; + } + + return str_replace('{{slash}}', '\\', $data); + } + + // -------------------------------------------------------------------- + + /** + * Garbage collection + * + * This deletes expired session rows from database + * if the probability percentage is met + * + * @access public + * @return void + */ + function _sess_gc() + { + if ($this->sess_use_database != TRUE) + { + return; + } + + srand(time()); + if ((rand() % 100) < $this->gc_probability) + { + $expire = $this->now - $this->sess_expiration; + + $this->CI->db->where("last_activity < {$expire}"); + $this->CI->db->delete($this->sess_table_name); + + log_message('debug', 'Session garbage collection performed.'); + } + } + + +} +// END Session Class + +/* End of file Session.php */ /* Location: ./system/libraries/Session.php */ \ No newline at end of file diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 6a0f2ec3..3ff0d2f5 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -1,386 +1,385 @@ - tags - var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'; - - // Elements that should not have

    and
    tags within them. - var $skip_elements = 'p|pre|ol|ul|dl|object|table'; - - // Tags we want the parser to completely ignore when splitting the string. - var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; - - // whether or not to protect quotes within { curly braces } - var $protect_braced_quotes = FALSE; - - /** - * Nothing to do here... - * - */ - function CI_Typography() - { - } - - /** - * Auto Typography - * - * This function converts text, making it typographically correct: - * - Converts double spaces into paragraphs. - * - Converts single line breaks into
    tags - * - Converts single and double quotes into correctly facing curly quote entities. - * - Converts three dots into ellipsis. - * - Converts double dashes into em-dashes. - * - Converts two spaces into entities - * - * @access public - * @param string - * @param bool whether to reduce more then two consecutive newlines to two - * @return string - */ - function auto_typography($str, $reduce_linebreaks = FALSE) - { - if ($str == '') - { - return ''; - } - - // Standardize Newlines to make matching easier - if (strpos($str, "\r") !== FALSE) - { - $str = str_replace(array("\r\n", "\r"), "\n", $str); - } - - // Reduce line breaks. If there are more than two consecutive linebreaks - // we'll compress them down to a maximum of two since there's no benefit to more. - if ($reduce_linebreaks === TRUE) - { - $str = preg_replace("/\n\n+/", "\n\n", $str); - } - - // Convert quotes within tags to temporary markers. We don't want quotes converted - // within tags so we'll temporarily convert them to {@DQ} and {@SQ} - // and we don't want double dashes converted to emdash entities, so they are marked with {@DD} - // likewise double spaces are converted to {@NBS} to prevent entity conversion - if (preg_match_all("#\<.+?>#si", $str, $matches)) - { - for ($i = 0, $total = count($matches[0]); $i < $total; $i++) - { - $str = str_replace($matches[0][$i], - str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $matches[0][$i]), - $str); - } - } - - if ($this->protect_braced_quotes === TRUE) - { - if (preg_match_all("#\{.+?}#si", $str, $matches)) - { - for ($i = 0, $total = count($matches[0]); $i < $total; $i++) - { - $str = str_replace($matches[0][$i], - str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches[0][$i]), - $str); - } - } - } - - // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag - // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be - // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} - $str = preg_replace("#<(/*)(".$this->inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str); - - // Split the string at every tag. This expression creates an array with this prototype: - // - // [array] - // { - // [0] = - // [1] = Content... - // [2] = - // Etc... - // } - $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); - - // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text - $str = ''; - $process = TRUE; - $paragraph = FALSE; - foreach ($chunks as $chunk) - { - // Are we dealing with a tag? If so, we'll skip the processing for this cycle. - // Well also set the "process" flag which allows us to skip

     tags and a few other things.
    -			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match))
    -			{
    -				if (preg_match("#".$this->skip_elements."#", $match[2]))
    -				{
    -					$process =  ($match[1] == '/') ? TRUE : FALSE;
    -				}
    -				
    -				$str .= $chunk;
    -				continue;
    -			}
    -			elseif (preg_match('/<(\/?)([a-z]*).*?>/s', $chunk, $tagmatch))
    -			{
    -				if ($tagmatch[1] == '/' && $tagmatch[2] == $this->last_tag)
    -				{
    -					$process = FALSE;
    -				}
    -				else
    -				{
    -					$process = TRUE;
    -					$this->last_tag = $tagmatch[2];					
    -				}
    -			}
    -
    -			if ($process == FALSE)
    -			{
    -				$str .= $chunk;
    -				continue;
    -			}
    -			
    -			//  Convert Newlines into 

    and
    tags - $str .= $this->format_characters($this->_format_newlines($chunk)); - } - - // is the whole of the content inside a block level element? - if ( ! preg_match("/^<(?:".$this->block_elements.")/i", $str, $match)) - { - $str = "

    {$str}

    "; - } - - - // some special linebreak cleanup - $str = preg_replace_callback('#<(?!/|'.$this->block_elements.')([^>]*)>

    (.*?)

    <(\w*)#si', array($this, '_linebreak_cleanup'), $str); - - // and cleanup empty paragraph tags sitting between two closing tags - $str = preg_replace('#()

    (\s*)

    ()#si', '$1$2$3', $str); - - // Final clean up - $table = array( - - // If the user submitted their own paragraph tags within the text - // we will retain them instead of using our tags. - '/(*?]>)

    /' => '$1', // )+#' => '

    ', - '/(

    )+/' => '

    ', - '/(

    \W+

    )+/' => '

    ', - - // Clean up stray paragraph tags that appear before block level elements - '#

    <('.$this->block_elements.')#' => '<$1', - - // Clean up open paragraph tags that appear before block level elements - '#

    (\W)<('.$this->block_elements.')#' => '

    $1<$2', - - // Clean up stray non-breaking spaces preceeding block elements - '#[  ]+<('.$this->block_elements.')#' => ' <$1', - - // Replace the temporary markers we added earlier - '/\{@TAG\}/' => '<', - '/\{@DQ\}/' => '"', - '/\{@SQ\}/' => "'", - '/\{@DD\}/' => '--', - '/\{@NBS\}/' => ' ' - - ); - - // Do we need to reduce empty lines? - if ($reduce_linebreaks === TRUE) - { - $table['#

    \n*

    #'] = ''; - } - else - { - // If we have empty paragraph tags we add a non-breaking space - // otherwise most browsers won't treat them as true paragraphs - $table['#

    #'] = '

     

    '; - } - - return preg_replace(array_keys($table), $table, $str); - - } - - // -------------------------------------------------------------------- - - /** - * Linebreak Cleanup - * - * Removes paragraph and line break tags inserted inbetween - * inline content and a new opening block level element - * - * @access private - * @param array - * @return string - */ - function _linebreak_cleanup($match) - { - if (in_array($match[3], explode('|', $this->block_elements))) - { - return "<{$match[1]}>".str_replace('
    ', '', $match[2])."<{$match[3]}"; - } - else - { - return $match[0]; - } - } - - // -------------------------------------------------------------------- - - /** - * Format Characters - * - * This function mainly converts double and single quotes - * to curly entities, but it also converts em-dashes, - * double spaces, and ampersands - * - * @access public - * @param string - * @return string - */ - function format_characters($str) - { - static $table; - - if ( ! isset($table)) - { - $table = array( - // nested smart quotes, opening and closing - // note that rules for grammar (English) allow only for two levels deep - // and that single quotes are _supposed_ to always be on the outside - // but we'll accommodate both - '/(^|\W|\s)\'"/' => '$1‘“', - '/\'"(\s|\W|$)/' => '’”$1', - '/(^|\W|\s)"\'/' => '$1“‘', - '/"\'(\s|\W|$)/' => '”’$1', - - // single quote smart quotes - '/\'(\s|\W|$)/' => '’$1', - '/(^|\W|\s)\'/' => '$1‘', - - // double quote smart quotes - '/"(\s|\W|$)/' => '”$1', - '/(^|\W|\s)"/' => '$1“', - - // apostrophes - "/(\w)'(\w)/" => '$1’$2', - - // Em dash and ellipses dots - '/\s?\-\-\s?/' => '—', - '/(\w)\.{3}/' => '$1…', - - // double space after sentences - '/(\W) /' => '$1  ', - - // ampersands, if not a character entity - '/&(?!#?[a-zA-Z0-9]{2,};)/' => '&' - ); - } - - return preg_replace(array_keys($table), $table, $str); - } - - // -------------------------------------------------------------------- - - /** - * Format Newlines - * - * Converts newline characters into either

    tags or
    - * - * @access public - * @param string - * @return string - */ - function _format_newlines($str) - { - if ($str == '') - { - return $str; - } - - if (strpos($str, "\n") === FALSE) - { - return $str; - } - - // Convert two consecutive newlines to paragraphs - $str = str_replace("\n\n", "

    \n\n

    ", $str); - - // Convert single spaces to
    tags - $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
    \\2\\3", $str); - - // Wrap the whole enchilada in enclosing paragraphs - if ($str != "\n") - { - $str = '

    '.$str.'

    '; - } - - // Remove empty paragraphs if they are on the first line, as this - // is a potential unintended consequence of the previous code - $str = preg_replace("/

    <\/p>(.*)/", "\\1", $str, 1); - - return $str; - } - - // ------------------------------------------------------------------------ - - /** - * Convert newlines to HTML line breaks except within PRE tags - * - * @access public - * @param string - * @return string - */ - function nl2br_except_pre($str) - { - $ex = explode("pre>",$str); - $ct = count($ex); - - $newstr = ""; - for ($i = 0; $i < $ct; $i++) - { - if (($i % 2) == 0) - { - $newstr .= nl2br($ex[$i]); - } - else - { - $newstr .= $ex[$i]; - } - - if ($ct - 1 != $i) - $newstr .= "pre>"; - } - - return $newstr; - } - -} -// END Typography Class - -/* End of file Typography.php */ + tags + var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'; + + // Elements that should not have

    and
    tags within them. + var $skip_elements = 'p|pre|ol|ul|dl|object|table'; + + // Tags we want the parser to completely ignore when splitting the string. + var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; + + // whether or not to protect quotes within { curly braces } + var $protect_braced_quotes = FALSE; + + /** + * Nothing to do here... + * + */ + function CI_Typography() + { + } + + /** + * Auto Typography + * + * This function converts text, making it typographically correct: + * - Converts double spaces into paragraphs. + * - Converts single line breaks into
    tags + * - Converts single and double quotes into correctly facing curly quote entities. + * - Converts three dots into ellipsis. + * - Converts double dashes into em-dashes. + * - Converts two spaces into entities + * + * @access public + * @param string + * @param bool whether to reduce more then two consecutive newlines to two + * @return string + */ + function auto_typography($str, $reduce_linebreaks = FALSE) + { + if ($str == '') + { + return ''; + } + + // Standardize Newlines to make matching easier + if (strpos($str, "\r") !== FALSE) + { + $str = str_replace(array("\r\n", "\r"), "\n", $str); + } + + // Reduce line breaks. If there are more than two consecutive linebreaks + // we'll compress them down to a maximum of two since there's no benefit to more. + if ($reduce_linebreaks === TRUE) + { + $str = preg_replace("/\n\n+/", "\n\n", $str); + } + + // Convert quotes within tags to temporary markers. We don't want quotes converted + // within tags so we'll temporarily convert them to {@DQ} and {@SQ} + // and we don't want double dashes converted to emdash entities, so they are marked with {@DD} + // likewise double spaces are converted to {@NBS} to prevent entity conversion + if (preg_match_all("#\<.+?>#si", $str, $matches)) + { + for ($i = 0, $total = count($matches[0]); $i < $total; $i++) + { + $str = str_replace($matches[0][$i], + str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $matches[0][$i]), + $str); + } + } + + if ($this->protect_braced_quotes === TRUE) + { + if (preg_match_all("#\{.+?}#si", $str, $matches)) + { + for ($i = 0, $total = count($matches[0]); $i < $total; $i++) + { + $str = str_replace($matches[0][$i], + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches[0][$i]), + $str); + } + } + } + + // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag + // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be + // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} + $str = preg_replace("#<(/*)(".$this->inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str); + + // Split the string at every tag. This expression creates an array with this prototype: + // + // [array] + // { + // [0] = + // [1] = Content... + // [2] = + // Etc... + // } + $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); + + // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text + $str = ''; + $process = TRUE; + $paragraph = FALSE; + foreach ($chunks as $chunk) + { + // Are we dealing with a tag? If so, we'll skip the processing for this cycle. + // Well also set the "process" flag which allows us to skip

     tags and a few other things.
    +			if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunk, $match))
    +			{
    +				if (preg_match("#".$this->skip_elements."#", $match[2]))
    +				{
    +					$process =  ($match[1] == '/') ? TRUE : FALSE;
    +				}
    +				
    +				$str .= $chunk;
    +				continue;
    +			}
    +			elseif (preg_match('/<(\/?)([a-z]*).*?>/s', $chunk, $tagmatch))
    +			{
    +				if ($tagmatch[1] == '/' && $tagmatch[2] == $this->last_tag)
    +				{
    +					$process = FALSE;
    +				}
    +				else
    +				{
    +					$process = TRUE;
    +					$this->last_tag = $tagmatch[2];					
    +				}
    +			}
    +
    +			if ($process == FALSE)
    +			{
    +				$str .= $chunk;
    +				continue;
    +			}
    +			
    +			//  Convert Newlines into 

    and
    tags + $str .= $this->format_characters($this->_format_newlines($chunk)); + } + + // is the whole of the content inside a block level element? + if ( ! preg_match("/^<(?:".$this->block_elements.")/i", $str, $match)) + { + $str = "

    {$str}

    "; + } + + + // some special linebreak cleanup + $str = preg_replace_callback('#<(?!/|'.$this->block_elements.')([^>]*)>

    (.*?)

    <(\w*)#si', array($this, '_linebreak_cleanup'), $str); + + // and cleanup empty paragraph tags sitting between two closing tags + $str = preg_replace('#()

    (\s*)

    ()#si', '$1$2$3', $str); + + // Final clean up + $table = array( + + // If the user submitted their own paragraph tags within the text + // we will retain them instead of using our tags. + '/(*?]>)

    /' => '$1', // )+#' => '

    ', + '/(

    \W*

    )+/' => '

    ', + + // Clean up stray paragraph tags that appear before block level elements + '#

    <('.$this->block_elements.')#' => '<$1', + + // Clean up open paragraph tags that appear before block level elements + '#

    (\W)<('.$this->block_elements.')#' => '

    $1<$2', + + // Clean up stray non-breaking spaces preceeding block elements + '#[  ]+<('.$this->block_elements.')#' => ' <$1', + + // Replace the temporary markers we added earlier + '/\{@TAG\}/' => '<', + '/\{@DQ\}/' => '"', + '/\{@SQ\}/' => "'", + '/\{@DD\}/' => '--', + '/\{@NBS\}/' => ' ' + + ); + + // Do we need to reduce empty lines? + if ($reduce_linebreaks === TRUE) + { + $table['#

    \n*

    #'] = ''; + } + else + { + // If we have empty paragraph tags we add a non-breaking space + // otherwise most browsers won't treat them as true paragraphs + $table['#

    #'] = '

     

    '; + } + + return preg_replace(array_keys($table), $table, $str); + + } + + // -------------------------------------------------------------------- + + /** + * Linebreak Cleanup + * + * Removes paragraph and line break tags inserted inbetween + * inline content and a new opening block level element + * + * @access private + * @param array + * @return string + */ + function _linebreak_cleanup($match) + { + if (in_array($match[3], explode('|', $this->block_elements))) + { + return "<{$match[1]}>".str_replace('
    ', '', $match[2])."<{$match[3]}"; + } + else + { + return $match[0]; + } + } + + // -------------------------------------------------------------------- + + /** + * Format Characters + * + * This function mainly converts double and single quotes + * to curly entities, but it also converts em-dashes, + * double spaces, and ampersands + * + * @access public + * @param string + * @return string + */ + function format_characters($str) + { + static $table; + + if ( ! isset($table)) + { + $table = array( + // nested smart quotes, opening and closing + // note that rules for grammar (English) allow only for two levels deep + // and that single quotes are _supposed_ to always be on the outside + // but we'll accommodate both + '/(^|\W|\s)\'"/' => '$1‘“', + '/\'"(\s|\W|$)/' => '’”$1', + '/(^|\W|\s)"\'/' => '$1“‘', + '/"\'(\s|\W|$)/' => '”’$1', + + // single quote smart quotes + '/\'(\s|\W|$)/' => '’$1', + '/(^|\W|\s)\'/' => '$1‘', + + // double quote smart quotes + '/"(\s|\W|$)/' => '”$1', + '/(^|\W|\s)"/' => '$1“', + + // apostrophes + "/(\w)'(\w)/" => '$1’$2', + + // Em dash and ellipses dots + '/\s?\-\-\s?/' => '—', + '/(\w)\.{3}/' => '$1…', + + // double space after sentences + '/(\W) /' => '$1  ', + + // ampersands, if not a character entity + '/&(?!#?[a-zA-Z0-9]{2,};)/' => '&' + ); + } + + return preg_replace(array_keys($table), $table, $str); + } + + // -------------------------------------------------------------------- + + /** + * Format Newlines + * + * Converts newline characters into either

    tags or
    + * + * @access public + * @param string + * @return string + */ + function _format_newlines($str) + { + if ($str == '') + { + return $str; + } + + if (strpos($str, "\n") === FALSE) + { + return $str; + } + + // Convert two consecutive newlines to paragraphs + $str = str_replace("\n\n", "

    \n\n

    ", $str); + + // Convert single spaces to
    tags + $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
    \\2\\3", $str); + + // Wrap the whole enchilada in enclosing paragraphs + if ($str != "\n") + { + $str = '

    '.$str.'

    '; + } + + // Remove empty paragraphs if they are on the first line, as this + // is a potential unintended consequence of the previous code + $str = preg_replace("/

    <\/p>(.*)/", "\\1", $str, 1); + + return $str; + } + + // ------------------------------------------------------------------------ + + /** + * Convert newlines to HTML line breaks except within PRE tags + * + * @access public + * @param string + * @return string + */ + function nl2br_except_pre($str) + { + $ex = explode("pre>",$str); + $ct = count($ex); + + $newstr = ""; + for ($i = 0; $i < $ct; $i++) + { + if (($i % 2) == 0) + { + $newstr .= nl2br($ex[$i]); + } + else + { + $newstr .= $ex[$i]; + } + + if ($ct - 1 != $i) + $newstr .= "pre>"; + } + + return $newstr; + } + +} +// END Typography Class + +/* End of file Typography.php */ /* Location: ./system/libraries/Typography.php */ \ No newline at end of file diff --git a/system/libraries/URI.php b/system/libraries/URI.php index aa2d71e8..b27dfa3c 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -1,585 +1,585 @@ -config =& load_class('Config'); - log_message('debug', "URI Class Initialized"); - } - - - // -------------------------------------------------------------------- - - /** - * Get the URI String - * - * @access private - * @return string - */ - function _fetch_uri_string() - { - if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') - { - // If the URL has a question mark then it's simplest to just - // build the URI string from the zero index of the $_GET array. - // This avoids having to deal with $_SERVER variables, which - // can be unreliable in some environments - if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') - { - $this->uri_string = key($_GET); - return; - } - - // Is there a PATH_INFO variable? - // Note: some servers seem to have trouble with getenv() so we'll test it two ways - $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); - if (trim($path, '/') != '' && $path != "/".SELF) - { - $this->uri_string = $path; - return; - } - - // No PATH_INFO?... What about QUERY_STRING? - $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); - if (trim($path, '/') != '') - { - $this->uri_string = $path; - return; - } - - // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); - if (trim($path, '/') != '' && $path != "/".SELF) - { - // remove path and script information so we have good URI data - $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); - return; - } - - // We've exhausted all our options... - $this->uri_string = ''; - } - else - { - $uri = strtoupper($this->config->item('uri_protocol')); - - if ($uri == 'REQUEST_URI') - { - $this->uri_string = $this->_parse_request_uri(); - return; - } - - $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); - } - - // If the URI contains only a slash we'll kill it - if ($this->uri_string == '/') - { - $this->uri_string = ''; - } - } - - // -------------------------------------------------------------------- - - /** - * Parse the REQUEST_URI - * - * Due to the way REQUEST_URI works it usually contains path info - * that makes it unusable as URI data. We'll trim off the unnecessary - * data, hopefully arriving at a valid URI that we can use. - * - * @access private - * @return string - */ - function _parse_request_uri() - { - if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') - { - return ''; - } - - $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); - - if ($request_uri == '' OR $request_uri == SELF) - { - return ''; - } - - $fc_path = FCPATH; - if (strpos($request_uri, '?') !== FALSE) - { - $fc_path .= '?'; - } - - $parsed_uri = explode("/", $request_uri); - - $i = 0; - foreach(explode("/", $fc_path) as $segment) - { - if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i]) - { - $i++; - } - } - - $parsed_uri = implode("/", array_slice($parsed_uri, $i)); - - if ($parsed_uri != '') - { - $parsed_uri = '/'.$parsed_uri; - } - - return $parsed_uri; - } - - // -------------------------------------------------------------------- - - /** - * Filter segments for malicious characters - * - * @access private - * @param string - * @return string - */ - function _filter_uri($str) - { - if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) - { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) - { - header('HTTP/1.1 400 Bad Request'); - exit('The URI you submitted has disallowed characters.'); - } - } - - // Convert programatic characters to entities - $bad = array('$', '(', ')', '%28', '%29'); - $good = array('$', '(', ')', '(', ')'); - - return str_replace($bad, $good, $str); - } - - // -------------------------------------------------------------------- - - /** - * Remove the suffix from the URL if needed - * - * @access private - * @return void - */ - function _remove_url_suffix() - { - if ($this->config->item('url_suffix') != "") - { - $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); - } - } - - // -------------------------------------------------------------------- - - /** - * Explode the URI Segments. The individual segments will - * be stored in the $this->segments array. - * - * @access private - * @return void - */ - function _explode_segments() - { - foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) - { - // Filter segments for security - $val = trim($this->_filter_uri($val)); - - if ($val != '') - { - $this->segments[] = $val; - } - } - } - - // -------------------------------------------------------------------- - /** - * Re-index Segments - * - * This function re-indexes the $this->segment array so that it - * starts at 1 rather than 0. Doing so makes it simpler to - * use functions like $this->uri->segment(n) since there is - * a 1:1 relationship between the segment array and the actual segments. - * - * @access private - * @return void - */ - function _reindex_segments() - { - array_unshift($this->segments, NULL); - array_unshift($this->rsegments, NULL); - unset($this->segments[0]); - unset($this->rsegments[0]); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment - * - * This function returns the URI segment based on the number provided. - * - * @access public - * @param integer - * @param bool - * @return string - */ - function segment($n, $no_result = FALSE) - { - return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI "routed" Segment - * - * This function returns the re-routed URI segment (assuming routing rules are used) - * based on the number provided. If there is no routing this function returns the - * same result as $this->segment() - * - * @access public - * @param integer - * @param bool - * @return string - */ - function rsegment($n, $no_result = FALSE) - { - return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string - * - * This function generates and associative array of URI data starting - * at the supplied segment. For example, if this is your URI: - * - * example.com/user/search/name/joe/location/UK/gender/male - * - * You can use this function to generate an array with this prototype: - * - * array ( - * name => joe - * location => UK - * gender => male - * ) - * - * @access public - * @param integer the starting segment number - * @param array an array of default values - * @return array - */ - function uri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'segment'); - } - /** - * Identical to above only it uses the re-routed segment array - * - */ - function ruri_to_assoc($n = 3, $default = array()) - { - return $this->_uri_to_assoc($n, $default, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Generate a key value pair from the URI string or Re-routed URI string - * - * @access private - * @param integer the starting segment number - * @param array an array of default values - * @param string which array we should use - * @return array - */ - function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') - { - if ($which == 'segment') - { - $total_segments = 'total_segments'; - $segment_array = 'segment_array'; - } - else - { - $total_segments = 'total_rsegments'; - $segment_array = 'rsegment_array'; - } - - if ( ! is_numeric($n)) - { - return $default; - } - - if (isset($this->keyval[$n])) - { - return $this->keyval[$n]; - } - - if ($this->$total_segments() < $n) - { - if (count($default) == 0) - { - return array(); - } - - $retval = array(); - foreach ($default as $val) - { - $retval[$val] = FALSE; - } - return $retval; - } - - $segments = array_slice($this->$segment_array(), ($n - 1)); - - $i = 0; - $lastval = ''; - $retval = array(); - foreach ($segments as $seg) - { - if ($i % 2) - { - $retval[$lastval] = $seg; - } - else - { - $retval[$seg] = FALSE; - $lastval = $seg; - } - - $i++; - } - - if (count($default) > 0) - { - foreach ($default as $val) - { - if ( ! array_key_exists($val, $retval)) - { - $retval[$val] = FALSE; - } - } - } - - // Cache the array for reuse - $this->keyval[$n] = $retval; - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Generate a URI string from an associative array - * - * - * @access public - * @param array an associative array of key/values - * @return array - */ - function assoc_to_uri($array) - { - $temp = array(); - foreach ((array)$array as $key => $val) - { - $temp[] = $key; - $temp[] = $val; - } - - return implode('/', $temp); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_segment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'segment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - * - * @access public - * @param integer - * @param string - * @return string - */ - function slash_rsegment($n, $where = 'trailing') - { - return $this->_slash_segment($n, $where, 'rsegment'); - } - - // -------------------------------------------------------------------- - - /** - * Fetch a URI Segment and add a trailing slash - helper function - * - * @access private - * @param integer - * @param string - * @param string - * @return string - */ - function _slash_segment($n, $where = 'trailing', $which = 'segment') - { - if ($where == 'trailing') - { - $trailing = '/'; - $leading = ''; - } - elseif ($where == 'leading') - { - $leading = '/'; - $trailing = ''; - } - else - { - $leading = '/'; - $trailing = '/'; - } - return $leading.$this->$which($n).$trailing; - } - - // -------------------------------------------------------------------- - - /** - * Segment Array - * - * @access public - * @return array - */ - function segment_array() - { - return $this->segments; - } - - // -------------------------------------------------------------------- - - /** - * Routed Segment Array - * - * @access public - * @return array - */ - function rsegment_array() - { - return $this->rsegments; - } - - // -------------------------------------------------------------------- - - /** - * Total number of segments - * - * @access public - * @return integer - */ - function total_segments() - { - return count($this->segments); - } - - // -------------------------------------------------------------------- - - /** - * Total number of routed segments - * - * @access public - * @return integer - */ - function total_rsegments() - { - return count($this->rsegments); - } - - // -------------------------------------------------------------------- - - /** - * Fetch the entire URI string - * - * @access public - * @return string - */ - function uri_string() - { - return $this->uri_string; - } - - - // -------------------------------------------------------------------- - - /** - * Fetch the entire Re-routed URI string - * - * @access public - * @return string - */ - function ruri_string() - { - return '/'.implode('/', $this->rsegment_array()).'/'; - } - -} -// END URI Class - -/* End of file URI.php */ +config =& load_class('Config'); + log_message('debug', "URI Class Initialized"); + } + + + // -------------------------------------------------------------------- + + /** + * Get the URI String + * + * @access private + * @return string + */ + function _fetch_uri_string() + { + if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') + { + // If the URL has a question mark then it's simplest to just + // build the URI string from the zero index of the $_GET array. + // This avoids having to deal with $_SERVER variables, which + // can be unreliable in some environments + if (is_array($_GET) && count($_GET) == 1 && trim(key($_GET), '/') != '') + { + $this->uri_string = key($_GET); + return; + } + + // Is there a PATH_INFO variable? + // Note: some servers seem to have trouble with getenv() so we'll test it two ways + $path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO'); + if (trim($path, '/') != '' && $path != "/".SELF) + { + $this->uri_string = $path; + return; + } + + // No PATH_INFO?... What about QUERY_STRING? + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); + if (trim($path, '/') != '') + { + $this->uri_string = $path; + return; + } + + // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? + $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + if (trim($path, '/') != '' && $path != "/".SELF) + { + // remove path and script information so we have good URI data + $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); + return; + } + + // We've exhausted all our options... + $this->uri_string = ''; + } + else + { + $uri = strtoupper($this->config->item('uri_protocol')); + + if ($uri == 'REQUEST_URI') + { + $this->uri_string = $this->_parse_request_uri(); + return; + } + + $this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); + } + + // If the URI contains only a slash we'll kill it + if ($this->uri_string == '/') + { + $this->uri_string = ''; + } + } + + // -------------------------------------------------------------------- + + /** + * Parse the REQUEST_URI + * + * Due to the way REQUEST_URI works it usually contains path info + * that makes it unusable as URI data. We'll trim off the unnecessary + * data, hopefully arriving at a valid URI that we can use. + * + * @access private + * @return string + */ + function _parse_request_uri() + { + if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '') + { + return ''; + } + + $request_uri = preg_replace("|/(.*)|", "\\1", str_replace("\\", "/", $_SERVER['REQUEST_URI'])); + + if ($request_uri == '' OR $request_uri == SELF) + { + return ''; + } + + $fc_path = FCPATH; + if (strpos($request_uri, '?') !== FALSE) + { + $fc_path .= '?'; + } + + $parsed_uri = explode("/", $request_uri); + + $i = 0; + foreach(explode("/", $fc_path) as $segment) + { + if (isset($parsed_uri[$i]) && $segment == $parsed_uri[$i]) + { + $i++; + } + } + + $parsed_uri = implode("/", array_slice($parsed_uri, $i)); + + if ($parsed_uri != '') + { + $parsed_uri = '/'.$parsed_uri; + } + + return $parsed_uri; + } + + // -------------------------------------------------------------------- + + /** + * Filter segments for malicious characters + * + * @access private + * @param string + * @return string + */ + function _filter_uri($str) + { + if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) + { + if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + { + header('HTTP/1.1 400 Bad Request'); + exit('The URI you submitted has disallowed characters.'); + } + } + + // Convert programatic characters to entities + $bad = array('$', '(', ')', '%28', '%29'); + $good = array('$', '(', ')', '(', ')'); + + return str_replace($bad, $good, $str); + } + + // -------------------------------------------------------------------- + + /** + * Remove the suffix from the URL if needed + * + * @access private + * @return void + */ + function _remove_url_suffix() + { + if ($this->config->item('url_suffix') != "") + { + $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); + } + } + + // -------------------------------------------------------------------- + + /** + * Explode the URI Segments. The individual segments will + * be stored in the $this->segments array. + * + * @access private + * @return void + */ + function _explode_segments() + { + foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) + { + // Filter segments for security + $val = trim($this->_filter_uri($val)); + + if ($val != '') + { + $this->segments[] = $val; + } + } + } + + // -------------------------------------------------------------------- + /** + * Re-index Segments + * + * This function re-indexes the $this->segment array so that it + * starts at 1 rather than 0. Doing so makes it simpler to + * use functions like $this->uri->segment(n) since there is + * a 1:1 relationship between the segment array and the actual segments. + * + * @access private + * @return void + */ + function _reindex_segments() + { + array_unshift($this->segments, NULL); + array_unshift($this->rsegments, NULL); + unset($this->segments[0]); + unset($this->rsegments[0]); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment + * + * This function returns the URI segment based on the number provided. + * + * @access public + * @param integer + * @param bool + * @return string + */ + function segment($n, $no_result = FALSE) + { + return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI "routed" Segment + * + * This function returns the re-routed URI segment (assuming routing rules are used) + * based on the number provided. If there is no routing this function returns the + * same result as $this->segment() + * + * @access public + * @param integer + * @param bool + * @return string + */ + function rsegment($n, $no_result = FALSE) + { + return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n]; + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string + * + * This function generates and associative array of URI data starting + * at the supplied segment. For example, if this is your URI: + * + * example.com/user/search/name/joe/location/UK/gender/male + * + * You can use this function to generate an array with this prototype: + * + * array ( + * name => joe + * location => UK + * gender => male + * ) + * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + */ + function uri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'segment'); + } + /** + * Identical to above only it uses the re-routed segment array + * + */ + function ruri_to_assoc($n = 3, $default = array()) + { + return $this->_uri_to_assoc($n, $default, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Generate a key value pair from the URI string or Re-routed URI string + * + * @access private + * @param integer the starting segment number + * @param array an array of default values + * @param string which array we should use + * @return array + */ + function _uri_to_assoc($n = 3, $default = array(), $which = 'segment') + { + if ($which == 'segment') + { + $total_segments = 'total_segments'; + $segment_array = 'segment_array'; + } + else + { + $total_segments = 'total_rsegments'; + $segment_array = 'rsegment_array'; + } + + if ( ! is_numeric($n)) + { + return $default; + } + + if (isset($this->keyval[$n])) + { + return $this->keyval[$n]; + } + + if ($this->$total_segments() < $n) + { + if (count($default) == 0) + { + return array(); + } + + $retval = array(); + foreach ($default as $val) + { + $retval[$val] = FALSE; + } + return $retval; + } + + $segments = array_slice($this->$segment_array(), ($n - 1)); + + $i = 0; + $lastval = ''; + $retval = array(); + foreach ($segments as $seg) + { + if ($i % 2) + { + $retval[$lastval] = $seg; + } + else + { + $retval[$seg] = FALSE; + $lastval = $seg; + } + + $i++; + } + + if (count($default) > 0) + { + foreach ($default as $val) + { + if ( ! array_key_exists($val, $retval)) + { + $retval[$val] = FALSE; + } + } + } + + // Cache the array for reuse + $this->keyval[$n] = $retval; + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Generate a URI string from an associative array + * + * + * @access public + * @param array an associative array of key/values + * @return array + */ + function assoc_to_uri($array) + { + $temp = array(); + foreach ((array)$array as $key => $val) + { + $temp[] = $key; + $temp[] = $val; + } + + return implode('/', $temp); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_segment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'segment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash + * + * @access public + * @param integer + * @param string + * @return string + */ + function slash_rsegment($n, $where = 'trailing') + { + return $this->_slash_segment($n, $where, 'rsegment'); + } + + // -------------------------------------------------------------------- + + /** + * Fetch a URI Segment and add a trailing slash - helper function + * + * @access private + * @param integer + * @param string + * @param string + * @return string + */ + function _slash_segment($n, $where = 'trailing', $which = 'segment') + { + if ($where == 'trailing') + { + $trailing = '/'; + $leading = ''; + } + elseif ($where == 'leading') + { + $leading = '/'; + $trailing = ''; + } + else + { + $leading = '/'; + $trailing = '/'; + } + return $leading.$this->$which($n).$trailing; + } + + // -------------------------------------------------------------------- + + /** + * Segment Array + * + * @access public + * @return array + */ + function segment_array() + { + return $this->segments; + } + + // -------------------------------------------------------------------- + + /** + * Routed Segment Array + * + * @access public + * @return array + */ + function rsegment_array() + { + return $this->rsegments; + } + + // -------------------------------------------------------------------- + + /** + * Total number of segments + * + * @access public + * @return integer + */ + function total_segments() + { + return count($this->segments); + } + + // -------------------------------------------------------------------- + + /** + * Total number of routed segments + * + * @access public + * @return integer + */ + function total_rsegments() + { + return count($this->rsegments); + } + + // -------------------------------------------------------------------- + + /** + * Fetch the entire URI string + * + * @access public + * @return string + */ + function uri_string() + { + return $this->uri_string; + } + + + // -------------------------------------------------------------------- + + /** + * Fetch the entire Re-routed URI string + * + * @access public + * @return string + */ + function ruri_string() + { + return '/'.implode('/', $this->rsegment_array()).'/'; + } + +} +// END URI Class + +/* End of file URI.php */ /* Location: ./system/libraries/URI.php */ \ No newline at end of file diff --git a/system/scaffolding/views/add.php b/system/scaffolding/views/add.php index cbb12f6f..cac255ac 100644 --- a/system/scaffolding/views/add.php +++ b/system/scaffolding/views/add.php @@ -1,32 +1,32 @@ -load->view('header'); ?> - -

    - - - - - - - -primary_key == 1) continue; ?> - - - - - type == 'blob'): ?> - - - - - - - -
    name; echo ' '.$field->default; ?>
    - - - - - -load->view('footer'); -/* End of file add.php */ -/* Location: ./system/scaffolding/views/add.php */ +load->view('header'); ?> + +

    + + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
    name; echo ' '.$field->default; ?>
    + + + + + +load->view('footer'); +/* End of file add.php */ +/* Location: ./system/scaffolding/views/add.php */ diff --git a/system/scaffolding/views/delete.php b/system/scaffolding/views/delete.php index d1954219..87b59bef 100644 --- a/system/scaffolding/views/delete.php +++ b/system/scaffolding/views/delete.php @@ -1,9 +1,9 @@ -load->view('header'); ?> - -

    - -

      |   - -load->view('footer'); -/* End of file delete.php */ -/* Location: ./system/scaffolding/views/delete.php */ +load->view('header'); ?> + +

    + +

      |   + +load->view('footer'); +/* End of file delete.php */ +/* Location: ./system/scaffolding/views/delete.php */ diff --git a/system/scaffolding/views/edit.php b/system/scaffolding/views/edit.php index fe553e59..c66259d9 100644 --- a/system/scaffolding/views/edit.php +++ b/system/scaffolding/views/edit.php @@ -1,33 +1,33 @@ -load->view('header'); ?> - - -

    - - - - - - - -primary_key == 1) continue; ?> - - - - - type == 'blob'): ?> - - - - - - - -
    name; ?>
    - - - - - -load->view('footer'); -/* End of file edit.php */ +load->view('header'); ?> + + +

    + + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
    name; ?>
    + + + + + +load->view('footer'); +/* End of file edit.php */ /* Location: ./system/scaffolding/views/edit.php */ \ No newline at end of file diff --git a/system/scaffolding/views/header.php b/system/scaffolding/views/header.php index 50f234a4..a1621ff3 100644 --- a/system/scaffolding/views/header.php +++ b/system/scaffolding/views/header.php @@ -1,29 +1,29 @@ - - - - -<?php echo $title; ?> - - - - - - - - - - - - -
    + + + + +<?php echo $title; ?> + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/system/scaffolding/views/no_data.php b/system/scaffolding/views/no_data.php index bc81e748..963341b7 100644 --- a/system/scaffolding/views/no_data.php +++ b/system/scaffolding/views/no_data.php @@ -1,8 +1,8 @@ -load->view('header'); ?> - -

    -

    - -load->view('footer'); -/* End of file no_data.php */ +load->view('header'); ?> + +

    +

    + +load->view('footer'); +/* End of file no_data.php */ /* Location: ./system/scaffolding/views/no_data.php */ \ No newline at end of file diff --git a/system/scaffolding/views/view.php b/system/scaffolding/views/view.php index a81241d3..69c1f45d 100644 --- a/system/scaffolding/views/view.php +++ b/system/scaffolding/views/view.php @@ -1,27 +1,27 @@ -load->view('header'); ?> - - - - - - - - - - -result() as $row): ?> - - - - - - - - -
    EditDelete
     $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
    - - - -load->view('footer'); -/* End of file view.php */ +load->view('header'); ?> + + + + + + + + + + +result() as $row): ?> + + + + + + + + +
    EditDelete
     $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
    + + + +load->view('footer'); +/* End of file view.php */ /* Location: ./system/scaffolding/views/view.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cde5f436..89ec0ac5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1,956 +1,956 @@ - - - - - - - - - - - - - - - - - - - -Change Log : CodeIgniter User Guide - - - - - - -
    -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Change Log

    - -

    Version 1.7.1

    -

    Release Date: not yet released
    -SVN Revision:

    - -
      -
    • Libraries -
        -
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • -
      • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
      • -
      • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
      • -
      -
    • -
    • Helpers - -
    • -
    - -

    Bug fixes for 1.7.1

    -
      -
    • Fixed a bug in the MySQLi driver when no port is specified
    • -
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • -
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • -
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.
    • -
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • -
    • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
    • -
    • Changed a few docblock comments to reflect actual return values.
    • -
    - - -

    Version 1.7

    -

    Release Date: October 23, 2008
    -SVN Revision: 1541

    - -
      -
    • Libraries -
        -
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • -
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • -
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • -
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • -
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • -
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • -
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • -
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • -
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • -
      • Added set_status_header() function to Output class.
      • -
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • -
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • -
      -
    • -
    • Database -
        -
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • -
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • -
      • Added Active Record caching feature to "update" and "delete" functions.
      • -
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • -
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • -
      • Added driver name variable in each DB driver, based on bug report #4436.
      • -
      -
    • -
    • Helpers -
        -
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • -
      • Added current_url() and uri_segments() to URL helper.
      • -
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • -
      • Added meta() function to HTML helper.
      • -
      • Improved accuracy of calculations in Number helper.
      • -
      • Removed added newlines ("\n") from most form and html helper functions.
      • -
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • -
      • Updated Date helper to match the world's current time zones and offsets.
      • -
      • Modified url_title() in the URL helper to remove characters and digits that are part of - character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • -
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • -
      -
    • -
    • Other Changes -
        -
      • Added PHP Style Guide to docs.
      • -
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • -
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • -
      • Added a file lock check during caching, before trying to write to the file.
      • -
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • -
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • -
      -
    • -
    - -

    Bug fixes for 1.7.0

    -
      -
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • -
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • -
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • -
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • -
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • -
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • -
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • -
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • -
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • -
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • -
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • -
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • -
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • -
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • -
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • -
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • -
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • -
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • -
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • -
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • -
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • -
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • -
    • Fixed DB backup bug in which field names were not being escaped.
    • -
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • -
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • -
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • -
    • Fixed a spelling error in a Loader error message.
    • -
    • Fixed a bug (5050) with IP validation with empty segments.
    • -
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • -
    - -

    Version 1.6.3

    -

    Release Date: June 26, 2008
    -SVN Revision: 1238

    -

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    -
      -
    • Database -
        -
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • -
      • Added ability to set multiple column non-primary keys to the Forge class
      • -
      • Added ability to set additional database config values in DSN connections via the query string.
      • -
      -
    • -
    • Libraries -
        -
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • -
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • -
      • Added get_post() to the Input class.
      • -
      • Documented get() in the Input class.
      • -
      • Added the ability to automatically output language items as form labels in the Language class.
      • -
      -
    • -
    • Helpers - -
    • -
    • Other changes -
        -
      • Improved security in xss_clean().
      • -
      • Removed an unused Router reference in _display_cache().
      • -
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • -
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • -
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • -
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • -
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • -
      • Documented the language file use of byte_format() in the number helper.
      • -
      -
    • -
    - - -

    Bug fixes for 1.6.3

    - -
      -
    • Added a language key for valid_emails in validation_lang.php.
    • -
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • -
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • -
    • Fixed a syntax error in upload_lang.php.
    • -
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • -
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • -
    • Removed some unused variables from the code (#4563).
    • -
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • -
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • -
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • -
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • -
    - -

    Version 1.6.2

    -

    Release Date: May 13, 2008
    -SVN Revision: 1155

    -
      -
    • Active Record -
        -
      • Added the ability to prevent escaping in having() clauses.
      • -
      • Added rename_table() into DBForge.
      • -
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • -
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • -
      -
    • -
    • Database -
        -
      • Added Strict Mode to database transactions.
      • -
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • -
      -
    • -
    • Config -
        -
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • -
      • Added 'audio/mpg' to list of mime types.
      • -
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      -
    • -
    • Libraries -
        -
      • Added increased security for filename handling in the Upload library.
      • -
      • Added increased security for sessions for client-side data tampering.
      • -
      • The MySQLi forge class is now in sync with MySQL forge.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • -
      • Added a valid_emails rule to the Validation class.
      • -
      • The Zip class now exits within download().
      • -
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • -
      -
    • -
    • Helpers -
        -
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • -
      • Added form_button() in the Form helper.
      • -
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • -
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • -
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • -
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • -
      • The Download helper now exits within force_download().
      • -
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • -
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • -
      -
    • -
    • Plugins -
        -
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • -
      -
    • -
    • Other - Changes -
        -
      • Added ability for xss_clean() to accept arrays.
      • -
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • -
      • Removed "scripts" from the auto-load search path. Scripts were deprecated - in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • -
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • -
      • Added a Common Functions page to the userguide for globally available functions.
      • -
      • Improved security and performance of xss_clean().
      • -
      -
    • -
    - -

    Bugfixes for 1.6.2

    -
      -
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • -
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • -
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • -
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • -
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • -
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • -
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • -
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • -
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • -
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • -
    • Fixed an AR bug with or_where_not_in() (#4171).
    • -
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • -
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • -
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • -
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • -
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • -
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • -
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • -
    • Fixed a bug in the DB class testing the $params argument.
    • -
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • -
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • -
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • -
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • -
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • -
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • -
    • Fixed an array to string conversion error in the Validation library (#4425)
    • -
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • -
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • -
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • -
    - -

    Version 1.6.1

    -

    Release Date: February 12, 2008
    - SVN Revision: 984

    -
      -
    • Active Record - -
    • -
    • Database drivers -
        -
      • Added support for setting client character set and collation for MySQLi.
      • -
      -
    • -
    • Core Changes -
        -
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • -
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • -
      • Added a 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 characters to the end of the default expression.
      • -
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • -
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • -
      -
    • -
    • Helpers -
        -
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • -
      -
    • -
    - - -

    Bugfixes for 1.6.1

    -
      -
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • -
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • -
    • Made Active Record fully database prefix aware (#3384).
    • -
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • -
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • -
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • -
    • Fixed a bug in query binding (#3402).
    • -
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • -
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • -
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • -
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • -
    • Fixed assorted user guide typos.
    • -
    - - - -

    Version 1.6.0

    -

    Release Date: January 30, 2008

    -
      -
    • DBForge -
        -
      • Added DBForge to the database tools.
      • -
      • Moved create_database() and drop_database() into DBForge.
      • -
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • -
      -
    • - -
    • Active Record -
        -
      • Added protect_identifiers() in Active Record.
      • -
      • All AR queries are backticked if appropriate to the database.
      • -
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • -
      • Added support for limit() into update() and delete() statements in Active Record.
      • -
      • Added empty_table() and truncate_table() to Active Record.
      • -
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • -
      • Added count_all_results() function to Active Record.
      • -
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • -
      • Added the ability to use aliases with joins in Active Record.
      • -
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • -
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • -
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • -
      -
    • - -
    • Other Database Related -
        -
      • MySQL driver now requires MySQL 4.1+
      • -
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • -
      • Added $this->db->dbprefix() to manually add database prefixes.
      • -
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • -
      • Added a check for NULL fields in the MySQL database backup utility.
      • -
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • -
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • -
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • -
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • -
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more - in harmony with the global nature of the behavior (#1834).
      • -
      -
    • - -
    • Core changes -
        -
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • -
      • Added the ability to auto-load Models.
      • -
      • Reorganized the URI and Routes classes for better clarity.
      • -
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • -
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • -
      • Deprecated Scaffolding.
      • -
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • -
      -
    • - -
    • Libraries -
        -
      • Changed the load protocol of Models to allow for extension.
      • -
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • -
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • -
      • Removed 'last_visit' from the Session class.
      • -
      • Added a language entry for valid_ip validation error.
      • -
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • -
      • Added an "integer" rule into the Validation library.
      • -
      • Added valid_base64() to the Validation library.
      • -
      • Documented clear() in the Image Processing library.
      • -
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • -
      • Modified Upload class $_FILES error messages to be more precise.
      • -
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • -
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • -
      • Added a few additional mime type variations for CSV.
      • -
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • -
      -
    • - -
    • Helpers & Plugins -
        -
      • Added link_tag() to the HTML helper.
      • -
      • Added img() to the HTML helper.
      • -
      • Added ability to "extend" Helpers.
      • -
      • Added an email helper into core helpers.
      • -
      • Added strip_quotes() function to string helper.
      • -
      • Added reduce_multiples() function to string helper.
      • -
      • Added quotes_to_entities() function to string helper.
      • -
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • -
      • Added support for external urls in form_open().
      • -
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • -
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • -
      -
    • - - -
    • Documentation Changes -
        -
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • -
      • Added titles to all user manual pages.
      • -
      • Added attributes into <html> of userguide for valid html.
      • -
      • Added Zip Encoding Class to the table of contents of the userguide.
      • -
      • Moved part of the userguide menu javascript to an external file.
      • -
      • Documented distinct() in Active Record.
      • -
      • Documented the timezones() function in the Date Helper.
      • -
      • Documented unset_userdata in the Session class.
      • -
      • Documented 2 config options to the Database configuration page.
      • -
      -
    • -
    - -

    Bug fixes for Version 1.6.0

    - -
      -
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • -
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • -
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • -
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • -
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • -
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • -
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • -
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • -
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • -
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • -
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • -
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • -
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • -
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • -
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • -
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • -
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • -
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • -
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • -
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • -
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • -
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • -
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • -
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • -
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • -
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • -
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • -
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • -
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • -
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • -
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • -
    • Removed an extraneous call to loading models (#3286).
    • -
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • -
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • -
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • -
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • -
    • Removed an unused parameter from Profiler (#3332).
    • -
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • -
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • -
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • -
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • -
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • -
    • Fixed a bug in captcha calling an invalid PHP function.
    • -
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • -
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • -
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • -
    • Fixed an example of comma-separated emails in the email library documentation.
    • -
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • -
    • Fixed a typo in the database language file.
    • -
    • Fixed a typo in the image language file "suppor" to "support".
    • -
    • Fixed an example for XML RPC.
    • -
    • Fixed an example of accept_charset() in the User Agent Library.
    • -
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • -
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • -
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • -
    • Added a stripslashes() into the Upload Library.
    • -
    • Fixed a series of grammatical and spelling errors in the language files.
    • -
    • Fixed assorted user guide typos.
    • -
    -

    Version 1.5.4

    -

    Release Date: July 12, 2007

    -
      -
    • Added custom Language files to the autoload options.
    • -
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • -
    • Added array to string into the profiler.
    • -
    • Added some additional mime types in application/config/mimes.php.
    • -
    • Added filename_security() method to Input library.
    • -
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • -
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • -
    • Fixed MSSQL insert_id().
    • -
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • -
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • -
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • -
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • -
    • Fixed a typo in the Calendar library
    • -
    • Fixed a typo in rpcs.php library
    • -
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • -
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • -
    • Fixed an IP validation bug.
    • -
    • Fixed a bug in display of POST keys in the Profiler output
    • -
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • -
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • -
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • -
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • -
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • -
    • Fixed various doc typos.
    • -
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • -
    • Docs now validate to XHTML 1 transitional
    • -
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • -
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • -
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • -
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • -
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • -
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • -
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • -
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • -
    -

    Version 1.5.3

    -

    Release Date: April 15, 2007

    -
      -
    • Added array to string into the profiler
    • -
    • Code Igniter references updated to CodeIgniter
    • -
    • pMachine references updated to EllisLab
    • -
    • Fixed a bug in the repeater function of string helper.
    • -
    • Fixed a bug in ODBC driver
    • -
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • -
    • Fixed a bug in the redirect function of the url helper.
    • -
    • Fixed an undefined variable in Loader
    • -
    • Fixed a version bug in the Postgres driver
    • -
    • Fixed a bug in the textarea function of the form helper for use with strings
    • -
    • Fixed doc typos.
    • -
    -

    Version 1.5.2

    -

    Release Date: February 13, 2007

    -
      -
    • Added subversion information to the downloads page.
    • -
    • Added support for captions in the Table Library
    • -
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • -
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • -
    • Removed unescaped variables in error messages of Input and Router classes
    • -
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • -
    • Fixed a bug in the form helper that gave textarea a value attribute
    • -
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • -
    • Fixed some doc typos.
    • -
    - - -

    Version 1.5.1

    -

    Release Date: November 23, 2006

    -
      -
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • -
    • Added support for naming custom library files in lower or uppercase.
    • -
    • Fixed a bug related to output buffering.
    • -
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • -
    • Fixed a bug that was suppressing errors in controllers.
    • -
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • -
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • -
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • -
    • Fixed some bugs in the Oracle DB driver.
    • -
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • -
    • Fixed some doc typos.
    • -
    -

    Version 1.5.0.1

    -

    Release Date: October 31, 2006

    -
      -
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • -
    • Fixed a bug in the word_wrap() helper function.
    • -
    • Fixed an invalid color Hex number in the Profiler class.
    • -
    • Fixed a corrupted image in the user guide.
    • -
    - - - -

    Version 1.5.0

    -

    Release Date: October 30, 2006

    - -
      -
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • -
    • Added Database Caching Class.
    • -
    • Added transaction support to the database classes.
    • -
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • -
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • -
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • -
    • Added Zip Encoding Library.
    • -
    • Added FTP Library.
    • -
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • -
    • Added support for storing models within sub-folders.
    • -
    • Added Download Helper.
    • -
    • Added simple_query() function to the database classes
    • -
    • Added standard_date() function to the Date Helper.
    • -
    • Added $query->free_result() to database class.
    • -
    • Added $query->list_fields() function to database class
    • -
    • Added $this->db->platform() function
    • -
    • Added new File Helper: get_filenames()
    • -
    • Added new helper: Smiley Helper
    • -
    • Added support for <ul> and <ol> lists in the HTML Helper
    • -
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • -
    • Added the ability to rename or relocate the "application" folder.
    • -
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • -
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • -
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • -
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • -
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • -
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • -
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • -
    • Fixed a bug in the Email class related to SMTP Helo data.
    • -
    • Fixed a bug in the word wrapping helper and function in the email class.
    • -
    • Fixed a bug in the validation class.
    • -
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • -
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • -
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • -
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • -
    • Fixed a pagination bug that was permitting negative values in the URL.
    • -
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • -
    • Changed _get_config() to get_config() since the function is not a private one.
    • -
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • -
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • -
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • -
    - - - - -

    Version 1.4.1

    -

    Release Date: September 21, 2006

    - -
      -
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • -
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • -
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • -
    • Added $this->output->set_header() function, which allows you to set server headers.
    • -
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • -
    • Added Inflector helper.
    • -
    • Added element() function in the array helper.
    • -
    • Added RAND() to active record orderby() function.
    • -
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • -
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • -
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • -
    • Added output compression option to the config file.
    • -
    • Removed the is_numeric test from the db->escape() function.
    • -
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • -
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • -
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • -
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • -
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • -
    • Added some code to allow email attachments to be reset when sending batches of email.
    • -
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • -
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • -
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • -
    - - - -

    Version 1.4.0

    -

    Release Date: September 17, 2006

    - -
      -
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • -
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • -
    • Added regular expressions support for routing rules.
    • -
    • Added the ability to remap function calls within your controllers.
    • -
    • Added the ability to replace core system classes with your own classes.
    • -
    • Added support for % character in URL.
    • -
    • Added the ability to supply full URLs using the anchor() helper function.
    • -
    • Added mode parameter to file_write() helper.
    • -
    • Added support for changing the port number in the Postgres driver.
    • -
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • -
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • -
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • -
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • -
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • -
    • Updated the form_open() helper to allow the GET method to be used.
    • -
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • -
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • -
    • Updated the Models loader function to allow multiple loads of the same model.
    • -
    • Updated the MS SQL driver so that single quotes are escaped.
    • -
    • Updated the Postgres and ODBC drivers for better compatibility.
    • -
    • Removed a strtolower() call that was changing URL segments to lower case.
    • -
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • -
    • Removed backticks from Postgres class since these are not needed.
    • -
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • -
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • -
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • -
    • Fixed a router bug that was making it too greedy when matching end segments.
    • -
    • Fixed a bug that was preventing multiple discrete database calls.
    • -
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • -
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • -
    • Fixed some missing prefixes when using the database prefix feature.
    • -
    • Fixed a typo in the Calendar class (cal_november).
    • -
    • Fixed a bug in the form_checkbox() helper.
    • -
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • -
    • Fixed an evaluation bug in the database initialization function.
    • -
    • Fixed a minor bug in one of the error messages in the language class.
    • -
    • Fixed a bug in the date helper timespan function.
    • -
    • Fixed an undefined variable in the DB Driver class.
    • -
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • -
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • -
    • Fixed a couple bugs in the Unit Testing class.
    • -
    • Fixed an incorrectly named variable in the Validation class.
    • -
    • Fixed an incorrectly named variable in the URI class.
    • -
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • -
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • -
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • -
    • Fixed some MS SQL bugs.
    • -
    • Fixed some doc typos.
    • -
    - - - -

    Version 1.3.3

    -

    Release Date: June 1, 2006

    - -
      - -
    • Models do not connect automatically to the database as of this version. More info here.
    • -
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • -
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • -
    • Fixed a bug in the active record "having" function.
    • -
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • -
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • -
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • -
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • -
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • -
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • -
    • Fixed a bug in the hash() security helper.
    • -
    • Fixed some typos.
    • -
    - - - - -

    Version 1.3.2

    -

    Release Date: April 17, 2006

    - -
      -
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • -
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • -
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • -
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • -
    • Fixed a couple bugs in the Model class.
    • -
    • Fixed some documentation typos and errata.
    • -
    - - - -

    Version 1.3.1

    -

    Release Date: April 11, 2006

    - -
      -
    • Added a Unit Testing Library.
    • -
    • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • -
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • -
    • Added getwhere function to Active Record class.
    • -
    • Added count_all function to Active Record class.
    • -
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • -
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • -
    • Added a new mime type to the upload class for better compatibility.
    • -
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • -
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • -
    • Fixed a bug in the image library when realpath() returns false.
    • -
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • -
    • Fixed a bug in the "exact_length" function of the validation class.
    • -
    • Fixed some typos in the user guide
    • -
    - - -

    Version 1.3

    -

    Release Date: April 3, 2006

    - -
      -
    • Added support for Models.
    • -
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • -
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • -
    • Added a feature to the database class that lets you run custom function calls.
    • -
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • -
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • -
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • -
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • -
    • Added a new error template for use with native PHP errors.
    • -
    • Added "alternator" function in the string helpers.
    • -
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • -
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • -
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and -all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • -
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • -
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • -
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • -
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • -
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • -
    • Fixed some typos in the default calendar template
    • -
    • Fixed some typos in the user guide
    • -
    - - - - - - - - -

    Version 1.2

    -

    Release Date: March 21, 2006

    - -
      -
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • -
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • -
    • Added new File Helper: delete_files()
    • -
    • Added new URL Helpers: base_url(), index_page()
    • -
    • Added the ability to create your own core libraries and store them in your local application directory.
    • -
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • -
    • Added Javascript Calendar plugin.
    • -
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • -
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • -
    • Fixed a bug in the DB "where" function.
    • -
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • -
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • -
    • Fixed some bugs in the xss_clean function
    • -
    - - - - - -

    Version Beta 1.1

    -

    Release Date: March 10, 2006

    - -
      -
    • Added a Calendaring class.
    • -
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • -
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • -
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • -
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • -
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • -
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • -
    • Fixed a data type error in the form_radio function (form helper)
    • -
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • -
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • -
    • Fixed a pagination problem in the scaffolding.
    • -
    • Fixed a bug in the mysql class "where" function.
    • -
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • -
    • Fixed a bug in the br() function in the HTML helper
    • -
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • -
    • Removed the "style" attributes form the form helpers.
    • -
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • -
    - -

    Version Beta 1.0

    -

    Release Date: February 28, 2006

    -

    First publicly released version.

    - -
    - - - - - - - + + + + + + + + + + + + + + + + + + + +Change Log : CodeIgniter User Guide + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Change Log

    + +

    Version 1.7.1

    +

    Release Date: not yet released
    +SVN Revision:

    + +
      +
    • Libraries +
        +
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • +
      • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
      • +
      • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
      • +
      +
    • +
    • Helpers + +
    • +
    + +

    Bug fixes for 1.7.1

    +
      +
    • Fixed a bug in the MySQLi driver when no port is specified
    • +
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • +
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • +
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.
    • +
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • +
    • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
    • +
    • Changed a few docblock comments to reflect actual return values.
    • +
    + + +

    Version 1.7

    +

    Release Date: October 23, 2008
    +SVN Revision: 1541

    + +
      +
    • Libraries +
        +
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • +
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • +
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • +
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • +
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • +
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • +
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • +
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • +
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • +
      • Added set_status_header() function to Output class.
      • +
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • +
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • +
      +
    • +
    • Database +
        +
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • +
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • +
      • Added Active Record caching feature to "update" and "delete" functions.
      • +
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • +
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • +
      • Added driver name variable in each DB driver, based on bug report #4436.
      • +
      +
    • +
    • Helpers +
        +
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • +
      • Added current_url() and uri_segments() to URL helper.
      • +
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • +
      • Added meta() function to HTML helper.
      • +
      • Improved accuracy of calculations in Number helper.
      • +
      • Removed added newlines ("\n") from most form and html helper functions.
      • +
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • +
      • Updated Date helper to match the world's current time zones and offsets.
      • +
      • Modified url_title() in the URL helper to remove characters and digits that are part of + character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • +
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • +
      +
    • +
    • Other Changes +
        +
      • Added PHP Style Guide to docs.
      • +
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • +
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • +
      • Added a file lock check during caching, before trying to write to the file.
      • +
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • +
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • +
      +
    • +
    + +

    Bug fixes for 1.7.0

    +
      +
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • +
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • +
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • +
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • +
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • +
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • +
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • +
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • +
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • +
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • +
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • +
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • +
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • +
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • +
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • +
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • +
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • +
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • +
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • +
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • +
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • +
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • +
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • +
    • Fixed DB backup bug in which field names were not being escaped.
    • +
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • +
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • +
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • +
    • Fixed a spelling error in a Loader error message.
    • +
    • Fixed a bug (5050) with IP validation with empty segments.
    • +
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • +
    + +

    Version 1.6.3

    +

    Release Date: June 26, 2008
    +SVN Revision: 1238

    +

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    +
      +
    • Database +
        +
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • +
      • Added ability to set multiple column non-primary keys to the Forge class
      • +
      • Added ability to set additional database config values in DSN connections via the query string.
      • +
      +
    • +
    • Libraries +
        +
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • +
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • +
      • Added get_post() to the Input class.
      • +
      • Documented get() in the Input class.
      • +
      • Added the ability to automatically output language items as form labels in the Language class.
      • +
      +
    • +
    • Helpers + +
    • +
    • Other changes +
        +
      • Improved security in xss_clean().
      • +
      • Removed an unused Router reference in _display_cache().
      • +
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • +
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • +
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • +
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • +
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • +
      • Documented the language file use of byte_format() in the number helper.
      • +
      +
    • +
    + + +

    Bug fixes for 1.6.3

    + +
      +
    • Added a language key for valid_emails in validation_lang.php.
    • +
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • +
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • +
    • Fixed a syntax error in upload_lang.php.
    • +
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • +
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • +
    • Removed some unused variables from the code (#4563).
    • +
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • +
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • +
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • +
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • +
    + +

    Version 1.6.2

    +

    Release Date: May 13, 2008
    +SVN Revision: 1155

    +
      +
    • Active Record +
        +
      • Added the ability to prevent escaping in having() clauses.
      • +
      • Added rename_table() into DBForge.
      • +
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • +
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • +
      +
    • +
    • Database +
        +
      • Added Strict Mode to database transactions.
      • +
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • +
      +
    • +
    • Config +
        +
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • +
      • Added 'audio/mpg' to list of mime types.
      • +
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      +
    • +
    • Libraries +
        +
      • Added increased security for filename handling in the Upload library.
      • +
      • Added increased security for sessions for client-side data tampering.
      • +
      • The MySQLi forge class is now in sync with MySQL forge.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • +
      • Added a valid_emails rule to the Validation class.
      • +
      • The Zip class now exits within download().
      • +
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • +
      +
    • +
    • Helpers +
        +
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • +
      • Added form_button() in the Form helper.
      • +
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • +
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • +
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • +
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • +
      • The Download helper now exits within force_download().
      • +
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • +
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • +
      +
    • +
    • Plugins +
        +
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • +
      +
    • +
    • Other + Changes +
        +
      • Added ability for xss_clean() to accept arrays.
      • +
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • +
      • Removed "scripts" from the auto-load search path. Scripts were deprecated + in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • +
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • +
      • Added a Common Functions page to the userguide for globally available functions.
      • +
      • Improved security and performance of xss_clean().
      • +
      +
    • +
    + +

    Bugfixes for 1.6.2

    +
      +
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • +
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • +
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • +
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • +
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • +
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • +
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • +
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • +
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • +
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • +
    • Fixed an AR bug with or_where_not_in() (#4171).
    • +
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • +
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • +
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • +
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • +
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • +
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • +
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • +
    • Fixed a bug in the DB class testing the $params argument.
    • +
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • +
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • +
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • +
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • +
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • +
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • +
    • Fixed an array to string conversion error in the Validation library (#4425)
    • +
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • +
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • +
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • +
    + +

    Version 1.6.1

    +

    Release Date: February 12, 2008
    + SVN Revision: 984

    +
      +
    • Active Record + +
    • +
    • Database drivers +
        +
      • Added support for setting client character set and collation for MySQLi.
      • +
      +
    • +
    • Core Changes +
        +
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • +
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • +
      • Added a 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 characters to the end of the default expression.
      • +
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • +
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • +
      +
    • +
    • Helpers +
        +
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • +
      +
    • +
    + + +

    Bugfixes for 1.6.1

    +
      +
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • +
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • +
    • Made Active Record fully database prefix aware (#3384).
    • +
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • +
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • +
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • +
    • Fixed a bug in query binding (#3402).
    • +
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • +
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • +
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • +
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • +
    • Fixed assorted user guide typos.
    • +
    + + + +

    Version 1.6.0

    +

    Release Date: January 30, 2008

    +
      +
    • DBForge +
        +
      • Added DBForge to the database tools.
      • +
      • Moved create_database() and drop_database() into DBForge.
      • +
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • +
      +
    • + +
    • Active Record +
        +
      • Added protect_identifiers() in Active Record.
      • +
      • All AR queries are backticked if appropriate to the database.
      • +
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • +
      • Added support for limit() into update() and delete() statements in Active Record.
      • +
      • Added empty_table() and truncate_table() to Active Record.
      • +
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • +
      • Added count_all_results() function to Active Record.
      • +
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • +
      • Added the ability to use aliases with joins in Active Record.
      • +
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • +
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • +
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • +
      +
    • + +
    • Other Database Related +
        +
      • MySQL driver now requires MySQL 4.1+
      • +
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • +
      • Added $this->db->dbprefix() to manually add database prefixes.
      • +
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • +
      • Added a check for NULL fields in the MySQL database backup utility.
      • +
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • +
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • +
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • +
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • +
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more + in harmony with the global nature of the behavior (#1834).
      • +
      +
    • + +
    • Core changes +
        +
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • +
      • Added the ability to auto-load Models.
      • +
      • Reorganized the URI and Routes classes for better clarity.
      • +
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • +
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • +
      • Deprecated Scaffolding.
      • +
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • +
      +
    • + +
    • Libraries +
        +
      • Changed the load protocol of Models to allow for extension.
      • +
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • +
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • +
      • Removed 'last_visit' from the Session class.
      • +
      • Added a language entry for valid_ip validation error.
      • +
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • +
      • Added an "integer" rule into the Validation library.
      • +
      • Added valid_base64() to the Validation library.
      • +
      • Documented clear() in the Image Processing library.
      • +
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • +
      • Modified Upload class $_FILES error messages to be more precise.
      • +
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • +
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • +
      • Added a few additional mime type variations for CSV.
      • +
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • +
      +
    • + +
    • Helpers & Plugins +
        +
      • Added link_tag() to the HTML helper.
      • +
      • Added img() to the HTML helper.
      • +
      • Added ability to "extend" Helpers.
      • +
      • Added an email helper into core helpers.
      • +
      • Added strip_quotes() function to string helper.
      • +
      • Added reduce_multiples() function to string helper.
      • +
      • Added quotes_to_entities() function to string helper.
      • +
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • +
      • Added support for external urls in form_open().
      • +
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • +
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • +
      +
    • + + +
    • Documentation Changes +
        +
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • +
      • Added titles to all user manual pages.
      • +
      • Added attributes into <html> of userguide for valid html.
      • +
      • Added Zip Encoding Class to the table of contents of the userguide.
      • +
      • Moved part of the userguide menu javascript to an external file.
      • +
      • Documented distinct() in Active Record.
      • +
      • Documented the timezones() function in the Date Helper.
      • +
      • Documented unset_userdata in the Session class.
      • +
      • Documented 2 config options to the Database configuration page.
      • +
      +
    • +
    + +

    Bug fixes for Version 1.6.0

    + +
      +
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • +
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • +
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • +
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • +
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • +
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • +
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • +
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • +
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • +
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • +
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • +
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • +
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • +
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • +
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • +
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • +
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • +
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • +
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • +
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • +
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • +
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • +
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • +
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • +
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • +
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • +
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • +
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • +
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • +
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • +
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • +
    • Removed an extraneous call to loading models (#3286).
    • +
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • +
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • +
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • +
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • +
    • Removed an unused parameter from Profiler (#3332).
    • +
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • +
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • +
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • +
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • +
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • +
    • Fixed a bug in captcha calling an invalid PHP function.
    • +
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • +
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • +
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • +
    • Fixed an example of comma-separated emails in the email library documentation.
    • +
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • +
    • Fixed a typo in the database language file.
    • +
    • Fixed a typo in the image language file "suppor" to "support".
    • +
    • Fixed an example for XML RPC.
    • +
    • Fixed an example of accept_charset() in the User Agent Library.
    • +
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • +
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • +
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • +
    • Added a stripslashes() into the Upload Library.
    • +
    • Fixed a series of grammatical and spelling errors in the language files.
    • +
    • Fixed assorted user guide typos.
    • +
    +

    Version 1.5.4

    +

    Release Date: July 12, 2007

    +
      +
    • Added custom Language files to the autoload options.
    • +
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • +
    • Added array to string into the profiler.
    • +
    • Added some additional mime types in application/config/mimes.php.
    • +
    • Added filename_security() method to Input library.
    • +
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • +
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • +
    • Fixed MSSQL insert_id().
    • +
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • +
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • +
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • +
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • +
    • Fixed a typo in the Calendar library
    • +
    • Fixed a typo in rpcs.php library
    • +
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • +
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • +
    • Fixed an IP validation bug.
    • +
    • Fixed a bug in display of POST keys in the Profiler output
    • +
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • +
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • +
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • +
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • +
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • +
    • Fixed various doc typos.
    • +
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • +
    • Docs now validate to XHTML 1 transitional
    • +
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • +
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • +
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • +
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • +
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • +
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • +
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • +
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • +
    +

    Version 1.5.3

    +

    Release Date: April 15, 2007

    +
      +
    • Added array to string into the profiler
    • +
    • Code Igniter references updated to CodeIgniter
    • +
    • pMachine references updated to EllisLab
    • +
    • Fixed a bug in the repeater function of string helper.
    • +
    • Fixed a bug in ODBC driver
    • +
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • +
    • Fixed a bug in the redirect function of the url helper.
    • +
    • Fixed an undefined variable in Loader
    • +
    • Fixed a version bug in the Postgres driver
    • +
    • Fixed a bug in the textarea function of the form helper for use with strings
    • +
    • Fixed doc typos.
    • +
    +

    Version 1.5.2

    +

    Release Date: February 13, 2007

    +
      +
    • Added subversion information to the downloads page.
    • +
    • Added support for captions in the Table Library
    • +
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • +
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • +
    • Removed unescaped variables in error messages of Input and Router classes
    • +
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • +
    • Fixed a bug in the form helper that gave textarea a value attribute
    • +
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • +
    • Fixed some doc typos.
    • +
    + + +

    Version 1.5.1

    +

    Release Date: November 23, 2006

    +
      +
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • +
    • Added support for naming custom library files in lower or uppercase.
    • +
    • Fixed a bug related to output buffering.
    • +
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • +
    • Fixed a bug that was suppressing errors in controllers.
    • +
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • +
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • +
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • +
    • Fixed some bugs in the Oracle DB driver.
    • +
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • +
    • Fixed some doc typos.
    • +
    +

    Version 1.5.0.1

    +

    Release Date: October 31, 2006

    +
      +
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • +
    • Fixed a bug in the word_wrap() helper function.
    • +
    • Fixed an invalid color Hex number in the Profiler class.
    • +
    • Fixed a corrupted image in the user guide.
    • +
    + + + +

    Version 1.5.0

    +

    Release Date: October 30, 2006

    + +
      +
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • +
    • Added Database Caching Class.
    • +
    • Added transaction support to the database classes.
    • +
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • +
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • +
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • +
    • Added Zip Encoding Library.
    • +
    • Added FTP Library.
    • +
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • +
    • Added support for storing models within sub-folders.
    • +
    • Added Download Helper.
    • +
    • Added simple_query() function to the database classes
    • +
    • Added standard_date() function to the Date Helper.
    • +
    • Added $query->free_result() to database class.
    • +
    • Added $query->list_fields() function to database class
    • +
    • Added $this->db->platform() function
    • +
    • Added new File Helper: get_filenames()
    • +
    • Added new helper: Smiley Helper
    • +
    • Added support for <ul> and <ol> lists in the HTML Helper
    • +
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • +
    • Added the ability to rename or relocate the "application" folder.
    • +
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • +
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • +
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • +
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • +
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • +
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • +
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • +
    • Fixed a bug in the Email class related to SMTP Helo data.
    • +
    • Fixed a bug in the word wrapping helper and function in the email class.
    • +
    • Fixed a bug in the validation class.
    • +
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • +
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • +
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • +
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • +
    • Fixed a pagination bug that was permitting negative values in the URL.
    • +
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • +
    • Changed _get_config() to get_config() since the function is not a private one.
    • +
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • +
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • +
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • +
    + + + + +

    Version 1.4.1

    +

    Release Date: September 21, 2006

    + +
      +
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • +
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • +
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • +
    • Added $this->output->set_header() function, which allows you to set server headers.
    • +
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • +
    • Added Inflector helper.
    • +
    • Added element() function in the array helper.
    • +
    • Added RAND() to active record orderby() function.
    • +
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • +
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • +
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • +
    • Added output compression option to the config file.
    • +
    • Removed the is_numeric test from the db->escape() function.
    • +
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • +
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • +
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • +
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • +
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • +
    • Added some code to allow email attachments to be reset when sending batches of email.
    • +
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • +
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • +
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • +
    + + + +

    Version 1.4.0

    +

    Release Date: September 17, 2006

    + +
      +
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added regular expressions support for routing rules.
    • +
    • Added the ability to remap function calls within your controllers.
    • +
    • Added the ability to replace core system classes with your own classes.
    • +
    • Added support for % character in URL.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • +
    • Added mode parameter to file_write() helper.
    • +
    • Added support for changing the port number in the Postgres driver.
    • +
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • +
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • +
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • +
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • +
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • +
    • Updated the form_open() helper to allow the GET method to be used.
    • +
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • +
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • +
    • Updated the Models loader function to allow multiple loads of the same model.
    • +
    • Updated the MS SQL driver so that single quotes are escaped.
    • +
    • Updated the Postgres and ODBC drivers for better compatibility.
    • +
    • Removed a strtolower() call that was changing URL segments to lower case.
    • +
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • +
    • Removed backticks from Postgres class since these are not needed.
    • +
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • +
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • +
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • +
    • Fixed a router bug that was making it too greedy when matching end segments.
    • +
    • Fixed a bug that was preventing multiple discrete database calls.
    • +
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • +
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • +
    • Fixed some missing prefixes when using the database prefix feature.
    • +
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed a bug in the form_checkbox() helper.
    • +
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • +
    • Fixed an evaluation bug in the database initialization function.
    • +
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed a bug in the date helper timespan function.
    • +
    • Fixed an undefined variable in the DB Driver class.
    • +
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • +
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • +
    • Fixed a couple bugs in the Unit Testing class.
    • +
    • Fixed an incorrectly named variable in the Validation class.
    • +
    • Fixed an incorrectly named variable in the URI class.
    • +
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • +
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • +
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • +
    • Fixed some MS SQL bugs.
    • +
    • Fixed some doc typos.
    • +
    + + + +

    Version 1.3.3

    +

    Release Date: June 1, 2006

    + +
      + +
    • Models do not connect automatically to the database as of this version. More info here.
    • +
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • +
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • +
    • Fixed a bug in the active record "having" function.
    • +
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • +
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • +
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • +
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • +
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • +
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • +
    • Fixed a bug in the hash() security helper.
    • +
    • Fixed some typos.
    • +
    + + + + +

    Version 1.3.2

    +

    Release Date: April 17, 2006

    + +
      +
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • +
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • +
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • +
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • +
    • Fixed a couple bugs in the Model class.
    • +
    • Fixed some documentation typos and errata.
    • +
    + + + +

    Version 1.3.1

    +

    Release Date: April 11, 2006

    + +
      +
    • Added a Unit Testing Library.
    • +
    • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • +
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • +
    • Added getwhere function to Active Record class.
    • +
    • Added count_all function to Active Record class.
    • +
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • +
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • +
    • Added a new mime type to the upload class for better compatibility.
    • +
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • +
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • +
    • Fixed a bug in the image library when realpath() returns false.
    • +
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • +
    • Fixed a bug in the "exact_length" function of the validation class.
    • +
    • Fixed some typos in the user guide
    • +
    + + +

    Version 1.3

    +

    Release Date: April 3, 2006

    + +
      +
    • Added support for Models.
    • +
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • +
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • +
    • Added a feature to the database class that lets you run custom function calls.
    • +
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • +
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • +
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • +
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • +
    • Added a new error template for use with native PHP errors.
    • +
    • Added "alternator" function in the string helpers.
    • +
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • +
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • +
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and +all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • +
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • +
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • +
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • +
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • +
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • +
    • Fixed some typos in the default calendar template
    • +
    • Fixed some typos in the user guide
    • +
    + + + + + + + + +

    Version 1.2

    +

    Release Date: March 21, 2006

    + +
      +
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • +
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • +
    • Added new File Helper: delete_files()
    • +
    • Added new URL Helpers: base_url(), index_page()
    • +
    • Added the ability to create your own core libraries and store them in your local application directory.
    • +
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • +
    • Added Javascript Calendar plugin.
    • +
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • +
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • +
    • Fixed a bug in the DB "where" function.
    • +
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • +
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • +
    • Fixed some bugs in the xss_clean function
    • +
    + + + + + +

    Version Beta 1.1

    +

    Release Date: March 10, 2006

    + +
      +
    • Added a Calendaring class.
    • +
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • +
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • +
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • +
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • +
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • +
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • +
    • Fixed a data type error in the form_radio function (form helper)
    • +
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • +
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • +
    • Fixed a pagination problem in the scaffolding.
    • +
    • Fixed a bug in the mysql class "where" function.
    • +
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • +
    • Fixed a bug in the br() function in the HTML helper
    • +
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • +
    • Removed the "style" attributes form the form helpers.
    • +
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • +
    + +

    Version Beta 1.0

    +

    Release Date: February 28, 2006

    +

    First publicly released version.

    + +
    + + + + + + + diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 43385d06..faa1a8ff 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -1,649 +1,649 @@ - - - - - -Style Guide : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    General Style and Syntax

    - -

    The following page describes the coding rules use adhere to when developing CodeIgniter.

    - - -

    Table of Contents

    - - -

    PHP Closing Tag

    -
    -

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced - by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should - OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. - This allows you to still identify a file as being complete and not truncated.

    -INCORRECT: -<?php - -echo "Here's my code!"; - -?> - -CORRECT: -<?php - -echo "Here's my code!"; - -/* End of file myfile.php */ -/* Location: ./system/modules/mymodule/myfile.php */ - -
    - - -

    Class and Method Naming

    -
    -

    Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

    - - INCORRECT: -class superclass -class SuperClass - -CORRECT: -class Super_class - -

    Notice that the Class and constructor methods are identically named and cased:

    - - class Super_class { - - function Super_class() - { - - } -} - -

    Examples of improper and proper method naming:

    - - INCORRECT: -function fileproperties() // not descriptive and needs underscore separator -function fileProperties() // not descriptive and uses CamelCase -function getfileproperties() // Better! But still missing underscore separator -function getFileProperties() // uses CamelCase -function get_the_file_properties_from_the_file() // wordy - -CORRECT: -function get_file_properties() // descriptive, underscore separator, and all lowercase letters - -
    - - -

    Variable Names

    -
    -

    The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

    -INCORRECT: -$j = 'foo'; // single letter variables should only be used in for() loops -$Str // contains uppercase letters -$bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning -$groupid // multiple words, needs underscore separator -$name_of_last_city_used // too long - -CORRECT: -for ($j = 0; $j < 10; $j++) -$str -$buffer -$group_id -$last_city - -
    - - -

    Commenting

    -
    -

    In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

    - -

    DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:

    - -/** - * Super Class - * - * @package Package Name - * @subpackage Subpackage - * @category Category - * @author Author Name - * @link http://example.com - */ -class Super_class { - -/** - * Encodes string for use in XML - * - * @access public - * @param string - * @return string - */ -function xml_encode($str) - -

    Use single line comments within code, leaving a blank line between large comment blocks and code.

    - -// break up the string by newlines -$parts = explode("\n", $str); - -// A longer comment that needs to give greater detail on what is -// occurring and why can use multiple single-line comments. Try to -// keep the width reasonable, around 70 characters is the easiest to -// read. Don't hesitate to link to permanent external resources -// that may provide greater detail: -// -// http://example.com/information_about_something/in_particular/ - -$parts = $this->foo($parts); - -
    - - -

    Constants

    -
    -

    Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use ExpressionEngine constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

    -INCORRECT: -myConstant // missing underscore separator and not fully uppercase -N // no single-letter constants -S_C_VER // not descriptive -$str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants - -CORRECT: -MY_CONSTANT -NEWLINE -SUPER_CLASS_VERSION -$str = str_replace(LD.'foo'.RD, 'bar', $str); - -
    - - -

    TRUE, FALSE, and NULL

    -
    -

    TRUE, FALSE, and NULL keywords should always be fully uppercase.

    -INCORRECT: -if ($foo == true) -$bar = false; -function foo($bar = null) - -CORRECT: -if ($foo == TRUE) -$bar = FALSE; -function foo($bar = NULL) -
    - - - -

    Logical Operators

    -
    -

    Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). - && is preferred over AND but either are acceptable, and a space should always precede and follow !.

    -INCORRECT: -if ($foo || $bar) -if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications -if (!$foo) -if (! is_array($foo)) - -CORRECT: -if ($foo OR $bar) -if ($foo && $bar) // recommended -if ( ! $foo) -if ( ! is_array($foo)) - -
    - - - -

    Comparing Return Values and Typecasting

    -
    -

    Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

    -

    Use the same stringency in returning and checking your own variables. Use === and !== as necessary. - -INCORRECT: -// If 'foo' is at the beginning of the string, strpos will return a 0, -// resulting in this conditional evaluating as TRUE -if (strpos($str, 'foo') == FALSE) - -CORRECT: -if (strpos($str, 'foo') === FALSE) - - -INCORRECT: -function build_string($str = "") -{ - if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument? - { - - } -} - -CORRECT: -function build_string($str = "") -{ - if ($str === "") - { - - } -} - -

    See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":

    - -$str = (string) $str; // cast $str as a string - -
    - - -

    Debugging Code

    -
    -

    No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

    - -// print_r($foo); -
    - - - -

    Whitespace in Files

    -
    -

    No whitespace can precede the opening PHP tag or follow the closing PHP tag. ExpressionEngine output is buffered, so whitespace in your files can cause output to begin before ExpressionEngine outputs its content, leading to errors and an inability for ExpressionEngine to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

    - -

    INCORRECT:

    - -<?php - // ...there is whitespace and a linebreak above the opening PHP tag - // as well as whitespace after the closing PHP tag -?> - -

    CORRECT:

    -<?php - // this sample has no whitespace before or after the opening and closing PHP tags -?> - -
    - - -

    Compatibility

    -
    -

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    -
    - - - -

    Class and File Names using Common Words

    -
    -

    When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

    - -INCORRECT: -class Email pi.email.php -class Xml ext.xml.php -class Import mod.import.php - -CORRECT: -class Pre_email pi.pre_email.php -class Pre_xml ext.pre_xml.php -class Pre_import mod.pre_import.php - -
    - - -

    Database Table Names

    -
    -

    Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as ExpressionEngine's database class will automatically convert 'exp_' to what is actually being used.

    - -INCORRECT: -email_addresses // missing both prefixes -pre_email_addresses // missing exp_ prefix -exp_email_addresses // missing unique prefix - -CORRECT: -exp_pre_email_addresses - - -

    NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington -

    - - - -

    One File per Class

    -
    -

    Use separate files for each class your add-on uses, unless the classes are closely related. An example of ExpressionEngine files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

    -
    - - - -

    Whitespace

    -
    -

    Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

    -
    - - - -

    Line Breaks

    -
    -

    Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

    -
    - - - -

    Code Indenting

    -
    -

    Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

    - -INCORRECT: -function foo($bar) { - // ... -} - -foreach ($arr as $key => $val) { - // ... -} - -if ($foo == $bar) { - // ... -} else { - // ... -} - -for ($i = 0; $i < 10; $i++) - { - for ($j = 0; $j < 10; $j++) - { - // ... - } - } - -CORRECT: -function foo($bar) -{ - // ... -} - -foreach ($arr as $key => $val) -{ - // ... -} - -if ($foo == $bar) -{ - // ... -} -else -{ - // ... -} - -for ($i = 0; $i < 10; $i++) -{ - for ($j = 0; $j < 10; $j++) - { - // ... - } -} -
    - - -

    Bracket and Parenthetic Spacing

    -
    -

    In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

    - -INCORRECT: -$arr[ $foo ] = 'foo'; - -CORRECT: -$arr[$foo] = 'foo'; // no spaces around array keys - - -INCORRECT: -function foo ( $bar ) -{ - -} - -CORRECT: -function foo($bar) // no spaces around parenthesis in function declarations -{ - -} - - -INCORRECT: -foreach( $query->result() as $row ) - -CORRECT: -foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis - -
    - - - -

    Localized Text in Control Panel

    -
    -

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    - -INCORRECT: -return "Invalid Selection"; - -CORRECT: -return $LANG->line('invalid_selection'); -
    - - - -

    Private Methods and Variables

    -
    -

    Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

    - -convert_text() // public method -_convert_text() // private method -
    - - - -

    PHP Errors

    -
    -

    Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

    - -

    Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:

    - -if (ini_get('display_errors') == 1) -{ - exit "Enabled"; -} - -

    On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:

    - -ini_set('display_errors', 1); - -

    NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

    -
    - - - -

    Short Open Tags

    -
    -

    Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

    - -INCORRECT: -<? echo $foo; ?> - -<?=$foo?> - -CORRECT: -<?php echo $foo; ?> -
    - - - -

    One Statement Per Line

    -
    -

    Never combine statements on one line.

    - -INCORRECT: -$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag); - -CORRECT: -$foo = 'this'; -$bar = 'that'; -$bat = str_replace($foo, $bar, $bag); - -
    - - - -

    Strings

    -
    -

    Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

    - -INCORRECT: -"My String" // no variable parsing, so no use for double quotes -"My string $foo" // needs braces -'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly - -CORRECT: -'My String' -"My string {$foo}" -"SELECT foo FROM bar WHERE baz = 'bag'" -
    - - - -

    SQL Queries

    -
    -

    MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

    - -

    Break up long queries into multiple lines for legibility, preferably breaking for each clause.

    - -INCORRECT: -// keywords are lowercase and query is too long for -// a single line (... indicates continuation of line) -$query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses -...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); - -CORRECT: -$query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz - FROM exp_pre_email_addresses - WHERE foo != 'oof' - AND baz != 'zab' - ORDER BY foobaz - LIMIT 5, 100"); -
    - - - -

    Default Function Arguments

    -
    -

    Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

    - -function foo($bar = '', $baz = FALSE) -
    - - - -

    Overlapping Tag Parameters

    -
    -

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    -
    - - -
    - - - -
    - - - - - - + + + + + +Style Guide : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    General Style and Syntax

    + +

    The following page describes the coding rules use adhere to when developing CodeIgniter.

    + + +

    Table of Contents

    + + +

    PHP Closing Tag

    +
    +

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced + by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should + OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. + This allows you to still identify a file as being complete and not truncated.

    +INCORRECT: +<?php + +echo "Here's my code!"; + +?> + +CORRECT: +<?php + +echo "Here's my code!"; + +/* End of file myfile.php */ +/* Location: ./system/modules/mymodule/myfile.php */ + +
    + + +

    Class and Method Naming

    +
    +

    Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

    + + INCORRECT: +class superclass +class SuperClass + +CORRECT: +class Super_class + +

    Notice that the Class and constructor methods are identically named and cased:

    + + class Super_class { + + function Super_class() + { + + } +} + +

    Examples of improper and proper method naming:

    + + INCORRECT: +function fileproperties() // not descriptive and needs underscore separator +function fileProperties() // not descriptive and uses CamelCase +function getfileproperties() // Better! But still missing underscore separator +function getFileProperties() // uses CamelCase +function get_the_file_properties_from_the_file() // wordy + +CORRECT: +function get_file_properties() // descriptive, underscore separator, and all lowercase letters + +
    + + +

    Variable Names

    +
    +

    The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

    +INCORRECT: +$j = 'foo'; // single letter variables should only be used in for() loops +$Str // contains uppercase letters +$bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning +$groupid // multiple words, needs underscore separator +$name_of_last_city_used // too long + +CORRECT: +for ($j = 0; $j < 10; $j++) +$str +$buffer +$group_id +$last_city + +
    + + +

    Commenting

    +
    +

    In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

    + +

    DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:

    + +/** + * Super Class + * + * @package Package Name + * @subpackage Subpackage + * @category Category + * @author Author Name + * @link http://example.com + */ +class Super_class { + +/** + * Encodes string for use in XML + * + * @access public + * @param string + * @return string + */ +function xml_encode($str) + +

    Use single line comments within code, leaving a blank line between large comment blocks and code.

    + +// break up the string by newlines +$parts = explode("\n", $str); + +// A longer comment that needs to give greater detail on what is +// occurring and why can use multiple single-line comments. Try to +// keep the width reasonable, around 70 characters is the easiest to +// read. Don't hesitate to link to permanent external resources +// that may provide greater detail: +// +// http://example.com/information_about_something/in_particular/ + +$parts = $this->foo($parts); + +
    + + +

    Constants

    +
    +

    Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use ExpressionEngine constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

    +INCORRECT: +myConstant // missing underscore separator and not fully uppercase +N // no single-letter constants +S_C_VER // not descriptive +$str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants + +CORRECT: +MY_CONSTANT +NEWLINE +SUPER_CLASS_VERSION +$str = str_replace(LD.'foo'.RD, 'bar', $str); + +
    + + +

    TRUE, FALSE, and NULL

    +
    +

    TRUE, FALSE, and NULL keywords should always be fully uppercase.

    +INCORRECT: +if ($foo == true) +$bar = false; +function foo($bar = null) + +CORRECT: +if ($foo == TRUE) +$bar = FALSE; +function foo($bar = NULL) +
    + + + +

    Logical Operators

    +
    +

    Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). + && is preferred over AND but either are acceptable, and a space should always precede and follow !.

    +INCORRECT: +if ($foo || $bar) +if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications +if (!$foo) +if (! is_array($foo)) + +CORRECT: +if ($foo OR $bar) +if ($foo && $bar) // recommended +if ( ! $foo) +if ( ! is_array($foo)) + +
    + + + +

    Comparing Return Values and Typecasting

    +
    +

    Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

    +

    Use the same stringency in returning and checking your own variables. Use === and !== as necessary. + +INCORRECT: +// If 'foo' is at the beginning of the string, strpos will return a 0, +// resulting in this conditional evaluating as TRUE +if (strpos($str, 'foo') == FALSE) + +CORRECT: +if (strpos($str, 'foo') === FALSE) + + +INCORRECT: +function build_string($str = "") +{ + if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument? + { + + } +} + +CORRECT: +function build_string($str = "") +{ + if ($str === "") + { + + } +} + +

    See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":

    + +$str = (string) $str; // cast $str as a string + +
    + + +

    Debugging Code

    +
    +

    No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

    + +// print_r($foo); +
    + + + +

    Whitespace in Files

    +
    +

    No whitespace can precede the opening PHP tag or follow the closing PHP tag. ExpressionEngine output is buffered, so whitespace in your files can cause output to begin before ExpressionEngine outputs its content, leading to errors and an inability for ExpressionEngine to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

    + +

    INCORRECT:

    + +<?php + // ...there is whitespace and a linebreak above the opening PHP tag + // as well as whitespace after the closing PHP tag +?> + +

    CORRECT:

    +<?php + // this sample has no whitespace before or after the opening and closing PHP tags +?> + +
    + + +

    Compatibility

    +
    +

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    +
    + + + +

    Class and File Names using Common Words

    +
    +

    When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

    + +INCORRECT: +class Email pi.email.php +class Xml ext.xml.php +class Import mod.import.php + +CORRECT: +class Pre_email pi.pre_email.php +class Pre_xml ext.pre_xml.php +class Pre_import mod.pre_import.php + +
    + + +

    Database Table Names

    +
    +

    Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as ExpressionEngine's database class will automatically convert 'exp_' to what is actually being used.

    + +INCORRECT: +email_addresses // missing both prefixes +pre_email_addresses // missing exp_ prefix +exp_email_addresses // missing unique prefix + +CORRECT: +exp_pre_email_addresses + + +

    NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington +

    + + + +

    One File per Class

    +
    +

    Use separate files for each class your add-on uses, unless the classes are closely related. An example of ExpressionEngine files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

    +
    + + + +

    Whitespace

    +
    +

    Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

    +
    + + + +

    Line Breaks

    +
    +

    Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

    +
    + + + +

    Code Indenting

    +
    +

    Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

    + +INCORRECT: +function foo($bar) { + // ... +} + +foreach ($arr as $key => $val) { + // ... +} + +if ($foo == $bar) { + // ... +} else { + // ... +} + +for ($i = 0; $i < 10; $i++) + { + for ($j = 0; $j < 10; $j++) + { + // ... + } + } + +CORRECT: +function foo($bar) +{ + // ... +} + +foreach ($arr as $key => $val) +{ + // ... +} + +if ($foo == $bar) +{ + // ... +} +else +{ + // ... +} + +for ($i = 0; $i < 10; $i++) +{ + for ($j = 0; $j < 10; $j++) + { + // ... + } +} +
    + + +

    Bracket and Parenthetic Spacing

    +
    +

    In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

    + +INCORRECT: +$arr[ $foo ] = 'foo'; + +CORRECT: +$arr[$foo] = 'foo'; // no spaces around array keys + + +INCORRECT: +function foo ( $bar ) +{ + +} + +CORRECT: +function foo($bar) // no spaces around parenthesis in function declarations +{ + +} + + +INCORRECT: +foreach( $query->result() as $row ) + +CORRECT: +foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis + +
    + + + +

    Localized Text in Control Panel

    +
    +

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    + +INCORRECT: +return "Invalid Selection"; + +CORRECT: +return $LANG->line('invalid_selection'); +
    + + + +

    Private Methods and Variables

    +
    +

    Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

    + +convert_text() // public method +_convert_text() // private method +
    + + + +

    PHP Errors

    +
    +

    Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

    + +

    Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:

    + +if (ini_get('display_errors') == 1) +{ + exit "Enabled"; +} + +

    On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:

    + +ini_set('display_errors', 1); + +

    NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

    +
    + + + +

    Short Open Tags

    +
    +

    Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

    + +INCORRECT: +<? echo $foo; ?> + +<?=$foo?> + +CORRECT: +<?php echo $foo; ?> +
    + + + +

    One Statement Per Line

    +
    +

    Never combine statements on one line.

    + +INCORRECT: +$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag); + +CORRECT: +$foo = 'this'; +$bar = 'that'; +$bat = str_replace($foo, $bar, $bag); + +
    + + + +

    Strings

    +
    +

    Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

    + +INCORRECT: +"My String" // no variable parsing, so no use for double quotes +"My string $foo" // needs braces +'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly + +CORRECT: +'My String' +"My string {$foo}" +"SELECT foo FROM bar WHERE baz = 'bag'" +
    + + + +

    SQL Queries

    +
    +

    MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

    + +

    Break up long queries into multiple lines for legibility, preferably breaking for each clause.

    + +INCORRECT: +// keywords are lowercase and query is too long for +// a single line (... indicates continuation of line) +$query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses +...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); + +CORRECT: +$query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz + FROM exp_pre_email_addresses + WHERE foo != 'oof' + AND baz != 'zab' + ORDER BY foobaz + LIMIT 5, 100"); +
    + + + +

    Default Function Arguments

    +
    +

    Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

    + +function foo($bar = '', $baz = FALSE) +
    + + + +

    Overlapping Tag Parameters

    +
    +

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    +
    + + +
    + + + +
  • + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 3b4ffb13..98b2c255 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -1,368 +1,368 @@ - - - - - -HTML Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    HTML Helper

    - -

    The HTML Helper file contains functions that assist in working with HTML.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('html'); - -

    The following functions are available:

    - -

    br()

    -

    Generates line break tags (<br />) based on the number you submit. Example:

    -echo br(3); -

    The above would produce: <br /><br /><br />

    - -

    heading()

    -

    Lets you create HTML <h1> tags. The first parameter will contain the data, the -second the size of the heading. Example:

    -echo heading('Welcome!', 3); -

    The above would produce: <h3>Welcome!</h3>

    -

    img()

    -

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    -echo img('images/picture.jpg');
    -// gives <img src="http://site.com/images/picture.jpg" />
    -

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    -

    echo img('images/picture.jpg', TRUE);
    -// gives <img src="http://site.com/index.php/images/picture.jpg" />

    -

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    -

    $image_properties = array(
    -           'src' => 'images/picture.jpg',
    -           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    -           'class' => 'post_images',
    -           'width' => '200',
    -           'height' => '200',
    -           'title' => 'That was quite a night',
    -           'rel' => 'lightbox',
    - );
    -
    - img($image_properties);
    - // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    -

    link_tag()

    -

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. -echo link_tag('css/mystyles.css');
    -// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    -

    Further examples:

    - - - echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    - // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> -
    -
    - echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    - // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    -

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    -

    - $link = array(
    -           'href' => 'css/printer.css',
    -           'rel' => 'stylesheet',
    -           'type' => 'text/css',
    -           'media' => 'print'
    - );
    -
    - echo link_tag($link);
    - // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    - -

    nbs()

    -

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    -echo nbs(3); -

    The above would produce: &nbsp;&nbsp;&nbsp;

    - -

    ol()  and  ul()

    - -

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'red',
    -            'blue',
    -            'green',
    -            'yellow'
    -            );
    -
    -$attributes = array(
    -                    'class' => 'boldlist',
    -                    'id'    => 'mylist'
    -                    );
    -
    -echo ul($list, $attributes);
    -
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>red</li>
    -  <li>blue</li>
    -  <li>green</li>
    -  <li>yellow</li>
    -</ul> -
    - -

    Here is a more complex example, using a multi-dimensional array:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'colors' => array(
    -                                'red',
    -                                'blue',
    -                                'green'
    -                            ),
    -            'shapes' => array(
    -                                'round',
    -                                'square',
    -                                'circles' => array(
    -                                                    'ellipse',
    -                                                    'oval',
    -                                                    'sphere'
    -                                                    )
    -                            ),
    -            'moods'    => array(
    -                                'happy',
    -                                'upset' => array(
    -                                                    'defeated' => array(
    -                                                                        'dejected',
    -                                                                        'disheartened',
    -                                                                        'depressed'
    -                                                                        ),
    -                                                    'annoyed',
    -                                                    'cross',
    -                                                    'angry'
    -                                                )
    -                            )
    -            );
    -
    -
    -echo ul($list);
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>colors
    -    <ul>
    -      <li>red</li>
    -      <li>blue</li>
    -      <li>green</li>
    -    </ul>
    -  </li>
    -  <li>shapes
    -    <ul>
    -      <li>round</li>
    -      <li>suare</li>
    -      <li>circles
    -        <ul>
    -          <li>elipse</li>
    -          <li>oval</li>
    -          <li>sphere</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -  <li>moods
    -    <ul>
    -      <li>happy</li>
    -      <li>upset
    -        <ul>
    -          <li>defeated
    -            <ul>
    -              <li>dejected</li>
    -              <li>disheartened</li>
    -              <li>depressed</li>
    -            </ul>
    -          </li>
    -          <li>annoyed</li>
    -          <li>cross</li>
    -          <li>angry</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -</ul> -
    - - - -

    meta()

    - -

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    - - -echo meta('description', 'My Great site');
    -// Generates: <meta name="description" content="My Great Site" />
    -

    - -echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    -// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    - -

    - -echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    -// Generates: <meta name="robots" content="no-cache" />
    - -

    - -$meta = array(
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'description', 'content' => 'My Great Site'),
    -        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    -    );
    -
    -echo meta($meta); -
    -// Generates:
    -// <meta name="robots" content="no-cache" />
    -// <meta name="description" content="My Great Site" />
    -// <meta name="keywords" content="love, passion, intrigue, deception" />
    -// <meta name="robots" content="no-cache" />
    -// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> -
    - - -

    doctype()

    - -

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    - - -echo docytype();
    -// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    -
    -echo doctype('html4-trans');
    -// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -
    - -

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DoctypeOptionResult
    XHTML 1.1doctype('xhtml11')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    XHTML 1.0 Strictdoctype('xhtml1-strict')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    XHTML 1.0 Transitionaldoctype('xhtml1-trans')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 Framesetdoctype('xhtml1-frame')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    HTML 5doctype('html5')<!DOCTYPE html>
    HTML 4 Strictdoctype('html4-strict')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    HTML 4 Transitionaldoctype('html4-trans')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTML 4 Framesetdoctype('html4-frame')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    - - - - -
    - - - - - - + + + + + +HTML Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    HTML Helper

    + +

    The HTML Helper file contains functions that assist in working with HTML.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('html'); + +

    The following functions are available:

    + +

    br()

    +

    Generates line break tags (<br />) based on the number you submit. Example:

    +echo br(3); +

    The above would produce: <br /><br /><br />

    + +

    heading()

    +

    Lets you create HTML <h1> tags. The first parameter will contain the data, the +second the size of the heading. Example:

    +echo heading('Welcome!', 3); +

    The above would produce: <h3>Welcome!</h3>

    +

    img()

    +

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    +echo img('images/picture.jpg');
    +// gives <img src="http://site.com/images/picture.jpg" />
    +

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    +

    echo img('images/picture.jpg', TRUE);
    +// gives <img src="http://site.com/index.php/images/picture.jpg" />

    +

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    +

    $image_properties = array(
    +           'src' => 'images/picture.jpg',
    +           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    +           'class' => 'post_images',
    +           'width' => '200',
    +           'height' => '200',
    +           'title' => 'That was quite a night',
    +           'rel' => 'lightbox',
    + );
    +
    + img($image_properties);
    + // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    +

    link_tag()

    +

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. +echo link_tag('css/mystyles.css');
    +// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    +

    Further examples:

    + + + echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    + // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> +
    +
    + echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    + // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    +

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    +

    + $link = array(
    +           'href' => 'css/printer.css',
    +           'rel' => 'stylesheet',
    +           'type' => 'text/css',
    +           'media' => 'print'
    + );
    +
    + echo link_tag($link);
    + // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    + +

    nbs()

    +

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    +echo nbs(3); +

    The above would produce: &nbsp;&nbsp;&nbsp;

    + +

    ol()  and  ul()

    + +

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'red',
    +            'blue',
    +            'green',
    +            'yellow'
    +            );
    +
    +$attributes = array(
    +                    'class' => 'boldlist',
    +                    'id'    => 'mylist'
    +                    );
    +
    +echo ul($list, $attributes);
    +
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>red</li>
    +  <li>blue</li>
    +  <li>green</li>
    +  <li>yellow</li>
    +</ul> +
    + +

    Here is a more complex example, using a multi-dimensional array:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'colors' => array(
    +                                'red',
    +                                'blue',
    +                                'green'
    +                            ),
    +            'shapes' => array(
    +                                'round',
    +                                'square',
    +                                'circles' => array(
    +                                                    'ellipse',
    +                                                    'oval',
    +                                                    'sphere'
    +                                                    )
    +                            ),
    +            'moods'    => array(
    +                                'happy',
    +                                'upset' => array(
    +                                                    'defeated' => array(
    +                                                                        'dejected',
    +                                                                        'disheartened',
    +                                                                        'depressed'
    +                                                                        ),
    +                                                    'annoyed',
    +                                                    'cross',
    +                                                    'angry'
    +                                                )
    +                            )
    +            );
    +
    +
    +echo ul($list);
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>colors
    +    <ul>
    +      <li>red</li>
    +      <li>blue</li>
    +      <li>green</li>
    +    </ul>
    +  </li>
    +  <li>shapes
    +    <ul>
    +      <li>round</li>
    +      <li>suare</li>
    +      <li>circles
    +        <ul>
    +          <li>elipse</li>
    +          <li>oval</li>
    +          <li>sphere</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +  <li>moods
    +    <ul>
    +      <li>happy</li>
    +      <li>upset
    +        <ul>
    +          <li>defeated
    +            <ul>
    +              <li>dejected</li>
    +              <li>disheartened</li>
    +              <li>depressed</li>
    +            </ul>
    +          </li>
    +          <li>annoyed</li>
    +          <li>cross</li>
    +          <li>angry</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +</ul> +
    + + + +

    meta()

    + +

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    + + +echo meta('description', 'My Great site');
    +// Generates: <meta name="description" content="My Great Site" />
    +

    + +echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    +// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    + +

    + +echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    +// Generates: <meta name="robots" content="no-cache" />
    + +

    + +$meta = array(
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'description', 'content' => 'My Great Site'),
    +        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    +    );
    +
    +echo meta($meta); +
    +// Generates:
    +// <meta name="robots" content="no-cache" />
    +// <meta name="description" content="My Great Site" />
    +// <meta name="keywords" content="love, passion, intrigue, deception" />
    +// <meta name="robots" content="no-cache" />
    +// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +
    + + +

    doctype()

    + +

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    + + +echo docytype();
    +// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    +
    +echo doctype('html4-trans');
    +// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +
    + +

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DoctypeOptionResult
    XHTML 1.1doctype('xhtml11')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    XHTML 1.0 Strictdoctype('xhtml1-strict')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    XHTML 1.0 Transitionaldoctype('xhtml1-trans')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 Framesetdoctype('xhtml1-frame')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    HTML 5doctype('html5')<!DOCTYPE html>
    HTML 4 Strictdoctype('html4-strict')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    HTML 4 Transitionaldoctype('html4-trans')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTML 4 Framesetdoctype('html4-frame')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 9c60759d..cad1ef49 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -1,98 +1,98 @@ - - - - - -Language Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Language Helper

    - -

    The Language Helper file contains functions that assist in working with language files.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('language'); - -

    The following functions are available:

    - -

    lang('language line', 'element id')

    - -

    This function returns a line of text from a loaded language file with simplified syntax - that may be more desirable for view files than calling $this->lang->line(). - The optional second parameter will also output a form label for you. Example:

    - -echo lang('language_key', 'form_item_id');
    -// becomes <label for="form_item_id">language_key</label>
    - - -
    - - - - - - + + + + + +Language Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Language Helper

    + +

    The Language Helper file contains functions that assist in working with language files.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('language'); + +

    The following functions are available:

    + +

    lang('language line', 'element id')

    + +

    This function returns a line of text from a loaded language file with simplified syntax + that may be more desirable for view files than calling $this->lang->line(). + The optional second parameter will also output a form label for you. Example:

    + +echo lang('language_key', 'form_item_id');
    +// becomes <label for="form_item_id">language_key</label>
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt index f29e5a77..081eecef 100644 --- a/user_guide/nav/hacks.txt +++ b/user_guide/nav/hacks.txt @@ -1,9 +1,9 @@ -I did the following hack in moo.fx.js: - -At line 79 in the toggle: function() function, I added: - -document.getElementById('nav').style.display = 'block'; - - - +I did the following hack in moo.fx.js: + +At line 79 in the toggle: function() function, I added: + +document.getElementById('nav').style.display = 'block'; + + + -- Rick Ellis \ No newline at end of file diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js index e6c36227..d294fd7f 100755 --- a/user_guide/nav/prototype.lite.js +++ b/user_guide/nav/prototype.lite.js @@ -1,127 +1,127 @@ -/* Prototype JavaScript framework - * (c) 2005 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * - * For details, see the Prototype web site: http://prototype.conio.net/ - * -/*--------------------------------------------------------------------------*/ - - -//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -} - -Object.extend = function(destination, source) { - for (property in source) { - destination[property] = source[property]; - } - return destination; -} - -Function.prototype.bind = function(object) { - var __method = this; - return function() { - return __method.apply(object, arguments); - } -} - -function $() { - var elements = new Array(); - - for (var i = 0; i < arguments.length; i++) { - var element = arguments[i]; - if (typeof element == 'string') - element = document.getElementById(element); - - if (arguments.length == 1) - return element; - - elements.push(element); - } - - return elements; -} - -//------------------------- - -document.getElementsByClassName = function(className) { - var children = document.getElementsByTagName('*') || document.all; - var elements = new Array(); - - for (var i = 0; i < children.length; i++) { - var child = children[i]; - var classNames = child.className.split(' '); - for (var j = 0; j < classNames.length; j++) { - if (classNames[j] == className) { - elements.push(child); - break; - } - } - } - - return elements; -} - -//------------------------- - -if (!window.Element) { - var Element = new Object(); -} - -Object.extend(Element, { - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - }, - - hasClassName: function(element, className) { - element = $(element); - if (!element) - return; - var a = element.className.split(' '); - for (var i = 0; i < a.length; i++) { - if (a[i] == className) - return true; - } - return false; - }, - - addClassName: function(element, className) { - element = $(element); - Element.removeClassName(element, className); - element.className += ' ' + className; - }, - - removeClassName: function(element, className) { - element = $(element); - if (!element) - return; - var newClassName = ''; - var a = element.className.split(' '); - for (var i = 0; i < a.length; i++) { - if (a[i] != className) { - if (i > 0) - newClassName += ' '; - newClassName += a[i]; - } - } - element.className = newClassName; - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - Element.remove(node); - } - } +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + + +//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +} + +Function.prototype.bind = function(object) { + var __method = this; + return function() { + return __method.apply(object, arguments); + } +} + +function $() { + var elements = new Array(); + + for (var i = 0; i < arguments.length; i++) { + var element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + + if (arguments.length == 1) + return element; + + elements.push(element); + } + + return elements; +} + +//------------------------- + +document.getElementsByClassName = function(className) { + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + var classNames = child.className.split(' '); + for (var j = 0; j < classNames.length; j++) { + if (classNames[j] == className) { + elements.push(child); + break; + } + } + } + + return elements; +} + +//------------------------- + +if (!window.Element) { + var Element = new Object(); +} + +Object.extend(Element, { + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + hasClassName: function(element, className) { + element = $(element); + if (!element) + return; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] == className) + return true; + } + return false; + }, + + addClassName: function(element, className) { + element = $(element); + Element.removeClassName(element, className); + element.className += ' ' + className; + }, + + removeClassName: function(element, className) { + element = $(element); + if (!element) + return; + var newClassName = ''; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] != className) { + if (i > 0) + newClassName += ' '; + newClassName += a[i]; + } + } + element.className = newClassName; + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + } }); \ No newline at end of file From 0b6a5e9bc646f374a2f6f8aa1582f195cb7032e0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 13 Nov 2008 00:54:48 +0000 Subject: [PATCH 1554/2544] Added prep_q_encoding() and Q encoding of From: and Subject: headers --- system/libraries/Email.php | 99 +++++++++++++++++++++++++++++++++----- user_guide/changelog.html | 1 + 2 files changed, 87 insertions(+), 13 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index e414d84e..a0ede724 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -182,9 +182,19 @@ function from($from, $name = '') $this->validate_email($this->_str_to_array($from)); } - if ($name != '' && strncmp($name, '"', 1) != 0) + // prepare the display name + if ($name != '') { - $name = '"'.$name.'"'; + // only use Q encoding if there are characters that would require it + if ( ! preg_match('/[\200-\377]/', $name)) + { + // add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes + $name = '"'.addcslashes($name, '\0..\37\177"\\').'"'; + } + else + { + $name = $this->_prep_q_encoding($name, TRUE); + } } $this->_set_header('From', $name.' <'.$from.'>'); @@ -336,17 +346,8 @@ function bcc($bcc, $limit = '') */ function subject($subject) { - if (strpos($subject, "\r") !== FALSE OR strpos($subject, "\n") !== FALSE) - { - $subject = str_replace(array("\r\n", "\r", "\n"), '', $subject); - } - - if (strpos($subject, "\t")) - { - $subject = str_replace("\t", ' ', $subject); - } - - $this->_set_header('Subject', trim($subject)); + $subject = $this->_prep_q_encoding($subject); + $this->_set_header('Subject', $subject); } // -------------------------------------------------------------------- @@ -1242,7 +1243,79 @@ function _prep_quoted_printable($str, $charlim = '') } // -------------------------------------------------------------------- + + /** + * Prep Q Encoding + * + * Performs "Q Encoding" on a string for use in email headers. It's related + * but not identical to quoted-printable, so it has its own method + * + * @access public + * @param str + * @param bool // set to TRUE for processing From: headers + * @return str + */ + function _prep_q_encoding($str, $from = FALSE) + { + $str = str_replace(array("\r", "\n"), array('', ''), $str); + + // Line length must not exceed 76 characters, so we adjust for + // a space, 7 extra characters =??Q??=, and the charset that we will add to each line + $limit = 75 - 7 - strlen($this->charset); + + // these special characters must be converted too + $convert = array('_', '=', '?'); + if ($from === TRUE) + { + $convert[] = ','; + $convert[] = ';'; + } + + $output = ''; + $temp = ''; + + for ($i = 0, $length = strlen($str); $i < $length; $i++) + { + // Grab the next character + $char = substr($str, $i, 1); + $ascii = ord($char); + + // convert ALL non-printable ASCII characters and our specials + if ($ascii < 32 OR $ascii > 126 OR in_array($char, $convert)) + { + $char = '='.dechex($ascii); + } + + // handle regular spaces a bit more compactly than =20 + if ($ascii == 32) + { + $char = '_'; + } + + // If we're at the character limit, add the line to the output, + // reset our temp variable, and keep on chuggin' + if ((strlen($temp) + strlen($char)) >= $limit) + { + $output .= $temp.$this->crlf; + $temp = ''; + } + + // Add the character to our temporary line + $temp .= $char; + } + + $str = $output.$temp; + + // wrap each line with the shebang, charset, and transfer encoding + // the preceding space on successive lines is required for header "folding" + $str = trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $str)); + + return $str; + } + + // -------------------------------------------------------------------- + /** * Send Email * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 89ec0ac5..cdadea79 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,6 +85,7 @@

    Bug fixes for 1.7.1

  • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
  • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
  • Changed a few docblock comments to reflect actual return values.
  • +
  • Fixed a bug with high ascii characters in subject and from email headers.
  • From 4f488dfe35e202d1e1949f03e4bcc52ec25a3941 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 13 Nov 2008 01:05:07 +0000 Subject: [PATCH 1555/2544] odcc to odbc --- user_guide/database/configuration.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 26bbe75e..f2da5808 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -121,7 +121,7 @@

    Explanation of Values:

  • 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, postgres, odcc, etc. Must be specified in lower case.
  • +
  • dbdriver - The database type. ie: mysql, postgres, odbc, etc. Must be specified in lower case.
  • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
  • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
  • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
  • From dd9f932556d3cd45a1d06cc478f40d06b7649a69 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 13 Nov 2008 01:06:57 +0000 Subject: [PATCH 1556/2544] "the" to "that" in a code comment --- system/libraries/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 95c02085..b6e10a3a 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -18,7 +18,7 @@ /** * CodeIgniter Application Controller Class * - * This class object is the super class the every library in + * This class object is the super class that every library in * CodeIgniter will be assigned to. * * @package CodeIgniter From 2067d1a727e7eb5e5ffb40e967f3d1fc4c8a41b2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 13 Nov 2008 22:59:24 +0000 Subject: [PATCH 1557/2544] Changing EOL style to LF --- index.php | 234 +- license.txt | 104 +- system/application/config/autoload.php | 230 +- system/application/config/config.php | 630 +-- system/application/config/constants.php | 80 +- system/application/config/database.php | 108 +- system/application/config/doctypes.php | 28 +- system/application/config/hooks.php | 30 +- system/application/config/index.html | 18 +- system/application/config/mimes.php | 208 +- system/application/config/routes.php | 94 +- system/application/config/smileys.php | 130 +- system/application/config/user_agents.php | 348 +- system/application/controllers/index.html | 18 +- system/application/controllers/welcome.php | 32 +- system/application/errors/error_404.php | 68 +- system/application/errors/error_db.php | 66 +- system/application/errors/error_general.php | 66 +- system/application/errors/error_php.php | 18 +- system/application/errors/index.html | 18 +- system/application/helpers/index.html | 18 +- system/application/hooks/index.html | 18 +- system/application/index.html | 18 +- .../application/language/english/index.html | 18 +- system/application/libraries/index.html | 18 +- system/application/models/index.html | 18 +- system/application/views/index.html | 18 +- system/application/views/welcome_message.php | 122 +- system/cache/index.html | 18 +- system/codeigniter/Base4.php | 136 +- system/codeigniter/Base5.php | 110 +- system/codeigniter/CodeIgniter.php | 550 +-- system/codeigniter/Common.php | 612 +-- system/codeigniter/Compat.php | 184 +- system/codeigniter/index.html | 18 +- system/database/DB.php | 290 +- system/database/DB_active_rec.php | 3626 +++++++-------- system/database/DB_cache.php | 388 +- system/database/DB_driver.php | 2636 +++++------ system/database/DB_forge.php | 708 +-- system/database/DB_result.php | 682 +-- system/database/DB_utility.php | 776 ++-- system/database/drivers/index.html | 18 +- system/database/drivers/mssql/index.html | 18 +- .../database/drivers/mssql/mssql_driver.php | 1242 ++--- system/database/drivers/mssql/mssql_forge.php | 494 +- .../database/drivers/mssql/mssql_result.php | 336 +- .../database/drivers/mssql/mssql_utility.php | 244 +- system/database/drivers/mysql/index.html | 18 +- .../database/drivers/mysql/mysql_driver.php | 1266 ++--- system/database/drivers/mysql/mysql_forge.php | 506 +- .../database/drivers/mysql/mysql_result.php | 336 +- .../database/drivers/mysql/mysql_utility.php | 488 +- system/database/drivers/mysqli/index.html | 18 +- .../database/drivers/mysqli/mysqli_driver.php | 1248 ++--- .../database/drivers/mysqli/mysqli_forge.php | 506 +- .../database/drivers/mysqli/mysqli_result.php | 336 +- .../drivers/mysqli/mysqli_utility.php | 244 +- system/database/drivers/oci8/index.html | 18 +- system/database/drivers/oci8/oci8_driver.php | 1472 +++--- system/database/drivers/oci8/oci8_forge.php | 494 +- system/database/drivers/oci8/oci8_result.php | 496 +- system/database/drivers/oci8/oci8_utility.php | 242 +- system/database/drivers/odbc/index.html | 18 +- system/database/drivers/odbc/odbc_driver.php | 1186 ++--- system/database/drivers/odbc/odbc_forge.php | 530 +-- system/database/drivers/odbc/odbc_result.php | 454 +- system/database/drivers/odbc/odbc_utility.php | 294 +- system/database/drivers/postgre/index.html | 18 +- .../drivers/postgre/postgre_driver.php | 1270 +++--- .../drivers/postgre/postgre_forge.php | 494 +- .../drivers/postgre/postgre_result.php | 336 +- .../drivers/postgre/postgre_utility.php | 246 +- system/database/drivers/sqlite/index.html | 18 +- .../database/drivers/sqlite/sqlite_driver.php | 1222 ++--- .../database/drivers/sqlite/sqlite_forge.php | 528 +-- .../database/drivers/sqlite/sqlite_result.php | 356 +- .../drivers/sqlite/sqlite_utility.php | 280 +- system/database/index.html | 18 +- system/fonts/index.html | 18 +- system/helpers/array_helper.php | 154 +- system/helpers/compatibility_helper.php | 994 ++-- system/helpers/cookie_helper.php | 270 +- system/helpers/date_helper.php | 1220 ++--- system/helpers/directory_helper.php | 158 +- system/helpers/download_helper.php | 198 +- system/helpers/email_helper.php | 122 +- system/helpers/file_helper.php | 928 ++-- system/helpers/form_helper.php | 1924 ++++---- system/helpers/html_helper.php | 830 ++-- system/helpers/index.html | 18 +- system/helpers/inflector_helper.php | 336 +- system/helpers/language_helper.php | 114 +- system/helpers/number_helper.php | 148 +- system/helpers/path_helper.php | 142 +- system/helpers/security_helper.php | 250 +- system/helpers/smiley_helper.php | 348 +- system/helpers/string_helper.php | 544 +-- system/helpers/text_helper.php | 884 ++-- system/helpers/typography_helper.php | 140 +- system/helpers/url_helper.php | 1162 ++--- system/helpers/xml_helper.php | 122 +- system/language/english/calendar_lang.php | 96 +- system/language/english/date_lang.php | 118 +- system/language/english/db_lang.php | 54 +- system/language/english/email_lang.php | 40 +- .../language/english/form_validation_lang.php | 46 +- system/language/english/ftp_lang.php | 28 +- system/language/english/imglib_lang.php | 40 +- system/language/english/index.html | 18 +- system/language/english/number_lang.php | 18 +- system/language/english/profiler_lang.php | 36 +- system/language/english/scaffolding_lang.php | 32 +- system/language/english/unit_test_lang.php | 46 +- system/language/english/upload_lang.php | 38 +- system/language/english/validation_lang.php | 46 +- system/language/index.html | 18 +- system/libraries/Benchmark.php | 224 +- system/libraries/Calendar.php | 952 ++-- system/libraries/Config.php | 486 +- system/libraries/Controller.php | 252 +- system/libraries/Email.php | 4054 ++++++++--------- system/libraries/Encrypt.php | 966 ++-- system/libraries/Exceptions.php | 342 +- system/libraries/Form_validation.php | 2572 +++++------ system/libraries/Ftp.php | 1234 ++--- system/libraries/Hooks.php | 450 +- system/libraries/Image_lib.php | 3094 ++++++------- system/libraries/Input.php | 2116 ++++----- system/libraries/Language.php | 244 +- system/libraries/Loader.php | 2174 ++++----- system/libraries/Log.php | 232 +- system/libraries/Model.php | 164 +- system/libraries/Output.php | 954 ++-- system/libraries/Pagination.php | 486 +- system/libraries/Parser.php | 344 +- system/libraries/Profiler.php | 782 ++-- system/libraries/Router.php | 768 ++-- system/libraries/Session.php | 1514 +++--- system/libraries/Sha1.php | 500 +- system/libraries/Table.php | 878 ++-- system/libraries/Trackback.php | 1098 ++--- system/libraries/Typography.php | 768 ++-- system/libraries/URI.php | 1168 ++--- system/libraries/Unit_test.php | 692 +-- system/libraries/Upload.php | 1860 ++++---- system/libraries/User_agent.php | 1002 ++-- system/libraries/Validation.php | 1748 +++---- system/libraries/Xmlrpc.php | 2840 ++++++------ system/libraries/Xmlrpcs.php | 1070 ++--- system/libraries/Zip.php | 716 +-- system/libraries/index.html | 18 +- system/logs/index.html | 18 +- system/plugins/captcha_pi.php | 710 +-- system/plugins/index.html | 18 +- system/plugins/js_calendar_pi.php | 1256 ++--- system/scaffolding/Scaffolding.php | 580 +-- system/scaffolding/images/index.html | 18 +- system/scaffolding/index.html | 18 +- system/scaffolding/views/add.php | 64 +- system/scaffolding/views/delete.php | 18 +- system/scaffolding/views/edit.php | 64 +- system/scaffolding/views/footer.php | 18 +- system/scaffolding/views/header.php | 56 +- system/scaffolding/views/index.html | 18 +- system/scaffolding/views/no_data.php | 14 +- system/scaffolding/views/stylesheet.css | 286 +- system/scaffolding/views/view.php | 52 +- user_guide/changelog.html | 1914 ++++---- user_guide/database/active_record.html | 1512 +++--- user_guide/database/caching.html | 438 +- user_guide/database/call_function.html | 234 +- user_guide/database/configuration.html | 312 +- user_guide/database/connecting.html | 360 +- user_guide/database/examples.html | 432 +- user_guide/database/fields.html | 324 +- user_guide/database/forge.html | 466 +- user_guide/database/helpers.html | 300 +- user_guide/database/index.html | 196 +- user_guide/database/queries.html | 290 +- user_guide/database/results.html | 474 +- user_guide/database/table_data.html | 224 +- user_guide/database/transactions.html | 398 +- user_guide/database/utilities.html | 588 +-- user_guide/doc_style/index.html | 170 +- user_guide/doc_style/template.html | 254 +- user_guide/general/alternative_php.html | 292 +- user_guide/general/ancillary_classes.html | 232 +- user_guide/general/autoloader.html | 200 +- user_guide/general/caching.html | 228 +- user_guide/general/common_functions.html | 178 +- user_guide/general/controllers.html | 768 ++-- user_guide/general/core_classes.html | 368 +- user_guide/general/creating_libraries.html | 594 +-- user_guide/general/credits.html | 170 +- user_guide/general/errors.html | 272 +- user_guide/general/helpers.html | 368 +- user_guide/general/hooks.html | 332 +- user_guide/general/libraries.html | 186 +- user_guide/general/managing_apps.html | 264 +- user_guide/general/models.html | 500 +- user_guide/general/plugins.html | 252 +- user_guide/general/profiling.html | 206 +- user_guide/general/quick_reference.html | 152 +- user_guide/general/requirements.html | 162 +- user_guide/general/reserved_names.html | 308 +- user_guide/general/routing.html | 350 +- user_guide/general/scaffolding.html | 290 +- user_guide/general/security.html | 304 +- user_guide/general/styleguide.html | 1296 +++--- user_guide/general/urls.html | 300 +- user_guide/general/views.html | 546 +-- user_guide/helpers/array_helper.html | 236 +- user_guide/helpers/compatibility_helper.html | 234 +- user_guide/helpers/cookie_helper.html | 294 +- user_guide/helpers/date_helper.html | 814 ++-- user_guide/helpers/directory_helper.html | 278 +- user_guide/helpers/download_helper.html | 222 +- user_guide/helpers/email_helper.html | 202 +- user_guide/helpers/file_helper.html | 354 +- user_guide/helpers/form_helper.html | 948 ++-- user_guide/helpers/html_helper.html | 734 +-- user_guide/helpers/inflector_helper.html | 300 +- user_guide/helpers/language_helper.html | 194 +- user_guide/helpers/number_helper.html | 212 +- user_guide/helpers/path_helper.html | 210 +- user_guide/helpers/security_helper.html | 248 +- user_guide/helpers/smiley_helper.html | 406 +- user_guide/helpers/string_helper.html | 350 +- user_guide/helpers/text_helper.html | 382 +- user_guide/helpers/typography_helper.html | 222 +- user_guide/helpers/url_helper.html | 560 +-- user_guide/helpers/xml_helper.html | 208 +- user_guide/index.html | 196 +- user_guide/installation/downloads.html | 204 +- user_guide/installation/index.html | 192 +- user_guide/installation/troubleshooting.html | 178 +- user_guide/installation/upgrade_120.html | 182 +- user_guide/installation/upgrade_130.html | 404 +- user_guide/installation/upgrade_131.html | 202 +- user_guide/installation/upgrade_132.html | 198 +- user_guide/installation/upgrade_133.html | 222 +- user_guide/installation/upgrade_140.html | 288 +- user_guide/installation/upgrade_141.html | 294 +- user_guide/installation/upgrade_150.html | 354 +- user_guide/installation/upgrade_152.html | 220 +- user_guide/installation/upgrade_153.html | 198 +- user_guide/installation/upgrade_154.html | 230 +- user_guide/installation/upgrade_160.html | 248 +- user_guide/installation/upgrade_161.html | 194 +- user_guide/installation/upgrade_162.html | 210 +- user_guide/installation/upgrade_163.html | 196 +- user_guide/installation/upgrade_170.html | 240 +- user_guide/installation/upgrade_b11.html | 286 +- user_guide/installation/upgrading.html | 196 +- user_guide/libraries/benchmark.html | 392 +- user_guide/libraries/calendar.html | 496 +- user_guide/libraries/config.html | 360 +- user_guide/libraries/email.html | 612 +-- user_guide/libraries/encryption.html | 362 +- user_guide/libraries/file_uploading.html | 874 ++-- user_guide/libraries/form_validation.html | 2440 +++++----- user_guide/libraries/ftp.html | 604 +-- user_guide/libraries/image_lib.html | 1330 +++--- user_guide/libraries/input.html | 460 +- user_guide/libraries/language.html | 272 +- user_guide/libraries/loader.html | 426 +- user_guide/libraries/output.html | 288 +- user_guide/libraries/pagination.html | 434 +- user_guide/libraries/parser.html | 414 +- user_guide/libraries/sessions.html | 620 +-- user_guide/libraries/table.html | 582 +-- user_guide/libraries/trackback.html | 490 +- user_guide/libraries/typography.html | 318 +- user_guide/libraries/unit_testing.html | 408 +- user_guide/libraries/uri.html | 502 +- user_guide/libraries/user_agent.html | 400 +- user_guide/libraries/validation.html | 1470 +++--- user_guide/libraries/xmlrpc.html | 1032 ++--- user_guide/libraries/zip.html | 554 +-- user_guide/license.html | 212 +- user_guide/nav/hacks.txt | 16 +- user_guide/nav/moo.fx.js | 236 +- user_guide/nav/moo.fx.pack.js | 480 +- user_guide/nav/nav.js | 272 +- user_guide/nav/prototype.lite.js | 252 +- user_guide/nav/user_guide_menu.js | 6 +- user_guide/overview/appflow.html | 188 +- user_guide/overview/at_a_glance.html | 342 +- user_guide/overview/features.html | 238 +- user_guide/overview/getting_started.html | 182 +- user_guide/overview/goals.html | 194 +- user_guide/overview/index.html | 166 +- user_guide/overview/mvc.html | 198 +- user_guide/toc.html | 412 +- user_guide/userguide.css | 810 ++-- 296 files changed, 67787 insertions(+), 67787 deletions(-) diff --git a/index.php b/index.php index de5fdef1..39aeda5c 100644 --- a/index.php +++ b/index.php @@ -1,118 +1,118 @@ - '', - 'xhtml1-strict' => '', - 'xhtml1-trans' => '', - 'xhtml1-frame' => '', - 'html5' => '', - 'html4-strict' => '', - 'html4-trans' => '', - 'html4-frame' => '' - ); - -/* End of file doctypes.php */ + '', + 'xhtml1-strict' => '', + 'xhtml1-trans' => '', + 'xhtml1-frame' => '', + 'html5' => '', + 'html4-strict' => '', + 'html4-trans' => '', + 'html4-frame' => '' + ); + +/* End of file doctypes.php */ /* Location: application/config/doctypes.php */ \ No newline at end of file diff --git a/system/application/config/hooks.php b/system/application/config/hooks.php index b94edb97..5e98a9b4 100644 --- a/system/application/config/hooks.php +++ b/system/application/config/hooks.php @@ -1,16 +1,16 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/config/mimes.php b/system/application/config/mimes.php index 51e444ee..10acfad9 100644 --- a/system/application/config/mimes.php +++ b/system/application/config/mimes.php @@ -1,105 +1,105 @@ - 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), - 'bin' => 'application/macbinary', - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'class' => 'application/octet-stream', - 'psd' => 'application/x-photoshop', - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => array('application/pdf', 'application/x-download'), - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => array('application/excel', 'application/vnd.ms-excel'), - 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), - 'wbxml' => 'application/wbxml', - 'wmlc' => 'application/wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'js' => 'application/x-javascript', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'xhtml' => 'application/xhtml+xml', - 'xht' => 'application/xhtml+xml', - 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => array('audio/mpeg', 'audio/mpg'), - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', - 'wav' => 'audio/x-wav', - 'bmp' => 'image/bmp', - 'gif' => 'image/gif', - 'jpeg' => array('image/jpeg', 'image/pjpeg'), - 'jpg' => array('image/jpeg', 'image/pjpeg'), - 'jpe' => array('image/jpeg', 'image/pjpeg'), - 'png' => array('image/png', 'image/x-png'), - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => array('text/plain', 'text/x-log'), - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'word' => array('application/msword', 'application/octet-stream'), - 'xl' => 'application/excel', - 'eml' => 'message/rfc822' - ); - - -/* End of file mimes.php */ + 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'class' => 'application/octet-stream', + 'psd' => 'application/x-photoshop', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => array('application/pdf', 'application/x-download'), + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => array('application/excel', 'application/vnd.ms-excel'), + 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => array('audio/mpeg', 'audio/mpg'), + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => array('text/plain', 'text/x-log'), + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'word' => array('application/msword', 'application/octet-stream'), + 'xl' => 'application/excel', + 'eml' => 'message/rfc822' + ); + + +/* End of file mimes.php */ /* Location: ./system/application/config/mimes.php */ \ No newline at end of file diff --git a/system/application/config/routes.php b/system/application/config/routes.php index c9592483..c2f1e99d 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -1,48 +1,48 @@ - array('grin.gif', '19', '19', 'grin'), - ':lol:' => array('lol.gif', '19', '19', 'LOL'), - ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), - ':)' => array('smile.gif', '19', '19', 'smile'), - ';-)' => array('wink.gif', '19', '19', 'wink'), - ';)' => array('wink.gif', '19', '19', 'wink'), - ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), - ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), - ':-S' => array('confused.gif', '19', '19', 'confused'), - ':wow:' => array('surprise.gif', '19', '19', 'surprised'), - ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), - ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), - '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), - ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), - ':P' => array('raspberry.gif', '19', '19', 'raspberry'), - ':blank:' => array('blank.gif', '19', '19', 'blank stare'), - ':long:' => array('longface.gif', '19', '19', 'long face'), - ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), - ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), - ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), - '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), - ':down:' => array('downer.gif', '19', '19', 'downer'), - ':red:' => array('embarrassed.gif', '19', '19', 'red face'), - ':sick:' => array('sick.gif', '19', '19', 'sick'), - ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), - ':-/' => array('hmm.gif', '19', '19', 'hmmm'), - '>:(' => array('mad.gif', '19', '19', 'mad'), - ':mad:' => array('mad.gif', '19', '19', 'mad'), - '>:-(' => array('angry.gif', '19', '19', 'angry'), - ':angry:' => array('angry.gif', '19', '19', 'angry'), - ':zip:' => array('zip.gif', '19', '19', 'zipper'), - ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), - ':ahhh:' => array('shock.gif', '19', '19', 'shock'), - ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), - ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), - ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), - ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), - ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), - ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), - ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), - ':snake:' => array('snake.gif', '19', '19', 'snake'), - ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), - ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item - - ); - -/* End of file smileys.php */ + array('grin.gif', '19', '19', 'grin'), + ':lol:' => array('lol.gif', '19', '19', 'LOL'), + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), + ':)' => array('smile.gif', '19', '19', 'smile'), + ';-)' => array('wink.gif', '19', '19', 'wink'), + ';)' => array('wink.gif', '19', '19', 'wink'), + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), + ':-S' => array('confused.gif', '19', '19', 'confused'), + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), + ':long:' => array('longface.gif', '19', '19', 'long face'), + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), + ':down:' => array('downer.gif', '19', '19', 'downer'), + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), + ':sick:' => array('sick.gif', '19', '19', 'sick'), + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), + '>:(' => array('mad.gif', '19', '19', 'mad'), + ':mad:' => array('mad.gif', '19', '19', 'mad'), + '>:-(' => array('angry.gif', '19', '19', 'angry'), + ':angry:' => array('angry.gif', '19', '19', 'angry'), + ':zip:' => array('zip.gif', '19', '19', 'zipper'), + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), + ':snake:' => array('snake.gif', '19', '19', 'snake'), + ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), + ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item + + ); + +/* End of file smileys.php */ /* Location: ./system/application/config/smileys.php */ \ No newline at end of file diff --git a/system/application/config/user_agents.php b/system/application/config/user_agents.php index eabd762f..c01b2767 100644 --- a/system/application/config/user_agents.php +++ b/system/application/config/user_agents.php @@ -1,175 +1,175 @@ - 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - '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( - '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', - 'Mozilla' => 'Mozilla', - 'Safari' => 'Safari', - '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' - - // Phones and Manufacturers - 'motorola' => "Motorola", - 'nokia' => "Nokia", - 'palm' => "Palm", - 'iphone' => "Apple iPhone", - '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", - - // Operating Systems - '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", - - // 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" - ); - -// 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' - ); - -/* End of file user_agents.php */ + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + '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( + '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', + 'Mozilla' => 'Mozilla', + 'Safari' => 'Safari', + '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' + + // Phones and Manufacturers + 'motorola' => "Motorola", + 'nokia' => "Nokia", + 'palm' => "Palm", + 'iphone' => "Apple iPhone", + '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", + + // Operating Systems + '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", + + // 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" + ); + +// 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' + ); + +/* End of file user_agents.php */ /* Location: ./system/application/config/user_agents.php */ \ No newline at end of file diff --git a/system/application/controllers/index.html b/system/application/controllers/index.html index 065d2da5..c942a79c 100644 --- a/system/application/controllers/index.html +++ b/system/application/controllers/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/controllers/welcome.php b/system/application/controllers/welcome.php index ec16000d..20d48855 100644 --- a/system/application/controllers/welcome.php +++ b/system/application/controllers/welcome.php @@ -1,17 +1,17 @@ -load->view('welcome_message'); - } -} - -/* End of file welcome.php */ +load->view('welcome_message'); + } +} + +/* End of file welcome.php */ /* Location: ./system/application/controllers/welcome.php */ \ No newline at end of file diff --git a/system/application/errors/error_404.php b/system/application/errors/error_404.php index cad73759..bfe9444b 100644 --- a/system/application/errors/error_404.php +++ b/system/application/errors/error_404.php @@ -1,35 +1,35 @@ - - - -404 Page Not Found - - - -
    -

    - -
    - + + + +404 Page Not Found + + + +
    +

    + +
    + \ No newline at end of file diff --git a/system/application/errors/error_db.php b/system/application/errors/error_db.php index 71a4b98d..1ce52dfc 100644 --- a/system/application/errors/error_db.php +++ b/system/application/errors/error_db.php @@ -1,34 +1,34 @@ - - -Database Error - - - -
    -

    - -
    - + + +Database Error + + + +
    +

    + +
    + \ No newline at end of file diff --git a/system/application/errors/error_general.php b/system/application/errors/error_general.php index 8545286f..d8610702 100644 --- a/system/application/errors/error_general.php +++ b/system/application/errors/error_general.php @@ -1,34 +1,34 @@ - - -Error - - - -
    -

    - -
    - + + +Error + + + +
    +

    + +
    + \ No newline at end of file diff --git a/system/application/errors/error_php.php b/system/application/errors/error_php.php index f5941c96..f085c203 100644 --- a/system/application/errors/error_php.php +++ b/system/application/errors/error_php.php @@ -1,10 +1,10 @@ -
    - -

    A PHP Error was encountered

    - -

    Severity:

    -

    Message:

    -

    Filename:

    -

    Line Number:

    - +
    + +

    A PHP Error was encountered

    + +

    Severity:

    +

    Message:

    +

    Filename:

    +

    Line Number:

    +
    \ No newline at end of file diff --git a/system/application/errors/index.html b/system/application/errors/index.html index 065d2da5..c942a79c 100644 --- a/system/application/errors/index.html +++ b/system/application/errors/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/helpers/index.html b/system/application/helpers/index.html index 065d2da5..c942a79c 100644 --- a/system/application/helpers/index.html +++ b/system/application/helpers/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/hooks/index.html b/system/application/hooks/index.html index 065d2da5..c942a79c 100644 --- a/system/application/hooks/index.html +++ b/system/application/hooks/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/index.html b/system/application/index.html index 065d2da5..c942a79c 100644 --- a/system/application/index.html +++ b/system/application/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/language/english/index.html b/system/application/language/english/index.html index 065d2da5..c942a79c 100644 --- a/system/application/language/english/index.html +++ b/system/application/language/english/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/libraries/index.html b/system/application/libraries/index.html index 065d2da5..c942a79c 100644 --- a/system/application/libraries/index.html +++ b/system/application/libraries/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/models/index.html b/system/application/models/index.html index 065d2da5..c942a79c 100644 --- a/system/application/models/index.html +++ b/system/application/models/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/views/index.html b/system/application/views/index.html index 065d2da5..c942a79c 100644 --- a/system/application/views/index.html +++ b/system/application/views/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/application/views/welcome_message.php b/system/application/views/welcome_message.php index 8313059e..653b62c7 100644 --- a/system/application/views/welcome_message.php +++ b/system/application/views/welcome_message.php @@ -1,62 +1,62 @@ - - -Welcome to CodeIgniter - - - - - -

    Welcome to CodeIgniter!

    - -

    The page you are looking at is being generated dynamically by CodeIgniter.

    - -

    If you would like to edit this page you'll find it located at:

    -system/application/views/welcome_message.php - -

    The corresponding controller for this page is found at:

    -system/application/controllers/welcome.php - -

    If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

    - - -


    Page rendered in {elapsed_time} seconds

    - - + + +Welcome to CodeIgniter + + + + + +

    Welcome to CodeIgniter!

    + +

    The page you are looking at is being generated dynamically by CodeIgniter.

    + +

    If you would like to edit this page you'll find it located at:

    +system/application/views/welcome_message.php + +

    The corresponding controller for this page is found at:

    +system/application/controllers/welcome.php + +

    If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

    + + +


    Page rendered in {elapsed_time} seconds

    + + \ No newline at end of file diff --git a/system/cache/index.html b/system/cache/index.html index 065d2da5..c942a79c 100644 --- a/system/cache/index.html +++ b/system/cache/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php index b242c00f..a95c2812 100644 --- a/system/codeigniter/Base4.php +++ b/system/codeigniter/Base4.php @@ -1,69 +1,69 @@ -load->library('email') to instantiate - * classes that can then be used within controllers as $this->email->send() - * - * PHP 4 also has trouble referencing the CI super object within application - * constructors since objects do not exist until the class is fully - * instantiated. Basically PHP 4 sucks... - * - * Since PHP 5 doesn't suffer from this problem so we load one of - * two files based on the version of PHP being run. - * - * @package CodeIgniter - * @subpackage codeigniter - * @category front-controller - * @author ExpressionEngine Dev Team - * @link http://codeigniter.com/user_guide/ - */ - class CI_Base extends CI_Loader { - - function CI_Base() - { - // This allows syntax like $this->load->foo() to work - parent::CI_Loader(); - $this->load =& $this; - - // This allows resources used within controller constructors to work - global $OBJ; - $OBJ = $this->load; // Do NOT use a reference. - } -} - -function &get_instance() -{ - global $CI, $OBJ; - - if (is_object($CI)) - { - return $CI; - } - - return $OBJ->load; -} - - -/* End of file Base4.php */ +load->library('email') to instantiate + * classes that can then be used within controllers as $this->email->send() + * + * PHP 4 also has trouble referencing the CI super object within application + * constructors since objects do not exist until the class is fully + * instantiated. Basically PHP 4 sucks... + * + * Since PHP 5 doesn't suffer from this problem so we load one of + * two files based on the version of PHP being run. + * + * @package CodeIgniter + * @subpackage codeigniter + * @category front-controller + * @author ExpressionEngine Dev Team + * @link http://codeigniter.com/user_guide/ + */ + class CI_Base extends CI_Loader { + + function CI_Base() + { + // This allows syntax like $this->load->foo() to work + parent::CI_Loader(); + $this->load =& $this; + + // This allows resources used within controller constructors to work + global $OBJ; + $OBJ = $this->load; // Do NOT use a reference. + } +} + +function &get_instance() +{ + global $CI, $OBJ; + + if (is_object($CI)) + { + return $CI; + } + + return $OBJ->load; +} + + +/* End of file Base4.php */ /* Location: ./system/codeigniter/Base4.php */ \ No newline at end of file diff --git a/system/codeigniter/Base5.php b/system/codeigniter/Base5.php index 8dd3ad04..aa903557 100644 --- a/system/codeigniter/Base5.php +++ b/system/codeigniter/Base5.php @@ -1,56 +1,56 @@ -mark('total_execution_time_start'); -$BM->mark('loading_time_base_classes_start'); - -/* - * ------------------------------------------------------ - * Instantiate the hooks class - * ------------------------------------------------------ - */ - -$EXT =& load_class('Hooks'); - -/* - * ------------------------------------------------------ - * Is there a "pre_system" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('pre_system'); - -/* - * ------------------------------------------------------ - * Instantiate the base classes - * ------------------------------------------------------ - */ - -$CFG =& load_class('Config'); -$URI =& load_class('URI'); -$RTR =& load_class('Router'); -$OUT =& load_class('Output'); - -/* - * ------------------------------------------------------ - * Is there a valid cache file? If so, we're done... - * ------------------------------------------------------ - */ - -if ($EXT->_call_hook('cache_override') === FALSE) -{ - if ($OUT->_display_cache($CFG, $URI) == TRUE) - { - exit; - } -} - -/* - * ------------------------------------------------------ - * Load the remaining base classes - * ------------------------------------------------------ - */ - -$IN =& load_class('Input'); -$LANG =& load_class('Language'); - -/* - * ------------------------------------------------------ - * Load the app controller and local controller - * ------------------------------------------------------ - * - * Note: Due to the poor object handling in PHP 4 we'll - * conditionally load different versions of the base - * class. Retaining PHP 4 compatibility requires a bit of a hack. - * - * Note: The Loader class needs to be included first - * - */ -if (floor(phpversion()) < 5) -{ - load_class('Loader', FALSE); - require(BASEPATH.'codeigniter/Base4'.EXT); -} -else -{ - require(BASEPATH.'codeigniter/Base5'.EXT); -} - -// Load the base controller class -load_class('Controller', FALSE); - -// Load the local application controller -// Note: The Router class automatically validates the controller path. If this include fails it -// means that the default controller in the Routes.php file is not resolving to something valid. -if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) -{ - show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); -} - -include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); - -// Set a mark point for benchmarking -$BM->mark('loading_time_base_classes_end'); - - -/* - * ------------------------------------------------------ - * Security check - * ------------------------------------------------------ - * - * None of the functions in the app controller or the - * loader class can be called via the URI, nor can - * controller functions that begin with an underscore - */ -$class = $RTR->fetch_class(); -$method = $RTR->fetch_method(); - -if ( ! class_exists($class) - OR $method == 'controller' - OR strncmp($method, '_', 1) == 0 - OR in_array(strtolower($method), array_map('strtolower', get_class_methods('Controller'))) - ) -{ - show_404("{$class}/{$method}"); -} - -/* - * ------------------------------------------------------ - * Is there a "pre_controller" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('pre_controller'); - -/* - * ------------------------------------------------------ - * Instantiate the controller and call requested method - * ------------------------------------------------------ - */ - -// Mark a start point so we can benchmark the controller -$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); - -$CI = new $class(); - -// Is this a scaffolding request? -if ($RTR->scaffolding_request === TRUE) -{ - if ($EXT->_call_hook('scaffolding_override') === FALSE) - { - $CI->_ci_scaffolding(); - } -} -else -{ - /* - * ------------------------------------------------------ - * Is there a "post_controller_constructor" hook? - * ------------------------------------------------------ - */ - $EXT->_call_hook('post_controller_constructor'); - - // Is there a "remap" function? - if (method_exists($CI, '_remap')) - { - $CI->_remap($method); - } - else - { - // is_callable() returns TRUE on some versions of PHP 5 for private and protected - // methods, so we'll use this workaround for consistent behavior - if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) - { - show_404("{$class}/{$method}"); - } - - // Call the requested method. - // Any URI segments present (besides the class/function) will be passed to the method for convenience - call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); - } -} - -// Mark a benchmark end point -$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); - -/* - * ------------------------------------------------------ - * Is there a "post_controller" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('post_controller'); - -/* - * ------------------------------------------------------ - * Send the final rendered output to the browser - * ------------------------------------------------------ - */ - -if ($EXT->_call_hook('display_override') === FALSE) -{ - $OUT->_display(); -} - -/* - * ------------------------------------------------------ - * Is there a "post_system" hook? - * ------------------------------------------------------ - */ -$EXT->_call_hook('post_system'); - -/* - * ------------------------------------------------------ - * Close the DB connection if one exists - * ------------------------------------------------------ - */ -if (class_exists('CI_DB') AND isset($CI->db)) -{ - $CI->db->close(); -} - - -/* End of file CodeIgniter.php */ +mark('total_execution_time_start'); +$BM->mark('loading_time_base_classes_start'); + +/* + * ------------------------------------------------------ + * Instantiate the hooks class + * ------------------------------------------------------ + */ + +$EXT =& load_class('Hooks'); + +/* + * ------------------------------------------------------ + * Is there a "pre_system" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('pre_system'); + +/* + * ------------------------------------------------------ + * Instantiate the base classes + * ------------------------------------------------------ + */ + +$CFG =& load_class('Config'); +$URI =& load_class('URI'); +$RTR =& load_class('Router'); +$OUT =& load_class('Output'); + +/* + * ------------------------------------------------------ + * Is there a valid cache file? If so, we're done... + * ------------------------------------------------------ + */ + +if ($EXT->_call_hook('cache_override') === FALSE) +{ + if ($OUT->_display_cache($CFG, $URI) == TRUE) + { + exit; + } +} + +/* + * ------------------------------------------------------ + * Load the remaining base classes + * ------------------------------------------------------ + */ + +$IN =& load_class('Input'); +$LANG =& load_class('Language'); + +/* + * ------------------------------------------------------ + * Load the app controller and local controller + * ------------------------------------------------------ + * + * Note: Due to the poor object handling in PHP 4 we'll + * conditionally load different versions of the base + * class. Retaining PHP 4 compatibility requires a bit of a hack. + * + * Note: The Loader class needs to be included first + * + */ +if (floor(phpversion()) < 5) +{ + load_class('Loader', FALSE); + require(BASEPATH.'codeigniter/Base4'.EXT); +} +else +{ + require(BASEPATH.'codeigniter/Base5'.EXT); +} + +// Load the base controller class +load_class('Controller', FALSE); + +// Load the local application controller +// Note: The Router class automatically validates the controller path. If this include fails it +// means that the default controller in the Routes.php file is not resolving to something valid. +if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) +{ + show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); +} + +include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); + +// Set a mark point for benchmarking +$BM->mark('loading_time_base_classes_end'); + + +/* + * ------------------------------------------------------ + * Security check + * ------------------------------------------------------ + * + * None of the functions in the app controller or the + * loader class can be called via the URI, nor can + * controller functions that begin with an underscore + */ +$class = $RTR->fetch_class(); +$method = $RTR->fetch_method(); + +if ( ! class_exists($class) + OR $method == 'controller' + OR strncmp($method, '_', 1) == 0 + OR in_array(strtolower($method), array_map('strtolower', get_class_methods('Controller'))) + ) +{ + show_404("{$class}/{$method}"); +} + +/* + * ------------------------------------------------------ + * Is there a "pre_controller" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('pre_controller'); + +/* + * ------------------------------------------------------ + * Instantiate the controller and call requested method + * ------------------------------------------------------ + */ + +// Mark a start point so we can benchmark the controller +$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); + +$CI = new $class(); + +// Is this a scaffolding request? +if ($RTR->scaffolding_request === TRUE) +{ + if ($EXT->_call_hook('scaffolding_override') === FALSE) + { + $CI->_ci_scaffolding(); + } +} +else +{ + /* + * ------------------------------------------------------ + * Is there a "post_controller_constructor" hook? + * ------------------------------------------------------ + */ + $EXT->_call_hook('post_controller_constructor'); + + // Is there a "remap" function? + if (method_exists($CI, '_remap')) + { + $CI->_remap($method); + } + else + { + // is_callable() returns TRUE on some versions of PHP 5 for private and protected + // methods, so we'll use this workaround for consistent behavior + if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) + { + show_404("{$class}/{$method}"); + } + + // Call the requested method. + // Any URI segments present (besides the class/function) will be passed to the method for convenience + call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); + } +} + +// Mark a benchmark end point +$BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); + +/* + * ------------------------------------------------------ + * Is there a "post_controller" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('post_controller'); + +/* + * ------------------------------------------------------ + * Send the final rendered output to the browser + * ------------------------------------------------------ + */ + +if ($EXT->_call_hook('display_override') === FALSE) +{ + $OUT->_display(); +} + +/* + * ------------------------------------------------------ + * Is there a "post_system" hook? + * ------------------------------------------------------ + */ +$EXT->_call_hook('post_system'); + +/* + * ------------------------------------------------------ + * Close the DB connection if one exists + * ------------------------------------------------------ + */ +if (class_exists('CI_DB') AND isset($CI->db)) +{ + $CI->db->close(); +} + + +/* End of file CodeIgniter.php */ /* Location: ./system/codeigniter/CodeIgniter.php */ \ No newline at end of file diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 9212f07a..3c75f5e6 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -1,307 +1,307 @@ -show_error('An Error Was Encountered', $message); - exit; -} - - -/** -* 404 Page Handler -* -* This function is similar to the show_error() function above -* However, instead of the standard error template it displays -* 404 errors. -* -* @access public -* @return void -*/ -function show_404($page = '') -{ - $error =& load_class('Exceptions'); - $error->show_404($page); - exit; -} - - -/** -* Error Logging Interface -* -* We use this as a simple mechanism to access the logging -* class and send messages to be logged. -* -* @access public -* @return void -*/ -function log_message($level = 'error', $message, $php_error = FALSE) -{ - static $LOG; - - $config =& get_config(); - if ($config['log_threshold'] == 0) - { - return; - } - - $LOG =& load_class('Log'); - $LOG->write_log($level, $message, $php_error); -} - -/** -* Exception Handler -* -* This is the custom exception handler that is declaired at the top -* of Codeigniter.php. The main reason we use this is permit -* PHP errors to be logged in our own log files since we may -* not have access to server logs. Since this function -* effectively intercepts PHP errors, however, we also need -* to display errors based on the current error_reporting level. -* We do that with the use of a PHP error template. -* -* @access private -* @return void -*/ -function _exception_handler($severity, $message, $filepath, $line) -{ - // We don't bother with "strict" notices since they will fill up - // the log file with information that isn't normally very - // helpful. For example, if you are running PHP 5 and you - // use version 4 style class functions (without prefixes - // like "public", "private", etc.) you'll get notices telling - // you that these have been deprecated. - - if ($severity == E_STRICT) - { - return; - } - - $error =& load_class('Exceptions'); - - // Should we display the error? - // We'll get the current error_reporting level and add its bits - // with the severity bits to find out. - - if (($severity & error_reporting()) == $severity) - { - $error->show_php_error($severity, $message, $filepath, $line); - } - - // Should we log the error? No? We're done... - $config =& get_config(); - if ($config['log_threshold'] == 0) - { - return; - } - - $error->log_exception($severity, $message, $filepath, $line); -} - - - -/* End of file Common.php */ +show_error('An Error Was Encountered', $message); + exit; +} + + +/** +* 404 Page Handler +* +* This function is similar to the show_error() function above +* However, instead of the standard error template it displays +* 404 errors. +* +* @access public +* @return void +*/ +function show_404($page = '') +{ + $error =& load_class('Exceptions'); + $error->show_404($page); + exit; +} + + +/** +* Error Logging Interface +* +* We use this as a simple mechanism to access the logging +* class and send messages to be logged. +* +* @access public +* @return void +*/ +function log_message($level = 'error', $message, $php_error = FALSE) +{ + static $LOG; + + $config =& get_config(); + if ($config['log_threshold'] == 0) + { + return; + } + + $LOG =& load_class('Log'); + $LOG->write_log($level, $message, $php_error); +} + +/** +* Exception Handler +* +* This is the custom exception handler that is declaired at the top +* of Codeigniter.php. The main reason we use this is permit +* PHP errors to be logged in our own log files since we may +* not have access to server logs. Since this function +* effectively intercepts PHP errors, however, we also need +* to display errors based on the current error_reporting level. +* We do that with the use of a PHP error template. +* +* @access private +* @return void +*/ +function _exception_handler($severity, $message, $filepath, $line) +{ + // We don't bother with "strict" notices since they will fill up + // the log file with information that isn't normally very + // helpful. For example, if you are running PHP 5 and you + // use version 4 style class functions (without prefixes + // like "public", "private", etc.) you'll get notices telling + // you that these have been deprecated. + + if ($severity == E_STRICT) + { + return; + } + + $error =& load_class('Exceptions'); + + // Should we display the error? + // We'll get the current error_reporting level and add its bits + // with the severity bits to find out. + + if (($severity & error_reporting()) == $severity) + { + $error->show_php_error($severity, $message, $filepath, $line); + } + + // Should we log the error? No? We're done... + $config =& get_config(); + if ($config['log_threshold'] == 0) + { + return; + } + + $error->log_exception($severity, $message, $filepath, $line); +} + + + +/* End of file Common.php */ /* Location: ./system/codeigniter/Common.php */ \ No newline at end of file diff --git a/system/codeigniter/Compat.php b/system/codeigniter/Compat.php index 291f01df..6100956a 100644 --- a/system/codeigniter/Compat.php +++ b/system/codeigniter/Compat.php @@ -1,93 +1,93 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/DB.php b/system/database/DB.php index 2b3ff3dc..ca0cfc2e 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -1,146 +1,146 @@ - $dns['scheme'], - 'hostname' => (isset($dns['host'])) ? rawurldecode($dns['host']) : '', - 'username' => (isset($dns['user'])) ? rawurldecode($dns['user']) : '', - 'password' => (isset($dns['pass'])) ? rawurldecode($dns['pass']) : '', - 'database' => (isset($dns['path'])) ? rawurldecode(substr($dns['path'], 1)) : '' - ); - - // were additional config items set? - if (isset($dns['query'])) - { - parse_str($dns['query'], $extra); - - foreach($extra as $key => $val) - { - // booleans please - if (strtoupper($val) == "TRUE") - { - $val = TRUE; - } - elseif (strtoupper($val) == "FALSE") - { - $val = FALSE; - } - - $params[$key] = $val; - } - } - } - - // No DB specified yet? Beat them senseless... - if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '') - { - show_error('You have not selected a database type to connect to.'); - } - - // Load the DB classes. Note: Since the active record class is optional - // we need to dynamically create a class that extends proper parent class - // based on whether we're using the active record class or not. - // Kudos to Paul for discovering this clever use of eval() - - if ($active_record_override == TRUE) - { - $active_record = TRUE; - } - - require_once(BASEPATH.'database/DB_driver'.EXT); - - if ( ! isset($active_record) OR $active_record == TRUE) - { - require_once(BASEPATH.'database/DB_active_rec'.EXT); - - if ( ! class_exists('CI_DB')) - { - eval('class CI_DB extends CI_DB_active_record { }'); - } - } - else - { - if ( ! class_exists('CI_DB')) - { - eval('class CI_DB extends CI_DB_driver { }'); - } - } - - require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver'.EXT); - - // Instantiate the DB adapter - $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; - $DB =& new $driver($params); - - if ($DB->autoinit == TRUE) - { - $DB->initialize(); - } - - return $DB; -} - - - -/* End of file DB.php */ + $dns['scheme'], + 'hostname' => (isset($dns['host'])) ? rawurldecode($dns['host']) : '', + 'username' => (isset($dns['user'])) ? rawurldecode($dns['user']) : '', + 'password' => (isset($dns['pass'])) ? rawurldecode($dns['pass']) : '', + 'database' => (isset($dns['path'])) ? rawurldecode(substr($dns['path'], 1)) : '' + ); + + // were additional config items set? + if (isset($dns['query'])) + { + parse_str($dns['query'], $extra); + + foreach($extra as $key => $val) + { + // booleans please + if (strtoupper($val) == "TRUE") + { + $val = TRUE; + } + elseif (strtoupper($val) == "FALSE") + { + $val = FALSE; + } + + $params[$key] = $val; + } + } + } + + // No DB specified yet? Beat them senseless... + if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '') + { + show_error('You have not selected a database type to connect to.'); + } + + // Load the DB classes. Note: Since the active record class is optional + // we need to dynamically create a class that extends proper parent class + // based on whether we're using the active record class or not. + // Kudos to Paul for discovering this clever use of eval() + + if ($active_record_override == TRUE) + { + $active_record = TRUE; + } + + require_once(BASEPATH.'database/DB_driver'.EXT); + + if ( ! isset($active_record) OR $active_record == TRUE) + { + require_once(BASEPATH.'database/DB_active_rec'.EXT); + + if ( ! class_exists('CI_DB')) + { + eval('class CI_DB extends CI_DB_active_record { }'); + } + } + else + { + if ( ! class_exists('CI_DB')) + { + eval('class CI_DB extends CI_DB_driver { }'); + } + } + + require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver'.EXT); + + // Instantiate the DB adapter + $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; + $DB =& new $driver($params); + + if ($DB->autoinit == TRUE) + { + $DB->initialize(); + } + + return $DB; +} + + + +/* End of file DB.php */ /* Location: ./system/database/DB.php */ \ No newline at end of file diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index b270b6fc..e8cefa2d 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1,1814 +1,1814 @@ -_protect_identifiers = $escape; - } - - if (is_string($select)) - { - $select = explode(',', $select); - } - - foreach ($select as $val) - { - $val = trim($val); - - if ($val != '') - { - $this->ar_select[] = $val; - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_select[] = $val; - $this->ar_cache_exists[] = 'select'; - } - } - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Select Max - * - * Generates a SELECT MAX(field) portion of a query - * - * @access public - * @param string the field - * @param string an alias - * @return object - */ - function select_max($select = '', $alias = '') - { - return $this->_max_min_avg_sum($select, $alias, 'MAX'); - } - - // -------------------------------------------------------------------- - - /** - * Select Min - * - * Generates a SELECT MIN(field) portion of a query - * - * @access public - * @param string the field - * @param string an alias - * @return object - */ - function select_min($select = '', $alias = '') - { - return $this->_max_min_avg_sum($select, $alias, 'MIN'); - } - - // -------------------------------------------------------------------- - - /** - * Select Average - * - * Generates a SELECT AVG(field) portion of a query - * - * @access public - * @param string the field - * @param string an alias - * @return object - */ - function select_avg($select = '', $alias = '') - { - return $this->_max_min_avg_sum($select, $alias, 'AVG'); - } - - // -------------------------------------------------------------------- - - /** - * Select Sum - * - * Generates a SELECT SUM(field) portion of a query - * - * @access public - * @param string the field - * @param string an alias - * @return object - */ - function select_sum($select = '', $alias = '') - { - return $this->_max_min_avg_sum($select, $alias, 'SUM'); - } - - // -------------------------------------------------------------------- - - /** - * Processing Function for the four functions above: - * - * select_max() - * select_min() - * select_avg() - * select_sum() - * - * @access public - * @param string the field - * @param string an alias - * @return object - */ - function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') - { - if ( ! is_string($select) OR $select == '') - { - $this->display_error('db_invalid_query'); - } - - $type = strtoupper($type); - - if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM'))) - { - show_error('Invalid function type: '.$type); - } - - if ($alias == '') - { - $alias = $this->_create_alias_from_table(trim($select)); - } - - $sql = $type.'('.$this->_protect_identifiers(trim($select)).') AS '.$alias; - - $this->ar_select[] = $sql; - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_select[] = $sql; - $this->ar_cache_exists[] = 'select'; - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Determines the alias name based on the table - * - * @access private - * @param string - * @return string - */ - function _create_alias_from_table($item) - { - if (strpos($item, '.') !== FALSE) - { - return end(explode('.', $item)); - } - - return $item; - } - - // -------------------------------------------------------------------- - - /** - * DISTINCT - * - * Sets a flag which tells the query string compiler to add DISTINCT - * - * @access public - * @param bool - * @return object - */ - function distinct($val = TRUE) - { - $this->ar_distinct = (is_bool($val)) ? $val : TRUE; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * From - * - * Generates the FROM portion of the query - * - * @access public - * @param mixed can be a string or array - * @return object - */ - function from($from) - { - foreach ((array)$from as $val) - { - if (strpos($val, ',') !== FALSE) - { - foreach (explode(',', $val) as $v) - { - $v = trim($v); - $this->_track_aliases($v); - - $this->ar_from[] = $this->_protect_identifiers($v, TRUE, NULL, FALSE); - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_from[] = $this->_protect_identifiers($v, TRUE, NULL, FALSE); - $this->ar_cache_exists[] = 'from'; - } - } - - } - else - { - $val = trim($val); - - // Extract any aliases that might exist. We use this information - // in the _protect_identifiers to know whether to add a table prefix - $this->_track_aliases($val); - - $this->ar_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); - $this->ar_cache_exists[] = 'from'; - } - } - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Join - * - * Generates the JOIN portion of the query - * - * @access public - * @param string - * @param string the join condition - * @param string the type of join - * @return object - */ - function join($table, $cond, $type = '') - { - if ($type != '') - { - $type = strtoupper(trim($type)); - - if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) - { - $type = ''; - } - else - { - $type .= ' '; - } - } - - // Extract any aliases that might exist. We use this information - // in the _protect_identifiers to know whether to add a table prefix - $this->_track_aliases($table); - - // Strip apart the condition and protect the identifiers - if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match)) - { - $match[1] = $this->_protect_identifiers($match[1]); - $match[3] = $this->_protect_identifiers($match[3]); - - $cond = $match[1].$match[2].$match[3]; - } - - // Assemble the JOIN statement - $join = $type.'JOIN '.$this->_protect_identifiers($table, TRUE, NULL, FALSE).' ON '.$cond; - - $this->ar_join[] = $join; - if ($this->ar_caching === TRUE) - { - $this->ar_cache_join[] = $join; - $this->ar_cache_exists[] = 'join'; - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Where - * - * Generates the WHERE portion of the query. Separates - * multiple calls with AND - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function where($key, $value = NULL, $escape = TRUE) - { - return $this->_where($key, $value, 'AND ', $escape); - } - - // -------------------------------------------------------------------- - - /** - * OR Where - * - * Generates the WHERE portion of the query. Separates - * multiple calls with OR - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function or_where($key, $value = NULL, $escape = TRUE) - { - return $this->_where($key, $value, 'OR ', $escape); - } - - // -------------------------------------------------------------------- - - /** - * orwhere() is an alias of or_where() - * this function is here for backwards compatibility, as - * orwhere() has been deprecated - */ - function orwhere($key, $value = NULL, $escape = TRUE) - { - return $this->or_where($key, $value, $escape); - } - - // -------------------------------------------------------------------- - - /** - * Where - * - * Called by where() or orwhere() - * - * @access private - * @param mixed - * @param mixed - * @param string - * @return object - */ - function _where($key, $value = NULL, $type = 'AND ', $escape = NULL) - { - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - // If the escape value was not set will will base it on the global setting - if ( ! is_bool($escape)) - { - $escape = $this->_protect_identifiers; - } - - foreach ($key as $k => $v) - { - $prefix = (count($this->ar_where) == 0 AND count($this->ar_cache_where) == 0) ? '' : $type; - - if (is_null($v) && ! $this->_has_operator($k)) - { - // value appears not to have been set, assign the test to IS NULL - $k .= ' IS NULL'; - } - - if ( ! is_null($v)) - { - if ($escape === TRUE) - { - $k = $this->_protect_identifiers($k, FALSE, $escape); - - $v = ' '.$this->escape($v); - } - - if ( ! $this->_has_operator($k)) - { - $k .= ' ='; - } - } - else - { - $k = $this->_protect_identifiers($k, FALSE, $escape); - } - - $this->ar_where[] = $prefix.$k.$v; - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_where[] = $prefix.$k.$v; - $this->ar_cache_exists[] = 'where'; - } - - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Where_in - * - * Generates a WHERE field IN ('item', 'item') SQL query joined with - * AND if appropriate - * - * @access public - * @param string The field to search - * @param array The values searched on - * @return object - */ - function where_in($key = NULL, $values = NULL) - { - return $this->_where_in($key, $values); - } - - // -------------------------------------------------------------------- - - /** - * Where_in_or - * - * Generates a WHERE field IN ('item', 'item') SQL query joined with - * OR if appropriate - * - * @access public - * @param string The field to search - * @param array The values searched on - * @return object - */ - function or_where_in($key = NULL, $values = NULL) - { - return $this->_where_in($key, $values, FALSE, 'OR '); - } - - // -------------------------------------------------------------------- - - /** - * Where_not_in - * - * Generates a WHERE field NOT IN ('item', 'item') SQL query joined - * with AND if appropriate - * - * @access public - * @param string The field to search - * @param array The values searched on - * @return object - */ - function where_not_in($key = NULL, $values = NULL) - { - return $this->_where_in($key, $values, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * Where_not_in_or - * - * Generates a WHERE field NOT IN ('item', 'item') SQL query joined - * with OR if appropriate - * - * @access public - * @param string The field to search - * @param array The values searched on - * @return object - */ - function or_where_not_in($key = NULL, $values = NULL) - { - return $this->_where_in($key, $values, TRUE, 'OR '); - } - - // -------------------------------------------------------------------- - - /** - * Where_in - * - * Called by where_in, where_in_or, where_not_in, where_not_in_or - * - * @access public - * @param string The field to search - * @param array The values searched on - * @param boolean If the statement would be IN or NOT IN - * @param string - * @return object - */ - function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') - { - if ($key === NULL OR $values === NULL) - { - return; - } - - if ( ! is_array($values)) - { - $values = array($values); - } - - $not = ($not) ? ' NOT' : ''; - - foreach ($values as $value) - { - $this->ar_wherein[] = $this->escape($value); - } - - $prefix = (count($this->ar_where) == 0) ? '' : $type; - - $where_in = $prefix . $this->_protect_identifiers($key) . $not . " IN (" . implode(", ", $this->ar_wherein) . ") "; - - $this->ar_where[] = $where_in; - if ($this->ar_caching === TRUE) - { - $this->ar_cache_where[] = $where_in; - $this->ar_cache_exists[] = 'where'; - } - - // reset the array for multiple calls - $this->ar_wherein = array(); - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Like - * - * Generates a %LIKE% portion of the query. Separates - * multiple calls with AND - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function like($field, $match = '', $side = 'both') - { - return $this->_like($field, $match, 'AND ', $side); - } - - // -------------------------------------------------------------------- - - /** - * Not Like - * - * Generates a NOT LIKE portion of the query. Separates - * multiple calls with AND - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function not_like($field, $match = '', $side = 'both') - { - return $this->_like($field, $match, 'AND ', $side, 'NOT'); - } - - // -------------------------------------------------------------------- - - /** - * OR Like - * - * Generates a %LIKE% portion of the query. Separates - * multiple calls with OR - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function or_like($field, $match = '', $side = 'both') - { - return $this->_like($field, $match, 'OR ', $side); - } - - // -------------------------------------------------------------------- - - /** - * OR Not Like - * - * Generates a NOT LIKE portion of the query. Separates - * multiple calls with OR - * - * @access public - * @param mixed - * @param mixed - * @return object - */ - function or_not_like($field, $match = '', $side = 'both') - { - return $this->_like($field, $match, 'OR ', $side, 'NOT'); - } - - // -------------------------------------------------------------------- - - /** - * orlike() is an alias of or_like() - * this function is here for backwards compatibility, as - * orlike() has been deprecated - */ - function orlike($field, $match = '', $side = 'both') - { - return $this->or_like($field, $match, $side); - } - - // -------------------------------------------------------------------- - - /** - * Like - * - * Called by like() or orlike() - * - * @access private - * @param mixed - * @param mixed - * @param string - * @return object - */ - function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') - { - if ( ! is_array($field)) - { - $field = array($field => $match); - } - - foreach ($field as $k => $v) - { - $k = $this->_protect_identifiers($k); - - $prefix = (count($this->ar_like) == 0) ? '' : $type; - - $v = $this->escape_str($v); - - if ($side == 'before') - { - $like_statement = $prefix." $k $not LIKE '%{$v}'"; - } - elseif ($side == 'after') - { - $like_statement = $prefix." $k $not LIKE '{$v}%'"; - } - else - { - $like_statement = $prefix." $k $not LIKE '%{$v}%'"; - } - - $this->ar_like[] = $like_statement; - if ($this->ar_caching === TRUE) - { - $this->ar_cache_like[] = $like_statement; - $this->ar_cache_exists[] = 'like'; - } - - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * GROUP BY - * - * @access public - * @param string - * @return object - */ - function group_by($by) - { - if (is_string($by)) - { - $by = explode(',', $by); - } - - foreach ($by as $val) - { - $val = trim($val); - - if ($val != '') - { - $this->ar_groupby[] = $this->_protect_identifiers($val); - - if ($this->ar_caching === TRUE) - { - $this->ar_cache_groupby[] = $this->_protect_identifiers($val); - $this->ar_cache_exists[] = 'groupby'; - } - } - } - return $this; - } - - // -------------------------------------------------------------------- - - /** - * groupby() is an alias of group_by() - * this function is here for backwards compatibility, as - * groupby() has been deprecated - */ - function groupby($by) - { - return $this->group_by($by); - } - - // -------------------------------------------------------------------- - - /** - * Sets the HAVING value - * - * Separates multiple calls with AND - * - * @access public - * @param string - * @param string - * @return object - */ - function having($key, $value = '', $escape = TRUE) - { - return $this->_having($key, $value, 'AND ', $escape); - } - - // -------------------------------------------------------------------- - - /** - * orhaving() is an alias of or_having() - * this function is here for backwards compatibility, as - * orhaving() has been deprecated - */ - - function orhaving($key, $value = '', $escape = TRUE) - { - return $this->or_having($key, $value, $escape); - } - // -------------------------------------------------------------------- - - /** - * Sets the OR HAVING value - * - * Separates multiple calls with OR - * - * @access public - * @param string - * @param string - * @return object - */ - function or_having($key, $value = '', $escape = TRUE) - { - return $this->_having($key, $value, 'OR ', $escape); - } - - // -------------------------------------------------------------------- - - /** - * Sets the HAVING values - * - * Called by having() or or_having() - * - * @access private - * @param string - * @param string - * @return object - */ - function _having($key, $value = '', $type = 'AND ', $escape = TRUE) - { - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - foreach ($key as $k => $v) - { - $prefix = (count($this->ar_having) == 0) ? '' : $type; - - if ($escape === TRUE) - { - $k = $this->_protect_identifiers($k); - } - - if ( ! $this->_has_operator($k)) - { - $k .= ' = '; - } - - if ($v != '') - { - $v = ' '.$this->escape_str($v); - } - - $this->ar_having[] = $prefix.$k.$v; - if ($this->ar_caching === TRUE) - { - $this->ar_cache_having[] = $prefix.$k.$v; - $this->ar_cache_exists[] = 'having'; - } - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the ORDER BY value - * - * @access public - * @param string - * @param string direction: asc or desc - * @return object - */ - function order_by($orderby, $direction = '') - { - if (strtolower($direction) == 'random') - { - $orderby = ''; // Random results want or don't need a field name - $direction = $this->_random_keyword; - } - elseif (trim($direction) != '') - { - $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; - } - - - if (strpos($orderby, ',') !== FALSE) - { - $temp = array(); - foreach (explode(',', $orderby) as $part) - { - $part = trim($part); - if ( ! in_array($part, $this->ar_aliased_tables)) - { - $part = $this->_protect_identifiers(trim($part)); - } - - $temp[] = $part; - } - - $orderby = implode(', ', $temp); - } - else - { - $orderby = $this->_protect_identifiers($orderby); - } - - $orderby_statement = $orderby.$direction; - - $this->ar_orderby[] = $orderby_statement; - if ($this->ar_caching === TRUE) - { - $this->ar_cache_orderby[] = $orderby_statement; - $this->ar_cache_exists[] = 'orderby'; - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * orderby() is an alias of order_by() - * this function is here for backwards compatibility, as - * orderby() has been deprecated - */ - function orderby($orderby, $direction = '') - { - return $this->order_by($orderby, $direction); - } - - // -------------------------------------------------------------------- - - /** - * Sets the LIMIT value - * - * @access public - * @param integer the limit value - * @param integer the offset value - * @return object - */ - function limit($value, $offset = '') - { - $this->ar_limit = $value; - - if ($offset != '') - { - $this->ar_offset = $offset; - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Sets the OFFSET value - * - * @access public - * @param integer the offset value - * @return object - */ - function offset($offset) - { - $this->ar_offset = $offset; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * The "set" function. Allows key/value pairs to be set for inserting or updating - * - * @access public - * @param mixed - * @param string - * @param boolean - * @return object - */ - function set($key, $value = '', $escape = TRUE) - { - $key = $this->_object_to_array($key); - - if ( ! is_array($key)) - { - $key = array($key => $value); - } - - foreach ($key as $k => $v) - { - if ($escape === FALSE) - { - $this->ar_set[$this->_protect_identifiers($k)] = $v; - } - else - { - $this->ar_set[$this->_protect_identifiers($k)] = $this->escape($v); - } - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Get - * - * Compiles the select statement based on the other functions called - * and runs the query - * - * @access public - * @param string the table - * @param string the limit clause - * @param string the offset clause - * @return object - */ - function get($table = '', $limit = null, $offset = null) - { - if ($table != '') - { - $this->_track_aliases($table); - $this->from($table); - } - - if ( ! is_null($limit)) - { - $this->limit($limit, $offset); - } - - $sql = $this->_compile_select(); - - $result = $this->query($sql); - $this->_reset_select(); - return $result; - } - - /** - * "Count All Results" query - * - * Generates a platform-specific query string that counts all records - * returned by an Active Record query. - * - * @access public - * @param string - * @return string - */ - function count_all_results($table = '') - { - if ($table != '') - { - $this->_track_aliases($table); - $this->from($table); - } - - $sql = $this->_compile_select($this->_count_string . $this->_protect_identifiers('numrows')); - - $query = $this->query($sql); - $this->_reset_select(); - - if ($query->num_rows() == 0) - { - return '0'; - } - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * Get_Where - * - * Allows the where clause, limit and offset to be added directly - * - * @access public - * @param string the where clause - * @param string the limit clause - * @param string the offset clause - * @return object - */ - function get_where($table = '', $where = null, $limit = null, $offset = null) - { - if ($table != '') - { - $this->from($table); - } - - if ( ! is_null($where)) - { - $this->where($where); - } - - if ( ! is_null($limit)) - { - $this->limit($limit, $offset); - } - - $sql = $this->_compile_select(); - - $result = $this->query($sql); - $this->_reset_select(); - return $result; - } - - // -------------------------------------------------------------------- - - /** - * getwhere() is an alias of get_where() - * this function is here for backwards compatibility, as - * getwhere() has been deprecated - */ - function getwhere($table = '', $where = null, $limit = null, $offset = null) - { - return $this->get_where($table, $where, $limit, $offset); - } - - // -------------------------------------------------------------------- - - /** - * Insert - * - * Compiles an insert string and runs the query - * - * @access public - * @param string the table to retrieve the results from - * @param array an associative array of insert values - * @return object - */ - function insert($table = '', $set = NULL) - { - if ( ! is_null($set)) - { - $this->set($set); - } - - if (count($this->ar_set) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_must_use_set'); - } - return FALSE; - } - - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - 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); - } - - // -------------------------------------------------------------------- - - /** - * Update - * - * Compiles an update string and runs the query - * - * @access public - * @param string the table to retrieve the results from - * @param array an associative array of update values - * @param mixed the where clause - * @return object - */ - function update($table = '', $set = NULL, $where = NULL, $limit = NULL) - { - // Combine any cached components with the current statements - $this->_merge_cache(); - - if ( ! is_null($set)) - { - $this->set($set); - } - - if (count($this->ar_set) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_must_use_set'); - } - return FALSE; - } - - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - - if ($where != NULL) - { - $this->where($where); - } - - if ($limit != NULL) - { - $this->limit($limit); - } - - $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); - } - - // -------------------------------------------------------------------- - - /** - * Empty Table - * - * Compiles a delete string and runs "DELETE FROM table" - * - * @access public - * @param string the table to empty - * @return object - */ - function empty_table($table = '') - { - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - else - { - $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); - } - - $sql = $this->_delete($table); - - $this->_reset_write(); - - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Truncate - * - * Compiles a truncate string and runs the query - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table to truncate - * @return object - */ - function truncate($table = '') - { - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - else - { - $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); - } - - $sql = $this->_truncate($table); - - $this->_reset_write(); - - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Delete - * - * Compiles a delete string and runs the query - * - * @access public - * @param mixed the table(s) to delete from. String or array - * @param mixed the where clause - * @param mixed the limit clause - * @param boolean - * @return object - */ - function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) - { - // Combine any cached components with the current statements - $this->_merge_cache(); - - if ($table == '') - { - if ( ! isset($this->ar_from[0])) - { - if ($this->db_debug) - { - return $this->display_error('db_must_set_table'); - } - return FALSE; - } - - $table = $this->ar_from[0]; - } - elseif (is_array($table)) - { - foreach($table as $single_table) - { - $this->delete($single_table, $where, $limit, FALSE); - } - - $this->_reset_write(); - return; - } - else - { - $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); - } - - if ($where != '') - { - $this->where($where); - } - - if ($limit != NULL) - { - $this->limit($limit); - } - - if (count($this->ar_where) == 0 && count($this->ar_like) == 0) - { - if ($this->db_debug) - { - return $this->display_error('db_del_must_use_where'); - } - - return FALSE; - } - - $sql = $this->_delete($table, $this->ar_where, $this->ar_like, $this->ar_limit); - - if ($reset_data) - { - $this->_reset_write(); - } - - return $this->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * DB Prefix - * - * Prepends a database prefix if one exists in configuration - * - * @access public - * @param string the table - * @return string - */ - function dbprefix($table = '') - { - if ($table == '') - { - $this->display_error('db_table_name_required'); - } - - return $this->dbprefix.$table; - } - - // -------------------------------------------------------------------- - - /** - * Track Aliases - * - * Used to track SQL statements written with aliased tables. - * - * @access private - * @param string The table to inspect - * @return string - */ - function _track_aliases($table) - { - if (is_array($table)) - { - foreach ($table as $t) - { - $this->_track_aliases($t); - } - return; - } - - // Does the string contain a comma? If so, we need to separate - // the string into discreet statements - if (strpos($table, ',') !== FALSE) - { - return $this->_track_aliases(explode(',', $table)); - } - - // if a table alias is used we can recognize it by a space - if (strpos($table, " ") !== FALSE) - { - // if the alias is written with the AS keyword, remove it - $table = preg_replace('/ AS /i', ' ', $table); - - // Grab the alias - $table = trim(strrchr($table, " ")); - - // Store the alias, if it doesn't already exist - if ( ! in_array($table, $this->ar_aliased_tables)) - { - $this->ar_aliased_tables[] = $table; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Compile the SELECT statement - * - * Generates a query string based on which functions were used. - * Should not be called directly. The get() function calls it. - * - * @access private - * @return string - */ - function _compile_select($select_override = FALSE) - { - // Combine any cached components with the current statements - $this->_merge_cache(); - - // ---------------------------------------------------------------- - - // Write the "select" portion of the query - - if ($select_override !== FALSE) - { - $sql = $select_override; - } - else - { - $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; - - if (count($this->ar_select) == 0) - { - $sql .= '*'; - } - else - { - // Cycle through the "select" portion of the query and prep each column name. - // The reason we protect identifiers here rather then in the select() function - // is because until the user calls the from() function we don't know if there are aliases - foreach ($this->ar_select as $key => $val) - { - $this->ar_select[$key] = $this->_protect_identifiers($val); - } - - $sql .= implode(', ', $this->ar_select); - } - } - - // ---------------------------------------------------------------- - - // Write the "FROM" portion of the query - - if (count($this->ar_from) > 0) - { - $sql .= "\nFROM "; - - $sql .= $this->_from_tables($this->ar_from); - } - - // ---------------------------------------------------------------- - - // Write the "JOIN" portion of the query - - if (count($this->ar_join) > 0) - { - $sql .= "\n"; - - $sql .= implode("\n", $this->ar_join); - } - - // ---------------------------------------------------------------- - - // Write the "WHERE" portion of the query - - if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) - { - $sql .= "\n"; - - $sql .= "WHERE "; - } - - $sql .= implode("\n", $this->ar_where); - - // ---------------------------------------------------------------- - - // Write the "LIKE" portion of the query - - if (count($this->ar_like) > 0) - { - if (count($this->ar_where) > 0) - { - $sql .= "\nAND "; - } - - $sql .= implode("\n", $this->ar_like); - } - - // ---------------------------------------------------------------- - - // Write the "GROUP BY" portion of the query - - if (count($this->ar_groupby) > 0) - { - $sql .= "\nGROUP BY "; - - $sql .= implode(', ', $this->ar_groupby); - } - - // ---------------------------------------------------------------- - - // Write the "HAVING" portion of the query - - if (count($this->ar_having) > 0) - { - $sql .= "\nHAVING "; - $sql .= implode("\n", $this->ar_having); - } - - // ---------------------------------------------------------------- - - // Write the "ORDER BY" portion of the query - - if (count($this->ar_orderby) > 0) - { - $sql .= "\nORDER BY "; - $sql .= implode(', ', $this->ar_orderby); - - if ($this->ar_order !== FALSE) - { - $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; - } - } - - // ---------------------------------------------------------------- - - // Write the "LIMIT" portion of the query - - if (is_numeric($this->ar_limit)) - { - $sql .= "\n"; - $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Object to Array - * - * Takes an object as input and converts the class variables to array key/vals - * - * @access public - * @param object - * @return array - */ - function _object_to_array($object) - { - if ( ! is_object($object)) - { - return $object; - } - - $array = array(); - foreach (get_object_vars($object) as $key => $val) - { - // There are some built in keys we need to ignore for this conversion - if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table') - { - $array[$key] = $val; - } - } - - return $array; - } - - // -------------------------------------------------------------------- - - /** - * Start Cache - * - * Starts AR caching - * - * @access public - * @return void - */ - function start_cache() - { - $this->ar_caching = TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Stop Cache - * - * Stops AR caching - * - * @access public - * @return void - */ - function stop_cache() - { - $this->ar_caching = FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Flush Cache - * - * Empties the AR cache - * - * @access public - * @return void - */ - function flush_cache() - { - $this->_reset_run( - array( - 'ar_cache_select' => array(), - 'ar_cache_from' => array(), - 'ar_cache_join' => array(), - 'ar_cache_where' => array(), - 'ar_cache_like' => array(), - 'ar_cache_groupby' => array(), - 'ar_cache_having' => array(), - 'ar_cache_orderby' => array(), - 'ar_cache_set' => array(), - 'ar_cache_exists' => array() - ) - ); - } - - // -------------------------------------------------------------------- - - /** - * Merge Cache - * - * When called, this function merges any cached AR arrays with - * locally called ones. - * - * @access private - * @return void - */ - function _merge_cache() - { - if (count($this->ar_cache_exists) == 0) - { - return; - } - - foreach ($this->ar_cache_exists as $val) - { - $ar_variable = 'ar_'.$val; - $ar_cache_var = 'ar_cache_'.$val; - - if (count($this->$ar_cache_var) == 0) - { - continue; - } - - $this->$ar_variable = array_unique(array_merge($this->$ar_cache_var, $this->$ar_variable)); - } - - // If we are "protecting identifiers" we need to examine the "from" - // portion of the query to determine if there are any aliases - if ($this->_protect_identifiers === TRUE AND count($this->ar_cache_from) > 0) - { - $this->_track_aliases($this->ar_from); - } - } - - // -------------------------------------------------------------------- - - /** - * Resets the active record values. Called by the get() function - * - * @access private - * @param array An array of fields to reset - * @return void - */ - function _reset_run($ar_reset_items) - { - foreach ($ar_reset_items as $item => $default_value) - { - if ( ! in_array($item, $this->ar_store_array)) - { - $this->$item = $default_value; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Resets the active record values. Called by the get() function - * - * @access private - * @return void - */ - function _reset_select() - { - $ar_reset_items = array( - 'ar_select' => array(), - 'ar_from' => array(), - 'ar_join' => array(), - 'ar_where' => array(), - 'ar_like' => array(), - 'ar_groupby' => array(), - 'ar_having' => array(), - 'ar_orderby' => array(), - 'ar_wherein' => array(), - 'ar_aliased_tables' => array(), - 'ar_distinct' => FALSE, - 'ar_limit' => FALSE, - 'ar_offset' => FALSE, - 'ar_order' => FALSE, - ); - - $this->_reset_run($ar_reset_items); - } - - // -------------------------------------------------------------------- - - /** - * Resets the active record "write" values. - * - * Called by the insert() update() and delete() functions - * - * @access private - * @return void - */ - function _reset_write() - { - $ar_reset_items = array( - 'ar_set' => array(), - 'ar_from' => array(), - 'ar_where' => array(), - 'ar_like' => array(), - 'ar_orderby' => array(), - 'ar_limit' => FALSE, - 'ar_order' => FALSE - ); - - $this->_reset_run($ar_reset_items); - } - -} - -/* End of file DB_active_rec.php */ +_protect_identifiers = $escape; + } + + if (is_string($select)) + { + $select = explode(',', $select); + } + + foreach ($select as $val) + { + $val = trim($val); + + if ($val != '') + { + $this->ar_select[] = $val; + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_select[] = $val; + $this->ar_cache_exists[] = 'select'; + } + } + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Select Max + * + * Generates a SELECT MAX(field) portion of a query + * + * @access public + * @param string the field + * @param string an alias + * @return object + */ + function select_max($select = '', $alias = '') + { + return $this->_max_min_avg_sum($select, $alias, 'MAX'); + } + + // -------------------------------------------------------------------- + + /** + * Select Min + * + * Generates a SELECT MIN(field) portion of a query + * + * @access public + * @param string the field + * @param string an alias + * @return object + */ + function select_min($select = '', $alias = '') + { + return $this->_max_min_avg_sum($select, $alias, 'MIN'); + } + + // -------------------------------------------------------------------- + + /** + * Select Average + * + * Generates a SELECT AVG(field) portion of a query + * + * @access public + * @param string the field + * @param string an alias + * @return object + */ + function select_avg($select = '', $alias = '') + { + return $this->_max_min_avg_sum($select, $alias, 'AVG'); + } + + // -------------------------------------------------------------------- + + /** + * Select Sum + * + * Generates a SELECT SUM(field) portion of a query + * + * @access public + * @param string the field + * @param string an alias + * @return object + */ + function select_sum($select = '', $alias = '') + { + return $this->_max_min_avg_sum($select, $alias, 'SUM'); + } + + // -------------------------------------------------------------------- + + /** + * Processing Function for the four functions above: + * + * select_max() + * select_min() + * select_avg() + * select_sum() + * + * @access public + * @param string the field + * @param string an alias + * @return object + */ + function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') + { + if ( ! is_string($select) OR $select == '') + { + $this->display_error('db_invalid_query'); + } + + $type = strtoupper($type); + + if ( ! in_array($type, array('MAX', 'MIN', 'AVG', 'SUM'))) + { + show_error('Invalid function type: '.$type); + } + + if ($alias == '') + { + $alias = $this->_create_alias_from_table(trim($select)); + } + + $sql = $type.'('.$this->_protect_identifiers(trim($select)).') AS '.$alias; + + $this->ar_select[] = $sql; + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_select[] = $sql; + $this->ar_cache_exists[] = 'select'; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Determines the alias name based on the table + * + * @access private + * @param string + * @return string + */ + function _create_alias_from_table($item) + { + if (strpos($item, '.') !== FALSE) + { + return end(explode('.', $item)); + } + + return $item; + } + + // -------------------------------------------------------------------- + + /** + * DISTINCT + * + * Sets a flag which tells the query string compiler to add DISTINCT + * + * @access public + * @param bool + * @return object + */ + function distinct($val = TRUE) + { + $this->ar_distinct = (is_bool($val)) ? $val : TRUE; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * From + * + * Generates the FROM portion of the query + * + * @access public + * @param mixed can be a string or array + * @return object + */ + function from($from) + { + foreach ((array)$from as $val) + { + if (strpos($val, ',') !== FALSE) + { + foreach (explode(',', $val) as $v) + { + $v = trim($v); + $this->_track_aliases($v); + + $this->ar_from[] = $this->_protect_identifiers($v, TRUE, NULL, FALSE); + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_from[] = $this->_protect_identifiers($v, TRUE, NULL, FALSE); + $this->ar_cache_exists[] = 'from'; + } + } + + } + else + { + $val = trim($val); + + // Extract any aliases that might exist. We use this information + // in the _protect_identifiers to know whether to add a table prefix + $this->_track_aliases($val); + + $this->ar_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_from[] = $this->_protect_identifiers($val, TRUE, NULL, FALSE); + $this->ar_cache_exists[] = 'from'; + } + } + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Join + * + * Generates the JOIN portion of the query + * + * @access public + * @param string + * @param string the join condition + * @param string the type of join + * @return object + */ + function join($table, $cond, $type = '') + { + if ($type != '') + { + $type = strtoupper(trim($type)); + + if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) + { + $type = ''; + } + else + { + $type .= ' '; + } + } + + // Extract any aliases that might exist. We use this information + // in the _protect_identifiers to know whether to add a table prefix + $this->_track_aliases($table); + + // Strip apart the condition and protect the identifiers + if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match)) + { + $match[1] = $this->_protect_identifiers($match[1]); + $match[3] = $this->_protect_identifiers($match[3]); + + $cond = $match[1].$match[2].$match[3]; + } + + // Assemble the JOIN statement + $join = $type.'JOIN '.$this->_protect_identifiers($table, TRUE, NULL, FALSE).' ON '.$cond; + + $this->ar_join[] = $join; + if ($this->ar_caching === TRUE) + { + $this->ar_cache_join[] = $join; + $this->ar_cache_exists[] = 'join'; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function where($key, $value = NULL, $escape = TRUE) + { + return $this->_where($key, $value, 'AND ', $escape); + } + + // -------------------------------------------------------------------- + + /** + * OR Where + * + * Generates the WHERE portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function or_where($key, $value = NULL, $escape = TRUE) + { + return $this->_where($key, $value, 'OR ', $escape); + } + + // -------------------------------------------------------------------- + + /** + * orwhere() is an alias of or_where() + * this function is here for backwards compatibility, as + * orwhere() has been deprecated + */ + function orwhere($key, $value = NULL, $escape = TRUE) + { + return $this->or_where($key, $value, $escape); + } + + // -------------------------------------------------------------------- + + /** + * Where + * + * Called by where() or orwhere() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _where($key, $value = NULL, $type = 'AND ', $escape = NULL) + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + // If the escape value was not set will will base it on the global setting + if ( ! is_bool($escape)) + { + $escape = $this->_protect_identifiers; + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_where) == 0 AND count($this->ar_cache_where) == 0) ? '' : $type; + + if (is_null($v) && ! $this->_has_operator($k)) + { + // value appears not to have been set, assign the test to IS NULL + $k .= ' IS NULL'; + } + + if ( ! is_null($v)) + { + if ($escape === TRUE) + { + $k = $this->_protect_identifiers($k, FALSE, $escape); + + $v = ' '.$this->escape($v); + } + + if ( ! $this->_has_operator($k)) + { + $k .= ' ='; + } + } + else + { + $k = $this->_protect_identifiers($k, FALSE, $escape); + } + + $this->ar_where[] = $prefix.$k.$v; + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_where[] = $prefix.$k.$v; + $this->ar_cache_exists[] = 'where'; + } + + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Where_in + * + * Generates a WHERE field IN ('item', 'item') SQL query joined with + * AND if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + * @return object + */ + function where_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values); + } + + // -------------------------------------------------------------------- + + /** + * Where_in_or + * + * Generates a WHERE field IN ('item', 'item') SQL query joined with + * OR if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + * @return object + */ + function or_where_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, FALSE, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Where_not_in + * + * Generates a WHERE field NOT IN ('item', 'item') SQL query joined + * with AND if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + * @return object + */ + function where_not_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Where_not_in_or + * + * Generates a WHERE field NOT IN ('item', 'item') SQL query joined + * with OR if appropriate + * + * @access public + * @param string The field to search + * @param array The values searched on + * @return object + */ + function or_where_not_in($key = NULL, $values = NULL) + { + return $this->_where_in($key, $values, TRUE, 'OR '); + } + + // -------------------------------------------------------------------- + + /** + * Where_in + * + * Called by where_in, where_in_or, where_not_in, where_not_in_or + * + * @access public + * @param string The field to search + * @param array The values searched on + * @param boolean If the statement would be IN or NOT IN + * @param string + * @return object + */ + function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') + { + if ($key === NULL OR $values === NULL) + { + return; + } + + if ( ! is_array($values)) + { + $values = array($values); + } + + $not = ($not) ? ' NOT' : ''; + + foreach ($values as $value) + { + $this->ar_wherein[] = $this->escape($value); + } + + $prefix = (count($this->ar_where) == 0) ? '' : $type; + + $where_in = $prefix . $this->_protect_identifiers($key) . $not . " IN (" . implode(", ", $this->ar_wherein) . ") "; + + $this->ar_where[] = $where_in; + if ($this->ar_caching === TRUE) + { + $this->ar_cache_where[] = $where_in; + $this->ar_cache_exists[] = 'where'; + } + + // reset the array for multiple calls + $this->ar_wherein = array(); + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'AND ', $side); + } + + // -------------------------------------------------------------------- + + /** + * Not Like + * + * Generates a NOT LIKE portion of the query. Separates + * multiple calls with AND + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function not_like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'AND ', $side, 'NOT'); + } + + // -------------------------------------------------------------------- + + /** + * OR Like + * + * Generates a %LIKE% portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function or_like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'OR ', $side); + } + + // -------------------------------------------------------------------- + + /** + * OR Not Like + * + * Generates a NOT LIKE portion of the query. Separates + * multiple calls with OR + * + * @access public + * @param mixed + * @param mixed + * @return object + */ + function or_not_like($field, $match = '', $side = 'both') + { + return $this->_like($field, $match, 'OR ', $side, 'NOT'); + } + + // -------------------------------------------------------------------- + + /** + * orlike() is an alias of or_like() + * this function is here for backwards compatibility, as + * orlike() has been deprecated + */ + function orlike($field, $match = '', $side = 'both') + { + return $this->or_like($field, $match, $side); + } + + // -------------------------------------------------------------------- + + /** + * Like + * + * Called by like() or orlike() + * + * @access private + * @param mixed + * @param mixed + * @param string + * @return object + */ + function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') + { + if ( ! is_array($field)) + { + $field = array($field => $match); + } + + foreach ($field as $k => $v) + { + $k = $this->_protect_identifiers($k); + + $prefix = (count($this->ar_like) == 0) ? '' : $type; + + $v = $this->escape_str($v); + + if ($side == 'before') + { + $like_statement = $prefix." $k $not LIKE '%{$v}'"; + } + elseif ($side == 'after') + { + $like_statement = $prefix." $k $not LIKE '{$v}%'"; + } + else + { + $like_statement = $prefix." $k $not LIKE '%{$v}%'"; + } + + $this->ar_like[] = $like_statement; + if ($this->ar_caching === TRUE) + { + $this->ar_cache_like[] = $like_statement; + $this->ar_cache_exists[] = 'like'; + } + + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * GROUP BY + * + * @access public + * @param string + * @return object + */ + function group_by($by) + { + if (is_string($by)) + { + $by = explode(',', $by); + } + + foreach ($by as $val) + { + $val = trim($val); + + if ($val != '') + { + $this->ar_groupby[] = $this->_protect_identifiers($val); + + if ($this->ar_caching === TRUE) + { + $this->ar_cache_groupby[] = $this->_protect_identifiers($val); + $this->ar_cache_exists[] = 'groupby'; + } + } + } + return $this; + } + + // -------------------------------------------------------------------- + + /** + * groupby() is an alias of group_by() + * this function is here for backwards compatibility, as + * groupby() has been deprecated + */ + function groupby($by) + { + return $this->group_by($by); + } + + // -------------------------------------------------------------------- + + /** + * Sets the HAVING value + * + * Separates multiple calls with AND + * + * @access public + * @param string + * @param string + * @return object + */ + function having($key, $value = '', $escape = TRUE) + { + return $this->_having($key, $value, 'AND ', $escape); + } + + // -------------------------------------------------------------------- + + /** + * orhaving() is an alias of or_having() + * this function is here for backwards compatibility, as + * orhaving() has been deprecated + */ + + function orhaving($key, $value = '', $escape = TRUE) + { + return $this->or_having($key, $value, $escape); + } + // -------------------------------------------------------------------- + + /** + * Sets the OR HAVING value + * + * Separates multiple calls with OR + * + * @access public + * @param string + * @param string + * @return object + */ + function or_having($key, $value = '', $escape = TRUE) + { + return $this->_having($key, $value, 'OR ', $escape); + } + + // -------------------------------------------------------------------- + + /** + * Sets the HAVING values + * + * Called by having() or or_having() + * + * @access private + * @param string + * @param string + * @return object + */ + function _having($key, $value = '', $type = 'AND ', $escape = TRUE) + { + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + $prefix = (count($this->ar_having) == 0) ? '' : $type; + + if ($escape === TRUE) + { + $k = $this->_protect_identifiers($k); + } + + if ( ! $this->_has_operator($k)) + { + $k .= ' = '; + } + + if ($v != '') + { + $v = ' '.$this->escape_str($v); + } + + $this->ar_having[] = $prefix.$k.$v; + if ($this->ar_caching === TRUE) + { + $this->ar_cache_having[] = $prefix.$k.$v; + $this->ar_cache_exists[] = 'having'; + } + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the ORDER BY value + * + * @access public + * @param string + * @param string direction: asc or desc + * @return object + */ + function order_by($orderby, $direction = '') + { + if (strtolower($direction) == 'random') + { + $orderby = ''; // Random results want or don't need a field name + $direction = $this->_random_keyword; + } + elseif (trim($direction) != '') + { + $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; + } + + + if (strpos($orderby, ',') !== FALSE) + { + $temp = array(); + foreach (explode(',', $orderby) as $part) + { + $part = trim($part); + if ( ! in_array($part, $this->ar_aliased_tables)) + { + $part = $this->_protect_identifiers(trim($part)); + } + + $temp[] = $part; + } + + $orderby = implode(', ', $temp); + } + else + { + $orderby = $this->_protect_identifiers($orderby); + } + + $orderby_statement = $orderby.$direction; + + $this->ar_orderby[] = $orderby_statement; + if ($this->ar_caching === TRUE) + { + $this->ar_cache_orderby[] = $orderby_statement; + $this->ar_cache_exists[] = 'orderby'; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * orderby() is an alias of order_by() + * this function is here for backwards compatibility, as + * orderby() has been deprecated + */ + function orderby($orderby, $direction = '') + { + return $this->order_by($orderby, $direction); + } + + // -------------------------------------------------------------------- + + /** + * Sets the LIMIT value + * + * @access public + * @param integer the limit value + * @param integer the offset value + * @return object + */ + function limit($value, $offset = '') + { + $this->ar_limit = $value; + + if ($offset != '') + { + $this->ar_offset = $offset; + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Sets the OFFSET value + * + * @access public + * @param integer the offset value + * @return object + */ + function offset($offset) + { + $this->ar_offset = $offset; + return $this; + } + + // -------------------------------------------------------------------- + + /** + * The "set" function. Allows key/value pairs to be set for inserting or updating + * + * @access public + * @param mixed + * @param string + * @param boolean + * @return object + */ + function set($key, $value = '', $escape = TRUE) + { + $key = $this->_object_to_array($key); + + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + foreach ($key as $k => $v) + { + if ($escape === FALSE) + { + $this->ar_set[$this->_protect_identifiers($k)] = $v; + } + else + { + $this->ar_set[$this->_protect_identifiers($k)] = $this->escape($v); + } + } + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Get + * + * Compiles the select statement based on the other functions called + * and runs the query + * + * @access public + * @param string the table + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function get($table = '', $limit = null, $offset = null) + { + if ($table != '') + { + $this->_track_aliases($table); + $this->from($table); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $result = $this->query($sql); + $this->_reset_select(); + return $result; + } + + /** + * "Count All Results" query + * + * Generates a platform-specific query string that counts all records + * returned by an Active Record query. + * + * @access public + * @param string + * @return string + */ + function count_all_results($table = '') + { + if ($table != '') + { + $this->_track_aliases($table); + $this->from($table); + } + + $sql = $this->_compile_select($this->_count_string . $this->_protect_identifiers('numrows')); + + $query = $this->query($sql); + $this->_reset_select(); + + if ($query->num_rows() == 0) + { + return '0'; + } + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * Get_Where + * + * Allows the where clause, limit and offset to be added directly + * + * @access public + * @param string the where clause + * @param string the limit clause + * @param string the offset clause + * @return object + */ + function get_where($table = '', $where = null, $limit = null, $offset = null) + { + if ($table != '') + { + $this->from($table); + } + + if ( ! is_null($where)) + { + $this->where($where); + } + + if ( ! is_null($limit)) + { + $this->limit($limit, $offset); + } + + $sql = $this->_compile_select(); + + $result = $this->query($sql); + $this->_reset_select(); + return $result; + } + + // -------------------------------------------------------------------- + + /** + * getwhere() is an alias of get_where() + * this function is here for backwards compatibility, as + * getwhere() has been deprecated + */ + function getwhere($table = '', $where = null, $limit = null, $offset = null) + { + return $this->get_where($table, $where, $limit, $offset); + } + + // -------------------------------------------------------------------- + + /** + * Insert + * + * Compiles an insert string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of insert values + * @return object + */ + function insert($table = '', $set = NULL) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + 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); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * Compiles an update string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of update values + * @param mixed the where clause + * @return object + */ + function update($table = '', $set = NULL, $where = NULL, $limit = NULL) + { + // Combine any cached components with the current statements + $this->_merge_cache(); + + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + if ($where != NULL) + { + $this->where($where); + } + + if ($limit != NULL) + { + $this->limit($limit); + } + + $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); + } + + // -------------------------------------------------------------------- + + /** + * Empty Table + * + * Compiles a delete string and runs "DELETE FROM table" + * + * @access public + * @param string the table to empty + * @return object + */ + function empty_table($table = '') + { + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + else + { + $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); + } + + $sql = $this->_delete($table); + + $this->_reset_write(); + + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Truncate + * + * Compiles a truncate string and runs the query + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table to truncate + * @return object + */ + function truncate($table = '') + { + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + else + { + $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); + } + + $sql = $this->_truncate($table); + + $this->_reset_write(); + + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * Compiles a delete string and runs the query + * + * @access public + * @param mixed the table(s) to delete from. String or array + * @param mixed the where clause + * @param mixed the limit clause + * @param boolean + * @return object + */ + function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) + { + // Combine any cached components with the current statements + $this->_merge_cache(); + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + elseif (is_array($table)) + { + foreach($table as $single_table) + { + $this->delete($single_table, $where, $limit, FALSE); + } + + $this->_reset_write(); + return; + } + else + { + $table = $this->_protect_identifiers($table, TRUE, NULL, FALSE); + } + + if ($where != '') + { + $this->where($where); + } + + if ($limit != NULL) + { + $this->limit($limit); + } + + if (count($this->ar_where) == 0 && count($this->ar_like) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_del_must_use_where'); + } + + return FALSE; + } + + $sql = $this->_delete($table, $this->ar_where, $this->ar_like, $this->ar_limit); + + if ($reset_data) + { + $this->_reset_write(); + } + + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * DB Prefix + * + * Prepends a database prefix if one exists in configuration + * + * @access public + * @param string the table + * @return string + */ + function dbprefix($table = '') + { + if ($table == '') + { + $this->display_error('db_table_name_required'); + } + + return $this->dbprefix.$table; + } + + // -------------------------------------------------------------------- + + /** + * Track Aliases + * + * Used to track SQL statements written with aliased tables. + * + * @access private + * @param string The table to inspect + * @return string + */ + function _track_aliases($table) + { + if (is_array($table)) + { + foreach ($table as $t) + { + $this->_track_aliases($t); + } + return; + } + + // Does the string contain a comma? If so, we need to separate + // the string into discreet statements + if (strpos($table, ',') !== FALSE) + { + return $this->_track_aliases(explode(',', $table)); + } + + // if a table alias is used we can recognize it by a space + if (strpos($table, " ") !== FALSE) + { + // if the alias is written with the AS keyword, remove it + $table = preg_replace('/ AS /i', ' ', $table); + + // Grab the alias + $table = trim(strrchr($table, " ")); + + // Store the alias, if it doesn't already exist + if ( ! in_array($table, $this->ar_aliased_tables)) + { + $this->ar_aliased_tables[] = $table; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Compile the SELECT statement + * + * Generates a query string based on which functions were used. + * Should not be called directly. The get() function calls it. + * + * @access private + * @return string + */ + function _compile_select($select_override = FALSE) + { + // Combine any cached components with the current statements + $this->_merge_cache(); + + // ---------------------------------------------------------------- + + // Write the "select" portion of the query + + if ($select_override !== FALSE) + { + $sql = $select_override; + } + else + { + $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT '; + + if (count($this->ar_select) == 0) + { + $sql .= '*'; + } + else + { + // Cycle through the "select" portion of the query and prep each column name. + // The reason we protect identifiers here rather then in the select() function + // is because until the user calls the from() function we don't know if there are aliases + foreach ($this->ar_select as $key => $val) + { + $this->ar_select[$key] = $this->_protect_identifiers($val); + } + + $sql .= implode(', ', $this->ar_select); + } + } + + // ---------------------------------------------------------------- + + // Write the "FROM" portion of the query + + if (count($this->ar_from) > 0) + { + $sql .= "\nFROM "; + + $sql .= $this->_from_tables($this->ar_from); + } + + // ---------------------------------------------------------------- + + // Write the "JOIN" portion of the query + + if (count($this->ar_join) > 0) + { + $sql .= "\n"; + + $sql .= implode("\n", $this->ar_join); + } + + // ---------------------------------------------------------------- + + // Write the "WHERE" portion of the query + + if (count($this->ar_where) > 0 OR count($this->ar_like) > 0) + { + $sql .= "\n"; + + $sql .= "WHERE "; + } + + $sql .= implode("\n", $this->ar_where); + + // ---------------------------------------------------------------- + + // Write the "LIKE" portion of the query + + if (count($this->ar_like) > 0) + { + if (count($this->ar_where) > 0) + { + $sql .= "\nAND "; + } + + $sql .= implode("\n", $this->ar_like); + } + + // ---------------------------------------------------------------- + + // Write the "GROUP BY" portion of the query + + if (count($this->ar_groupby) > 0) + { + $sql .= "\nGROUP BY "; + + $sql .= implode(', ', $this->ar_groupby); + } + + // ---------------------------------------------------------------- + + // Write the "HAVING" portion of the query + + if (count($this->ar_having) > 0) + { + $sql .= "\nHAVING "; + $sql .= implode("\n", $this->ar_having); + } + + // ---------------------------------------------------------------- + + // Write the "ORDER BY" portion of the query + + if (count($this->ar_orderby) > 0) + { + $sql .= "\nORDER BY "; + $sql .= implode(', ', $this->ar_orderby); + + if ($this->ar_order !== FALSE) + { + $sql .= ($this->ar_order == 'desc') ? ' DESC' : ' ASC'; + } + } + + // ---------------------------------------------------------------- + + // Write the "LIMIT" portion of the query + + if (is_numeric($this->ar_limit)) + { + $sql .= "\n"; + $sql = $this->_limit($sql, $this->ar_limit, $this->ar_offset); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @access public + * @param object + * @return array + */ + function _object_to_array($object) + { + if ( ! is_object($object)) + { + return $object; + } + + $array = array(); + foreach (get_object_vars($object) as $key => $val) + { + // There are some built in keys we need to ignore for this conversion + if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table') + { + $array[$key] = $val; + } + } + + return $array; + } + + // -------------------------------------------------------------------- + + /** + * Start Cache + * + * Starts AR caching + * + * @access public + * @return void + */ + function start_cache() + { + $this->ar_caching = TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Stop Cache + * + * Stops AR caching + * + * @access public + * @return void + */ + function stop_cache() + { + $this->ar_caching = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Flush Cache + * + * Empties the AR cache + * + * @access public + * @return void + */ + function flush_cache() + { + $this->_reset_run( + array( + 'ar_cache_select' => array(), + 'ar_cache_from' => array(), + 'ar_cache_join' => array(), + 'ar_cache_where' => array(), + 'ar_cache_like' => array(), + 'ar_cache_groupby' => array(), + 'ar_cache_having' => array(), + 'ar_cache_orderby' => array(), + 'ar_cache_set' => array(), + 'ar_cache_exists' => array() + ) + ); + } + + // -------------------------------------------------------------------- + + /** + * Merge Cache + * + * When called, this function merges any cached AR arrays with + * locally called ones. + * + * @access private + * @return void + */ + function _merge_cache() + { + if (count($this->ar_cache_exists) == 0) + { + return; + } + + foreach ($this->ar_cache_exists as $val) + { + $ar_variable = 'ar_'.$val; + $ar_cache_var = 'ar_cache_'.$val; + + if (count($this->$ar_cache_var) == 0) + { + continue; + } + + $this->$ar_variable = array_unique(array_merge($this->$ar_cache_var, $this->$ar_variable)); + } + + // If we are "protecting identifiers" we need to examine the "from" + // portion of the query to determine if there are any aliases + if ($this->_protect_identifiers === TRUE AND count($this->ar_cache_from) > 0) + { + $this->_track_aliases($this->ar_from); + } + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record values. Called by the get() function + * + * @access private + * @param array An array of fields to reset + * @return void + */ + function _reset_run($ar_reset_items) + { + foreach ($ar_reset_items as $item => $default_value) + { + if ( ! in_array($item, $this->ar_store_array)) + { + $this->$item = $default_value; + } + } + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record values. Called by the get() function + * + * @access private + * @return void + */ + function _reset_select() + { + $ar_reset_items = array( + 'ar_select' => array(), + 'ar_from' => array(), + 'ar_join' => array(), + 'ar_where' => array(), + 'ar_like' => array(), + 'ar_groupby' => array(), + 'ar_having' => array(), + 'ar_orderby' => array(), + 'ar_wherein' => array(), + 'ar_aliased_tables' => array(), + 'ar_distinct' => FALSE, + 'ar_limit' => FALSE, + 'ar_offset' => FALSE, + 'ar_order' => FALSE, + ); + + $this->_reset_run($ar_reset_items); + } + + // -------------------------------------------------------------------- + + /** + * Resets the active record "write" values. + * + * Called by the insert() update() and delete() functions + * + * @access private + * @return void + */ + function _reset_write() + { + $ar_reset_items = array( + 'ar_set' => array(), + 'ar_from' => array(), + 'ar_where' => array(), + 'ar_like' => array(), + 'ar_orderby' => array(), + 'ar_limit' => FALSE, + 'ar_order' => FALSE + ); + + $this->_reset_run($ar_reset_items); + } + +} + +/* End of file DB_active_rec.php */ /* Location: ./system/database/DB_active_rec.php */ \ No newline at end of file diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 9bb1b165..70a2d95e 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -1,195 +1,195 @@ -CI - // and load the file helper since we use it a lot - $this->CI =& get_instance(); - $this->db =& $db; - $this->CI->load->helper('file'); - } - - // -------------------------------------------------------------------- - - /** - * Set Cache Directory Path - * - * @access public - * @param string the path to the cache directory - * @return bool - */ - function check_path($path = '') - { - if ($path == '') - { - if ($this->db->cachedir == '') - { - return $this->db->cache_off(); - } - - $path = $this->db->cachedir; - } - - // Add a trailing slash to the path if needed - $path = preg_replace("/(.+?)\/*$/", "\\1/", $path); - - if ( ! is_dir($path) OR ! is_really_writable($path)) - { - // If the path is wrong we'll turn off caching - return $this->db->cache_off(); - } - - $this->db->cachedir = $path; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Retrieve a cached query - * - * The URI being requested will become the name of the cache sub-folder. - * An MD5 hash of the SQL statement will become the cache file name - * - * @access public - * @return string - */ - function read($sql) - { - if ( ! $this->check_path()) - { - return $this->db->cache_off(); - } - - $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); - - $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - - $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql); - - if (FALSE === ($cachedata = read_file($filepath))) - { - return FALSE; - } - - return unserialize($cachedata); - } - - // -------------------------------------------------------------------- - - /** - * Write a query to a cache file - * - * @access public - * @return bool - */ - function write($sql, $object) - { - if ( ! $this->check_path()) - { - return $this->db->cache_off(); - } - - $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); - - $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - - $dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'; - - $filename = md5($sql); - - if ( ! @is_dir($dir_path)) - { - if ( ! @mkdir($dir_path, DIR_WRITE_MODE)) - { - return FALSE; - } - - @chmod($dir_path, DIR_WRITE_MODE); - } - - if (write_file($dir_path.$filename, serialize($object)) === FALSE) - { - return FALSE; - } - - @chmod($dir_path.$filename, DIR_WRITE_MODE); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Delete cache files within a particular directory - * - * @access public - * @return bool - */ - function delete($segment_one = '', $segment_two = '') - { - if ($segment_one == '') - { - $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); - } - - if ($segment_two == '') - { - $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); - } - - $dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'; - - delete_files($dir_path, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * Delete all existing cache files - * - * @access public - * @return bool - */ - function delete_all() - { - delete_files($this->db->cachedir, TRUE); - } - -} - - -/* End of file DB_cache.php */ +CI + // and load the file helper since we use it a lot + $this->CI =& get_instance(); + $this->db =& $db; + $this->CI->load->helper('file'); + } + + // -------------------------------------------------------------------- + + /** + * Set Cache Directory Path + * + * @access public + * @param string the path to the cache directory + * @return bool + */ + function check_path($path = '') + { + if ($path == '') + { + if ($this->db->cachedir == '') + { + return $this->db->cache_off(); + } + + $path = $this->db->cachedir; + } + + // Add a trailing slash to the path if needed + $path = preg_replace("/(.+?)\/*$/", "\\1/", $path); + + if ( ! is_dir($path) OR ! is_really_writable($path)) + { + // If the path is wrong we'll turn off caching + return $this->db->cache_off(); + } + + $this->db->cachedir = $path; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Retrieve a cached query + * + * The URI being requested will become the name of the cache sub-folder. + * An MD5 hash of the SQL statement will become the cache file name + * + * @access public + * @return string + */ + function read($sql) + { + if ( ! $this->check_path()) + { + return $this->db->cache_off(); + } + + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); + + $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + + $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql); + + if (FALSE === ($cachedata = read_file($filepath))) + { + return FALSE; + } + + return unserialize($cachedata); + } + + // -------------------------------------------------------------------- + + /** + * Write a query to a cache file + * + * @access public + * @return bool + */ + function write($sql, $object) + { + if ( ! $this->check_path()) + { + return $this->db->cache_off(); + } + + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); + + $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + + $dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'; + + $filename = md5($sql); + + if ( ! @is_dir($dir_path)) + { + if ( ! @mkdir($dir_path, DIR_WRITE_MODE)) + { + return FALSE; + } + + @chmod($dir_path, DIR_WRITE_MODE); + } + + if (write_file($dir_path.$filename, serialize($object)) === FALSE) + { + return FALSE; + } + + @chmod($dir_path.$filename, DIR_WRITE_MODE); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Delete cache files within a particular directory + * + * @access public + * @return bool + */ + function delete($segment_one = '', $segment_two = '') + { + if ($segment_one == '') + { + $segment_one = ($this->CI->uri->segment(1) == FALSE) ? 'default' : $this->CI->uri->segment(1); + } + + if ($segment_two == '') + { + $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); + } + + $dir_path = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'; + + delete_files($dir_path, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Delete all existing cache files + * + * @access public + * @return bool + */ + function delete_all() + { + delete_files($this->db->cachedir, TRUE); + } + +} + + +/* End of file DB_cache.php */ /* Location: ./system/database/DB_cache.php */ \ No newline at end of file diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index dbd82dbc..4293acc9 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1,1319 +1,1319 @@ - $val) - { - $this->$key = $val; - } - } - - log_message('debug', 'Database Driver Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Initialize Database Settings - * - * @access private Called by the constructor - * @param mixed - * @return void - */ - function initialize() - { - // If an existing connection resource is available - // there is no need to connect and select the database - if (is_resource($this->conn_id) OR is_object($this->conn_id)) - { - return TRUE; - } - - // ---------------------------------------------------------------- - - // 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 - if ( ! $this->conn_id) - { - log_message('error', 'Unable to connect to the database'); - - if ($this->db_debug) - { - $this->display_error('db_unable_to_connect'); - } - return FALSE; - } - - // ---------------------------------------------------------------- - - // Select the DB... assuming a database name is specified in the config file - if ($this->database != '') - { - if ( ! $this->db_select()) - { - log_message('error', 'Unable to select database: '.$this->database); - - if ($this->db_debug) - { - $this->display_error('db_unable_to_select', $this->database); - } - return FALSE; - } - else - { - // We've selected the DB. Now we set the character set - if ( ! $this->db_set_charset($this->char_set, $this->dbcollat)) - { - return FALSE; - } - - return TRUE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - if ( ! $this->_db_set_charset($this->char_set, $this->dbcollat)) - { - log_message('error', 'Unable to set database connection charset: '.$this->char_set); - - if ($this->db_debug) - { - $this->display_error('db_unable_to_set_charset', $this->char_set); - } - - return FALSE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * The name of the platform in use (mysql, mssql, etc...) - * - * @access public - * @return string - */ - function platform() - { - return $this->dbdriver; - } - - // -------------------------------------------------------------------- - - /** - * Database Version Number. Returns a string containing the - * version of the database being used - * - * @access public - * @return string - */ - function version() - { - if (FALSE === ($sql = $this->_version())) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - if ($this->dbdriver == 'oci8') - { - return $sql; - } - - $query = $this->query($sql); - return $query->row('ver'); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * Accepts an SQL string as input and returns a result object upon - * successful execution of a "read" type query. Returns boolean TRUE - * upon successful execution of a "write" type query. Returns boolean - * FALSE upon failure, and if the $db_debug variable is set to TRUE - * will raise an error. - * - * @access public - * @param string An SQL query string - * @param array An array of binding data - * @return mixed - */ - function query($sql, $binds = FALSE, $return_object = TRUE) - { - if ($sql == '') - { - if ($this->db_debug) - { - log_message('error', 'Invalid query: '.$sql); - return $this->display_error('db_invalid_query'); - } - return FALSE; - } - - // Verify table prefix and replace if necessary - if ( ($this->dbprefix != '' AND $this->swap_pre != '') AND ($this->dbprefix != $this->swap_pre) ) - { - $sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql); - } - - // Is query caching enabled? If the query is a "read type" - // we will load the caching class and return the previously - // cached query if it exists - if ($this->cache_on == TRUE AND stristr($sql, 'SELECT')) - { - if ($this->_cache_init()) - { - $this->load_rdriver(); - if (FALSE !== ($cache = $this->CACHE->read($sql))) - { - return $cache; - } - } - } - - // Compile binds if needed - if ($binds !== FALSE) - { - $sql = $this->compile_binds($sql, $binds); - } - - // Save the query for debugging - if ($this->save_queries == TRUE) - { - $this->queries[] = $sql; - } - - // Start the Query Timer - $time_start = list($sm, $ss) = explode(' ', microtime()); - - // Run the Query - if (FALSE === ($this->result_id = $this->simple_query($sql))) - { - if ($this->save_queries == TRUE) - { - $this->query_times[] = 0; - } - - // This will trigger a rollback if transactions are being used - $this->_trans_status = FALSE; - - if ($this->db_debug) - { - // grab the error number and message now, as we might run some - // additional queries before displaying the error - $error_no = $this->_error_number(); - $error_msg = $this->_error_message(); - - // We call this function in order to roll-back queries - // if transactions are enabled. If we don't call this here - // the error message will trigger an exit, causing the - // transactions to remain in limbo. - $this->trans_complete(); - - // Log and display errors - log_message('error', 'Query error: '.$error_msg); - return $this->display_error( - array( - 'Error Number: '.$error_no, - $error_msg, - $sql - ) - ); - } - - return FALSE; - } - - // Stop and aggregate the query time results - $time_end = list($em, $es) = explode(' ', microtime()); - $this->benchmark += ($em + $es) - ($sm + $ss); - - if ($this->save_queries == TRUE) - { - $this->query_times[] = ($em + $es) - ($sm + $ss); - } - - // Increment the query counter - $this->query_count++; - - // Was the query a "write" type? - // If so we'll simply return true - if ($this->is_write_type($sql) === TRUE) - { - // If caching is enabled we'll auto-cleanup any - // existing files related to this particular URI - if ($this->cache_on == TRUE AND $this->cache_autodel == TRUE AND $this->_cache_init()) - { - $this->CACHE->delete(); - } - - return TRUE; - } - - // Return TRUE if we don't need to create a result object - // Currently only the Oracle driver uses this when stored - // procedures are used - if ($return_object !== TRUE) - { - return TRUE; - } - - // Load and instantiate the result driver - - $driver = $this->load_rdriver(); - $RES = new $driver(); - $RES->conn_id = $this->conn_id; - $RES->result_id = $this->result_id; - - if ($this->dbdriver == 'oci8') - { - $RES->stmt_id = $this->stmt_id; - $RES->curs_id = NULL; - $RES->limit_used = $this->limit_used; - $this->stmt_id = FALSE; - } - - // oci8 vars must be set before calling this - $RES->num_rows = $RES->num_rows(); - - // Is query caching enabled? If so, we'll serialize the - // result object and save it to a cache file. - if ($this->cache_on == TRUE AND $this->_cache_init()) - { - // We'll create a new instance of the result object - // only without the platform specific driver since - // we can't use it with cached data (the query result - // resource ID won't be any good once we've cached the - // result object, so we'll have to compile the data - // and save it) - $CR = new CI_DB_result(); - $CR->num_rows = $RES->num_rows(); - $CR->result_object = $RES->result_object(); - $CR->result_array = $RES->result_array(); - - // Reset these since cached objects can not utilize resource IDs. - $CR->conn_id = NULL; - $CR->result_id = NULL; - - $this->CACHE->write($sql, $CR); - } - - return $RES; - } - - // -------------------------------------------------------------------- - - /** - * Load the result drivers - * - * @access public - * @return string the name of the result class - */ - function load_rdriver() - { - $driver = 'CI_DB_'.$this->dbdriver.'_result'; - - if ( ! class_exists($driver)) - { - include_once(BASEPATH.'database/DB_result'.EXT); - include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); - } - - return $driver; - } - - // -------------------------------------------------------------------- - - /** - * Simple Query - * This is a simplified version of the query() function. Internally - * we only use it when running transaction commands since they do - * not require all the features of the main query() function. - * - * @access public - * @param string the sql query - * @return mixed - */ - function simple_query($sql) - { - if ( ! $this->conn_id) - { - $this->initialize(); - } - - return $this->_execute($sql); - } - - // -------------------------------------------------------------------- - - /** - * Disable Transactions - * This permits transactions to be disabled at run-time. - * - * @access public - * @return void - */ - function trans_off() - { - $this->trans_enabled = FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Enable/disable Transaction Strict Mode - * When strict mode is enabled, if you are running multiple groups of - * transactions, if one group fails all groups will be rolled back. - * If strict mode is disabled, each group is treated autonomously, meaning - * a failure of one group will not affect any others - * - * @access public - * @return void - */ - function trans_strict($mode = TRUE) - { - $this->trans_strict = is_bool($mode) ? $mode : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Start Transaction - * - * @access public - * @return void - */ - function trans_start($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return FALSE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - $this->_trans_depth += 1; - return; - } - - $this->trans_begin($test_mode); - } - - // -------------------------------------------------------------------- - - /** - * Complete Transaction - * - * @access public - * @return bool - */ - function trans_complete() - { - if ( ! $this->trans_enabled) - { - return FALSE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 1) - { - $this->_trans_depth -= 1; - return TRUE; - } - - // The query() function will set this flag to FALSE in the event that a query failed - if ($this->_trans_status === FALSE) - { - $this->trans_rollback(); - - // If we are NOT running in strict mode, we will reset - // the _trans_status flag so that subsequent groups of transactions - // will be permitted. - if ($this->trans_strict === FALSE) - { - $this->_trans_status = TRUE; - } - - log_message('debug', 'DB Transaction Failure'); - return FALSE; - } - - $this->trans_commit(); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Lets you retrieve the transaction flag to determine if it has failed - * - * @access public - * @return bool - */ - function trans_status() - { - return $this->_trans_status; - } - - // -------------------------------------------------------------------- - - /** - * Compile Bindings - * - * @access public - * @param string the sql statement - * @param array an array of bind data - * @return string - */ - function compile_binds($sql, $binds) - { - if (strpos($sql, $this->bind_marker) === FALSE) - { - return $sql; - } - - if ( ! is_array($binds)) - { - $binds = array($binds); - } - - // Get the sql segments around the bind markers - $segments = explode($this->bind_marker, $sql); - - // The count of bind should be 1 less then the count of segments - // If there are more bind arguments trim it down - if (count($binds) >= count($segments)) { - $binds = array_slice($binds, 0, count($segments)-1); - } - - // Construct the binded query - $result = $segments[0]; - $i = 0; - foreach ($binds as $bind) - { - $result .= $this->escape($bind); - $result .= $segments[++$i]; - } - - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Determines if a query is a "write" type. - * - * @access public - * @param string An SQL query string - * @return boolean - */ - function is_write_type($sql) - { - if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) - { - return FALSE; - } - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Calculate the aggregate query elapsed time - * - * @access public - * @param integer The number of decimal places - * @return integer - */ - function elapsed_time($decimals = 6) - { - return number_format($this->benchmark, $decimals); - } - - // -------------------------------------------------------------------- - - /** - * Returns the total number of queries - * - * @access public - * @return integer - */ - function total_queries() - { - return $this->query_count; - } - - // -------------------------------------------------------------------- - - /** - * Returns the last query that was executed - * - * @access public - * @return void - */ - function last_query() - { - return end($this->queries); - } - - // -------------------------------------------------------------------- - - /** - * "Smart" Escape String - * - * Escapes data based on type - * Sets boolean and null types - * - * @access public - * @param string - * @return integer - */ - function escape($str) - { - switch (gettype($str)) - { - case 'string' : $str = "'".$this->escape_str($str)."'"; - break; - case 'boolean' : $str = ($str === FALSE) ? 0 : 1; - break; - default : $str = ($str === NULL) ? 'NULL' : $str; - break; - } - - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Primary - * - * Retrieves the primary key. It assumes that the row in the first - * position is the primary key - * - * @access public - * @param string the table name - * @return string - */ - function primary($table = '') - { - $fields = $this->list_fields($table); - - if ( ! is_array($fields)) - { - return FALSE; - } - - return current($fields); - } - - // -------------------------------------------------------------------- - - /** - * Returns an array of table names - * - * @access public - * @return array - */ - function list_tables($constrain_by_prefix = FALSE) - { - // Is there a cached result? - if (isset($this->data_cache['table_names'])) - { - return $this->data_cache['table_names']; - } - - if (FALSE === ($sql = $this->_list_tables($constrain_by_prefix))) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - $retval = array(); - $query = $this->query($sql); - - if ($query->num_rows() > 0) - { - foreach($query->result_array() as $row) - { - if (isset($row['TABLE_NAME'])) - { - $retval[] = $row['TABLE_NAME']; - } - else - { - $retval[] = array_shift($row); - } - } - } - - $this->data_cache['table_names'] = $retval; - return $this->data_cache['table_names']; - } - - // -------------------------------------------------------------------- - - /** - * Determine if a particular table exists - * @access public - * @return boolean - */ - function table_exists($table_name) - { - return ( ! in_array($this->_protect_identifiers($table_name, TRUE, FALSE, FALSE), $this->list_tables())) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Fetch MySQL Field Names - * - * @access public - * @param string the table name - * @return array - */ - function list_fields($table = '') - { - // Is there a cached result? - if (isset($this->data_cache['field_names'][$table])) - { - return $this->data_cache['field_names'][$table]; - } - - if ($table == '') - { - if ($this->db_debug) - { - return $this->display_error('db_field_param_missing'); - } - return FALSE; - } - - if (FALSE === ($sql = $this->_list_columns($this->_protect_identifiers($table, TRUE, NULL, FALSE)))) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - - $query = $this->query($sql); - - $retval = array(); - foreach($query->result_array() as $row) - { - if (isset($row['COLUMN_NAME'])) - { - $retval[] = $row['COLUMN_NAME']; - } - else - { - $retval[] = current($row); - } - } - - $this->data_cache['field_names'][$table] = $retval; - return $this->data_cache['field_names'][$table]; - } - - // -------------------------------------------------------------------- - - /** - * Determine if a particular field exists - * @access public - * @param string - * @param string - * @return boolean - */ - function field_exists($field_name, $table_name) - { - return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Returns an object with field data - * - * @access public - * @param string the table name - * @return object - */ - function field_data($table = '') - { - if ($table == '') - { - if ($this->db_debug) - { - return $this->display_error('db_field_param_missing'); - } - return FALSE; - } - - $query = $this->query($this->_field_data($this->_protect_identifiers($table, TRUE, NULL, FALSE))); - - return $query->field_data(); - } - - // -------------------------------------------------------------------- - - /** - * Generate an insert string - * - * @access public - * @param string the table upon which the query will be performed - * @param array an associative array data of key/values - * @return string - */ - function insert_string($table, $data) - { - $fields = array(); - $values = array(); - - foreach($data as $key => $val) - { - $fields[] = $this->_escape_identifiers($key); - $values[] = $this->escape($val); - } - - return $this->_insert($this->_protect_identifiers($table, TRUE, NULL, FALSE), $fields, $values); - } - - // -------------------------------------------------------------------- - - /** - * Generate an update string - * - * @access public - * @param string the table upon which the query will be performed - * @param array an associative array data of key/values - * @param mixed the "where" statement - * @return string - */ - function update_string($table, $data, $where) - { - if ($where == '') - { - return false; - } - - $fields = array(); - foreach($data as $key => $val) - { - $fields[$this->_protect_identifiers($key)] = $this->escape($val); - } - - if ( ! is_array($where)) - { - $dest = array($where); - } - else - { - $dest = array(); - foreach ($where as $key => $val) - { - $prefix = (count($dest) == 0) ? '' : ' AND '; - - if ($val !== '') - { - if ( ! $this->_has_operator($key)) - { - $key .= ' ='; - } - - $val = ' '.$this->escape($val); - } - - $dest[] = $prefix.$key.$val; - } - } - - return $this->_update($this->_protect_identifiers($table, TRUE, NULL, FALSE), $fields, $dest); - } - - // -------------------------------------------------------------------- - - /** - * Tests whether the string has an SQL operator - * - * @access private - * @param string - * @return bool - */ - function _has_operator($str) - { - $str = trim($str); - if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str)) - { - return FALSE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Enables a native PHP function to be run, using a platform agnostic wrapper. - * - * @access public - * @param string the function name - * @param mixed any parameters needed by the function - * @return mixed - */ - function call_function($function) - { - $driver = ($this->dbdriver == 'postgre') ? 'pg_' : $this->dbdriver.'_'; - - if (FALSE === strpos($driver, $function)) - { - $function = $driver.$function; - } - - if ( ! function_exists($function)) - { - if ($this->db_debug) - { - return $this->display_error('db_unsupported_function'); - } - return FALSE; - } - else - { - $args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null; - - return call_user_func_array($function, $args); - } - } - - // -------------------------------------------------------------------- - - /** - * Set Cache Directory Path - * - * @access public - * @param string the path to the cache directory - * @return void - */ - function cache_set_path($path = '') - { - $this->cachedir = $path; - } - - // -------------------------------------------------------------------- - - /** - * Enable Query Caching - * - * @access public - * @return void - */ - function cache_on() - { - $this->cache_on = TRUE; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Disable Query Caching - * - * @access public - * @return void - */ - function cache_off() - { - $this->cache_on = FALSE; - return FALSE; - } - - - // -------------------------------------------------------------------- - - /** - * Delete the cache files associated with a particular URI - * - * @access public - * @return void - */ - function cache_delete($segment_one = '', $segment_two = '') - { - if ( ! $this->_cache_init()) - { - return FALSE; - } - return $this->CACHE->delete($segment_one, $segment_two); - } - - // -------------------------------------------------------------------- - - /** - * Delete All cache files - * - * @access public - * @return void - */ - function cache_delete_all() - { - if ( ! $this->_cache_init()) - { - return FALSE; - } - - return $this->CACHE->delete_all(); - } - - // -------------------------------------------------------------------- - - /** - * Initialize the Cache Class - * - * @access private - * @return void - */ - function _cache_init() - { - if (is_object($this->CACHE) AND class_exists('CI_DB_Cache')) - { - return TRUE; - } - - if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) - { - return $this->cache_off(); - } - - $this->CACHE = new CI_DB_Cache($this); // pass db object to support multiple db connections and returned db objects - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @return void - */ - function close() - { - if (is_resource($this->conn_id) OR is_object($this->conn_id)) - { - $this->_close($this->conn_id); - } - $this->conn_id = FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Display an error message - * - * @access public - * @param string the error message - * @param string any "swap" values - * @param boolean whether to localize the message - * @return string sends the application/error_db.php template - */ - function display_error($error = '', $swap = '', $native = FALSE) - { - $LANG =& load_class('Language'); - $LANG->load('db'); - - $heading = $LANG->line('db_error_heading'); - - if ($native == TRUE) - { - $message = $error; - } - else - { - $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; - } - - $error =& load_class('Exceptions'); - echo $error->show_error($heading, $message, 'error_db'); - exit; - } - - // -------------------------------------------------------------------- - - /** - * Protect Identifiers - * - * This function adds backticks if appropriate based on db type - * - * @access private - * @param mixed the item to escape - * @return mixed the item with backticks - */ - function protect_identifiers($item, $prefix_single = FALSE) - { - return $this->_protect_identifiers($item, $prefix_single); - } - - // -------------------------------------------------------------------- - - /** - * Protect Identifiers - * - * This function is used extensively by the Active Record class, and by - * a couple functions in this class. - * It takes a column or table name (optionally with an alias) and inserts - * the table prefix onto it. Some logic is necessary in order to deal with - * column names that include the path. Consider a query like this: - * - * SELECT * FROM hostname.database.table.column AS c FROM hostname.database.table - * - * Or a query with aliasing: - * - * SELECT m.member_id, m.member_name FROM members AS m - * - * Since the column name can include up to four segments (host, DB, table, column) - * or also have an alias prefix, we need to do a bit of work to figure this out and - * insert the table prefix (if it exists) in the proper position, and escape only - * the correct identifiers. - * - * @access private - * @param string - * @param bool - * @param mixed - * @param bool - * @return string - */ - function _protect_identifiers($item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE) - { - if ( ! is_bool($protect_identifiers)) - { - $protect_identifiers = $this->_protect_identifiers; - } - - // Convert tabs or multiple spaces into single spaces - $item = preg_replace('/[\t| ]+/', ' ', $item); - - // If the item has an alias declaration we remove it and set it aside. - // Basically we remove everything to the right of the first space - $alias = ''; - if (strpos($item, ' ') !== FALSE) - { - $alias = strstr($item, " "); - $item = substr($item, 0, - strlen($alias)); - } - - // Break the string apart if it contains periods, then insert the table prefix - // in the correct location, assuming the period doesn't indicate that we're dealing - // with an alias. While we're at it, we will escape the components - if (strpos($item, '.') !== FALSE) - { - $parts = explode('.', $item); - - // Does the first segment of the exploded item match - // one of the aliases previously identified? If so, - // we have nothing more to do other than escape the item - if (in_array($parts[0], $this->ar_aliased_tables)) - { - if ($protect_identifiers === TRUE) - { - foreach ($parts as $key => $val) - { - if ( ! in_array($val, $this->_reserved_identifiers)) - { - $parts[$key] = $this->_escape_identifiers($val); - } - } - - $item = implode('.', $parts); - } - return $item.$alias; - } - - // Is there a table prefix defined in the config file? If not, no need to do anything - if ($this->dbprefix != '') - { - // We now add the table prefix based on some logic. - // Do we have 4 segments (hostname.database.table.column)? - // If so, we add the table prefix to the column name in the 3rd segment. - if (isset($parts[3])) - { - $i = 2; - } - // Do we have 3 segments (database.table.column)? - // If so, we add the table prefix to the column name in 2nd position - elseif (isset($parts[2])) - { - $i = 1; - } - // Do we have 2 segments (table.column)? - // If so, we add the table prefix to the column name in 1st segment - else - { - $i = 0; - } - - // This flag is set when the supplied $item does not contain a field name. - // This can happen when this function is being called from a JOIN. - if ($field_exists == FALSE) - { - $i++; - } - - // We only add the table prefix if it does not already exist - if (substr($parts[$i], 0, strlen($this->dbprefix)) != $this->dbprefix) - { - $parts[$i] = $this->dbprefix.$parts[$i]; - } - - // Put the parts back together - $item = implode('.', $parts); - } - - if ($protect_identifiers === TRUE) - { - $item = $this->_escape_identifiers($item); - } - - return $item.$alias; - } - - // This is basically a bug fix for queries that use MAX, MIN, etc. - // If a parenthesis is found we know that we do not need to - // escape the data or add a prefix. There's probably a more graceful - // way to deal with this, but I'm not thinking of it -- Rick - if (strpos($item, '(') !== FALSE) - { - return $item.$alias; - } - - // Is there a table prefix? If not, no need to insert it - if ($this->dbprefix != '') - { - // Do we prefix an item with no segments? - if ($prefix_single == TRUE AND substr($item, 0, strlen($this->dbprefix)) != $this->dbprefix) - { - $item = $this->dbprefix.$item; - } - } - - if ($protect_identifiers === TRUE AND ! in_array($item, $this->_reserved_identifiers)) - { - $item = $this->_escape_identifiers($item); - } - - return $item.$alias; - } - - -} - - -/* End of file DB_driver.php */ + $val) + { + $this->$key = $val; + } + } + + log_message('debug', 'Database Driver Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * Initialize Database Settings + * + * @access private Called by the constructor + * @param mixed + * @return void + */ + function initialize() + { + // If an existing connection resource is available + // there is no need to connect and select the database + if (is_resource($this->conn_id) OR is_object($this->conn_id)) + { + return TRUE; + } + + // ---------------------------------------------------------------- + + // 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 + if ( ! $this->conn_id) + { + log_message('error', 'Unable to connect to the database'); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_connect'); + } + return FALSE; + } + + // ---------------------------------------------------------------- + + // Select the DB... assuming a database name is specified in the config file + if ($this->database != '') + { + if ( ! $this->db_select()) + { + log_message('error', 'Unable to select database: '.$this->database); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_select', $this->database); + } + return FALSE; + } + else + { + // We've selected the DB. Now we set the character set + if ( ! $this->db_set_charset($this->char_set, $this->dbcollat)) + { + return FALSE; + } + + return TRUE; + } + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + if ( ! $this->_db_set_charset($this->char_set, $this->dbcollat)) + { + log_message('error', 'Unable to set database connection charset: '.$this->char_set); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_set_charset', $this->char_set); + } + + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * The name of the platform in use (mysql, mssql, etc...) + * + * @access public + * @return string + */ + function platform() + { + return $this->dbdriver; + } + + // -------------------------------------------------------------------- + + /** + * Database Version Number. Returns a string containing the + * version of the database being used + * + * @access public + * @return string + */ + function version() + { + if (FALSE === ($sql = $this->_version())) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + if ($this->dbdriver == 'oci8') + { + return $sql; + } + + $query = $this->query($sql); + return $query->row('ver'); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * Accepts an SQL string as input and returns a result object upon + * successful execution of a "read" type query. Returns boolean TRUE + * upon successful execution of a "write" type query. Returns boolean + * FALSE upon failure, and if the $db_debug variable is set to TRUE + * will raise an error. + * + * @access public + * @param string An SQL query string + * @param array An array of binding data + * @return mixed + */ + function query($sql, $binds = FALSE, $return_object = TRUE) + { + if ($sql == '') + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$sql); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } + + // Verify table prefix and replace if necessary + if ( ($this->dbprefix != '' AND $this->swap_pre != '') AND ($this->dbprefix != $this->swap_pre) ) + { + $sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql); + } + + // Is query caching enabled? If the query is a "read type" + // we will load the caching class and return the previously + // cached query if it exists + if ($this->cache_on == TRUE AND stristr($sql, 'SELECT')) + { + if ($this->_cache_init()) + { + $this->load_rdriver(); + if (FALSE !== ($cache = $this->CACHE->read($sql))) + { + return $cache; + } + } + } + + // Compile binds if needed + if ($binds !== FALSE) + { + $sql = $this->compile_binds($sql, $binds); + } + + // Save the query for debugging + if ($this->save_queries == TRUE) + { + $this->queries[] = $sql; + } + + // Start the Query Timer + $time_start = list($sm, $ss) = explode(' ', microtime()); + + // Run the Query + if (FALSE === ($this->result_id = $this->simple_query($sql))) + { + if ($this->save_queries == TRUE) + { + $this->query_times[] = 0; + } + + // This will trigger a rollback if transactions are being used + $this->_trans_status = FALSE; + + if ($this->db_debug) + { + // grab the error number and message now, as we might run some + // additional queries before displaying the error + $error_no = $this->_error_number(); + $error_msg = $this->_error_message(); + + // We call this function in order to roll-back queries + // if transactions are enabled. If we don't call this here + // the error message will trigger an exit, causing the + // transactions to remain in limbo. + $this->trans_complete(); + + // Log and display errors + log_message('error', 'Query error: '.$error_msg); + return $this->display_error( + array( + 'Error Number: '.$error_no, + $error_msg, + $sql + ) + ); + } + + return FALSE; + } + + // Stop and aggregate the query time results + $time_end = list($em, $es) = explode(' ', microtime()); + $this->benchmark += ($em + $es) - ($sm + $ss); + + if ($this->save_queries == TRUE) + { + $this->query_times[] = ($em + $es) - ($sm + $ss); + } + + // Increment the query counter + $this->query_count++; + + // Was the query a "write" type? + // If so we'll simply return true + if ($this->is_write_type($sql) === TRUE) + { + // If caching is enabled we'll auto-cleanup any + // existing files related to this particular URI + if ($this->cache_on == TRUE AND $this->cache_autodel == TRUE AND $this->_cache_init()) + { + $this->CACHE->delete(); + } + + return TRUE; + } + + // Return TRUE if we don't need to create a result object + // Currently only the Oracle driver uses this when stored + // procedures are used + if ($return_object !== TRUE) + { + return TRUE; + } + + // Load and instantiate the result driver + + $driver = $this->load_rdriver(); + $RES = new $driver(); + $RES->conn_id = $this->conn_id; + $RES->result_id = $this->result_id; + + if ($this->dbdriver == 'oci8') + { + $RES->stmt_id = $this->stmt_id; + $RES->curs_id = NULL; + $RES->limit_used = $this->limit_used; + $this->stmt_id = FALSE; + } + + // oci8 vars must be set before calling this + $RES->num_rows = $RES->num_rows(); + + // Is query caching enabled? If so, we'll serialize the + // result object and save it to a cache file. + if ($this->cache_on == TRUE AND $this->_cache_init()) + { + // We'll create a new instance of the result object + // only without the platform specific driver since + // we can't use it with cached data (the query result + // resource ID won't be any good once we've cached the + // result object, so we'll have to compile the data + // and save it) + $CR = new CI_DB_result(); + $CR->num_rows = $RES->num_rows(); + $CR->result_object = $RES->result_object(); + $CR->result_array = $RES->result_array(); + + // Reset these since cached objects can not utilize resource IDs. + $CR->conn_id = NULL; + $CR->result_id = NULL; + + $this->CACHE->write($sql, $CR); + } + + return $RES; + } + + // -------------------------------------------------------------------- + + /** + * Load the result drivers + * + * @access public + * @return string the name of the result class + */ + function load_rdriver() + { + $driver = 'CI_DB_'.$this->dbdriver.'_result'; + + if ( ! class_exists($driver)) + { + include_once(BASEPATH.'database/DB_result'.EXT); + include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + } + + return $driver; + } + + // -------------------------------------------------------------------- + + /** + * Simple Query + * This is a simplified version of the query() function. Internally + * we only use it when running transaction commands since they do + * not require all the features of the main query() function. + * + * @access public + * @param string the sql query + * @return mixed + */ + function simple_query($sql) + { + if ( ! $this->conn_id) + { + $this->initialize(); + } + + return $this->_execute($sql); + } + + // -------------------------------------------------------------------- + + /** + * Disable Transactions + * This permits transactions to be disabled at run-time. + * + * @access public + * @return void + */ + function trans_off() + { + $this->trans_enabled = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Enable/disable Transaction Strict Mode + * When strict mode is enabled, if you are running multiple groups of + * transactions, if one group fails all groups will be rolled back. + * If strict mode is disabled, each group is treated autonomously, meaning + * a failure of one group will not affect any others + * + * @access public + * @return void + */ + function trans_strict($mode = TRUE) + { + $this->trans_strict = is_bool($mode) ? $mode : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Start Transaction + * + * @access public + * @return void + */ + function trans_start($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return FALSE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + $this->_trans_depth += 1; + return; + } + + $this->trans_begin($test_mode); + } + + // -------------------------------------------------------------------- + + /** + * Complete Transaction + * + * @access public + * @return bool + */ + function trans_complete() + { + if ( ! $this->trans_enabled) + { + return FALSE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 1) + { + $this->_trans_depth -= 1; + return TRUE; + } + + // The query() function will set this flag to FALSE in the event that a query failed + if ($this->_trans_status === FALSE) + { + $this->trans_rollback(); + + // If we are NOT running in strict mode, we will reset + // the _trans_status flag so that subsequent groups of transactions + // will be permitted. + if ($this->trans_strict === FALSE) + { + $this->_trans_status = TRUE; + } + + log_message('debug', 'DB Transaction Failure'); + return FALSE; + } + + $this->trans_commit(); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Lets you retrieve the transaction flag to determine if it has failed + * + * @access public + * @return bool + */ + function trans_status() + { + return $this->_trans_status; + } + + // -------------------------------------------------------------------- + + /** + * Compile Bindings + * + * @access public + * @param string the sql statement + * @param array an array of bind data + * @return string + */ + function compile_binds($sql, $binds) + { + if (strpos($sql, $this->bind_marker) === FALSE) + { + return $sql; + } + + if ( ! is_array($binds)) + { + $binds = array($binds); + } + + // Get the sql segments around the bind markers + $segments = explode($this->bind_marker, $sql); + + // The count of bind should be 1 less then the count of segments + // If there are more bind arguments trim it down + if (count($binds) >= count($segments)) { + $binds = array_slice($binds, 0, count($segments)-1); + } + + // Construct the binded query + $result = $segments[0]; + $i = 0; + foreach ($binds as $bind) + { + $result .= $this->escape($bind); + $result .= $segments[++$i]; + } + + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Determines if a query is a "write" type. + * + * @access public + * @param string An SQL query string + * @return boolean + */ + function is_write_type($sql) + { + if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)) + { + return FALSE; + } + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Calculate the aggregate query elapsed time + * + * @access public + * @param integer The number of decimal places + * @return integer + */ + function elapsed_time($decimals = 6) + { + return number_format($this->benchmark, $decimals); + } + + // -------------------------------------------------------------------- + + /** + * Returns the total number of queries + * + * @access public + * @return integer + */ + function total_queries() + { + return $this->query_count; + } + + // -------------------------------------------------------------------- + + /** + * Returns the last query that was executed + * + * @access public + * @return void + */ + function last_query() + { + return end($this->queries); + } + + // -------------------------------------------------------------------- + + /** + * "Smart" Escape String + * + * Escapes data based on type + * Sets boolean and null types + * + * @access public + * @param string + * @return integer + */ + function escape($str) + { + switch (gettype($str)) + { + case 'string' : $str = "'".$this->escape_str($str)."'"; + break; + case 'boolean' : $str = ($str === FALSE) ? 0 : 1; + break; + default : $str = ($str === NULL) ? 'NULL' : $str; + break; + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Primary + * + * Retrieves the primary key. It assumes that the row in the first + * position is the primary key + * + * @access public + * @param string the table name + * @return string + */ + function primary($table = '') + { + $fields = $this->list_fields($table); + + if ( ! is_array($fields)) + { + return FALSE; + } + + return current($fields); + } + + // -------------------------------------------------------------------- + + /** + * Returns an array of table names + * + * @access public + * @return array + */ + function list_tables($constrain_by_prefix = FALSE) + { + // Is there a cached result? + if (isset($this->data_cache['table_names'])) + { + return $this->data_cache['table_names']; + } + + if (FALSE === ($sql = $this->_list_tables($constrain_by_prefix))) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $retval = array(); + $query = $this->query($sql); + + if ($query->num_rows() > 0) + { + foreach($query->result_array() as $row) + { + if (isset($row['TABLE_NAME'])) + { + $retval[] = $row['TABLE_NAME']; + } + else + { + $retval[] = array_shift($row); + } + } + } + + $this->data_cache['table_names'] = $retval; + return $this->data_cache['table_names']; + } + + // -------------------------------------------------------------------- + + /** + * Determine if a particular table exists + * @access public + * @return boolean + */ + function table_exists($table_name) + { + return ( ! in_array($this->_protect_identifiers($table_name, TRUE, FALSE, FALSE), $this->list_tables())) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Fetch MySQL Field Names + * + * @access public + * @param string the table name + * @return array + */ + function list_fields($table = '') + { + // Is there a cached result? + if (isset($this->data_cache['field_names'][$table])) + { + return $this->data_cache['field_names'][$table]; + } + + if ($table == '') + { + if ($this->db_debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + if (FALSE === ($sql = $this->_list_columns($this->_protect_identifiers($table, TRUE, NULL, FALSE)))) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + + $query = $this->query($sql); + + $retval = array(); + foreach($query->result_array() as $row) + { + if (isset($row['COLUMN_NAME'])) + { + $retval[] = $row['COLUMN_NAME']; + } + else + { + $retval[] = current($row); + } + } + + $this->data_cache['field_names'][$table] = $retval; + return $this->data_cache['field_names'][$table]; + } + + // -------------------------------------------------------------------- + + /** + * Determine if a particular field exists + * @access public + * @param string + * @param string + * @return boolean + */ + function field_exists($field_name, $table_name) + { + return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Returns an object with field data + * + * @access public + * @param string the table name + * @return object + */ + function field_data($table = '') + { + if ($table == '') + { + if ($this->db_debug) + { + return $this->display_error('db_field_param_missing'); + } + return FALSE; + } + + $query = $this->query($this->_field_data($this->_protect_identifiers($table, TRUE, NULL, FALSE))); + + return $query->field_data(); + } + + // -------------------------------------------------------------------- + + /** + * Generate an insert string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @return string + */ + function insert_string($table, $data) + { + $fields = array(); + $values = array(); + + foreach($data as $key => $val) + { + $fields[] = $this->_escape_identifiers($key); + $values[] = $this->escape($val); + } + + return $this->_insert($this->_protect_identifiers($table, TRUE, NULL, FALSE), $fields, $values); + } + + // -------------------------------------------------------------------- + + /** + * Generate an update string + * + * @access public + * @param string the table upon which the query will be performed + * @param array an associative array data of key/values + * @param mixed the "where" statement + * @return string + */ + function update_string($table, $data, $where) + { + if ($where == '') + { + return false; + } + + $fields = array(); + foreach($data as $key => $val) + { + $fields[$this->_protect_identifiers($key)] = $this->escape($val); + } + + if ( ! is_array($where)) + { + $dest = array($where); + } + else + { + $dest = array(); + foreach ($where as $key => $val) + { + $prefix = (count($dest) == 0) ? '' : ' AND '; + + if ($val !== '') + { + if ( ! $this->_has_operator($key)) + { + $key .= ' ='; + } + + $val = ' '.$this->escape($val); + } + + $dest[] = $prefix.$key.$val; + } + } + + return $this->_update($this->_protect_identifiers($table, TRUE, NULL, FALSE), $fields, $dest); + } + + // -------------------------------------------------------------------- + + /** + * Tests whether the string has an SQL operator + * + * @access private + * @param string + * @return bool + */ + function _has_operator($str) + { + $str = trim($str); + if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str)) + { + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Enables a native PHP function to be run, using a platform agnostic wrapper. + * + * @access public + * @param string the function name + * @param mixed any parameters needed by the function + * @return mixed + */ + function call_function($function) + { + $driver = ($this->dbdriver == 'postgre') ? 'pg_' : $this->dbdriver.'_'; + + if (FALSE === strpos($driver, $function)) + { + $function = $driver.$function; + } + + if ( ! function_exists($function)) + { + if ($this->db_debug) + { + return $this->display_error('db_unsupported_function'); + } + return FALSE; + } + else + { + $args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null; + + return call_user_func_array($function, $args); + } + } + + // -------------------------------------------------------------------- + + /** + * Set Cache Directory Path + * + * @access public + * @param string the path to the cache directory + * @return void + */ + function cache_set_path($path = '') + { + $this->cachedir = $path; + } + + // -------------------------------------------------------------------- + + /** + * Enable Query Caching + * + * @access public + * @return void + */ + function cache_on() + { + $this->cache_on = TRUE; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Disable Query Caching + * + * @access public + * @return void + */ + function cache_off() + { + $this->cache_on = FALSE; + return FALSE; + } + + + // -------------------------------------------------------------------- + + /** + * Delete the cache files associated with a particular URI + * + * @access public + * @return void + */ + function cache_delete($segment_one = '', $segment_two = '') + { + if ( ! $this->_cache_init()) + { + return FALSE; + } + return $this->CACHE->delete($segment_one, $segment_two); + } + + // -------------------------------------------------------------------- + + /** + * Delete All cache files + * + * @access public + * @return void + */ + function cache_delete_all() + { + if ( ! $this->_cache_init()) + { + return FALSE; + } + + return $this->CACHE->delete_all(); + } + + // -------------------------------------------------------------------- + + /** + * Initialize the Cache Class + * + * @access private + * @return void + */ + function _cache_init() + { + if (is_object($this->CACHE) AND class_exists('CI_DB_Cache')) + { + return TRUE; + } + + if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) + { + return $this->cache_off(); + } + + $this->CACHE = new CI_DB_Cache($this); // pass db object to support multiple db connections and returned db objects + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @return void + */ + function close() + { + if (is_resource($this->conn_id) OR is_object($this->conn_id)) + { + $this->_close($this->conn_id); + } + $this->conn_id = FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Display an error message + * + * @access public + * @param string the error message + * @param string any "swap" values + * @param boolean whether to localize the message + * @return string sends the application/error_db.php template + */ + function display_error($error = '', $swap = '', $native = FALSE) + { + $LANG =& load_class('Language'); + $LANG->load('db'); + + $heading = $LANG->line('db_error_heading'); + + if ($native == TRUE) + { + $message = $error; + } + else + { + $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; + } + + $error =& load_class('Exceptions'); + echo $error->show_error($heading, $message, 'error_db'); + exit; + } + + // -------------------------------------------------------------------- + + /** + * Protect Identifiers + * + * This function adds backticks if appropriate based on db type + * + * @access private + * @param mixed the item to escape + * @return mixed the item with backticks + */ + function protect_identifiers($item, $prefix_single = FALSE) + { + return $this->_protect_identifiers($item, $prefix_single); + } + + // -------------------------------------------------------------------- + + /** + * Protect Identifiers + * + * This function is used extensively by the Active Record class, and by + * a couple functions in this class. + * It takes a column or table name (optionally with an alias) and inserts + * the table prefix onto it. Some logic is necessary in order to deal with + * column names that include the path. Consider a query like this: + * + * SELECT * FROM hostname.database.table.column AS c FROM hostname.database.table + * + * Or a query with aliasing: + * + * SELECT m.member_id, m.member_name FROM members AS m + * + * Since the column name can include up to four segments (host, DB, table, column) + * or also have an alias prefix, we need to do a bit of work to figure this out and + * insert the table prefix (if it exists) in the proper position, and escape only + * the correct identifiers. + * + * @access private + * @param string + * @param bool + * @param mixed + * @param bool + * @return string + */ + function _protect_identifiers($item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE) + { + if ( ! is_bool($protect_identifiers)) + { + $protect_identifiers = $this->_protect_identifiers; + } + + // Convert tabs or multiple spaces into single spaces + $item = preg_replace('/[\t| ]+/', ' ', $item); + + // If the item has an alias declaration we remove it and set it aside. + // Basically we remove everything to the right of the first space + $alias = ''; + if (strpos($item, ' ') !== FALSE) + { + $alias = strstr($item, " "); + $item = substr($item, 0, - strlen($alias)); + } + + // Break the string apart if it contains periods, then insert the table prefix + // in the correct location, assuming the period doesn't indicate that we're dealing + // with an alias. While we're at it, we will escape the components + if (strpos($item, '.') !== FALSE) + { + $parts = explode('.', $item); + + // Does the first segment of the exploded item match + // one of the aliases previously identified? If so, + // we have nothing more to do other than escape the item + if (in_array($parts[0], $this->ar_aliased_tables)) + { + if ($protect_identifiers === TRUE) + { + foreach ($parts as $key => $val) + { + if ( ! in_array($val, $this->_reserved_identifiers)) + { + $parts[$key] = $this->_escape_identifiers($val); + } + } + + $item = implode('.', $parts); + } + return $item.$alias; + } + + // Is there a table prefix defined in the config file? If not, no need to do anything + if ($this->dbprefix != '') + { + // We now add the table prefix based on some logic. + // Do we have 4 segments (hostname.database.table.column)? + // If so, we add the table prefix to the column name in the 3rd segment. + if (isset($parts[3])) + { + $i = 2; + } + // Do we have 3 segments (database.table.column)? + // If so, we add the table prefix to the column name in 2nd position + elseif (isset($parts[2])) + { + $i = 1; + } + // Do we have 2 segments (table.column)? + // If so, we add the table prefix to the column name in 1st segment + else + { + $i = 0; + } + + // This flag is set when the supplied $item does not contain a field name. + // This can happen when this function is being called from a JOIN. + if ($field_exists == FALSE) + { + $i++; + } + + // We only add the table prefix if it does not already exist + if (substr($parts[$i], 0, strlen($this->dbprefix)) != $this->dbprefix) + { + $parts[$i] = $this->dbprefix.$parts[$i]; + } + + // Put the parts back together + $item = implode('.', $parts); + } + + if ($protect_identifiers === TRUE) + { + $item = $this->_escape_identifiers($item); + } + + return $item.$alias; + } + + // This is basically a bug fix for queries that use MAX, MIN, etc. + // If a parenthesis is found we know that we do not need to + // escape the data or add a prefix. There's probably a more graceful + // way to deal with this, but I'm not thinking of it -- Rick + if (strpos($item, '(') !== FALSE) + { + return $item.$alias; + } + + // Is there a table prefix? If not, no need to insert it + if ($this->dbprefix != '') + { + // Do we prefix an item with no segments? + if ($prefix_single == TRUE AND substr($item, 0, strlen($this->dbprefix)) != $this->dbprefix) + { + $item = $this->dbprefix.$item; + } + } + + if ($protect_identifiers === TRUE AND ! in_array($item, $this->_reserved_identifiers)) + { + $item = $this->_escape_identifiers($item); + } + + return $item.$alias; + } + + +} + + +/* End of file DB_driver.php */ /* Location: ./system/database/DB_driver.php */ \ No newline at end of file diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 20f0a308..f708910f 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -1,355 +1,355 @@ -db - $CI =& get_instance(); - $this->db =& $CI->db; - log_message('debug', "Database Forge Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function create_database($db_name) - { - $sql = $this->_create_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access public - * @param string the database name - * @return bool - */ - function drop_database($db_name) - { - $sql = $this->_drop_database($db_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Add Key - * - * @access public - * @param string key - * @param string type - * @return void - */ - function add_key($key = '', $primary = FALSE) - { - if (is_array($key)) - { - foreach($key as $one) - { - $this->add_key($one, $primary); - } - - return; - } - - if ($key == '') - { - show_error('Key information is required for that operation.'); - } - - if ($primary === TRUE) - { - $this->primary_keys[] = $key; - } - else - { - $this->keys[] = $key; - } - } - - // -------------------------------------------------------------------- - - /** - * Add Field - * - * @access public - * @param string collation - * @return void - */ - function add_field($field = '') - { - if ($field == '') - { - show_error('Field information is required.'); - } - - if (is_string($field)) - { - if ($field == 'id') - { - $this->add_field(array( - 'id' => array( - 'type' => 'INT', - 'constraint' => 9, - 'auto_increment' => TRUE - ) - )); - $this->add_key('id', TRUE); - } - else - { - if (strpos($field, ' ') === FALSE) - { - show_error('Field information is required for that operation.'); - } - - $this->fields[] = $field; - } - } - - if (is_array($field)) - { - $this->fields = array_merge($this->fields, $field); - } - - } - - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access public - * @param string the table name - * @return bool - */ - function create_table($table = '', $if_not_exists = FALSE) - { - if ($table == '') - { - show_error('A table name is required for that operation.'); - } - - if (count($this->fields) == 0) - { - show_error('Field information is required.'); - } - - $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); - - $this->_reset(); - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access public - * @param string the table name - * @return bool - */ - function drop_table($table_name) - { - $sql = $this->_drop_table($this->db->dbprefix.$table_name); - - if (is_bool($sql)) - { - return $sql; - } - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Rename Table - * - * @access public - * @param string the old table name - * @param string the new table name - * @return bool - */ - function rename_table($table_name, $new_table_name) - { - if ($table_name == '' OR $new_table_name == '') - { - show_error('A table name is required for that operation.'); - } - - $sql = $this->_rename_table($table_name, $new_table_name); - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Column Add - * - * @access public - * @param string the table name - * @param string the column name - * @param string the column definition - * @return bool - */ - function add_column($table = '', $field = array(), $after_field = '') - { - if ($table == '') - { - show_error('A table name is required for that operation.'); - } - - // add field info into field array, but we can only do one at a time - // so only grab the first field in the event there are more then one - $this->add_field(array_slice($field, 0, 1)); - - if (count($this->fields) == 0) - { - show_error('Field information is required.'); - } - - $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); - - $this->_reset(); - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Column Drop - * - * @access public - * @param string the table name - * @param string the column name - * @return bool - */ - function drop_column($table = '', $column_name = '') - { - - if ($table == '') - { - show_error('A table name is required for that operation.'); - } - - if ($column_name == '') - { - show_error('A column name is required for that operation.'); - } - - $sql = $this->_alter_table('DROP', $this->db->dbprefix.$table, $column_name); - - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Column Modify - * - * @access public - * @param string the table name - * @param string the column name - * @param string the column definition - * @return bool - */ - function modify_column($table = '', $field = array()) - { - if ($table == '') - { - show_error('A table name is required for that operation.'); - } - - // add field info into field array, but we can only do one at a time - // so only grab the first field in the event there are more then one - $this->add_field(array_slice($field, 0, 1)); - - if (count($this->fields) == 0) - { - show_error('Field information is required.'); - } - - $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); - - $this->_reset(); - return $this->db->query($sql); - } - - // -------------------------------------------------------------------- - - /** - * Reset - * - * Resets table creation vars - * - * @access private - * @return void - */ - function _reset() - { - $this->fields = array(); - $this->keys = array(); - $this->primary_keys = array(); - } - -} - -/* End of file DB_forge.php */ +db + $CI =& get_instance(); + $this->db =& $CI->db; + log_message('debug', "Database Forge Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Create database + * + * @access public + * @param string the database name + * @return bool + */ + function create_database($db_name) + { + $sql = $this->_create_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access public + * @param string the database name + * @return bool + */ + function drop_database($db_name) + { + $sql = $this->_drop_database($db_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Add Key + * + * @access public + * @param string key + * @param string type + * @return void + */ + function add_key($key = '', $primary = FALSE) + { + if (is_array($key)) + { + foreach($key as $one) + { + $this->add_key($one, $primary); + } + + return; + } + + if ($key == '') + { + show_error('Key information is required for that operation.'); + } + + if ($primary === TRUE) + { + $this->primary_keys[] = $key; + } + else + { + $this->keys[] = $key; + } + } + + // -------------------------------------------------------------------- + + /** + * Add Field + * + * @access public + * @param string collation + * @return void + */ + function add_field($field = '') + { + if ($field == '') + { + show_error('Field information is required.'); + } + + if (is_string($field)) + { + if ($field == 'id') + { + $this->add_field(array( + 'id' => array( + 'type' => 'INT', + 'constraint' => 9, + 'auto_increment' => TRUE + ) + )); + $this->add_key('id', TRUE); + } + else + { + if (strpos($field, ' ') === FALSE) + { + show_error('Field information is required for that operation.'); + } + + $this->fields[] = $field; + } + } + + if (is_array($field)) + { + $this->fields = array_merge($this->fields, $field); + } + + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access public + * @param string the table name + * @return bool + */ + function create_table($table = '', $if_not_exists = FALSE) + { + if ($table == '') + { + show_error('A table name is required for that operation.'); + } + + if (count($this->fields) == 0) + { + show_error('Field information is required.'); + } + + $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); + + $this->_reset(); + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access public + * @param string the table name + * @return bool + */ + function drop_table($table_name) + { + $sql = $this->_drop_table($this->db->dbprefix.$table_name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Rename Table + * + * @access public + * @param string the old table name + * @param string the new table name + * @return bool + */ + function rename_table($table_name, $new_table_name) + { + if ($table_name == '' OR $new_table_name == '') + { + show_error('A table name is required for that operation.'); + } + + $sql = $this->_rename_table($table_name, $new_table_name); + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Column Add + * + * @access public + * @param string the table name + * @param string the column name + * @param string the column definition + * @return bool + */ + function add_column($table = '', $field = array(), $after_field = '') + { + if ($table == '') + { + show_error('A table name is required for that operation.'); + } + + // add field info into field array, but we can only do one at a time + // so only grab the first field in the event there are more then one + $this->add_field(array_slice($field, 0, 1)); + + if (count($this->fields) == 0) + { + show_error('Field information is required.'); + } + + $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); + + $this->_reset(); + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Column Drop + * + * @access public + * @param string the table name + * @param string the column name + * @return bool + */ + function drop_column($table = '', $column_name = '') + { + + if ($table == '') + { + show_error('A table name is required for that operation.'); + } + + if ($column_name == '') + { + show_error('A column name is required for that operation.'); + } + + $sql = $this->_alter_table('DROP', $this->db->dbprefix.$table, $column_name); + + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Column Modify + * + * @access public + * @param string the table name + * @param string the column name + * @param string the column definition + * @return bool + */ + function modify_column($table = '', $field = array()) + { + if ($table == '') + { + show_error('A table name is required for that operation.'); + } + + // add field info into field array, but we can only do one at a time + // so only grab the first field in the event there are more then one + $this->add_field(array_slice($field, 0, 1)); + + if (count($this->fields) == 0) + { + show_error('Field information is required.'); + } + + $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); + + $this->_reset(); + return $this->db->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Reset + * + * Resets table creation vars + * + * @access private + * @return void + */ + function _reset() + { + $this->fields = array(); + $this->keys = array(); + $this->primary_keys = array(); + } + +} + +/* End of file DB_forge.php */ /* Location: ./system/database/DB_forge.php */ \ No newline at end of file diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 8f55f671..41281418 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -1,342 +1,342 @@ -result_object() : $this->result_array(); - } - - // -------------------------------------------------------------------- - - /** - * Query result. "object" version. - * - * @access public - * @return object - */ - function result_object() - { - if (count($this->result_object) > 0) - { - return $this->result_object; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - $this->_data_seek(0); - while ($row = $this->_fetch_object()) - { - $this->result_object[] = $row; - } - - return $this->result_object; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @access public - * @return array - */ - function result_array() - { - if (count($this->result_array) > 0) - { - return $this->result_array; - } - - // In the event that query caching is on the result_id variable - // will return FALSE since there isn't a valid SQL resource so - // we'll simply return an empty array. - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - $this->_data_seek(0); - while ($row = $this->_fetch_assoc()) - { - $this->result_array[] = $row; - } - - return $this->result_array; - } - - // -------------------------------------------------------------------- - - /** - * Query result. Acts as a wrapper function for the following functions. - * - * @access public - * @param string - * @param string can be "object" or "array" - * @return mixed either a result object or array - */ - function row($n = 0, $type = 'object') - { - if ( ! is_numeric($n)) - { - // We cache the row data for subsequent uses - if ( ! is_array($this->row_data)) - { - $this->row_data = $this->row_array(0); - } - - // array_key_exists() instead of isset() to allow for MySQL NULL values - if (array_key_exists($n, $this->row_data)) - { - return $this->row_data[$n]; - } - // reset the $n variable if the result was not achieved - $n = 0; - } - - return ($type == 'object') ? $this->row_object($n) : $this->row_array($n); - } - - // -------------------------------------------------------------------- - - /** - * Assigns an item into a particular column slot - * - * @access public - * @return object - */ - function set_row($key, $value = NULL) - { - // We cache the row data for subsequent uses - if ( ! is_array($this->row_data)) - { - $this->row_data = $this->row_array(0); - } - - if (is_array($key)) - { - foreach ($key as $k => $v) - { - $this->row_data[$k] = $v; - } - - return; - } - - if ($key != '' AND ! is_null($value)) - { - $this->row_data[$key] = $value; - } - } - - // -------------------------------------------------------------------- - - /** - * Returns a single result row - object version - * - * @access public - * @return object - */ - function row_object($n = 0) - { - $result = $this->result_object(); - - if (count($result) == 0) - { - return $result; - } - - if ($n != $this->current_row AND isset($result[$n])) - { - $this->current_row = $n; - } - - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * Returns a single result row - array version - * - * @access public - * @return array - */ - function row_array($n = 0) - { - $result = $this->result_array(); - - if (count($result) == 0) - { - return $result; - } - - if ($n != $this->current_row AND isset($result[$n])) - { - $this->current_row = $n; - } - - return $result[$this->current_row]; - } - - - // -------------------------------------------------------------------- - - /** - * Returns the "first" row - * - * @access public - * @return object - */ - function first_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - return $result[0]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "last" row - * - * @access public - * @return object - */ - function last_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - return $result[count($result) -1]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "next" row - * - * @access public - * @return object - */ - function next_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - - if (isset($result[$this->current_row + 1])) - { - ++$this->current_row; - } - - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * Returns the "previous" row - * - * @access public - * @return object - */ - function previous_row($type = 'object') - { - $result = $this->result($type); - - if (count($result) == 0) - { - return $result; - } - - if (isset($result[$this->current_row - 1])) - { - --$this->current_row; - } - return $result[$this->current_row]; - } - - // -------------------------------------------------------------------- - - /** - * The following functions are normally overloaded by the identically named - * methods in the platform-specific driver -- except when query caching - * is used. When caching is enabled we do not load the other driver. - * These functions are primarily here to prevent undefined function errors - * when a cached result object is in use. They are not otherwise fully - * 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(); } - -} -// END DB_result class - -/* End of file DB_result.php */ +result_object() : $this->result_array(); + } + + // -------------------------------------------------------------------- + + /** + * Query result. "object" version. + * + * @access public + * @return object + */ + function result_object() + { + if (count($this->result_object) > 0) + { + return $this->result_object; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + $this->_data_seek(0); + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + + return $this->result_object; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + $this->_data_seek(0); + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } + + // -------------------------------------------------------------------- + + /** + * Query result. Acts as a wrapper function for the following functions. + * + * @access public + * @param string + * @param string can be "object" or "array" + * @return mixed either a result object or array + */ + function row($n = 0, $type = 'object') + { + if ( ! is_numeric($n)) + { + // We cache the row data for subsequent uses + if ( ! is_array($this->row_data)) + { + $this->row_data = $this->row_array(0); + } + + // array_key_exists() instead of isset() to allow for MySQL NULL values + if (array_key_exists($n, $this->row_data)) + { + return $this->row_data[$n]; + } + // reset the $n variable if the result was not achieved + $n = 0; + } + + return ($type == 'object') ? $this->row_object($n) : $this->row_array($n); + } + + // -------------------------------------------------------------------- + + /** + * Assigns an item into a particular column slot + * + * @access public + * @return object + */ + function set_row($key, $value = NULL) + { + // We cache the row data for subsequent uses + if ( ! is_array($this->row_data)) + { + $this->row_data = $this->row_array(0); + } + + if (is_array($key)) + { + foreach ($key as $k => $v) + { + $this->row_data[$k] = $v; + } + + return; + } + + if ($key != '' AND ! is_null($value)) + { + $this->row_data[$key] = $value; + } + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - object version + * + * @access public + * @return object + */ + function row_object($n = 0) + { + $result = $this->result_object(); + + if (count($result) == 0) + { + return $result; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns a single result row - array version + * + * @access public + * @return array + */ + function row_array($n = 0) + { + $result = $this->result_array(); + + if (count($result) == 0) + { + return $result; + } + + if ($n != $this->current_row AND isset($result[$n])) + { + $this->current_row = $n; + } + + return $result[$this->current_row]; + } + + + // -------------------------------------------------------------------- + + /** + * Returns the "first" row + * + * @access public + * @return object + */ + function first_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + return $result[0]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "last" row + * + * @access public + * @return object + */ + function last_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + return $result[count($result) -1]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "next" row + * + * @access public + * @return object + */ + function next_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + + if (isset($result[$this->current_row + 1])) + { + ++$this->current_row; + } + + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * Returns the "previous" row + * + * @access public + * @return object + */ + function previous_row($type = 'object') + { + $result = $this->result($type); + + if (count($result) == 0) + { + return $result; + } + + if (isset($result[$this->current_row - 1])) + { + --$this->current_row; + } + return $result[$this->current_row]; + } + + // -------------------------------------------------------------------- + + /** + * The following functions are normally overloaded by the identically named + * methods in the platform-specific driver -- except when query caching + * is used. When caching is enabled we do not load the other driver. + * These functions are primarily here to prevent undefined function errors + * when a cached result object is in use. They are not otherwise fully + * 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(); } + +} +// END DB_result class + +/* End of file DB_result.php */ /* Location: ./system/database/DB_result.php */ \ No newline at end of file diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index a37522d9..195e4c46 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,389 +1,389 @@ -db - $CI =& get_instance(); - $this->db =& $CI->db; - - log_message('debug', "Database Utility Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * List databases - * - * @access public - * @return bool - */ - function list_databases() - { - // Is there a cached result? - if (isset($this->data_cache['db_names'])) - { - return $this->data_cache['db_names']; - } - - $query = $this->db->query($this->_list_databases()); - $dbs = array(); - if ($query->num_rows() > 0) - { - foreach ($query->result_array() as $row) - { - $dbs[] = current($row); - } - } - - $this->data_cache['db_names'] = $dbs; - return $this->data_cache['db_names']; - } - - // -------------------------------------------------------------------- - - /** - * Optimize Table - * - * @access public - * @param string the table name - * @return bool - */ - function optimize_table($table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - show_error('db_must_use_set'); - } - - $query = $this->db->query($sql); - $res = $query->result_array(); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Optimize Database - * - * @access public - * @return array - */ - function optimize_database() - { - $result = array(); - foreach ($this->db->list_tables() as $table_name) - { - $sql = $this->_optimize_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Build the result array... - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - $res = current($res); - $key = str_replace($this->db->database.'.', '', current($res)); - $keys = array_keys($res); - unset($res[$keys[0]]); - - $result[$key] = $res; - } - - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Repair Table - * - * @access public - * @param string the table name - * @return bool - */ - function repair_table($table_name) - { - $sql = $this->_repair_table($table_name); - - if (is_bool($sql)) - { - return $sql; - } - - $query = $this->db->query($sql); - - // Note: Due to a bug in current() that affects some versions - // of PHP we can not pass function call directly into it - $res = $query->result_array(); - return current($res); - } - - // -------------------------------------------------------------------- - - /** - * Generate CSV from a query result object - * - * @access public - * @param object The query result object - * @param string The delimiter - comma by default - * @param string The newline character - \n by default - * @param string The enclosure - double quote by default - * @return string - */ - function csv_from_result($query, $delim = ",", $newline = "\n", $enclosure = '"') - { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } - - $out = ''; - - // First generate the headings from the table column names - foreach ($query->list_fields() as $name) - { - $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim; - } - - $out = rtrim($out); - $out .= $newline; - - // Next blast through the result array and build out the rows - foreach ($query->result_array() as $row) - { - foreach ($row as $item) - { - $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure.$delim; - } - $out = rtrim($out); - $out .= $newline; - } - - return $out; - } - - // -------------------------------------------------------------------- - - /** - * Generate XML data from a query result object - * - * @access public - * @param object The query result object - * @param array Any preferences - * @return string - */ - function xml_from_result($query, $params = array()) - { - if ( ! is_object($query) OR ! method_exists($query, 'field_names')) - { - show_error('You must submit a valid result object'); - } - - // Set our default values - foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) - { - if ( ! isset($params[$key])) - { - $params[$key] = $val; - } - } - - // Create variables for convenience - extract($params); - - // Load the xml helper - $CI =& get_instance(); - $CI->load->helper('xml'); - - // Generate the result - $xml = "<{$root}>".$newline; - foreach ($query->result_array() as $row) - { - $xml .= $tab."<{$element}>".$newline; - - foreach ($row as $key => $val) - { - $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; - } - $xml .= $tab."".$newline; - } - $xml .= "".$newline; - - return $xml; - } - - // -------------------------------------------------------------------- - - /** - * Database Backup - * - * @access public - * @return void - */ - function backup($params = array()) - { - // If the parameters have not been submitted as an - // array then we know that it is simply the table - // name, which is a valid short cut. - if (is_string($params)) - { - $params = array('tables' => $params); - } - - // ------------------------------------------------------ - - // Set up our default preferences - $prefs = array( - 'tables' => array(), - 'ignore' => array(), - 'filename' => '', - 'format' => 'gzip', // gzip, zip, txt - 'add_drop' => TRUE, - 'add_insert' => TRUE, - 'newline' => "\n" - ); - - // Did the user submit any preferences? If so set them.... - if (count($params) > 0) - { - foreach ($prefs as $key => $val) - { - if (isset($params[$key])) - { - $prefs[$key] = $params[$key]; - } - } - } - - // ------------------------------------------------------ - - // Are we backing up a complete database or individual tables? - // If no table names were submitted we'll fetch the entire table list - if (count($prefs['tables']) == 0) - { - $prefs['tables'] = $this->db->list_tables(); - } - - // ------------------------------------------------------ - - // Validate the format - if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) - { - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Is the encoder supported? If not, we'll either issue an - // error or use plain text depending on the debug settings - if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) - OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_compression'); - } - - $prefs['format'] = 'txt'; - } - - // ------------------------------------------------------ - - // Set the filename if not provided - Only needed with Zip files - if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') - { - $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; - $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); - } - - // ------------------------------------------------------ - - // Was a Gzip file requested? - if ($prefs['format'] == 'gzip') - { - return gzencode($this->_backup($prefs)); - } - - // ------------------------------------------------------ - - // Was a text file requested? - if ($prefs['format'] == 'txt') - { - return $this->_backup($prefs); - } - - // ------------------------------------------------------ - - // Was a Zip file requested? - if ($prefs['format'] == 'zip') - { - // If they included the .zip file extension we'll remove it - if (preg_match("|.+?\.zip$|", $prefs['filename'])) - { - $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); - } - - // Tack on the ".sql" file extension if needed - if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) - { - $prefs['filename'] .= '.sql'; - } - - // Load the Zip class and output it - - $CI =& get_instance(); - $CI->load->library('zip'); - $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); - return $CI->zip->get_zip(); - } - - } - -} - - -/* End of file DB_utility.php */ +db + $CI =& get_instance(); + $this->db =& $CI->db; + + log_message('debug', "Database Utility Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * List databases + * + * @access public + * @return bool + */ + function list_databases() + { + // Is there a cached result? + if (isset($this->data_cache['db_names'])) + { + return $this->data_cache['db_names']; + } + + $query = $this->db->query($this->_list_databases()); + $dbs = array(); + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $dbs[] = current($row); + } + } + + $this->data_cache['db_names'] = $dbs; + return $this->data_cache['db_names']; + } + + // -------------------------------------------------------------------- + + /** + * Optimize Table + * + * @access public + * @param string the table name + * @return bool + */ + function optimize_table($table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + show_error('db_must_use_set'); + } + + $query = $this->db->query($sql); + $res = $query->result_array(); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Optimize Database + * + * @access public + * @return array + */ + function optimize_database() + { + $result = array(); + foreach ($this->db->list_tables() as $table_name) + { + $sql = $this->_optimize_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Build the result array... + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + $res = current($res); + $key = str_replace($this->db->database.'.', '', current($res)); + $keys = array_keys($res); + unset($res[$keys[0]]); + + $result[$key] = $res; + } + + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Repair Table + * + * @access public + * @param string the table name + * @return bool + */ + function repair_table($table_name) + { + $sql = $this->_repair_table($table_name); + + if (is_bool($sql)) + { + return $sql; + } + + $query = $this->db->query($sql); + + // Note: Due to a bug in current() that affects some versions + // of PHP we can not pass function call directly into it + $res = $query->result_array(); + return current($res); + } + + // -------------------------------------------------------------------- + + /** + * Generate CSV from a query result object + * + * @access public + * @param object The query result object + * @param string The delimiter - comma by default + * @param string The newline character - \n by default + * @param string The enclosure - double quote by default + * @return string + */ + function csv_from_result($query, $delim = ",", $newline = "\n", $enclosure = '"') + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + $out = ''; + + // First generate the headings from the table column names + foreach ($query->list_fields() as $name) + { + $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim; + } + + $out = rtrim($out); + $out .= $newline; + + // Next blast through the result array and build out the rows + foreach ($query->result_array() as $row) + { + foreach ($row as $item) + { + $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure.$delim; + } + $out = rtrim($out); + $out .= $newline; + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * Generate XML data from a query result object + * + * @access public + * @param object The query result object + * @param array Any preferences + * @return string + */ + function xml_from_result($query, $params = array()) + { + if ( ! is_object($query) OR ! method_exists($query, 'field_names')) + { + show_error('You must submit a valid result object'); + } + + // Set our default values + foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val) + { + if ( ! isset($params[$key])) + { + $params[$key] = $val; + } + } + + // Create variables for convenience + extract($params); + + // Load the xml helper + $CI =& get_instance(); + $CI->load->helper('xml'); + + // Generate the result + $xml = "<{$root}>".$newline; + foreach ($query->result_array() as $row) + { + $xml .= $tab."<{$element}>".$newline; + + foreach ($row as $key => $val) + { + $xml .= $tab.$tab."<{$key}>".xml_convert($val)."".$newline; + } + $xml .= $tab."".$newline; + } + $xml .= "".$newline; + + return $xml; + } + + // -------------------------------------------------------------------- + + /** + * Database Backup + * + * @access public + * @return void + */ + function backup($params = array()) + { + // If the parameters have not been submitted as an + // array then we know that it is simply the table + // name, which is a valid short cut. + if (is_string($params)) + { + $params = array('tables' => $params); + } + + // ------------------------------------------------------ + + // Set up our default preferences + $prefs = array( + 'tables' => array(), + 'ignore' => array(), + 'filename' => '', + 'format' => 'gzip', // gzip, zip, txt + 'add_drop' => TRUE, + 'add_insert' => TRUE, + 'newline' => "\n" + ); + + // Did the user submit any preferences? If so set them.... + if (count($params) > 0) + { + foreach ($prefs as $key => $val) + { + if (isset($params[$key])) + { + $prefs[$key] = $params[$key]; + } + } + } + + // ------------------------------------------------------ + + // Are we backing up a complete database or individual tables? + // If no table names were submitted we'll fetch the entire table list + if (count($prefs['tables']) == 0) + { + $prefs['tables'] = $this->db->list_tables(); + } + + // ------------------------------------------------------ + + // Validate the format + if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE)) + { + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Is the encoder supported? If not, we'll either issue an + // error or use plain text depending on the debug settings + if (($prefs['format'] == 'gzip' AND ! @function_exists('gzencode')) + OR ($prefs['format'] == 'zip' AND ! @function_exists('gzcompress'))) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_compression'); + } + + $prefs['format'] = 'txt'; + } + + // ------------------------------------------------------ + + // Set the filename if not provided - Only needed with Zip files + if ($prefs['filename'] == '' AND $prefs['format'] == 'zip') + { + $prefs['filename'] = (count($prefs['tables']) == 1) ? $prefs['tables'] : $this->db->database; + $prefs['filename'] .= '_'.date('Y-m-d_H-i', time()); + } + + // ------------------------------------------------------ + + // Was a Gzip file requested? + if ($prefs['format'] == 'gzip') + { + return gzencode($this->_backup($prefs)); + } + + // ------------------------------------------------------ + + // Was a text file requested? + if ($prefs['format'] == 'txt') + { + return $this->_backup($prefs); + } + + // ------------------------------------------------------ + + // Was a Zip file requested? + if ($prefs['format'] == 'zip') + { + // If they included the .zip file extension we'll remove it + if (preg_match("|.+?\.zip$|", $prefs['filename'])) + { + $prefs['filename'] = str_replace('.zip', '', $prefs['filename']); + } + + // Tack on the ".sql" file extension if needed + if ( ! preg_match("|.+?\.sql$|", $prefs['filename'])) + { + $prefs['filename'] .= '.sql'; + } + + // Load the Zip class and output it + + $CI =& get_instance(); + $CI->load->library('zip'); + $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); + return $CI->zip->get_zip(); + } + + } + +} + + +/* End of file DB_utility.php */ /* Location: ./system/database/DB_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/index.html b/system/database/drivers/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/index.html +++ b/system/database/drivers/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/mssql/index.html b/system/database/drivers/mssql/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/mssql/index.html +++ b/system/database/drivers/mssql/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 6ad0880f..78f81daf 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -1,622 +1,622 @@ -port != '') - { - $this->hostname .= ','.$this->port; - } - - return @mssql_connect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - if ($this->port != '') - { - $this->hostname .= ','.$this->port; - } - - return @mssql_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - // Note: The brackets are required in the event that the DB name - // contains reserved characters - return @mssql_select_db('['.$this->database.']', $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @mssql_query($sql, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('BEGIN TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK TRAN'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - // Access the CI object - $CI =& get_instance(); - - // Escape single quotes - return str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mssql_rows_affected($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * Returns the last id created in the Identity column. - * - * @access public - * @return integer - */ - function insert_id() - { - $ver = self::_parse_major_version($this->version()); - $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); - $query = $this->query($sql); - $row = $query->row(); - return $row->last_id; - } - - // -------------------------------------------------------------------- - - /** - * Parse major version - * - * Grabs the major version number from the - * database server version string passed in. - * - * @access private - * @param string $version - * @return int16 major version number - */ - function _parse_major_version($version) - { - preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); - return $ver_info[1]; // return the major version b/c that's all we're interested in. - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT @@VERSION AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; - - // for future compatibility - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - //$sql .= " LIKE '".$this->dbprefix."%'"; - return FALSE; // not currently supported - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * List column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access private - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT TOP 1 * FROM ".$table; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - // Are errros even supported in MS SQL? - return ''; - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - // Are error numbers supported? - return ''; - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return implode(', ', $tables); - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return "TRUNCATE ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $i = $limit + $offset; - - return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mssql_close($conn_id); - } - -} - - - -/* End of file mssql_driver.php */ +port != '') + { + $this->hostname .= ','.$this->port; + } + + return @mssql_connect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ($this->port != '') + { + $this->hostname .= ','.$this->port; + } + + return @mssql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Note: The brackets are required in the event that the DB name + // contains reserved characters + return @mssql_select_db('['.$this->database.']', $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @mssql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('BEGIN TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK TRAN'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // Access the CI object + $CI =& get_instance(); + + // Escape single quotes + return str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mssql_rows_affected($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * Returns the last id created in the Identity column. + * + * @access public + * @return integer + */ + function insert_id() + { + $ver = self::_parse_major_version($this->version()); + $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); + $query = $this->query($sql); + $row = $query->row(); + return $row->last_id; + } + + // -------------------------------------------------------------------- + + /** + * Parse major version + * + * Grabs the major version number from the + * database server version string passed in. + * + * @access private + * @param string $version + * @return int16 major version number + */ + function _parse_major_version($version) + { + preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); + return $ver_info[1]; // return the major version b/c that's all we're interested in. + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT @@VERSION AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; + + // for future compatibility + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + //$sql .= " LIKE '".$this->dbprefix."%'"; + return FALSE; // not currently supported + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * List column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access private + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT TOP 1 * FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + // Are errros even supported in MS SQL? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + // Are error numbers supported? + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return implode(', ', $tables); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $i = $limit + $offset; + + return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.$i.' ', $sql); + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mssql_close($conn_id); + } + +} + + + +/* End of file mssql_driver.php */ /* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index 8665dc05..512fc47d 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -1,248 +1,248 @@ -db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access private - * @param string the table name - * @param array the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool - */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) - { - $sql = 'CREATE TABLE '; - - if ($if_not_exists === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->_escape_identifiers($table)." ("; - $current_field_count = 0; - - foreach ($fields as $field=>$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - $sql .= ' '.$attributes['TYPE']; - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key = $this->db->_protect_identifiers($key); - } - else - { - $key = array($this->db->_protect_identifiers($key)); - } - - $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n)"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param boolean should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql; - } - - $sql .= " $column_definition"; - - if ($default_value != '') - { - $sql .= " DEFAULT \"$default_value\""; - } - - if ($null === NULL) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - // I think this syntax will work, but can find little documentation on renaming tables in MSSQL - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - -} - -/* End of file mssql_forge.php */ +db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param array the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $sql .= $this->db->_escape_identifiers($table)." ("; + $current_field_count = 0; + + foreach ($fields as $field=>$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n)"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + // I think this syntax will work, but can find little documentation on renaming tables in MSSQL + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + +} + +/* End of file mssql_forge.php */ /* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index 33fdda9d..e9679cb1 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -1,169 +1,169 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mssql_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mssql_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mssql_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->max_length = $field->max_length; - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - mssql_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mssql_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mssql_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mssql_fetch_object($this->result_id); - } - -} - - -/* End of file mssql_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mssql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mssql_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->max_length = $field->max_length; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mssql_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mssql_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mssql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mssql_fetch_object($this->result_id); + } + +} + + +/* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 1736fbaf..38118acc 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -1,123 +1,123 @@ -db->display_error('db_unsuported_feature'); - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - -} - - -/* End of file mssql_utility.php */ +db->display_error('db_unsuported_feature'); + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return "CREATE DATABASE ".$name; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return "DROP DATABASE ".$name; + } + +} + + +/* End of file mssql_utility.php */ /* Location: ./system/database/drivers/mssql/mssql_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/index.html b/system/database/drivers/mysql/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/mysql/index.html +++ b/system/database/drivers/mysql/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 45bf7714..943b3c03 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -1,634 +1,634 @@ -port != '') - { - $this->hostname .= ':'.$this->port; - } - - return @mysql_connect($this->hostname, $this->username, $this->password, TRUE); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - if ($this->port != '') - { - $this->hostname .= ':'.$this->port; - } - - return @mysql_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return @mysql_select_db($this->database, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @mysql_query($sql, $this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies - // the query so that it returns the number of affected rows - if ($this->delete_hack === TRUE) - { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) - { - $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('SET AUTOCOMMIT=0'); - $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - if (is_array($str)) - { - foreach($str as $key => $val) - { - $str[$key] = $this->escape_str($val); - } - - return $str; - } - - if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) - { - return mysql_real_escape_string($str, $this->conn_id); - } - elseif (function_exists('mysql_escape_string')) - { - return mysql_escape_string($str); - } - else - { - return addslashes($str); - } - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mysql_affected_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @mysql_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return (int)$row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - $sql .= " LIKE '".$this->dbprefix."%'"; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$table." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return mysql_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return mysql_errno($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return '('.implode(', ', $tables).')'; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return "TRUNCATE ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - if ($offset == 0) - { - $offset = ''; - } - else - { - $offset .= ", "; - } - - return $sql."LIMIT ".$offset.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mysql_close($conn_id); - } - -} - - -/* End of file mysql_driver.php */ +port != '') + { + $this->hostname .= ':'.$this->port; + } + + return @mysql_connect($this->hostname, $this->username, $this->password, TRUE); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ($this->port != '') + { + $this->hostname .= ':'.$this->port; + } + + return @mysql_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysql_select_db($this->database, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @mysql_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('SET AUTOCOMMIT=0'); + $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val); + } + + return $str; + } + + if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) + { + return mysql_real_escape_string($str, $this->conn_id); + } + elseif (function_exists('mysql_escape_string')) + { + return mysql_escape_string($str); + } + else + { + return addslashes($str); + } + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysql_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysql_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return (int)$row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " LIKE '".$this->dbprefix."%'"; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return mysql_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return mysql_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mysql_close($conn_id); + } + +} + + +/* End of file mysql_driver.php */ /* Location: ./system/database/drivers/mysql/mysql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 28a77b3b..d8cb77ea 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -1,254 +1,254 @@ -$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - if (array_key_exists('NAME', $attributes)) - { - $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; - } - - if (array_key_exists('TYPE', $attributes)) - { - $sql .= ' '.$attributes['TYPE']; - } - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes)) - { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access private - * @param string the table name - * @param mixed the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool - */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) - { - $sql = 'CREATE TABLE '; - - if ($if_not_exists === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->_escape_identifiers($table)." ("; - - $sql .= $this->_process_fields($fields); - - if (count($primary_keys) > 0) - { - $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key_name = $this->db->_protect_identifiers(implode('_', $key)); - $key = $this->db->_protect_identifiers($key); - } - else - { - $key_name = $this->db->_protect_identifiers($key); - $key = array($key_name); - } - - $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return string - */ - function _drop_table($table) - { - return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param array fields - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $fields, $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql.$this->db->_protect_identifiers($fields); - } - - $sql .= $this->_process_fields($fields); - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - -} - -/* End of file mysql_forge.php */ +$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + if (array_key_exists('NAME', $attributes)) + { + $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; + } + + if (array_key_exists('TYPE', $attributes)) + { + $sql .= ' '.$attributes['TYPE']; + } + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes)) + { + $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param mixed the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $sql .= $this->db->_escape_identifiers($table)." ("; + + $sql .= $this->_process_fields($fields); + + if (count($primary_keys) > 0) + { + $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key_name = $this->db->_protect_identifiers(implode('_', $key)); + $key = $this->db->_protect_identifiers($key); + } + else + { + $key_name = $this->db->_protect_identifiers($key); + $key = array($key_name); + } + + $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return string + */ + function _drop_table($table) + { + return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param array fields + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $fields, $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql.$this->db->_protect_identifiers($fields); + } + + $sql .= $this->_process_fields($fields); + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + +} + +/* End of file mysql_forge.php */ /* Location: ./system/database/drivers/mysql/mysql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index a28a1985..673aeac8 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -1,169 +1,169 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mysql_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mysql_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mysql_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->default = $field->def; - $F->max_length = $field->max_length; - $F->primary_key = $field->primary_key; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - mysql_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mysql_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mysql_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mysql_fetch_object($this->result_id); - } - -} - - -/* End of file mysql_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysql_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mysql_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysql_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = $field->primary_key; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + mysql_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mysql_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysql_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysql_fetch_object($this->result_id); + } + +} + + +/* End of file mysql_result.php */ /* Location: ./system/database/drivers/mysql/mysql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index d2c10dbb..003b1dd6 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -1,245 +1,245 @@ -db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return "REPAIR TABLE ".$this->db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - /** - * MySQL Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - if (count($params) == 0) - { - return FALSE; - } - - // Extract the prefs for simplicity - extract($params); - - // Build the output - $output = ''; - foreach ((array)$tables as $table) - { - // Is the table in the "ignore" list? - if (in_array($table, (array)$ignore, TRUE)) - { - continue; - } - - // Get the table schema - $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); - - // No result means the table name was invalid - if ($query === FALSE) - { - continue; - } - - // Write out the table schema - $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - - if ($add_drop == TRUE) - { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; - } - - $i = 0; - $result = $query->result_array(); - foreach ($result[0] as $val) - { - if ($i++ % 2) - { - $output .= $val.';'.$newline.$newline; - } - } - - // If inserts are not needed we're done... - if ($add_insert == FALSE) - { - continue; - } - - // Grab all the data from the current table - $query = $this->db->query("SELECT * FROM $table"); - - if ($query->num_rows() == 0) - { - continue; - } - - // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to - // surround the data with quotes or not - - $i = 0; - $field_str = ''; - $is_int = array(); - while ($field = mysql_fetch_field($query->result_id)) - { - // Most versions of MySQL store timestamp as a string - $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), //, 'timestamp'), - TRUE) - ) ? TRUE : FALSE; - - // Create a string of field names - $field_str .= '`'.$field->name.'`, '; - $i++; - } - - // Trim off the end comma - $field_str = preg_replace( "/, $/" , "" , $field_str); - - - // Build the insert string - foreach ($query->result_array() as $row) - { - $val_str = ''; - - $i = 0; - foreach ($row as $v) - { - // Is the value NULL? - if ($v === NULL) - { - $val_str .= 'NULL'; - } - else - { - // Escape the data if it's not an integer - if ($is_int[$i] == FALSE) - { - $val_str .= $this->db->escape($v); - } - else - { - $val_str .= $v; - } - } - - // Append a comma - $val_str .= ', '; - $i++; - } - - // Remove the comma at the end of the string - $val_str = preg_replace( "/, $/" , "" , $val_str); - - // Build the INSERT string - $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; - } - - $output .= $newline.$newline; - } - - return $output; - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - -} - -/* End of file mysql_utility.php */ +db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return "REPAIR TABLE ".$this->db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + /** + * MySQL Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + if (count($params) == 0) + { + return FALSE; + } + + // Extract the prefs for simplicity + extract($params); + + // Build the output + $output = ''; + foreach ((array)$tables as $table) + { + // Is the table in the "ignore" list? + if (in_array($table, (array)$ignore, TRUE)) + { + continue; + } + + // Get the table schema + $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); + + // No result means the table name was invalid + if ($query === FALSE) + { + continue; + } + + // Write out the table schema + $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; + + if ($add_drop == TRUE) + { + $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + } + + $i = 0; + $result = $query->result_array(); + foreach ($result[0] as $val) + { + if ($i++ % 2) + { + $output .= $val.';'.$newline.$newline; + } + } + + // If inserts are not needed we're done... + if ($add_insert == FALSE) + { + continue; + } + + // Grab all the data from the current table + $query = $this->db->query("SELECT * FROM $table"); + + if ($query->num_rows() == 0) + { + continue; + } + + // Fetch the field names and determine if the field is an + // integer type. We use this info to decide whether to + // surround the data with quotes or not + + $i = 0; + $field_str = ''; + $is_int = array(); + while ($field = mysql_fetch_field($query->result_id)) + { + // Most versions of MySQL store timestamp as a string + $is_int[$i] = (in_array( + strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), //, 'timestamp'), + TRUE) + ) ? TRUE : FALSE; + + // Create a string of field names + $field_str .= '`'.$field->name.'`, '; + $i++; + } + + // Trim off the end comma + $field_str = preg_replace( "/, $/" , "" , $field_str); + + + // Build the insert string + foreach ($query->result_array() as $row) + { + $val_str = ''; + + $i = 0; + foreach ($row as $v) + { + // Is the value NULL? + if ($v === NULL) + { + $val_str .= 'NULL'; + } + else + { + // Escape the data if it's not an integer + if ($is_int[$i] == FALSE) + { + $val_str .= $this->db->escape($v); + } + else + { + $val_str .= $v; + } + } + + // Append a comma + $val_str .= ', '; + $i++; + } + + // Remove the comma at the end of the string + $val_str = preg_replace( "/, $/" , "" , $val_str); + + // Build the INSERT string + $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; + } + + $output .= $newline.$newline; + } + + return $output; + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return "CREATE DATABASE ".$name; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return "DROP DATABASE ".$name; + } + +} + +/* End of file mysql_utility.php */ /* Location: ./system/database/drivers/mysql/mysql_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/index.html b/system/database/drivers/mysqli/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/mysqli/index.html +++ b/system/database/drivers/mysqli/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 1b3da7a6..ce458f29 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -1,625 +1,625 @@ -port != '') - { - return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port); - } - else - { - return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database); - } - - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return $this->db_connect(); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return @mysqli_select_db($this->conn_id, $this->database); - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access private - * @param string - * @param string - * @return resource - */ - function _db_set_charset($charset, $collation) - { - return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - $result = @mysqli_query($this->conn_id, $sql); - return $result; - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies - // the query so that it returns the number of affected rows - if ($this->delete_hack === TRUE) - { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) - { - $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('SET AUTOCOMMIT=0'); - $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - $this->simple_query('SET AUTOCOMMIT=1'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - if (function_exists('mysqli_real_escape_string') AND is_object($this->conn_id)) - { - return mysqli_real_escape_string($this->conn_id, $str); - } - elseif (function_exists('mysql_escape_string')) - { - return mysql_escape_string($str); - } - else - { - return addslashes($str); - } - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @mysqli_affected_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @mysqli_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - $sql .= " LIKE '".$this->dbprefix."%'"; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$table." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return mysqli_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return mysqli_errno($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return '('.implode(', ', $tables).')'; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return "TRUNCATE ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $sql .= "LIMIT ".$limit; - - if ($offset > 0) - { - $sql .= " OFFSET ".$offset; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @mysqli_close($conn_id); - } - - -} - - -/* End of file mysqli_driver.php */ +port != '') + { + return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port); + } + else + { + return @mysqli_connect($this->hostname, $this->username, $this->password, $this->database); + } + + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return $this->db_connect(); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return @mysqli_select_db($this->conn_id, $this->database); + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access private + * @param string + * @param string + * @return resource + */ + function _db_set_charset($charset, $collation) + { + return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + $result = @mysqli_query($this->conn_id, $sql); + return $result; + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + // the query so that it returns the number of affected rows + if ($this->delete_hack === TRUE) + { + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + { + $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('SET AUTOCOMMIT=0'); + $this->simple_query('START TRANSACTION'); // can also be BEGIN or BEGIN WORK + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + $this->simple_query('SET AUTOCOMMIT=1'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + if (function_exists('mysqli_real_escape_string') AND is_object($this->conn_id)) + { + return mysqli_real_escape_string($this->conn_id, $str); + } + elseif (function_exists('mysql_escape_string')) + { + return mysql_escape_string($str); + } + else + { + return addslashes($str); + } + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @mysqli_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @mysqli_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SHOW TABLES FROM ".$this->_escape_char.$this->database.$this->_escape_char; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " LIKE '".$this->dbprefix."%'"; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return mysqli_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return mysqli_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @mysqli_close($conn_id); + } + + +} + + +/* End of file mysqli_driver.php */ /* Location: ./system/database/drivers/mysqli/mysqli_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c7889bf4..99c2ebc3 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -1,254 +1,254 @@ -$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - if (array_key_exists('NAME', $attributes)) - { - $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; - } - - if (array_key_exists('TYPE', $attributes)) - { - $sql .= ' '.$attributes['TYPE']; - } - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes)) - { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access private - * @param string the table name - * @param mixed the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool - */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) - { - $sql = 'CREATE TABLE '; - - if ($if_not_exists === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->_escape_identifiers($table)." ("; - - $sql .= $this->_process_fields($fields); - - if (count($primary_keys) > 0) - { - $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key_name = $this->db->_protect_identifiers(implode('_', $key)); - $key = $this->db->_protect_identifiers($key); - } - else - { - $key_name = $this->db->_protect_identifiers($key); - $key = array($key_name); - } - - $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return string - */ - function _drop_table($table) - { - return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param array fields - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $fields, $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql.$this->db->_protect_identifiers($fields); - } - - $sql .= $this->_process_fields($fields); - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - -} - -/* End of file mysqli_forge.php */ +$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + if (array_key_exists('NAME', $attributes)) + { + $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; + } + + if (array_key_exists('TYPE', $attributes)) + { + $sql .= ' '.$attributes['TYPE']; + } + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes)) + { + $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param mixed the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $sql .= $this->db->_escape_identifiers($table)." ("; + + $sql .= $this->_process_fields($fields); + + if (count($primary_keys) > 0) + { + $key_name = $this->db->_protect_identifiers(implode('_', $primary_keys)); + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY ".$key_name." (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key_name = $this->db->_protect_identifiers(implode('_', $key)); + $key = $this->db->_protect_identifiers($key); + } + else + { + $key_name = $this->db->_protect_identifiers($key); + $key = array($key_name); + } + + $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n) DEFAULT CHARACTER SET {$this->db->char_set} COLLATE {$this->db->dbcollat};"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return string + */ + function _drop_table($table) + { + return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param array fields + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $fields, $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql.$this->db->_protect_identifiers($fields); + } + + $sql .= $this->_process_fields($fields); + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + +} + +/* End of file mysqli_forge.php */ /* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index b690914b..5b1f7936 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -1,169 +1,169 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @mysqli_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - while ($field = mysqli_fetch_field($this->result_id)) - { - $field_names[] = $field->name; - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - while ($field = mysqli_fetch_field($this->result_id)) - { - $F = new stdClass(); - $F->name = $field->name; - $F->type = $field->type; - $F->default = $field->def; - $F->max_length = $field->max_length; - $F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_object($this->result_id)) - { - mysqli_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return mysqli_data_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return mysqli_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return mysqli_fetch_object($this->result_id); - } - -} - - -/* End of file mysqli_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @mysqli_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + while ($field = mysqli_fetch_field($this->result_id)) + { + $field_names[] = $field->name; + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + while ($field = mysqli_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + $F->primary_key = ($field->flags & MYSQLI_PRI_KEY_FLAG) ? 1 : 0; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_object($this->result_id)) + { + mysqli_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return mysqli_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return mysqli_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return mysqli_fetch_object($this->result_id); + } + +} + + +/* End of file mysqli_result.php */ /* Location: ./system/database/drivers/mysqli/mysqli_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index d19b6437..c1d191d1 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -1,123 +1,123 @@ -db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return "REPAIR TABLE ".$this->db->_escape_identifiers($table); - } - - // -------------------------------------------------------------------- - - /** - * MySQLi Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - -} - -/* End of file mysqli_utility.php */ +db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return "REPAIR TABLE ".$this->db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * MySQLi Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return "CREATE DATABASE ".$name; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return "DROP DATABASE ".$name; + } + +} + +/* End of file mysqli_utility.php */ /* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/index.html b/system/database/drivers/oci8/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/oci8/index.html +++ b/system/database/drivers/oci8/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 0c146778..0629a594 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -1,737 +1,737 @@ -username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @ociplogon($this->username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return ociserverversion($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - 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); - } - - /** - * Generate a statement ID - * - * @access private - * @param string an SQL query - * @return none - */ - function _set_stmt_id($sql) - { - if ( ! is_resource($this->stmt_id)) - { - $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); - } - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * getCursor. Returns a cursor from the datbase - * - * @access public - * @return cursor id - */ - function get_cursor() - { - $this->curs_id = ocinewcursor($this->conn_id); - return $this->curs_id; - } - - // -------------------------------------------------------------------- - - /** - * Stored Procedure. Executes a stored procedure - * - * @access public - * @param package package stored procedure is in - * @param procedure stored procedure to execute - * @param params array of parameters - * @return array - * - * params array keys - * - * KEY OPTIONAL NOTES - * name no the name of the parameter should be in : format - * value no the value of the parameter. If this is an OUT or IN OUT parameter, - * this should be a reference to a variable - * type yes the type of the parameter - * length yes the max size of the parameter - */ - function stored_procedure($package, $procedure, $params) - { - if ($package == '' OR $procedure == '' OR ! is_array($params)) - { - if ($this->db_debug) - { - log_message('error', 'Invalid query: '.$package.'.'.$procedure); - return $this->display_error('db_invalid_query'); - } - return FALSE; - } - - // build the query string - $sql = "begin $package.$procedure("; - - $have_cursor = FALSE; - foreach($params as $param) - { - $sql .= $param['name'] . ","; - - if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR)) - { - $have_cursor = TRUE; - } - } - $sql = trim($sql, ",") . "); end;"; - - $this->stmt_id = FALSE; - $this->_set_stmt_id($sql); - $this->_bind_params($params); - $this->query($sql, FALSE, $have_cursor); - } - - // -------------------------------------------------------------------- - - /** - * Bind parameters - * - * @access private - * @return none - */ - function _bind_params($params) - { - if ( ! is_array($params) OR ! is_resource($this->stmt_id)) - { - return; - } - - foreach ($params as $param) - { - foreach (array('name', 'value', 'type', 'length') as $val) - { - if ( ! isset($param[$val])) - { - $param[$val] = ''; - } - } - - ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); - } - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->_commit = OCI_DEFAULT; - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = OCIcommit($this->conn_id); - $this->_commit = OCI_COMMIT_ON_SUCCESS; - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = OCIrollback($this->conn_id); - $this->_commit = OCI_COMMIT_ON_SUCCESS; - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - // Access the CI object - $CI =& get_instance(); - - return $CI->_remove_invisible_characters($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @ocirowcount($this->stmt_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - // not supported in oracle - return $this->display_error('db_unsupported_function'); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query == FALSE) - { - return 0; - } - - $row = $query->row(); - return $row->NUMROWS; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SELECT TABLE_NAME FROM ALL_TABLES"; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - $sql .= " WHERE TABLE_NAME LIKE '".$this->dbprefix."%'"; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$table." where rownum = 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - $error = ocierror($this->conn_id); - return $error['message']; - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - $error = ocierror($this->conn_id); - return $error['code']; - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return implode(', ', $tables); - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return "TRUNCATE TABLE ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $limit = $offset + $limit; - $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; - - if ($offset != 0) - { - $newsql .= " WHERE rnum >= $offset"; - } - - // remember that we used limits - $this->limit_used = TRUE; - - return $newsql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @ocilogoff($conn_id); - } - - -} - - - -/* End of file oci8_driver.php */ +username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @ociplogon($this->username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return ociserverversion($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + 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); + } + + /** + * Generate a statement ID + * + * @access private + * @param string an SQL query + * @return none + */ + function _set_stmt_id($sql) + { + if ( ! is_resource($this->stmt_id)) + { + $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); + } + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * getCursor. Returns a cursor from the datbase + * + * @access public + * @return cursor id + */ + function get_cursor() + { + $this->curs_id = ocinewcursor($this->conn_id); + return $this->curs_id; + } + + // -------------------------------------------------------------------- + + /** + * Stored Procedure. Executes a stored procedure + * + * @access public + * @param package package stored procedure is in + * @param procedure stored procedure to execute + * @param params array of parameters + * @return array + * + * params array keys + * + * KEY OPTIONAL NOTES + * name no the name of the parameter should be in : format + * value no the value of the parameter. If this is an OUT or IN OUT parameter, + * this should be a reference to a variable + * type yes the type of the parameter + * length yes the max size of the parameter + */ + function stored_procedure($package, $procedure, $params) + { + if ($package == '' OR $procedure == '' OR ! is_array($params)) + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$package.'.'.$procedure); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } + + // build the query string + $sql = "begin $package.$procedure("; + + $have_cursor = FALSE; + foreach($params as $param) + { + $sql .= $param['name'] . ","; + + if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR)) + { + $have_cursor = TRUE; + } + } + $sql = trim($sql, ",") . "); end;"; + + $this->stmt_id = FALSE; + $this->_set_stmt_id($sql); + $this->_bind_params($params); + $this->query($sql, FALSE, $have_cursor); + } + + // -------------------------------------------------------------------- + + /** + * Bind parameters + * + * @access private + * @return none + */ + function _bind_params($params) + { + if ( ! is_array($params) OR ! is_resource($this->stmt_id)) + { + return; + } + + foreach ($params as $param) + { + foreach (array('name', 'value', 'type', 'length') as $val) + { + if ( ! isset($param[$val])) + { + $param[$val] = ''; + } + } + + ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); + } + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->_commit = OCI_DEFAULT; + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = OCIcommit($this->conn_id); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = OCIrollback($this->conn_id); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // Access the CI object + $CI =& get_instance(); + + return $CI->_remove_invisible_characters($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @ocirowcount($this->stmt_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + // not supported in oracle + return $this->display_error('db_unsupported_function'); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query == FALSE) + { + return 0; + } + + $row = $query->row(); + return $row->NUMROWS; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SELECT TABLE_NAME FROM ALL_TABLES"; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " WHERE TABLE_NAME LIKE '".$this->dbprefix."%'"; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." where rownum = 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + $error = ocierror($this->conn_id); + return $error['message']; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + $error = ocierror($this->conn_id); + return $error['code']; + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return implode(', ', $tables); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE TABLE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $limit = $offset + $limit; + $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; + + if ($offset != 0) + { + $newsql .= " WHERE rnum >= $offset"; + } + + // remember that we used limits + $this->limit_used = TRUE; + + return $newsql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @ocilogoff($conn_id); + } + + +} + + + +/* End of file oci8_driver.php */ /* Location: ./system/database/drivers/oci8/oci8_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 4b073d07..bbc11f33 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -1,248 +1,248 @@ -db->_escape_identifiers($table)." ("; - $current_field_count = 0; - - foreach ($fields as $field=>$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - $sql .= ' '.$attributes['TYPE']; - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key = $this->db->_protect_identifiers($key); - } - else - { - $key = array($this->db->_protect_identifiers($key)); - } - - $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n)"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return bool - */ - function _drop_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param boolean should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql; - } - - $sql .= " $column_definition"; - - if ($default_value != '') - { - $sql .= " DEFAULT \"$default_value\""; - } - - if ($null === NULL) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - - -} - -/* End of file oci8_forge.php */ +db->_escape_identifiers($table)." ("; + $current_field_count = 0; + + foreach ($fields as $field=>$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n)"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return bool + */ + function _drop_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + + +} + +/* End of file oci8_forge.php */ /* Location: ./system/database/drivers/oci8/oci8_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 4cfbfa4b..7d7cd1c3 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -1,249 +1,249 @@ -result_array()); - @ociexecute($this->stmt_id); - - if ($this->curs_id) - { - @ociexecute($this->curs_id); - } - - return $rowcount; - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - $count = @ocinumcols($this->stmt_id); - - // if we used a limit we subtract it - if ($this->limit_used) - { - $count = $count - 1; - } - - return $count; - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) - { - $field_names[] = ocicolumnname($this->stmt_id, $c); - } - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $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); - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - ocifreestatement($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc(&$row) - { - $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; - - return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - 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; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @access public - * @return array - */ - 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)) - { - $this->result_array[] = $row; - } - - return $this->result_array; - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return FALSE; // Not needed - } - -} - - -/* End of file oci8_result.php */ +result_array()); + @ociexecute($this->stmt_id); + + if ($this->curs_id) + { + @ociexecute($this->curs_id); + } + + return $rowcount; + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + $count = @ocinumcols($this->stmt_id); + + // if we used a limit we subtract it + if ($this->limit_used) + { + $count = $count - 1; + } + + return $count; + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + $fieldCount = $this->num_fields(); + for ($c = 1; $c <= $fieldCount; $c++) + { + $field_names[] = ocicolumnname($this->stmt_id, $c); + } + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + $fieldCount = $this->num_fields(); + for ($c = 1; $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); + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + ocifreestatement($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc(&$row) + { + $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; + + return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + 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; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + 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)) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return FALSE; // Not needed + } + +} + + +/* End of file oci8_result.php */ /* Location: ./system/database/drivers/oci8/oci8_result.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index a3b6d815..cf6e9e64 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -1,122 +1,122 @@ -db->display_error('db_unsuported_feature'); - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return FALSE; - } - -} - -/* End of file oci8_utility.php */ +db->display_error('db_unsuported_feature'); + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access public + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return FALSE; + } + +} + +/* End of file oci8_utility.php */ /* Location: ./system/database/drivers/oci8/oci8_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/index.html b/system/database/drivers/odbc/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/odbc/index.html +++ b/system/database/drivers/odbc/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 3c6f0154..8fcbcfe0 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -1,594 +1,594 @@ -_random_keyword = ' RND('.time().')'; // database specific random keyword - } - - /** - * Non-persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_connect() - { - return @odbc_connect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @odbc_pconnect($this->hostname, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - // Not needed for ODBC - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @odbc_exec($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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; - - return odbc_autocommit($this->conn_id, FALSE); - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = odbc_commit($this->conn_id); - odbc_autocommit($this->conn_id, TRUE); - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $ret = odbc_rollback($this->conn_id); - odbc_autocommit($this->conn_id, TRUE); - return $ret; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - // Access the CI object - $CI =& get_instance(); - - // ODBC doesn't require escaping - return $CI->_remove_invisible_characters($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @odbc_num_rows($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @odbc_insert_id($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SHOW TABLES FROM `".$this->database."`"; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - //$sql .= " LIKE '".$this->dbprefix."%'"; - return FALSE; // not currently supported - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SHOW COLUMNS FROM ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT TOP 1 FROM ".$table; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return odbc_errormsg($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return odbc_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return '('.implode(', ', $tables).')'; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return $this->_delete($table); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - // Does ODBC doesn't use the LIMIT clause? - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @odbc_close($conn_id); - } - - -} - - - -/* End of file odbc_driver.php */ +_random_keyword = ' RND('.time().')'; // database specific random keyword + } + + /** + * Non-persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_connect() + { + return @odbc_connect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @odbc_pconnect($this->hostname, $this->username, $this->password); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for ODBC + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @odbc_exec($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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; + + return odbc_autocommit($this->conn_id, FALSE); + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = odbc_commit($this->conn_id); + odbc_autocommit($this->conn_id, TRUE); + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $ret = odbc_rollback($this->conn_id); + odbc_autocommit($this->conn_id, TRUE); + return $ret; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + // Access the CI object + $CI =& get_instance(); + + // ODBC doesn't require escaping + return $CI->_remove_invisible_characters($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @odbc_num_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @odbc_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SHOW TABLES FROM `".$this->database."`"; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + //$sql .= " LIKE '".$this->dbprefix."%'"; + return FALSE; // not currently supported + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT TOP 1 FROM ".$table; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return odbc_errormsg($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return odbc_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return $this->_delete($table); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + // Does ODBC doesn't use the LIMIT clause? + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @odbc_close($conn_id); + } + + +} + + + +/* End of file odbc_driver.php */ /* Location: ./system/database/drivers/odbc/odbc_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index 099925ca..5305afbe 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -1,266 +1,266 @@ -db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - // ODBC has no "drop database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access private - * @param string the table name - * @param array the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool - */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) - { - $sql = 'CREATE TABLE '; - - if ($if_not_exists === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->_escape_identifiers($table)." ("; - $current_field_count = 0; - - foreach ($fields as $field=>$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - $sql .= ' '.$attributes['TYPE']; - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key = $this->db->_protect_identifiers($key); - } - else - { - $key = array($this->db->_protect_identifiers($key)); - } - - $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n)"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return bool - */ - function _drop_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param boolean should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql; - } - - $sql .= " $column_definition"; - - if ($default_value != '') - { - $sql .= " DEFAULT \"$default_value\""; - } - - if ($null === NULL) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - - } - - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - - -} - -/* End of file odbc_forge.php */ +db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + // ODBC has no "drop database" command since it's + // designed to connect to an existing database + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param array the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $sql .= $this->db->_escape_identifiers($table)." ("; + $current_field_count = 0; + + foreach ($fields as $field=>$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n)"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return bool + */ + function _drop_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + + +} + +/* End of file odbc_forge.php */ /* Location: ./system/database/drivers/odbc/odbc_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 6d6542e7..9a59cfc2 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -1,228 +1,228 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @odbc_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $field_names[] = odbc_field_name($this->result_id, $i); - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = odbc_field_name($this->result_id, $i); - $F->type = odbc_field_type($this->result_id, $i); - $F->max_length = odbc_field_len($this->result_id, $i); - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - odbc_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - if (function_exists('odbc_fetch_object')) - { - return odbc_fetch_array($this->result_id); - } - else - { - return $this->_odbc_fetch_array($this->result_id); - } - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - if (function_exists('odbc_fetch_object')) - { - return odbc_fetch_object($this->result_id); - } - else - { - return $this->_odbc_fetch_object($this->result_id); - } - } - - - /** - * Result - object - * - * subsititutes the odbc_fetch_object function when - * not available (odbc_fetch_object requires unixODBC) - * - * @access private - * @return object - */ - function _odbc_fetch_object(& $odbc_result) { - $rs = array(); - $rs_obj = false; - if (odbc_fetch_into($odbc_result, $rs)) { - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); - $rs_obj->$field_name = $v; - } - } - return $rs_obj; - } - - - /** - * Result - array - * - * subsititutes the odbc_fetch_array function when - * not available (odbc_fetch_array requires unixODBC) - * - * @access private - * @return array - */ - function _odbc_fetch_array(& $odbc_result) { - $rs = array(); - $rs_assoc = false; - if (odbc_fetch_into($odbc_result, $rs)) { - $rs_assoc=array(); - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); - $rs_assoc[$field_name] = $v; - } - } - return $rs_assoc; - } - -} - - -/* End of file odbc_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @odbc_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $field_names[] = odbc_field_name($this->result_id, $i); + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = odbc_field_name($this->result_id, $i); + $F->type = odbc_field_type($this->result_id, $i); + $F->max_length = odbc_field_len($this->result_id, $i); + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + odbc_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_array($this->result_id); + } + else + { + return $this->_odbc_fetch_array($this->result_id); + } + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + if (function_exists('odbc_fetch_object')) + { + return odbc_fetch_object($this->result_id); + } + else + { + return $this->_odbc_fetch_object($this->result_id); + } + } + + + /** + * Result - object + * + * subsititutes the odbc_fetch_object function when + * not available (odbc_fetch_object requires unixODBC) + * + * @access private + * @return object + */ + function _odbc_fetch_object(& $odbc_result) { + $rs = array(); + $rs_obj = false; + if (odbc_fetch_into($odbc_result, $rs)) { + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_obj->$field_name = $v; + } + } + return $rs_obj; + } + + + /** + * Result - array + * + * subsititutes the odbc_fetch_array function when + * not available (odbc_fetch_array requires unixODBC) + * + * @access private + * @return array + */ + function _odbc_fetch_array(& $odbc_result) { + $rs = array(); + $rs_assoc = false; + if (odbc_fetch_into($odbc_result, $rs)) { + $rs_assoc=array(); + foreach ($rs as $k=>$v) { + $field_name= odbc_field_name($odbc_result, $k+1); + $rs_assoc[$field_name] = $v; + } + } + return $rs_assoc; + } + +} + + +/* End of file odbc_result.php */ /* Location: ./system/database/drivers/odbc/odbc_result.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index 6f4376ed..67aee642 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -1,148 +1,148 @@ -db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Generates a platform-specific query so that a table can be optimized - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Generates a platform-specific query so that a table can be repaired - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - // Not a supported ODBC feature - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * ODBC Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database() - { - // ODBC has no "create database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - // ODBC has no "drop database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } -} - -/* End of file odbc_utility.php */ +db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + // Not a supported ODBC feature + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * ODBC Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database() + { + // ODBC has no "create database" command since it's + // designed to connect to an existing database + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + // ODBC has no "drop database" command since it's + // designed to connect to an existing database + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return FALSE; + } +} + +/* End of file odbc_utility.php */ /* Location: ./system/database/drivers/odbc/odbc_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/index.html b/system/database/drivers/postgre/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/postgre/index.html +++ b/system/database/drivers/postgre/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 68622a22..da0b0f23 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -1,636 +1,636 @@ - 'host', - 'port' => 'port', - 'database' => 'dbname', - 'username' => 'user', - 'password' => 'password' - ); - - $connect_string = ""; - foreach ($components as $key => $val) - { - if (isset($this->$key) && $this->$key != '') - { - $connect_string .= " $val=".$this->$key; - } - } - return trim($connect_string); - } - - // -------------------------------------------------------------------- - - /** - * Non-persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_connect() - { - return @pg_connect($this->_connect_string()); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return @pg_pconnect($this->_connect_string()); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - // Not needed for Postgre so we'll return TRUE - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return "SELECT version() AS ver"; - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @pg_query($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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; - - return @pg_exec($this->conn_id, "begin"); - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - return @pg_exec($this->conn_id, "commit"); - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - return @pg_exec($this->conn_id, "rollback"); - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return pg_escape_string($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @pg_affected_rows($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - $v = $this->_version(); - $v = $v['server']; - - $table = func_num_args() > 0 ? func_get_arg(0) : null; - $column = func_num_args() > 1 ? func_get_arg(1) : null; - - if ($table == null && $v >= '8.1') - { - $sql='SELECT LASTVAL() as ins_id'; - } - elseif ($table != null && $column != null && $v >= '8.0') - { - $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); - $query = $this->query($sql); - $row = $query->row(); - $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); - } - elseif ($table != null) - { - // seq_name passed in table parameter - $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); - } - else - { - return pg_last_oid($this->result_id); - } - $query = $this->query($sql); - $row = $query->row(); - return $row->ins_id; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - $sql .= " AND table_name LIKE '".$this->dbprefix."%'"; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$table."'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$table." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return pg_last_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return ''; - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return implode(', ', $tables); - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return "TRUNCATE ".$table; - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - $sql .= "LIMIT ".$limit; - - if ($offset > 0) - { - $sql .= " OFFSET ".$offset; - } - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @pg_close($conn_id); - } - - -} - - -/* End of file postgre_driver.php */ + 'host', + 'port' => 'port', + 'database' => 'dbname', + 'username' => 'user', + 'password' => 'password' + ); + + $connect_string = ""; + foreach ($components as $key => $val) + { + if (isset($this->$key) && $this->$key != '') + { + $connect_string .= " $val=".$this->$key; + } + } + return trim($connect_string); + } + + // -------------------------------------------------------------------- + + /** + * Non-persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_connect() + { + return @pg_connect($this->_connect_string()); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return @pg_pconnect($this->_connect_string()); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // Not needed for Postgre so we'll return TRUE + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return "SELECT version() AS ver"; + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @pg_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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; + + return @pg_exec($this->conn_id, "begin"); + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + return @pg_exec($this->conn_id, "commit"); + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + return @pg_exec($this->conn_id, "rollback"); + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return pg_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @pg_affected_rows($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + $v = $this->_version(); + $v = $v['server']; + + $table = func_num_args() > 0 ? func_get_arg(0) : null; + $column = func_num_args() > 1 ? func_get_arg(1) : null; + + if ($table == null && $v >= '8.1') + { + $sql='SELECT LASTVAL() as ins_id'; + } + elseif ($table != null && $column != null && $v >= '8.0') + { + $sql = sprintf("SELECT pg_get_serial_sequence('%s','%s') as seq", $table, $column); + $query = $this->query($sql); + $row = $query->row(); + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $row->seq); + } + elseif ($table != null) + { + // seq_name passed in table parameter + $sql = sprintf("SELECT CURRVAL('%s') as ins_id", $table); + } + else + { + return pg_last_oid($this->result_id); + } + $query = $this->query($sql); + $row = $query->row(); + return $row->ins_id; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " AND table_name LIKE '".$this->dbprefix."%'"; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$table."'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return pg_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return ''; + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return implode(', ', $tables); + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + $sql .= "LIMIT ".$limit; + + if ($offset > 0) + { + $sql .= " OFFSET ".$offset; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @pg_close($conn_id); + } + + +} + + +/* End of file postgre_driver.php */ /* Location: ./system/database/drivers/postgre/postgre_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 5b4bcc29..72c2dd79 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -1,248 +1,248 @@ -db->_escape_identifiers($table)." ("; - $current_field_count = 0; - - foreach ($fields as $field=>$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - $sql .= ' '.$attributes['TYPE']; - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key = $this->db->_protect_identifiers($key); - } - else - { - $key = array($this->db->_protect_identifiers($key)); - } - - $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n);"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return bool - */ - function _drop_table($table) - { - return "DROP TABLE ".$this->db->_escape_identifiers($table)." CASCADE"; - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param boolean should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - return $sql; - } - - $sql .= " $column_definition"; - - if ($default_value != '') - { - $sql .= " DEFAULT \"$default_value\""; - } - - if ($null === NULL) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } - - -} - -/* End of file postgre_forge.php */ +db->_escape_identifiers($table)." ("; + $current_field_count = 0; + + foreach ($fields as $field=>$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tFOREIGN KEY (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n);"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return bool + */ + function _drop_table($table) + { + return "DROP TABLE ".$this->db->_escape_identifiers($table)." CASCADE"; + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + + +} + +/* End of file postgre_forge.php */ /* Location: ./system/database/drivers/postgre/postgre_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 78b9a604..3206c133 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -1,169 +1,169 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @pg_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $field_names[] = pg_field_name($this->result_id, $i); - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = pg_field_name($this->result_id, $i); - $F->type = pg_field_type($this->result_id, $i); - $F->max_length = pg_field_size($this->result_id, $i); - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - if (is_resource($this->result_id)) - { - pg_free_result($this->result_id); - $this->result_id = FALSE; - } - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return pg_result_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return pg_fetch_assoc($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - return pg_fetch_object($this->result_id); - } - -} - - -/* End of file postgre_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @pg_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $field_names[] = pg_field_name($this->result_id, $i); + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = pg_field_name($this->result_id, $i); + $F->type = pg_field_type($this->result_id, $i); + $F->max_length = pg_field_size($this->result_id, $i); + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if (is_resource($this->result_id)) + { + pg_free_result($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return pg_result_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return pg_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return pg_fetch_object($this->result_id); + } + +} + + +/* End of file postgre_result.php */ /* Location: ./system/database/drivers/postgre/postgre_result.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index f9b0f22e..06292f22 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -1,124 +1,124 @@ -db->display_error('db_unsuported_feature'); - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - - -} - - -/* End of file postgre_utility.php */ +db->display_error('db_unsuported_feature'); + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return "CREATE DATABASE ".$name; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return "DROP DATABASE ".$name; + } + + +} + + +/* End of file postgre_utility.php */ /* Location: ./system/database/drivers/postgre/postgre_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/index.html b/system/database/drivers/sqlite/index.html index 065d2da5..c942a79c 100644 --- a/system/database/drivers/sqlite/index.html +++ b/system/database/drivers/sqlite/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 992e2479..058cef77 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -1,612 +1,612 @@ -database, FILE_WRITE_MODE, $error)) - { - log_message('error', $error); - - if ($this->db_debug) - { - $this->display_error($error, '', TRUE); - } - - return FALSE; - } - - return $conn_id; - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) - { - log_message('error', $error); - - if ($this->db_debug) - { - $this->display_error($error, '', TRUE); - } - - return FALSE; - } - - return $conn_id; - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Set client character set - * - * @access public - * @param string - * @param string - * @return resource - */ - function db_set_charset($charset, $collation) - { - // @todo - add support if needed - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return sqlite_libversion(); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - $sql = $this->_prep_query($sql); - return @sqlite_query($this->conn_id, $sql); - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Begin Transaction - * - * @access public - * @return bool - */ - function trans_begin($test_mode = FALSE) - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - // 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->simple_query('BEGIN TRANSACTION'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Commit Transaction - * - * @access public - * @return bool - */ - function trans_commit() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('COMMIT'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Rollback Transaction - * - * @access public - * @return bool - */ - function trans_rollback() - { - if ( ! $this->trans_enabled) - { - return TRUE; - } - - // When transactions are nested we only begin/commit/rollback the outermost ones - if ($this->_trans_depth > 0) - { - return TRUE; - } - - $this->simple_query('ROLLBACK'); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return sqlite_escape_string($str); - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return sqlite_changes($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - return @sqlite_last_insert_rowid($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - - if ($query->num_rows() == 0) - return '0'; - - $row = $query->row(); - return $row->numrows; - } - - // -------------------------------------------------------------------- - - /** - * List table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @param boolean - * @return string - */ - function _list_tables($prefix_limit = FALSE) - { - $sql = "SELECT name from sqlite_master WHERE type='table'"; - - if ($prefix_limit !== FALSE AND $this->dbprefix != '') - { - $sql .= " AND 'name' LIKE '".$this->dbprefix."%'"; - } - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - // Not supported - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { - return "SELECT * FROM ".$table." LIMIT 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - return sqlite_error_string(sqlite_last_error($this->conn_id)); - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - return sqlite_last_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Escape the SQL Identifiers - * - * This function escapes column and table names - * - * @access private - * @param string - * @return string - */ - function _escape_identifiers($item) - { - if ($this->_escape_char == '') - { - return $item; - } - - foreach ($this->_reserved_identifiers as $id) - { - if (strpos($item, '.'.$id) !== FALSE) - { - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - } - - if (strpos($item, '.') !== FALSE) - { - $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; - } - else - { - $str = $this->_escape_char.$item.$this->_escape_char; - } - - // remove duplicates if the user already included the escape - return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); - } - - // -------------------------------------------------------------------- - - /** - * From Tables - * - * This function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards - * - * @access public - * @param type - * @return type - */ - function _from_tables($tables) - { - if ( ! is_array($tables)) - { - $tables = array($tables); - } - - return '('.implode(', ', $tables).')'; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * 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 - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @param array the orderby clause - * @param array the limit clause - * @return string - */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; - - $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); - - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; - - $sql .= $orderby.$limit; - - return $sql; - } - - - // -------------------------------------------------------------------- - - /** - * Truncate statement - * - * Generates a platform-specific truncate string from the supplied data - * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" - * - * @access public - * @param string the table name - * @return string - */ - function _truncate($table) - { - return $this->_delete($table); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @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) - { - $conditions = ''; - - if (count($where) > 0 OR count($like) > 0) - { - $conditions = "\nWHERE "; - $conditions .= implode("\n", $this->ar_where); - - if (count($where) > 0 && count($like) > 0) - { - $conditions .= " AND "; - } - $conditions .= implode("\n", $like); - } - - $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; - - return "DELETE FROM ".$table.$conditions.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @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) - { - if ($offset == 0) - { - $offset = ''; - } - else - { - $offset .= ", "; - } - - return $sql."LIMIT ".$offset.$limit; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - @sqlite_close($conn_id); - } - - -} - - -/* End of file sqlite_driver.php */ +database, FILE_WRITE_MODE, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + + return FALSE; + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) + { + log_message('error', $error); + + if ($this->db_debug) + { + $this->display_error($error, '', TRUE); + } + + return FALSE; + } + + return $conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // @todo - add support if needed + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return sqlite_libversion(); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @sqlite_query($this->conn_id, $sql); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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->simple_query('BEGIN TRANSACTION'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('COMMIT'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + $this->simple_query('ROLLBACK'); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return sqlite_escape_string($str); + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return sqlite_changes($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @sqlite_last_insert_rowid($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + return '0'; + + $row = $query->row(); + return $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SELECT name from sqlite_master WHERE type='table'"; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " AND 'name' LIKE '".$this->dbprefix."%'"; + } + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + // Not supported + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return sqlite_error_string(sqlite_last_error($this->conn_id)); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return sqlite_last_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + + // -------------------------------------------------------------------- + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return $this->_delete($table); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @sqlite_close($conn_id); + } + + +} + + +/* End of file sqlite_driver.php */ /* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 2039525b..73630def 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -1,265 +1,265 @@ -db->database) OR ! @unlink($this->db->database)) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unable_to_drop'); - } - return FALSE; - } - return TRUE; - } - // -------------------------------------------------------------------- - - /** - * Create Table - * - * @access private - * @param string the table name - * @param array the fields - * @param mixed primary key(s) - * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL - * @return bool - */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) - { - $sql = 'CREATE TABLE '; - - // IF NOT EXISTS added to SQLite in 3.3.0 - if ($if_not_exists === TRUE && version_compare($this->_version(), '3.3.0', '>=') === TRUE) - { - $sql .= 'IF NOT EXISTS '; - } - - $sql .= $this->db->_escape_identifiers($table)."("; - $current_field_count = 0; - - foreach ($fields as $field=>$attributes) - { - // Numeric field names aren't allowed in databases, so if the key is - // numeric, we know it was assigned by PHP and the developer manually - // entered the field information, so we'll simply add it to the list - if (is_numeric($field)) - { - $sql .= "\n\t$attributes"; - } - else - { - $attributes = array_change_key_case($attributes, CASE_UPPER); - - $sql .= "\n\t".$this->db->_protect_identifiers($field); - - $sql .= ' '.$attributes['TYPE']; - - if (array_key_exists('CONSTRAINT', $attributes)) - { - $sql .= '('.$attributes['CONSTRAINT'].')'; - } - - if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) - { - $sql .= ' UNSIGNED'; - } - - if (array_key_exists('DEFAULT', $attributes)) - { - $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; - } - - if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) - { - $sql .= ' AUTO_INCREMENT'; - } - } - - // don't add a comma on the end of the last field - if (++$current_field_count < count($fields)) - { - $sql .= ','; - } - } - - if (count($primary_keys) > 0) - { - $primary_keys = $this->db->_protect_identifiers($primary_keys); - $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; - } - - if (is_array($keys) && count($keys) > 0) - { - foreach ($keys as $key) - { - if (is_array($key)) - { - $key = $this->db->_protect_identifiers($key); - } - else - { - $key = array($this->db->_protect_identifiers($key)); - } - - $sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")"; - } - } - - $sql .= "\n)"; - - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * Unsupported feature in SQLite - * - * @access private - * @return bool - */ - function _drop_table($table) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return array(); - } - - // -------------------------------------------------------------------- - - /** - * Alter table query - * - * Generates a platform-specific query so that a table can be altered - * Called by add_column(), drop_column(), and column_alter(), - * - * @access private - * @param string the ALTER type (ADD, DROP, CHANGE) - * @param string the column name - * @param string the table name - * @param string the column definition - * @param string the default value - * @param boolean should 'NOT NULL' be added - * @param string the field after which we should add the new field - * @return object - */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); - - // DROP has everything it needs now. - if ($alter_type == 'DROP') - { - // SQLite does not support dropping columns - // http://www.sqlite.org/omitted.html - // http://www.sqlite.org/faq.html#q11 - return FALSE; - } - - $sql .= " $column_definition"; - - if ($default_value != '') - { - $sql .= " DEFAULT \"$default_value\""; - } - - if ($null === NULL) - { - $sql .= ' NULL'; - } - else - { - $sql .= ' NOT NULL'; - } - - if ($after_field != '') - { - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); - } - - return $sql; - - } - - // -------------------------------------------------------------------- - - /** - * Rename a table - * - * Generates a platform-specific query so that a table can be renamed - * - * @access private - * @param string the old table name - * @param string the new table name - * @return string - */ - function _rename_table($table_name, $new_table_name) - { - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; - } -} - -/* End of file sqlite_forge.php */ +db->database) OR ! @unlink($this->db->database)) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unable_to_drop'); + } + return FALSE; + } + return TRUE; + } + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param array the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + // IF NOT EXISTS added to SQLite in 3.3.0 + if ($if_not_exists === TRUE && version_compare($this->_version(), '3.3.0', '>=') === TRUE) + { + $sql .= 'IF NOT EXISTS '; + } + + $sql .= $this->db->_escape_identifiers($table)."("; + $current_field_count = 0; + + foreach ($fields as $field=>$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + $sql .= ' UNSIGNED'; + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + if (count($primary_keys) > 0) + { + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key = $this->db->_protect_identifiers($key); + } + else + { + $key = array($this->db->_protect_identifiers($key)); + } + + $sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n)"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * Unsupported feature in SQLite + * + * @access private + * @return bool + */ + function _drop_table($table) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unsuported_feature'); + } + return array(); + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param string the table name + * @param string the column definition + * @param string the default value + * @param boolean should 'NOT NULL' be added + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type ".$this->db->_protect_identifiers($column_name); + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + // SQLite does not support dropping columns + // http://www.sqlite.org/omitted.html + // http://www.sqlite.org/faq.html#q11 + return FALSE; + } + + $sql .= " $column_definition"; + + if ($default_value != '') + { + $sql .= " DEFAULT \"$default_value\""; + } + + if ($null === NULL) + { + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; + } + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } +} + +/* End of file sqlite_forge.php */ /* Location: ./system/database/drivers/sqlite/sqlite_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 735a0736..bed16982 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -1,179 +1,179 @@ -result_id); - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - return @sqlite_num_fields($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Fetch Field Names - * - * Generates an array of column names - * - * @access public - * @return array - */ - function list_fields() - { - $field_names = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $field_names[] = sqlite_field_name($this->result_id, $i); - } - - return $field_names; - } - - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - for ($i = 0; $i < $this->num_fields(); $i++) - { - $F = new stdClass(); - $F->name = sqlite_field_name($this->result_id, $i); - $F->type = 'varchar'; - $F->max_length = 0; - $F->primary_key = 0; - $F->default = ''; - - $retval[] = $F; - } - - return $retval; - } - - // -------------------------------------------------------------------- - - /** - * Free the result - * - * @return null - */ - function free_result() - { - // Not implemented in SQLite - } - - // -------------------------------------------------------------------- - - /** - * Data Seek - * - * Moves the internal pointer to the desired offset. We call - * this internally before fetching results to make sure the - * result set starts at zero - * - * @access private - * @return array - */ - function _data_seek($n = 0) - { - return sqlite_seek($this->result_id, $n); - } - - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc() - { - return sqlite_fetch_array($this->result_id); - } - - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - if (function_exists('sqlite_fetch_object')) - { - return sqlite_fetch_object($this->result_id); - } - else - { - $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC); - if (is_array($arr)) - { - $obj = (object) $arr; - return $obj; - } else { - return NULL; - } - } - } - -} - - -/* End of file sqlite_result.php */ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @sqlite_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + $field_names = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $field_names[] = sqlite_field_name($this->result_id, $i); + } + + return $field_names; + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + for ($i = 0; $i < $this->num_fields(); $i++) + { + $F = new stdClass(); + $F->name = sqlite_field_name($this->result_id, $i); + $F->type = 'varchar'; + $F->max_length = 0; + $F->primary_key = 0; + $F->default = ''; + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + // Not implemented in SQLite + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return sqlite_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return sqlite_fetch_array($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + if (function_exists('sqlite_fetch_object')) + { + return sqlite_fetch_object($this->result_id); + } + else + { + $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC); + if (is_array($arr)) + { + $obj = (object) $arr; + return $obj; + } else { + return NULL; + } + } + } + +} + + +/* End of file sqlite_result.php */ /* Location: ./system/database/drivers/sqlite/sqlite_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 3527b5b1..c067403f 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -1,141 +1,141 @@ -db_debug) - { - return $this->display_error('db_unsuported_feature'); - } - return array(); - } - - // -------------------------------------------------------------------- - - /** - * Optimize table query - * - * Is optimization even supported in SQLite? - * - * @access private - * @param string the table name - * @return object - */ - function _optimize_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Repair table query - * - * Are table repairs even supported in SQLite? - * - * @access private - * @param string the table name - * @return object - */ - function _repair_table($table) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * SQLite Export - * - * @access private - * @param array Preferences - * @return mixed - */ - function _backup($params = array()) - { - // Currently unsupported - return $this->db->display_error('db_unsuported_feature'); - } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function _create_database() - { - // In SQLite, a database is created when you connect to the database. - // We'll return TRUE so that an error isn't generated - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unable_to_drop'); - } - return FALSE; - } - return TRUE; - } - -} - -/* End of file sqlite_utility.php */ +db_debug) + { + return $this->display_error('db_unsuported_feature'); + } + return array(); + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Is optimization even supported in SQLite? + * + * @access private + * @param string the table name + * @return object + */ + function _optimize_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Are table repairs even supported in SQLite? + * + * @access private + * @param string the table name + * @return object + */ + function _repair_table($table) + { + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * SQLite Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // Currently unsupported + return $this->db->display_error('db_unsuported_feature'); + } + + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access public + * @param string the database name + * @return bool + */ + function _create_database() + { + // In SQLite, a database is created when you connect to the database. + // We'll return TRUE so that an error isn't generated + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) + { + if ($this->db->db_debug) + { + return $this->db->display_error('db_unable_to_drop'); + } + return FALSE; + } + return TRUE; + } + +} + +/* End of file sqlite_utility.php */ /* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ \ No newline at end of file diff --git a/system/database/index.html b/system/database/index.html index 065d2da5..c942a79c 100644 --- a/system/database/index.html +++ b/system/database/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/fonts/index.html b/system/fonts/index.html index 065d2da5..c942a79c 100644 --- a/system/fonts/index.html +++ b/system/fonts/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 4c8323b3..411d3097 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -1,78 +1,78 @@ - 0) // 8 = FILE_APPEND flag - { - $mode = FOPEN_WRITE_CREATE; - } - else - { - $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE; - } - - // Check if we're using the include path - if (($flags & 1) > 0) // 1 = FILE_USE_INCLUDE_PATH flag - { - $use_include_path = TRUE; - } - else - { - $use_include_path = FALSE; - } - - $fp = @fopen($filename, $mode, $use_include_path); - - if ($fp === FALSE) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') failed to open stream', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - if (($flags & LOCK_EX) > 0) - { - if ( ! flock($fp, LOCK_EX)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') unable to acquire an exclusive lock on file', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - } - - // write it - if (($written = @fwrite($fp, $data)) === FALSE) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') failed to write to '.htmlentities($filename), $backtrace[0]['file'], $backtrace[0]['line']); - } - - // Close the handle - @fclose($fp); - - // Return length - return $written; - } -} - -// ------------------------------------------------------------------------ - -/** - * fputcsv() - * - * Format line as CSV and write to file pointer - * http://us.php.net/manual/en/function.fputcsv.php - * - * @access public - * @param resource file pointer - * @param array data to be written - * @param string delimiter - * @param string enclosure - * @return int length of written string - */ -if ( ! function_exists('fputcsv')) -{ - function fputcsv($handle, $fields, $delimiter = ',', $enclosure = '"') - { - // Checking for a handle resource - if ( ! is_resource($handle)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 1 to be stream resource, '.gettype($handle).' given', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - // OK, it is a resource, but is it a stream? - if (get_resource_type($handle) !== 'stream') - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 1 to be stream resource, '.get_resource_type($handle).' given', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - // Checking for an array of fields - if ( ! is_array($fields)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 2 to be array, '.gettype($fields).' given', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - // validate delimiter - if (strlen($delimiter) > 1) - { - $delimiter = substr($delimiter, 0, 1); - $backtrace = debug_backtrace(); - _exception_handler(E_NOTICE, 'fputcsv() delimiter must be one character long, "'.htmlentities($delimiter).'" used', $backtrace[0]['file'], $backtrace[0]['line']); - } - - // validate enclosure - if (strlen($enclosure) > 1) - { - $enclosure = substr($enclosure, 0, 1); - $backtrace = debug_backtrace(); - _exception_handler(E_NOTICE, 'fputcsv() enclosure must be one character long, "'.htmlentities($enclosure).'" used', $backtrace[0]['file'], $backtrace[0]['line']); - - } - - $out = ''; - - foreach ($fields as $cell) - { - $cell = str_replace($enclosure, $enclosure.$enclosure, $cell); - - if (strpos($cell, $delimiter) !== FALSE OR strpos($cell, $enclosure) !== FALSE OR strpos($cell, "\n") !== FALSE) - { - $out .= $enclosure.$cell.$enclosure.$delimiter; - } - else - { - $out .= $cell.$delimiter; - } - } - - $length = @fwrite($handle, substr($out, 0, -1)."\n"); - - return $length; - } -} - -// ------------------------------------------------------------------------ - -/** - * stripos() - * - * Find position of first occurrence of a case-insensitive string - * http://us.php.net/manual/en/function.stripos.php - * - * @access public - * @param string haystack - * @param string needle - * @param int offset - * @return int numeric position of the first occurrence of needle in the haystack - */ -if ( ! function_exists('stripos')) -{ - function stripos($haystack, $needle, $offset = NULL) - { - // Cast non string scalar values - if (is_scalar($haystack)) - { - settype($haystack, 'STRING'); - } - - if ( ! is_string($haystack)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'stripos() expects parameter 1 to be string, '.gettype($haystack).' given', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - if ( ! is_scalar($needle)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'stripos() needle is not a string or an integer in '.$backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - if (is_float($offset)) - { - $offset = (int)$offset; - } - - if ( ! is_int($offset) && ! is_bool($offset) && ! is_null($offset)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'stripos() expects parameter 3 to be long, '.gettype($offset).' given', $backtrace[0]['file'], $backtrace[0]['line']); - return NULL; - } - - return strpos(strtolower($haystack), strtolower($needle), $offset); - } -} - -// ------------------------------------------------------------------------ - -/** - * str_ireplace() - * - * Find position of first occurrence of a case-insensitive string - * http://us.php.net/manual/en/function.str-ireplace.php - * (parameter 4, $count, is not supported as to do so in PHP 4 would make - * it a required parameter) - * - * @access public - * @param mixed search - * @param mixed replace - * @param mixed subject - * @return int numeric position of the first occurrence of needle in the haystack - */ -if ( ! function_exists('str_ireplace')) -{ - function str_ireplace($search, $replace, $subject) - { - // Nothing to do here - if ($search === NULL OR $subject === NULL) - { - return $subject; - } - - // Crazy arguments - if (is_scalar($search) && is_array($replace)) - { - $backtrace = debug_backtrace(); - - if (is_object($replace)) - { - show_error('Object of class '.get_class($replace).' could not be converted to string in '.$backtrace[0]['file'].' on line '.$backtrace[0]['line']); - } - else - { - _exception_handler(E_USER_NOTICE, 'Array to string conversion in '.$backtrace[0]['file'], $backtrace[0]['line']); - } - } - - // Searching for an array - if (is_array($search)) - { - // Replacing with an array - if (is_array($replace)) - { - $search = array_values($search); - $replace = array_values($replace); - - if (count($search) >= count($replace)) - { - $replace = array_pad($replace, count($search), ''); - } - else - { - $replace = array_slice($replace, 0, count($search)); - } - } - else - { - // Replacing with a string all positions - $replace = array_fill(0, count($search), $replace); - } - } - else - { - //Searching for a string and replacing with a string. - $search = array((string)$search); - $replace = array((string)$replace); - } - - // Prepare the search array - foreach ($search as $search_key => $search_value) - { - $search[$search_key] = '/'.preg_quote($search_value, '/').'/i'; - } - - // Prepare the replace array (escape backreferences) - foreach ($replace as $k => $v) - { - $replace[$k] = str_replace(array(chr(92), '$'), array(chr(92).chr(92), '\$'), $v); - } - - // do the replacement - $result = preg_replace($search, $replace, (array)$subject); - - // Check if subject was initially a string and return it as a string - if ( ! is_array($subject)) - { - return current($result); - } - - // Otherwise, just return the array - return $result; - } -} - -// ------------------------------------------------------------------------ - -/** - * http_build_query() - * - * Generate URL-encoded query string - * http://us.php.net/manual/en/function.http-build-query.php - * - * @access public - * @param array form data - * @param string numeric prefix - * @param string argument separator - * @return string URL-encoded string - */ -if ( ! function_exists('http_build_query')) -{ - function http_build_query($formdata, $numeric_prefix = NULL, $separator = NULL) - { - // Check the data - if ( ! is_array($formdata) && ! is_object($formdata)) - { - $backtrace = debug_backtrace(); - _exception_handler(E_USER_WARNING, 'http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given', $backtrace[0]['file'], $backtrace[0]['line']); - return FALSE; - } - - // Cast it as array - if (is_object($formdata)) - { - $formdata = get_object_vars($formdata); - } - - // If the array is empty, return NULL - if (empty($formdata)) - { - return NULL; - } - - // Argument separator - if ($separator === NULL) - { - $separator = ini_get('arg_separator.output'); - - if (strlen($separator) == 0) - { - $separator = '&'; - } - } - - // Start building the query - $tmp = array(); - - foreach ($formdata as $key => $val) - { - if ($val === NULL) - { - continue; - } - - if (is_integer($key) && $numeric_prefix != NULL) - { - $key = $numeric_prefix.$key; - } - - if (is_resource($val)) - { - return NULL; - } - - // hand it off to a recursive parser - $tmp[] = _http_build_query_helper($key, $val, $separator); - } - - return implode($separator, $tmp); - } - - - // Helper helper. Remind anyone of college? - // Required to handle recursion in nested arrays. - // - // You could shave fractions of fractions of a second by moving where - // the urlencoding takes place, but it's much less intuitive, and if - // your application has 10,000 form fields, well, you have other problems ;) - function _http_build_query_helper($key, $val, $separator = '&') - { - if (is_scalar($val)) - { - return urlencode($key).'='.urlencode($val); - } - else - { - // arrays please - if (is_object($val)) - { - $val = get_object_vars($val); - } - - foreach ($val as $k => $v) - { - $tmp[] = _http_build_query_helper($key.'['.$k.']', $v, $separator); - } - } - - return implode($separator, $tmp); - } -} - - -/* End of file compatibility_helper.php */ + 0) // 8 = FILE_APPEND flag + { + $mode = FOPEN_WRITE_CREATE; + } + else + { + $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE; + } + + // Check if we're using the include path + if (($flags & 1) > 0) // 1 = FILE_USE_INCLUDE_PATH flag + { + $use_include_path = TRUE; + } + else + { + $use_include_path = FALSE; + } + + $fp = @fopen($filename, $mode, $use_include_path); + + if ($fp === FALSE) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') failed to open stream', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + if (($flags & LOCK_EX) > 0) + { + if ( ! flock($fp, LOCK_EX)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') unable to acquire an exclusive lock on file', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + } + + // write it + if (($written = @fwrite($fp, $data)) === FALSE) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'file_put_contents('.htmlentities($filename).') failed to write to '.htmlentities($filename), $backtrace[0]['file'], $backtrace[0]['line']); + } + + // Close the handle + @fclose($fp); + + // Return length + return $written; + } +} + +// ------------------------------------------------------------------------ + +/** + * fputcsv() + * + * Format line as CSV and write to file pointer + * http://us.php.net/manual/en/function.fputcsv.php + * + * @access public + * @param resource file pointer + * @param array data to be written + * @param string delimiter + * @param string enclosure + * @return int length of written string + */ +if ( ! function_exists('fputcsv')) +{ + function fputcsv($handle, $fields, $delimiter = ',', $enclosure = '"') + { + // Checking for a handle resource + if ( ! is_resource($handle)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 1 to be stream resource, '.gettype($handle).' given', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + // OK, it is a resource, but is it a stream? + if (get_resource_type($handle) !== 'stream') + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 1 to be stream resource, '.get_resource_type($handle).' given', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + // Checking for an array of fields + if ( ! is_array($fields)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'fputcsv() expects parameter 2 to be array, '.gettype($fields).' given', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + // validate delimiter + if (strlen($delimiter) > 1) + { + $delimiter = substr($delimiter, 0, 1); + $backtrace = debug_backtrace(); + _exception_handler(E_NOTICE, 'fputcsv() delimiter must be one character long, "'.htmlentities($delimiter).'" used', $backtrace[0]['file'], $backtrace[0]['line']); + } + + // validate enclosure + if (strlen($enclosure) > 1) + { + $enclosure = substr($enclosure, 0, 1); + $backtrace = debug_backtrace(); + _exception_handler(E_NOTICE, 'fputcsv() enclosure must be one character long, "'.htmlentities($enclosure).'" used', $backtrace[0]['file'], $backtrace[0]['line']); + + } + + $out = ''; + + foreach ($fields as $cell) + { + $cell = str_replace($enclosure, $enclosure.$enclosure, $cell); + + if (strpos($cell, $delimiter) !== FALSE OR strpos($cell, $enclosure) !== FALSE OR strpos($cell, "\n") !== FALSE) + { + $out .= $enclosure.$cell.$enclosure.$delimiter; + } + else + { + $out .= $cell.$delimiter; + } + } + + $length = @fwrite($handle, substr($out, 0, -1)."\n"); + + return $length; + } +} + +// ------------------------------------------------------------------------ + +/** + * stripos() + * + * Find position of first occurrence of a case-insensitive string + * http://us.php.net/manual/en/function.stripos.php + * + * @access public + * @param string haystack + * @param string needle + * @param int offset + * @return int numeric position of the first occurrence of needle in the haystack + */ +if ( ! function_exists('stripos')) +{ + function stripos($haystack, $needle, $offset = NULL) + { + // Cast non string scalar values + if (is_scalar($haystack)) + { + settype($haystack, 'STRING'); + } + + if ( ! is_string($haystack)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'stripos() expects parameter 1 to be string, '.gettype($haystack).' given', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + if ( ! is_scalar($needle)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'stripos() needle is not a string or an integer in '.$backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + if (is_float($offset)) + { + $offset = (int)$offset; + } + + if ( ! is_int($offset) && ! is_bool($offset) && ! is_null($offset)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'stripos() expects parameter 3 to be long, '.gettype($offset).' given', $backtrace[0]['file'], $backtrace[0]['line']); + return NULL; + } + + return strpos(strtolower($haystack), strtolower($needle), $offset); + } +} + +// ------------------------------------------------------------------------ + +/** + * str_ireplace() + * + * Find position of first occurrence of a case-insensitive string + * http://us.php.net/manual/en/function.str-ireplace.php + * (parameter 4, $count, is not supported as to do so in PHP 4 would make + * it a required parameter) + * + * @access public + * @param mixed search + * @param mixed replace + * @param mixed subject + * @return int numeric position of the first occurrence of needle in the haystack + */ +if ( ! function_exists('str_ireplace')) +{ + function str_ireplace($search, $replace, $subject) + { + // Nothing to do here + if ($search === NULL OR $subject === NULL) + { + return $subject; + } + + // Crazy arguments + if (is_scalar($search) && is_array($replace)) + { + $backtrace = debug_backtrace(); + + if (is_object($replace)) + { + show_error('Object of class '.get_class($replace).' could not be converted to string in '.$backtrace[0]['file'].' on line '.$backtrace[0]['line']); + } + else + { + _exception_handler(E_USER_NOTICE, 'Array to string conversion in '.$backtrace[0]['file'], $backtrace[0]['line']); + } + } + + // Searching for an array + if (is_array($search)) + { + // Replacing with an array + if (is_array($replace)) + { + $search = array_values($search); + $replace = array_values($replace); + + if (count($search) >= count($replace)) + { + $replace = array_pad($replace, count($search), ''); + } + else + { + $replace = array_slice($replace, 0, count($search)); + } + } + else + { + // Replacing with a string all positions + $replace = array_fill(0, count($search), $replace); + } + } + else + { + //Searching for a string and replacing with a string. + $search = array((string)$search); + $replace = array((string)$replace); + } + + // Prepare the search array + foreach ($search as $search_key => $search_value) + { + $search[$search_key] = '/'.preg_quote($search_value, '/').'/i'; + } + + // Prepare the replace array (escape backreferences) + foreach ($replace as $k => $v) + { + $replace[$k] = str_replace(array(chr(92), '$'), array(chr(92).chr(92), '\$'), $v); + } + + // do the replacement + $result = preg_replace($search, $replace, (array)$subject); + + // Check if subject was initially a string and return it as a string + if ( ! is_array($subject)) + { + return current($result); + } + + // Otherwise, just return the array + return $result; + } +} + +// ------------------------------------------------------------------------ + +/** + * http_build_query() + * + * Generate URL-encoded query string + * http://us.php.net/manual/en/function.http-build-query.php + * + * @access public + * @param array form data + * @param string numeric prefix + * @param string argument separator + * @return string URL-encoded string + */ +if ( ! function_exists('http_build_query')) +{ + function http_build_query($formdata, $numeric_prefix = NULL, $separator = NULL) + { + // Check the data + if ( ! is_array($formdata) && ! is_object($formdata)) + { + $backtrace = debug_backtrace(); + _exception_handler(E_USER_WARNING, 'http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given', $backtrace[0]['file'], $backtrace[0]['line']); + return FALSE; + } + + // Cast it as array + if (is_object($formdata)) + { + $formdata = get_object_vars($formdata); + } + + // If the array is empty, return NULL + if (empty($formdata)) + { + return NULL; + } + + // Argument separator + if ($separator === NULL) + { + $separator = ini_get('arg_separator.output'); + + if (strlen($separator) == 0) + { + $separator = '&'; + } + } + + // Start building the query + $tmp = array(); + + foreach ($formdata as $key => $val) + { + if ($val === NULL) + { + continue; + } + + if (is_integer($key) && $numeric_prefix != NULL) + { + $key = $numeric_prefix.$key; + } + + if (is_resource($val)) + { + return NULL; + } + + // hand it off to a recursive parser + $tmp[] = _http_build_query_helper($key, $val, $separator); + } + + return implode($separator, $tmp); + } + + + // Helper helper. Remind anyone of college? + // Required to handle recursion in nested arrays. + // + // You could shave fractions of fractions of a second by moving where + // the urlencoding takes place, but it's much less intuitive, and if + // your application has 10,000 form fields, well, you have other problems ;) + function _http_build_query_helper($key, $val, $separator = '&') + { + if (is_scalar($val)) + { + return urlencode($key).'='.urlencode($val); + } + else + { + // arrays please + if (is_object($val)) + { + $val = get_object_vars($val); + } + + foreach ($val as $k => $v) + { + $tmp[] = _http_build_query_helper($key.'['.$k.']', $v, $separator); + } + } + + return implode($separator, $tmp); + } +} + + +/* End of file compatibility_helper.php */ /* Location: ./system/helpers/compatibility_helper.php */ \ No newline at end of file diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 61561b71..d906882a 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -1,136 +1,136 @@ -config->item('cookie_prefix') != '') - { - $prefix = $CI->config->item('cookie_prefix'); - } - if ($domain == '' AND $CI->config->item('cookie_domain') != '') - { - $domain = $CI->config->item('cookie_domain'); - } - if ($path == '/' AND $CI->config->item('cookie_path') != '/') - { - $path = $CI->config->item('cookie_path'); - } - - if ( ! is_numeric($expire)) - { - $expire = time() - 86500; - } - else - { - if ($expire > 0) - { - $expire = time() + $expire; - } - else - { - $expire = 0; - } - } - - setcookie($prefix.$name, $value, $expire, $path, $domain, 0); - } -} - -// -------------------------------------------------------------------- - -/** - * Fetch an item from the COOKIE array - * - * @access public - * @param string - * @param bool - * @return mixed - */ -if ( ! function_exists('get_cookie')) -{ - function get_cookie($index = '', $xss_clean = FALSE) - { - $CI =& get_instance(); - return $CI->input->cookie($index, $xss_clean); - } -} - -// -------------------------------------------------------------------- - -/** - * Delete a COOKIE - * - * @param mixed - * @param string the cookie domain. Usually: .yourdomain.com - * @param string the cookie path - * @param string the cookie prefix - * @return void - */ -if ( ! function_exists('delete_cookie')) -{ - function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') - { - set_cookie($name, '', '', $domain, $path, $prefix); - } -} - - -/* End of file cookie_helper.php */ +config->item('cookie_prefix') != '') + { + $prefix = $CI->config->item('cookie_prefix'); + } + if ($domain == '' AND $CI->config->item('cookie_domain') != '') + { + $domain = $CI->config->item('cookie_domain'); + } + if ($path == '/' AND $CI->config->item('cookie_path') != '/') + { + $path = $CI->config->item('cookie_path'); + } + + if ( ! is_numeric($expire)) + { + $expire = time() - 86500; + } + else + { + if ($expire > 0) + { + $expire = time() + $expire; + } + else + { + $expire = 0; + } + } + + setcookie($prefix.$name, $value, $expire, $path, $domain, 0); + } +} + +// -------------------------------------------------------------------- + +/** + * Fetch an item from the COOKIE array + * + * @access public + * @param string + * @param bool + * @return mixed + */ +if ( ! function_exists('get_cookie')) +{ + function get_cookie($index = '', $xss_clean = FALSE) + { + $CI =& get_instance(); + return $CI->input->cookie($index, $xss_clean); + } +} + +// -------------------------------------------------------------------- + +/** + * Delete a COOKIE + * + * @param mixed + * @param string the cookie domain. Usually: .yourdomain.com + * @param string the cookie path + * @param string the cookie prefix + * @return void + */ +if ( ! function_exists('delete_cookie')) +{ + function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') + { + set_cookie($name, '', '', $domain, $path, $prefix); + } +} + + +/* End of file cookie_helper.php */ /* Location: ./system/helpers/cookie_helper.php */ \ No newline at end of file diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index c9c89688..dbd7e0ec 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -1,611 +1,611 @@ -config->item('time_reference')) == 'gmt') - { - $now = time(); - $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); - - if (strlen($system_time) < 10) - { - $system_time = time(); - log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); - } - - return $system_time; - } - else - { - return time(); - } - } -} - -// ------------------------------------------------------------------------ - -/** - * Convert MySQL Style Datecodes - * - * This function is identical to PHPs date() function, - * except that it allows date codes to be formatted using - * the MySQL style, where each code letter is preceded - * with a percent sign: %Y %m %d etc... - * - * The benefit of doing dates this way is that you don't - * have to worry about escaping your text letters that - * match the date codes. - * - * @access public - * @param string - * @param integer - * @return integer - */ -if ( ! function_exists('mdate')) -{ - function mdate($datestr = '', $time = '') - { - if ($datestr == '') - return ''; - - if ($time == '') - $time = now(); - - $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); - return date($datestr, $time); - } -} - -// ------------------------------------------------------------------------ - -/** - * Standard Date - * - * Returns a date formatted according to the submitted standard. - * - * @access public - * @param string the chosen format - * @param integer Unix timestamp - * @return string - */ -if ( ! function_exists('standard_date')) -{ - function standard_date($fmt = 'DATE_RFC822', $time = '') - { - $formats = array( - 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%Q', - 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', - 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%O', - 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', - 'DATE_RFC850' => '%l, %d-%M-%y %H:%m:%i 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', - 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%Q' - ); - - if ( ! isset($formats[$fmt])) - { - return FALSE; - } - - return mdate($formats[$fmt], $time); - } -} - -// ------------------------------------------------------------------------ - -/** - * Timespan - * - * Returns a span of seconds in this format: - * 10 days 14 hours 36 minutes 47 seconds - * - * @access public - * @param integer a number of seconds - * @param integer Unix timestamp - * @return integer - */ -if ( ! function_exists('timespan')) -{ - function timespan($seconds = 1, $time = '') - { - $CI =& get_instance(); - $CI->lang->load('date'); - - if ( ! is_numeric($seconds)) - { - $seconds = 1; - } - - if ( ! is_numeric($time)) - { - $time = time(); - } - - if ($time <= $seconds) - { - $seconds = 1; - } - else - { - $seconds = $time - $seconds; - } - - $str = ''; - $years = floor($seconds / 31536000); - - if ($years > 0) - { - $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; - } - - $seconds -= $years * 31536000; - $months = floor($seconds / 2628000); - - if ($years > 0 OR $months > 0) - { - if ($months > 0) - { - $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; - } - - $seconds -= $months * 2628000; - } - - $weeks = floor($seconds / 604800); - - if ($years > 0 OR $months > 0 OR $weeks > 0) - { - if ($weeks > 0) - { - $str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; - } - - $seconds -= $weeks * 604800; - } - - $days = floor($seconds / 86400); - - if ($months > 0 OR $weeks > 0 OR $days > 0) - { - if ($days > 0) - { - $str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; - } - - $seconds -= $days * 86400; - } - - $hours = floor($seconds / 3600); - - if ($days > 0 OR $hours > 0) - { - if ($hours > 0) - { - $str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; - } - - $seconds -= $hours * 3600; - } - - $minutes = floor($seconds / 60); - - if ($days > 0 OR $hours > 0 OR $minutes > 0) - { - if ($minutes > 0) - { - $str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; - } - - $seconds -= $minutes * 60; - } - - if ($str == '') - { - $str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; - } - - return substr(trim($str), 0, -1); - } -} - -// ------------------------------------------------------------------------ - -/** - * Number of days in a month - * - * Takes a month/year as input and returns the number of days - * for the given month/year. Takes leap years into consideration. - * - * @access public - * @param integer a numeric month - * @param integer a numeric year - * @return integer - */ -if ( ! function_exists('days_in_month')) -{ - function days_in_month($month = 0, $year = '') - { - if ($month < 1 OR $month > 12) - { - return 0; - } - - if ( ! is_numeric($year) OR strlen($year) != 4) - { - $year = date('Y'); - } - - if ($month == 2) - { - if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) - { - return 29; - } - } - - $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); - return $days_in_month[$month - 1]; - } -} - -// ------------------------------------------------------------------------ - -/** - * Converts a local Unix timestamp to GMT - * - * @access public - * @param integer Unix timestamp - * @return integer - */ -if ( ! function_exists('local_to_gmt')) -{ - function local_to_gmt($time = '') - { - if ($time == '') - $time = time(); - - return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); - } -} - -// ------------------------------------------------------------------------ - -/** - * Converts GMT time to a localized value - * - * Takes a Unix timestamp (in GMT) as input, and returns - * at the local value based on the timezone and DST setting - * submitted - * - * @access public - * @param integer Unix timestamp - * @param string timezone - * @param bool whether DST is active - * @return integer - */ -if ( ! function_exists('gmt_to_local')) -{ - function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) - { - if ($time == '') - { - return now(); - } - - $time += timezones($timezone) * 3600; - - if ($dst == TRUE) - { - $time += 3600; - } - - return $time; - } -} - -// ------------------------------------------------------------------------ - -/** - * Converts a MySQL Timestamp to Unix - * - * @access public - * @param integer Unix timestamp - * @return integer - */ -if ( ! function_exists('mysql_to_unix')) -{ - function mysql_to_unix($time = '') - { - // We'll remove certain characters for backward compatibility - // since the formatting changed with MySQL 4.1 - // YYYY-MM-DD HH:MM:SS - - $time = str_replace('-', '', $time); - $time = str_replace(':', '', $time); - $time = str_replace(' ', '', $time); - - // YYYYMMDDHHMMSS - return mktime( - substr($time, 8, 2), - substr($time, 10, 2), - substr($time, 12, 2), - substr($time, 4, 2), - substr($time, 6, 2), - substr($time, 0, 4) - ); - } -} - -// ------------------------------------------------------------------------ - -/** - * Unix to "Human" - * - * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM - * - * @access public - * @param integer Unix timestamp - * @param bool whether to show seconds - * @param string format: us or euro - * @return string - */ -if ( ! function_exists('unix_to_human')) -{ - function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') - { - $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; - - if ($fmt == 'us') - { - $r .= date('h', $time).':'.date('i', $time); - } - else - { - $r .= date('H', $time).':'.date('i', $time); - } - - if ($seconds) - { - $r .= ':'.date('s', $time); - } - - if ($fmt == 'us') - { - $r .= ' '.date('A', $time); - } - - return $r; - } -} - -// ------------------------------------------------------------------------ - -/** - * Convert "human" date to GMT - * - * Reverses the above process - * - * @access public - * @param string format: us or euro - * @return integer - */ -if ( ! function_exists('human_to_unix')) -{ - function human_to_unix($datestr = '') - { - if ($datestr == '') - { - return FALSE; - } - - $datestr = trim($datestr); - $datestr = preg_replace("/\040+/", "\040", $datestr); - - if ( ! preg_match('/^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s[0-9]{1,2}:[0-9]{1,2}(?::[0-9]{1,2})?(?:\s[AP]M)?$/i', $datestr)) - { - return FALSE; - } - - $split = preg_split("/\040/", $datestr); - - $ex = explode("-", $split['0']); - - $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; - $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; - - $ex = explode(":", $split['1']); - - $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; - $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - - if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) - { - $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; - } - else - { - // Unless specified, seconds get set to zero. - $sec = '00'; - } - - if (isset($split['2'])) - { - $ampm = strtolower($split['2']); - - if (substr($ampm, 0, 1) == 'p' AND $hour < 12) - $hour = $hour + 12; - - if (substr($ampm, 0, 1) == 'a' AND $hour == 12) - $hour = '00'; - - if (strlen($hour) == 1) - $hour = '0'.$hour; - } - - return mktime($hour, $min, $sec, $month, $day, $year); - } -} - -// ------------------------------------------------------------------------ - -/** - * Timezone Menu - * - * Generates a drop-down menu of timezones. - * - * @access public - * @param string timezone - * @param string classname - * @param string menu name - * @return string - */ -if ( ! function_exists('timezone_menu')) -{ - function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') - { - $CI =& get_instance(); - $CI->lang->load('date'); - - if ($default == 'GMT') - $default = 'UTC'; - - $menu = '"; - - return $menu; - } -} - -// ------------------------------------------------------------------------ - -/** - * Timezones - * - * Returns an array of timezones. This is a helper function - * for various other ones in this library - * - * @access public - * @param string timezone - * @return string - */ -if ( ! function_exists('timezones')) -{ - function timezones($tz = '') - { - // Note: Don't change the order of these even though - // some items appear to be in the wrong order - - $zones = array( - 'UM12' => -12, - 'UM11' => -11, - 'UM10' => -10, - 'UM95' => -9.5, - 'UM9' => -9, - 'UM8' => -8, - 'UM7' => -7, - 'UM6' => -6, - 'UM5' => -5, - 'UM45' => -4.5, - 'UM4' => -4, - 'UM35' => -3.5, - 'UM3' => -3, - 'UM2' => -2, - 'UM1' => -1, - 'UTC' => 0, - 'UP1' => +1, - 'UP2' => +2, - 'UP3' => +3, - 'UP35' => +3.5, - 'UP4' => +4, - 'UP45' => +4.5, - 'UP5' => +5, - 'UP55' => +5.5, - 'UP575' => +5.75, - 'UP6' => +6, - 'UP65' => +6.5, - 'UP7' => +7, - 'UP8' => +8, - 'UP875' => +8.75, - 'UP9' => +9, - 'UP95' => +9.5, - 'UP10' => +10, - 'UP105' => +10.5, - 'UP11' => +11, - 'UP115' => +11.5, - 'UP12' => +12, - 'UP1275' => +12.75, - 'UP13' => +13, - 'UP14' => +14 - ); - - if ($tz == '') - { - return $zones; - } - - if ($tz == 'GMT') - $tz = 'UTC'; - - return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; - } -} - - -/* End of file date_helper.php */ +config->item('time_reference')) == 'gmt') + { + $now = time(); + $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); + + if (strlen($system_time) < 10) + { + $system_time = time(); + log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); + } + + return $system_time; + } + else + { + return time(); + } + } +} + +// ------------------------------------------------------------------------ + +/** + * Convert MySQL Style Datecodes + * + * This function is identical to PHPs date() function, + * except that it allows date codes to be formatted using + * the MySQL style, where each code letter is preceded + * with a percent sign: %Y %m %d etc... + * + * The benefit of doing dates this way is that you don't + * have to worry about escaping your text letters that + * match the date codes. + * + * @access public + * @param string + * @param integer + * @return integer + */ +if ( ! function_exists('mdate')) +{ + function mdate($datestr = '', $time = '') + { + if ($datestr == '') + return ''; + + if ($time == '') + $time = now(); + + $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); + return date($datestr, $time); + } +} + +// ------------------------------------------------------------------------ + +/** + * Standard Date + * + * Returns a date formatted according to the submitted standard. + * + * @access public + * @param string the chosen format + * @param integer Unix timestamp + * @return string + */ +if ( ! function_exists('standard_date')) +{ + function standard_date($fmt = 'DATE_RFC822', $time = '') + { + $formats = array( + 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%Q', + 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', + 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%O', + 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', + 'DATE_RFC850' => '%l, %d-%M-%y %H:%m:%i 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', + 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%Q' + ); + + if ( ! isset($formats[$fmt])) + { + return FALSE; + } + + return mdate($formats[$fmt], $time); + } +} + +// ------------------------------------------------------------------------ + +/** + * Timespan + * + * Returns a span of seconds in this format: + * 10 days 14 hours 36 minutes 47 seconds + * + * @access public + * @param integer a number of seconds + * @param integer Unix timestamp + * @return integer + */ +if ( ! function_exists('timespan')) +{ + function timespan($seconds = 1, $time = '') + { + $CI =& get_instance(); + $CI->lang->load('date'); + + if ( ! is_numeric($seconds)) + { + $seconds = 1; + } + + if ( ! is_numeric($time)) + { + $time = time(); + } + + if ($time <= $seconds) + { + $seconds = 1; + } + else + { + $seconds = $time - $seconds; + } + + $str = ''; + $years = floor($seconds / 31536000); + + if ($years > 0) + { + $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; + } + + $seconds -= $years * 31536000; + $months = floor($seconds / 2628000); + + if ($years > 0 OR $months > 0) + { + if ($months > 0) + { + $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; + } + + $seconds -= $months * 2628000; + } + + $weeks = floor($seconds / 604800); + + if ($years > 0 OR $months > 0 OR $weeks > 0) + { + if ($weeks > 0) + { + $str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; + } + + $seconds -= $weeks * 604800; + } + + $days = floor($seconds / 86400); + + if ($months > 0 OR $weeks > 0 OR $days > 0) + { + if ($days > 0) + { + $str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; + } + + $seconds -= $days * 86400; + } + + $hours = floor($seconds / 3600); + + if ($days > 0 OR $hours > 0) + { + if ($hours > 0) + { + $str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; + } + + $seconds -= $hours * 3600; + } + + $minutes = floor($seconds / 60); + + if ($days > 0 OR $hours > 0 OR $minutes > 0) + { + if ($minutes > 0) + { + $str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; + } + + $seconds -= $minutes * 60; + } + + if ($str == '') + { + $str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; + } + + return substr(trim($str), 0, -1); + } +} + +// ------------------------------------------------------------------------ + +/** + * Number of days in a month + * + * Takes a month/year as input and returns the number of days + * for the given month/year. Takes leap years into consideration. + * + * @access public + * @param integer a numeric month + * @param integer a numeric year + * @return integer + */ +if ( ! function_exists('days_in_month')) +{ + function days_in_month($month = 0, $year = '') + { + if ($month < 1 OR $month > 12) + { + return 0; + } + + if ( ! is_numeric($year) OR strlen($year) != 4) + { + $year = date('Y'); + } + + if ($month == 2) + { + if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) + { + return 29; + } + } + + $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + return $days_in_month[$month - 1]; + } +} + +// ------------------------------------------------------------------------ + +/** + * Converts a local Unix timestamp to GMT + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +if ( ! function_exists('local_to_gmt')) +{ + function local_to_gmt($time = '') + { + if ($time == '') + $time = time(); + + return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); + } +} + +// ------------------------------------------------------------------------ + +/** + * Converts GMT time to a localized value + * + * Takes a Unix timestamp (in GMT) as input, and returns + * at the local value based on the timezone and DST setting + * submitted + * + * @access public + * @param integer Unix timestamp + * @param string timezone + * @param bool whether DST is active + * @return integer + */ +if ( ! function_exists('gmt_to_local')) +{ + function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) + { + if ($time == '') + { + return now(); + } + + $time += timezones($timezone) * 3600; + + if ($dst == TRUE) + { + $time += 3600; + } + + return $time; + } +} + +// ------------------------------------------------------------------------ + +/** + * Converts a MySQL Timestamp to Unix + * + * @access public + * @param integer Unix timestamp + * @return integer + */ +if ( ! function_exists('mysql_to_unix')) +{ + function mysql_to_unix($time = '') + { + // We'll remove certain characters for backward compatibility + // since the formatting changed with MySQL 4.1 + // YYYY-MM-DD HH:MM:SS + + $time = str_replace('-', '', $time); + $time = str_replace(':', '', $time); + $time = str_replace(' ', '', $time); + + // YYYYMMDDHHMMSS + return mktime( + substr($time, 8, 2), + substr($time, 10, 2), + substr($time, 12, 2), + substr($time, 4, 2), + substr($time, 6, 2), + substr($time, 0, 4) + ); + } +} + +// ------------------------------------------------------------------------ + +/** + * Unix to "Human" + * + * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM + * + * @access public + * @param integer Unix timestamp + * @param bool whether to show seconds + * @param string format: us or euro + * @return string + */ +if ( ! function_exists('unix_to_human')) +{ + function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') + { + $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; + + if ($fmt == 'us') + { + $r .= date('h', $time).':'.date('i', $time); + } + else + { + $r .= date('H', $time).':'.date('i', $time); + } + + if ($seconds) + { + $r .= ':'.date('s', $time); + } + + if ($fmt == 'us') + { + $r .= ' '.date('A', $time); + } + + return $r; + } +} + +// ------------------------------------------------------------------------ + +/** + * Convert "human" date to GMT + * + * Reverses the above process + * + * @access public + * @param string format: us or euro + * @return integer + */ +if ( ! function_exists('human_to_unix')) +{ + function human_to_unix($datestr = '') + { + if ($datestr == '') + { + return FALSE; + } + + $datestr = trim($datestr); + $datestr = preg_replace("/\040+/", "\040", $datestr); + + if ( ! preg_match('/^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s[0-9]{1,2}:[0-9]{1,2}(?::[0-9]{1,2})?(?:\s[AP]M)?$/i', $datestr)) + { + return FALSE; + } + + $split = preg_split("/\040/", $datestr); + + $ex = explode("-", $split['0']); + + $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; + $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + + $ex = explode(":", $split['1']); + + $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; + $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; + + if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) + { + $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; + } + else + { + // Unless specified, seconds get set to zero. + $sec = '00'; + } + + if (isset($split['2'])) + { + $ampm = strtolower($split['2']); + + if (substr($ampm, 0, 1) == 'p' AND $hour < 12) + $hour = $hour + 12; + + if (substr($ampm, 0, 1) == 'a' AND $hour == 12) + $hour = '00'; + + if (strlen($hour) == 1) + $hour = '0'.$hour; + } + + return mktime($hour, $min, $sec, $month, $day, $year); + } +} + +// ------------------------------------------------------------------------ + +/** + * Timezone Menu + * + * Generates a drop-down menu of timezones. + * + * @access public + * @param string timezone + * @param string classname + * @param string menu name + * @return string + */ +if ( ! function_exists('timezone_menu')) +{ + function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') + { + $CI =& get_instance(); + $CI->lang->load('date'); + + if ($default == 'GMT') + $default = 'UTC'; + + $menu = '"; + + return $menu; + } +} + +// ------------------------------------------------------------------------ + +/** + * Timezones + * + * Returns an array of timezones. This is a helper function + * for various other ones in this library + * + * @access public + * @param string timezone + * @return string + */ +if ( ! function_exists('timezones')) +{ + function timezones($tz = '') + { + // Note: Don't change the order of these even though + // some items appear to be in the wrong order + + $zones = array( + 'UM12' => -12, + 'UM11' => -11, + 'UM10' => -10, + 'UM95' => -9.5, + 'UM9' => -9, + 'UM8' => -8, + 'UM7' => -7, + 'UM6' => -6, + 'UM5' => -5, + 'UM45' => -4.5, + 'UM4' => -4, + 'UM35' => -3.5, + 'UM3' => -3, + 'UM2' => -2, + 'UM1' => -1, + 'UTC' => 0, + 'UP1' => +1, + 'UP2' => +2, + 'UP3' => +3, + 'UP35' => +3.5, + 'UP4' => +4, + 'UP45' => +4.5, + 'UP5' => +5, + 'UP55' => +5.5, + 'UP575' => +5.75, + 'UP6' => +6, + 'UP65' => +6.5, + 'UP7' => +7, + 'UP8' => +8, + 'UP875' => +8.75, + 'UP9' => +9, + 'UP95' => +9.5, + 'UP10' => +10, + 'UP105' => +10.5, + 'UP11' => +11, + 'UP115' => +11.5, + 'UP12' => +12, + 'UP1275' => +12.75, + 'UP13' => +13, + 'UP14' => +14 + ); + + if ($tz == '') + { + return $zones; + } + + if ($tz == 'GMT') + $tz = 'UTC'; + + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; + } +} + + +/* End of file date_helper.php */ /* Location: ./system/helpers/date_helper.php */ \ No newline at end of file diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 8a1b999c..be365909 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -1,80 +1,80 @@ - 0) - { - $data =& fread($fp, filesize($file)); - } - - flock($fp, LOCK_UN); - fclose($fp); - - return $data; - } -} - -// ------------------------------------------------------------------------ - -/** - * Write File - * - * Writes data to the file specified in the path. - * Creates a new file if non-existent. - * - * @access public - * @param string path to file - * @param string file data - * @return bool - */ -if ( ! function_exists('write_file')) -{ - function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE) - { - if ( ! $fp = @fopen($path, $mode)) - { - return FALSE; - } - - flock($fp, LOCK_EX); - fwrite($fp, $data); - flock($fp, LOCK_UN); - fclose($fp); - - return TRUE; - } -} - -// ------------------------------------------------------------------------ - -/** - * Delete Files - * - * Deletes all files contained in the supplied directory path. - * Files must be writable or owned by the system in order to be deleted. - * If the second parameter is set to TRUE, any directories contained - * within the supplied base directory will be nuked as well. - * - * @access public - * @param string path to file - * @param bool whether to delete any directories found in the path - * @return bool - */ -if ( ! function_exists('delete_files')) -{ - function delete_files($path, $del_dir = FALSE, $level = 0) - { - // Trim the trailing slash - $path = preg_replace("|^(.+?)/*$|", "\\1", $path); - - if ( ! $current_dir = @opendir($path)) - return; - - while(FALSE !== ($filename = @readdir($current_dir))) - { - if ($filename != "." and $filename != "..") - { - if (is_dir($path.'/'.$filename)) - { - // Ignore empty folders - if (substr($filename, 0, 1) != '.') - { - delete_files($path.'/'.$filename, $del_dir, $level + 1); - } - } - else - { - unlink($path.'/'.$filename); - } - } - } - @closedir($current_dir); - - if ($del_dir == TRUE AND $level > 0) - { - @rmdir($path); - } - } -} - -// ------------------------------------------------------------------------ - -/** - * Get Filenames - * - * Reads the specified directory and builds an array containing the filenames. - * Any sub-folders contained within the specified path are read as well. - * - * @access public - * @param string path to source - * @param bool whether to include the path as part of the filename - * @param bool internal variable to determine recursion status - do not use in calls - * @return array - */ -if ( ! function_exists('get_filenames')) -{ - function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE) - { - static $_filedata = array(); - - if ($fp = @opendir($source_dir)) - { - // reset the array and make sure $source_dir has a trailing slash on the initial call - if ($_recursion === FALSE) - { - $_filedata = array(); - $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; - } - - while (FALSE !== ($file = readdir($fp))) - { - if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0) - { - get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); - } - elseif (strncmp($file, '.', 1) !== 0) - { - - $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file; - } - } - return $_filedata; - } - else - { - return FALSE; - } - } -} - -// -------------------------------------------------------------------- - -/** - * Get Directory File Information - * - * Reads the specified directory and builds an array containing the filenames, - * filesize, dates, and permissions - * - * Any sub-folders contained within the specified path are read as well. - * - * @access public - * @param string path to source - * @param bool whether to include the path as part of the filename - * @param bool internal variable to determine recursion status - do not use in calls - * @return array - */ -if ( ! function_exists('get_dir_file_info')) -{ - function get_dir_file_info($source_dir, $include_path = FALSE, $_recursion = FALSE) - { - $_filedata = array(); - $relative_path = $source_dir; - - if ($fp = @opendir($source_dir)) - { - // reset the array and make sure $source_dir has a trailing slash on the initial call - if ($_recursion === FALSE) - { - $_filedata = array(); - $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; - } - - while (FALSE !== ($file = readdir($fp))) - { - if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0) - { - get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); - } - elseif (strncmp($file, '.', 1) !== 0) - { - $_filedata[$file] = get_file_info($source_dir.$file); - $_filedata[$file]['relative_path'] = $relative_path; - } - } - return $_filedata; - } - else - { - return FALSE; - } - } -} - -// -------------------------------------------------------------------- - -/** -* Get File Info -* -* Given a file and path, returns the name, path, size, date modified -* Second parameter allows you to explicitly declare what information you want returned -* Options are: name, server_path, size, date, readable, writable, executable, fileperms -* Returns FALSE if the file cannot be found. -* -* @access public -* @param string path to file -* @param mixed array or comma separated string of information returned -* @return array -*/ -if ( ! function_exists('get_file_info')) -{ - function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) - { - - if ( ! file_exists($file)) - { - return FALSE; - } - - if (is_string($returned_values)) - { - $returned_values = explode(',', $returned_values); - } - - foreach ($returned_values as $key) - { - switch ($key) - { - case 'name': - $fileinfo['name'] = substr(strrchr($file, '/'), 1); - break; - case 'server_path': - $fileinfo['server_path'] = $file; - break; - case 'size': - $fileinfo['size'] = filesize($file); - break; - case 'date': - $fileinfo['date'] = filectime($file); - break; - case 'readable': - $fileinfo['readable'] = is_readable($file); - break; - case 'writable': - // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms() - $fileinfo['writable'] = is_writable($file); - break; - case 'executable': - $fileinfo['executable'] = is_executable($file); - break; - case 'fileperms': - $fileinfo['fileperms'] = fileperms($file); - break; - } - } - - return $fileinfo; - } -} - -// -------------------------------------------------------------------- - -/** - * Get Mime by Extension - * - * Translates a file extension into a mime type based on config/mimes.php. - * Returns FALSE if it can't determine the type, or open the mime config file - * - * Note: this is NOT an accurate way of determining file mime types, and is here strictly as a convenience - * It should NOT be trusted, and should certainly NOT be used for security - * - * @access public - * @param string path to file - * @return mixed - */ -if ( ! function_exists('get_mime_by_extension')) -{ - function get_mime_by_extension($file) - { - $extension = substr(strrchr($file, '.'), 1); - - global $mimes; - - if ( ! is_array($mimes)) - { - if ( ! require_once(APPPATH.'config/mimes.php')) - { - return FALSE; - } - } - - if (array_key_exists($extension, $mimes)) - { - if (is_array($mimes[$extension])) - { - // Multiple mime types, just give the first one - return current($mimes[$extension]); - } - else - { - return $mimes[$extension]; - } - } - else - { - return FALSE; - } - } -} - -// -------------------------------------------------------------------- - -/** - * Symbolic Permissions - * - * Takes a numeric value representing a file's permissions and returns - * standard symbolic notation representing that value - * - * @access public - * @param int - * @return string - */ -if ( ! function_exists('symbolic_permissions')) -{ - function symbolic_permissions($perms) - { - if (($perms & 0xC000) == 0xC000) - { - $symbolic = 's'; // Socket - } - elseif (($perms & 0xA000) == 0xA000) - { - $symbolic = 'l'; // Symbolic Link - } - elseif (($perms & 0x8000) == 0x8000) - { - $symbolic = '-'; // Regular - } - elseif (($perms & 0x6000) == 0x6000) - { - $symbolic = 'b'; // Block special - } - elseif (($perms & 0x4000) == 0x4000) - { - $symbolic = 'd'; // Directory - } - elseif (($perms & 0x2000) == 0x2000) - { - $symbolic = 'c'; // Character special - } - elseif (($perms & 0x1000) == 0x1000) - { - $symbolic = 'p'; // FIFO pipe - } - else - { - $symbolic = 'u'; // Unknown - } - - // Owner - $symbolic .= (($perms & 0x0100) ? 'r' : '-'); - $symbolic .= (($perms & 0x0080) ? 'w' : '-'); - $symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); - - // Group - $symbolic .= (($perms & 0x0020) ? 'r' : '-'); - $symbolic .= (($perms & 0x0010) ? 'w' : '-'); - $symbolic .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); - - // World - $symbolic .= (($perms & 0x0004) ? 'r' : '-'); - $symbolic .= (($perms & 0x0002) ? 'w' : '-'); - $symbolic .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); - - return $symbolic; - } -} - -// -------------------------------------------------------------------- - -/** - * Octal Permissions - * - * Takes a numeric value representing a file's permissions and returns - * a three character string representing the file's octal permissions - * - * @access public - * @param int - * @return string - */ -if ( ! function_exists('octal_permissions')) -{ - function octal_permissions($perms) - { - return substr(sprintf('%o', $perms), -3); - } -} - - -/* End of file file_helper.php */ + 0) + { + $data =& fread($fp, filesize($file)); + } + + flock($fp, LOCK_UN); + fclose($fp); + + return $data; + } +} + +// ------------------------------------------------------------------------ + +/** + * Write File + * + * Writes data to the file specified in the path. + * Creates a new file if non-existent. + * + * @access public + * @param string path to file + * @param string file data + * @return bool + */ +if ( ! function_exists('write_file')) +{ + function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE) + { + if ( ! $fp = @fopen($path, $mode)) + { + return FALSE; + } + + flock($fp, LOCK_EX); + fwrite($fp, $data); + flock($fp, LOCK_UN); + fclose($fp); + + return TRUE; + } +} + +// ------------------------------------------------------------------------ + +/** + * Delete Files + * + * Deletes all files contained in the supplied directory path. + * Files must be writable or owned by the system in order to be deleted. + * If the second parameter is set to TRUE, any directories contained + * within the supplied base directory will be nuked as well. + * + * @access public + * @param string path to file + * @param bool whether to delete any directories found in the path + * @return bool + */ +if ( ! function_exists('delete_files')) +{ + function delete_files($path, $del_dir = FALSE, $level = 0) + { + // Trim the trailing slash + $path = preg_replace("|^(.+?)/*$|", "\\1", $path); + + if ( ! $current_dir = @opendir($path)) + return; + + while(FALSE !== ($filename = @readdir($current_dir))) + { + if ($filename != "." and $filename != "..") + { + if (is_dir($path.'/'.$filename)) + { + // Ignore empty folders + if (substr($filename, 0, 1) != '.') + { + delete_files($path.'/'.$filename, $del_dir, $level + 1); + } + } + else + { + unlink($path.'/'.$filename); + } + } + } + @closedir($current_dir); + + if ($del_dir == TRUE AND $level > 0) + { + @rmdir($path); + } + } +} + +// ------------------------------------------------------------------------ + +/** + * Get Filenames + * + * Reads the specified directory and builds an array containing the filenames. + * Any sub-folders contained within the specified path are read as well. + * + * @access public + * @param string path to source + * @param bool whether to include the path as part of the filename + * @param bool internal variable to determine recursion status - do not use in calls + * @return array + */ +if ( ! function_exists('get_filenames')) +{ + function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE) + { + static $_filedata = array(); + + if ($fp = @opendir($source_dir)) + { + // reset the array and make sure $source_dir has a trailing slash on the initial call + if ($_recursion === FALSE) + { + $_filedata = array(); + $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; + } + + while (FALSE !== ($file = readdir($fp))) + { + if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0) + { + get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); + } + elseif (strncmp($file, '.', 1) !== 0) + { + + $_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file; + } + } + return $_filedata; + } + else + { + return FALSE; + } + } +} + +// -------------------------------------------------------------------- + +/** + * Get Directory File Information + * + * Reads the specified directory and builds an array containing the filenames, + * filesize, dates, and permissions + * + * Any sub-folders contained within the specified path are read as well. + * + * @access public + * @param string path to source + * @param bool whether to include the path as part of the filename + * @param bool internal variable to determine recursion status - do not use in calls + * @return array + */ +if ( ! function_exists('get_dir_file_info')) +{ + function get_dir_file_info($source_dir, $include_path = FALSE, $_recursion = FALSE) + { + $_filedata = array(); + $relative_path = $source_dir; + + if ($fp = @opendir($source_dir)) + { + // reset the array and make sure $source_dir has a trailing slash on the initial call + if ($_recursion === FALSE) + { + $_filedata = array(); + $source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; + } + + while (FALSE !== ($file = readdir($fp))) + { + if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0) + { + get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); + } + elseif (strncmp($file, '.', 1) !== 0) + { + $_filedata[$file] = get_file_info($source_dir.$file); + $_filedata[$file]['relative_path'] = $relative_path; + } + } + return $_filedata; + } + else + { + return FALSE; + } + } +} + +// -------------------------------------------------------------------- + +/** +* Get File Info +* +* Given a file and path, returns the name, path, size, date modified +* Second parameter allows you to explicitly declare what information you want returned +* Options are: name, server_path, size, date, readable, writable, executable, fileperms +* Returns FALSE if the file cannot be found. +* +* @access public +* @param string path to file +* @param mixed array or comma separated string of information returned +* @return array +*/ +if ( ! function_exists('get_file_info')) +{ + function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) + { + + if ( ! file_exists($file)) + { + return FALSE; + } + + if (is_string($returned_values)) + { + $returned_values = explode(',', $returned_values); + } + + foreach ($returned_values as $key) + { + switch ($key) + { + case 'name': + $fileinfo['name'] = substr(strrchr($file, '/'), 1); + break; + case 'server_path': + $fileinfo['server_path'] = $file; + break; + case 'size': + $fileinfo['size'] = filesize($file); + break; + case 'date': + $fileinfo['date'] = filectime($file); + break; + case 'readable': + $fileinfo['readable'] = is_readable($file); + break; + case 'writable': + // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms() + $fileinfo['writable'] = is_writable($file); + break; + case 'executable': + $fileinfo['executable'] = is_executable($file); + break; + case 'fileperms': + $fileinfo['fileperms'] = fileperms($file); + break; + } + } + + return $fileinfo; + } +} + +// -------------------------------------------------------------------- + +/** + * Get Mime by Extension + * + * Translates a file extension into a mime type based on config/mimes.php. + * Returns FALSE if it can't determine the type, or open the mime config file + * + * Note: this is NOT an accurate way of determining file mime types, and is here strictly as a convenience + * It should NOT be trusted, and should certainly NOT be used for security + * + * @access public + * @param string path to file + * @return mixed + */ +if ( ! function_exists('get_mime_by_extension')) +{ + function get_mime_by_extension($file) + { + $extension = substr(strrchr($file, '.'), 1); + + global $mimes; + + if ( ! is_array($mimes)) + { + if ( ! require_once(APPPATH.'config/mimes.php')) + { + return FALSE; + } + } + + if (array_key_exists($extension, $mimes)) + { + if (is_array($mimes[$extension])) + { + // Multiple mime types, just give the first one + return current($mimes[$extension]); + } + else + { + return $mimes[$extension]; + } + } + else + { + return FALSE; + } + } +} + +// -------------------------------------------------------------------- + +/** + * Symbolic Permissions + * + * Takes a numeric value representing a file's permissions and returns + * standard symbolic notation representing that value + * + * @access public + * @param int + * @return string + */ +if ( ! function_exists('symbolic_permissions')) +{ + function symbolic_permissions($perms) + { + if (($perms & 0xC000) == 0xC000) + { + $symbolic = 's'; // Socket + } + elseif (($perms & 0xA000) == 0xA000) + { + $symbolic = 'l'; // Symbolic Link + } + elseif (($perms & 0x8000) == 0x8000) + { + $symbolic = '-'; // Regular + } + elseif (($perms & 0x6000) == 0x6000) + { + $symbolic = 'b'; // Block special + } + elseif (($perms & 0x4000) == 0x4000) + { + $symbolic = 'd'; // Directory + } + elseif (($perms & 0x2000) == 0x2000) + { + $symbolic = 'c'; // Character special + } + elseif (($perms & 0x1000) == 0x1000) + { + $symbolic = 'p'; // FIFO pipe + } + else + { + $symbolic = 'u'; // Unknown + } + + // Owner + $symbolic .= (($perms & 0x0100) ? 'r' : '-'); + $symbolic .= (($perms & 0x0080) ? 'w' : '-'); + $symbolic .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); + + // Group + $symbolic .= (($perms & 0x0020) ? 'r' : '-'); + $symbolic .= (($perms & 0x0010) ? 'w' : '-'); + $symbolic .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); + + // World + $symbolic .= (($perms & 0x0004) ? 'r' : '-'); + $symbolic .= (($perms & 0x0002) ? 'w' : '-'); + $symbolic .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); + + return $symbolic; + } +} + +// -------------------------------------------------------------------- + +/** + * Octal Permissions + * + * Takes a numeric value representing a file's permissions and returns + * a three character string representing the file's octal permissions + * + * @access public + * @param int + * @return string + */ +if ( ! function_exists('octal_permissions')) +{ + function octal_permissions($perms) + { + return substr(sprintf('%o', $perms), -3); + } +} + + +/* End of file file_helper.php */ /* Location: ./system/helpers/file_helper.php */ \ No newline at end of file diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 109d8c17..c002c6fc 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1,963 +1,963 @@ -config->site_url($action) : $action; - - $form = '
    0) - { - $form .= form_hidden($hidden); - } - - return $form; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Declaration - Multipart type - * - * Creates the opening portion of the form, but with "multipart/form-data". - * - * @access public - * @param string the URI segments of the form destination - * @param array a key/value pair of attributes - * @param array a key/value pair hidden data - * @return string - */ -if ( ! function_exists('form_open_multipart')) -{ - function form_open_multipart($action, $attributes = array(), $hidden = array()) - { - $attributes['enctype'] = 'multipart/form-data'; - return form_open($action, $attributes, $hidden); - } -} - -// ------------------------------------------------------------------------ - -/** - * Hidden Input Field - * - * Generates hidden fields. You can pass a simple key/value string or an associative - * array with multiple values. - * - * @access public - * @param mixed - * @param string - * @return string - */ -if ( ! function_exists('form_hidden')) -{ - function form_hidden($name, $value = '') - { - if ( ! is_array($name)) - { - return ''; - } - - $form = ''; - - foreach ($name as $name => $value) - { - $form .= "\n"; - $form .= ''; - } - - return $form; - } -} - -// ------------------------------------------------------------------------ - -/** - * Text Input Field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_input')) -{ - function form_input($data = '', $value = '', $extra = '') - { - $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Password Field - * - * Identical to the input function but adds the "password" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_password')) -{ - function form_password($data = '', $value = '', $extra = '') - { - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'password'; - return form_input($data, $value, $extra); - } -} - -// ------------------------------------------------------------------------ - -/** - * Upload Field - * - * Identical to the input function but adds the "file" type - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_upload')) -{ - function form_upload($data = '', $value = '', $extra = '') - { - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'file'; - return form_input($data, $value, $extra); - } -} - -// ------------------------------------------------------------------------ - -/** - * Textarea field - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_textarea')) -{ - function form_textarea($data = '', $value = '', $extra = '') - { - $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); - - if ( ! is_array($data) OR ! isset($data['value'])) - { - $val = $value; - } - else - { - $val = $data['value']; - unset($data['value']); // textareas don't use the value attribute - } - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Drop-down Menu - * - * @access public - * @param string - * @param array - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_dropdown')) -{ - function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') - { - if ( ! is_array($selected)) - { - $selected = array($selected); - } - - // If no selected state was submitted we will attempt to set it automatically - if (count($selected) === 0) - { - // If the form name appears in the $_POST array we have a winner! - if (isset($_POST[$name])) - { - $selected = array($_POST[$name]); - } - } - - if ($extra != '') $extra = ' '.$extra; - - $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; - - $form = ''; - - return $form; - } -} - -// ------------------------------------------------------------------------ - -/** - * Checkbox Field - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -if ( ! function_exists('form_checkbox')) -{ - function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') - { - $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - if (is_array($data) AND array_key_exists('checked', $data)) - { - $checked = $data['checked']; - - if ($checked == FALSE) - { - unset($data['checked']); - } - else - { - $data['checked'] = 'checked'; - } - } - - if ($checked == TRUE) - { - $defaults['checked'] = 'checked'; - } - else - { - unset($defaults['checked']); - } - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Radio Button - * - * @access public - * @param mixed - * @param string - * @param bool - * @param string - * @return string - */ -if ( ! function_exists('form_radio')) -{ - function form_radio($data = '', $value = '', $checked = FALSE, $extra = '') - { - if ( ! is_array($data)) - { - $data = array('name' => $data); - } - - $data['type'] = 'radio'; - return form_checkbox($data, $value, $checked, $extra); - } -} - -// ------------------------------------------------------------------------ - -/** - * Submit Button - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_submit')) -{ - function form_submit($data = '', $value = '', $extra = '') - { - $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Reset Button - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_reset')) -{ - function form_reset($data = '', $value = '', $extra = '') - { - $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Button - * - * @access public - * @param mixed - * @param string - * @param string - * @return string - */ -if ( ! function_exists('form_button')) -{ - function form_button($data = '', $content = '', $extra = '') - { - $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit'); - - if ( is_array($data) AND isset($data['content'])) - { - $content = $data['content']; - unset($data['content']); // content is not an attribute - } - - return ""; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Label Tag - * - * @access public - * @param string The text to appear onscreen - * @param string The id the label applies to - * @param string Additional attributes - * @return string - */ -if ( ! function_exists('form_label')) -{ - function form_label($label_text = '', $id = '', $attributes = array()) - { - - $label = ' 0) - { - foreach ($attributes as $key => $val) - { - $label .= ' '.$key.'="'.$val.'"'; - } - } - - $label .= ">$label_text"; - - return $label; - } -} - -// ------------------------------------------------------------------------ -/** - * Fieldset Tag - * - * Used to produce
    text. To close fieldset - * use form_fieldset_close() - * - * @access public - * @param string The legend text - * @param string Additional attributes - * @return string - */ -if ( ! function_exists('form_fieldset')) -{ - function form_fieldset($legend_text = '', $attributes = array()) - { - $fieldset = "".$extra; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Close Tag - * - * @access public - * @param string - * @return string - */ -if ( ! function_exists('form_close')) -{ - function form_close($extra = '') - { - return "".$extra; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Prep - * - * Formats text so that it can be safely placed in a form field in the event it has HTML tags. - * - * @access public - * @param string - * @return string - */ -if ( ! function_exists('form_prep')) -{ - function form_prep($str = '') - { - // if the field name is an array we do this recursively - if (is_array($str)) - { - foreach ($str as $key => $val) - { - $str[$key] = form_prep($val); - } - - return $str; - } - - if ($str === '') - { - return ''; - } - - $temp = '__TEMP_AMPERSANDS__'; - - // Replace entities to temporary markers so that - // htmlspecialchars won't mess them up - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - - $str = htmlspecialchars($str); - - // In case htmlspecialchars misses these. - $str = str_replace(array("'", '"'), array("'", """), $str); - - // Decode the temp markers back to entities - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;",$str); - - return $str; - } -} - -// ------------------------------------------------------------------------ - -/** - * Form Value - * - * Grabs a value from the POST array for the specified field so you can - * re-populate an input field or textarea. If Form Validation - * is active it retrieves the info from the validation class - * - * @access public - * @param string - * @return mixed - */ -if ( ! function_exists('set_value')) -{ - function set_value($field = '', $default = '') - { - if (FALSE === ($OBJ =& _get_validation_object())) - { - if ( ! isset($_POST[$field])) - { - return $default; - } - - return form_prep($_POST[$field]); - } - - return form_prep($OBJ->set_value($field, $default)); - } -} - -// ------------------------------------------------------------------------ - -/** - * Set Select - * - * Let's you set the selected value of a '; + } + + $form = ''; + + foreach ($name as $name => $value) + { + $form .= "\n"; + $form .= ''; + } + + return $form; + } +} + +// ------------------------------------------------------------------------ + +/** + * Text Input Field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_input')) +{ + function form_input($data = '', $value = '', $extra = '') + { + $defaults = array('type' => 'text', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Password Field + * + * Identical to the input function but adds the "password" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_password')) +{ + function form_password($data = '', $value = '', $extra = '') + { + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'password'; + return form_input($data, $value, $extra); + } +} + +// ------------------------------------------------------------------------ + +/** + * Upload Field + * + * Identical to the input function but adds the "file" type + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_upload')) +{ + function form_upload($data = '', $value = '', $extra = '') + { + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'file'; + return form_input($data, $value, $extra); + } +} + +// ------------------------------------------------------------------------ + +/** + * Textarea field + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_textarea')) +{ + function form_textarea($data = '', $value = '', $extra = '') + { + $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12'); + + if ( ! is_array($data) OR ! isset($data['value'])) + { + $val = $value; + } + else + { + $val = $data['value']; + unset($data['value']); // textareas don't use the value attribute + } + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Drop-down Menu + * + * @access public + * @param string + * @param array + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_dropdown')) +{ + function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '') + { + if ( ! is_array($selected)) + { + $selected = array($selected); + } + + // If no selected state was submitted we will attempt to set it automatically + if (count($selected) === 0) + { + // If the form name appears in the $_POST array we have a winner! + if (isset($_POST[$name])) + { + $selected = array($_POST[$name]); + } + } + + if ($extra != '') $extra = ' '.$extra; + + $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; + + $form = ''; + + return $form; + } +} + +// ------------------------------------------------------------------------ + +/** + * Checkbox Field + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +if ( ! function_exists('form_checkbox')) +{ + function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') + { + $defaults = array('type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + if (is_array($data) AND array_key_exists('checked', $data)) + { + $checked = $data['checked']; + + if ($checked == FALSE) + { + unset($data['checked']); + } + else + { + $data['checked'] = 'checked'; + } + } + + if ($checked == TRUE) + { + $defaults['checked'] = 'checked'; + } + else + { + unset($defaults['checked']); + } + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Radio Button + * + * @access public + * @param mixed + * @param string + * @param bool + * @param string + * @return string + */ +if ( ! function_exists('form_radio')) +{ + function form_radio($data = '', $value = '', $checked = FALSE, $extra = '') + { + if ( ! is_array($data)) + { + $data = array('name' => $data); + } + + $data['type'] = 'radio'; + return form_checkbox($data, $value, $checked, $extra); + } +} + +// ------------------------------------------------------------------------ + +/** + * Submit Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_submit')) +{ + function form_submit($data = '', $value = '', $extra = '') + { + $defaults = array('type' => 'submit', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Reset Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_reset')) +{ + function form_reset($data = '', $value = '', $extra = '') + { + $defaults = array('type' => 'reset', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value); + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Form Button + * + * @access public + * @param mixed + * @param string + * @param string + * @return string + */ +if ( ! function_exists('form_button')) +{ + function form_button($data = '', $content = '', $extra = '') + { + $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit'); + + if ( is_array($data) AND isset($data['content'])) + { + $content = $data['content']; + unset($data['content']); // content is not an attribute + } + + return ""; + } +} + +// ------------------------------------------------------------------------ + +/** + * Form Label Tag + * + * @access public + * @param string The text to appear onscreen + * @param string The id the label applies to + * @param string Additional attributes + * @return string + */ +if ( ! function_exists('form_label')) +{ + function form_label($label_text = '', $id = '', $attributes = array()) + { + + $label = ' 0) + { + foreach ($attributes as $key => $val) + { + $label .= ' '.$key.'="'.$val.'"'; + } + } + + $label .= ">$label_text"; + + return $label; + } +} + +// ------------------------------------------------------------------------ +/** + * Fieldset Tag + * + * Used to produce
    text. To close fieldset + * use form_fieldset_close() + * + * @access public + * @param string The legend text + * @param string Additional attributes + * @return string + */ +if ( ! function_exists('form_fieldset')) +{ + function form_fieldset($legend_text = '', $attributes = array()) + { + $fieldset = "".$extra; + } +} + +// ------------------------------------------------------------------------ + +/** + * Form Close Tag + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('form_close')) +{ + function form_close($extra = '') + { + return "".$extra; + } +} + +// ------------------------------------------------------------------------ + +/** + * Form Prep + * + * Formats text so that it can be safely placed in a form field in the event it has HTML tags. + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('form_prep')) +{ + function form_prep($str = '') + { + // if the field name is an array we do this recursively + if (is_array($str)) + { + foreach ($str as $key => $val) + { + $str[$key] = form_prep($val); + } + + return $str; + } + + if ($str === '') + { + return ''; + } + + $temp = '__TEMP_AMPERSANDS__'; + + // Replace entities to temporary markers so that + // htmlspecialchars won't mess them up + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + $str = htmlspecialchars($str); + + // In case htmlspecialchars misses these. + $str = str_replace(array("'", '"'), array("'", """), $str); + + // Decode the temp markers back to entities + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); + $str = preg_replace("/$temp(\w+);/","&\\1;",$str); + + return $str; + } +} + +// ------------------------------------------------------------------------ + +/** + * Form Value + * + * Grabs a value from the POST array for the specified field so you can + * re-populate an input field or textarea. If Form Validation + * is active it retrieves the info from the validation class + * + * @access public + * @param string + * @return mixed + */ +if ( ! function_exists('set_value')) +{ + function set_value($field = '', $default = '') + { + if (FALSE === ($OBJ =& _get_validation_object())) + { + if ( ! isset($_POST[$field])) + { + return $default; + } + + return form_prep($_POST[$field]); + } + + return form_prep($OBJ->set_value($field, $default)); + } +} + +// ------------------------------------------------------------------------ + +/** + * Set Select + * + * Let's you set the selected value of a '; - - -Then, on the page that accepts the submission you'll have something like this: - - // First, delete old captchas - $expiration = time()-7200; // Two hour limit - $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); - - // Then see if a captcha exists: - $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; - $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); - $query = $this->db->query($sql, $binds); - $row = $query->row(); - - if ($row->count == 0) - { - echo "You must submit the word that appears in the image"; - } - -*/ - - - -/** -|========================================================== -| Create Captcha -|========================================================== -| -*/ -function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') -{ - $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); - - foreach ($defaults as $key => $val) - { - if ( ! is_array($data)) - { - if ( ! isset($$key) OR $$key == '') - { - $$key = $val; - } - } - else - { - $$key = ( ! isset($data[$key])) ? $val : $data[$key]; - } - } - - if ($img_path == '' OR $img_url == '') - { - return FALSE; - } - - if ( ! @is_dir($img_path)) - { - return FALSE; - } - - if ( ! is_really_writable($img_path)) - { - return FALSE; - } - - if ( ! extension_loaded('gd')) - { - return FALSE; - } - - // ----------------------------------- - // Remove old images - // ----------------------------------- - - list($usec, $sec) = explode(" ", microtime()); - $now = ((float)$usec + (float)$sec); - - $current_dir = @opendir($img_path); - - while($filename = @readdir($current_dir)) - { - if ($filename != "." and $filename != ".." and $filename != "index.html") - { - $name = str_replace(".jpg", "", $filename); - - if (($name + $expiration) < $now) - { - @unlink($img_path.$filename); - } - } - } - - @closedir($current_dir); - - // ----------------------------------- - // Do we have a "word" yet? - // ----------------------------------- - - if ($word == '') - { - $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $str = ''; - for ($i = 0; $i < 8; $i++) - { - $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); - } - - $word = $str; - } - - // ----------------------------------- - // Determine angle and position - // ----------------------------------- - - $length = strlen($word); - $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; - $x_axis = rand(6, (360/$length)-16); - $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); - - // ----------------------------------- - // Create image - // ----------------------------------- - - // PHP.net recommends imagecreatetruecolor(), but it isn't always available - if (function_exists('imagecreatetruecolor')) - { - $im = imagecreatetruecolor($img_width, $img_height); - } - else - { - $im = imagecreate($img_width, $img_height); - } - - // ----------------------------------- - // Assign colors - // ----------------------------------- - - $bg_color = imagecolorallocate ($im, 255, 255, 255); - $border_color = imagecolorallocate ($im, 153, 102, 102); - $text_color = imagecolorallocate ($im, 204, 153, 153); - $grid_color = imagecolorallocate($im, 255, 182, 182); - $shadow_color = imagecolorallocate($im, 255, 240, 240); - - // ----------------------------------- - // Create the rectangle - // ----------------------------------- - - ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); - - // ----------------------------------- - // Create the spiral pattern - // ----------------------------------- - - $theta = 1; - $thetac = 7; - $radius = 16; - $circles = 20; - $points = 32; - - for ($i = 0; $i < ($circles * $points) - 1; $i++) - { - $theta = $theta + $thetac; - $rad = $radius * ($i / $points ); - $x = ($rad * cos($theta)) + $x_axis; - $y = ($rad * sin($theta)) + $y_axis; - $theta = $theta + $thetac; - $rad1 = $radius * (($i + 1) / $points); - $x1 = ($rad1 * cos($theta)) + $x_axis; - $y1 = ($rad1 * sin($theta )) + $y_axis; - imageline($im, $x, $y, $x1, $y1, $grid_color); - $theta = $theta - $thetac; - } - - // ----------------------------------- - // Write the text - // ----------------------------------- - - $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; - - if ($use_font == FALSE) - { - $font_size = 5; - $x = rand(0, $img_width/($length/3)); - $y = 0; - } - else - { - $font_size = 16; - $x = rand(0, $img_width/($length/1.5)); - $y = $font_size+2; - } - - for ($i = 0; $i < strlen($word); $i++) - { - if ($use_font == FALSE) - { - $y = rand(0 , $img_height/2); - imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); - $x += ($font_size*2); - } - else - { - $y = rand($img_height/2, $img_height-3); - imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); - $x += $font_size; - } - } - - - // ----------------------------------- - // Create the border - // ----------------------------------- - - imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); - - // ----------------------------------- - // Generate the image - // ----------------------------------- - - $img_name = $now.'.jpg'; - - ImageJPEG($im, $img_path.$img_name); - - $img = "\""; - - ImageDestroy($im); - - return array('word' => $word, 'time' => $now, 'image' => $img); -} - - -/* End of file captcha_pi.php */ +load->plugin('captcha'); + +Once loaded you can generate a captcha like this: + + $vals = array( + 'word' => 'Random word', + 'img_path' => './captcha/', + 'img_url' => 'http://example.com/captcha/', + 'font_path' => './system/fonts/texb.ttf', + 'img_width' => '150', + 'img_height' => 30, + 'expiration' => 7200 + ); + + $cap = create_captcha($vals); + echo $cap['image']; + + +NOTES: + + The captcha function requires the GD image library. + + Only the img_path and img_url are required. + + If a "word" is not supplied, the function will generate a random + ASCII string. You might put together your own word library that + you can draw randomly from. + + If you do not specify a path to a TRUE TYPE font, the native ugly GD + font will be used. + + The "captcha" folder must be writable (666, or 777) + + The "expiration" (in seconds) signifies how long an image will + remain in the captcha folder before it will be deleted. The default + is two hours. + +RETURNED DATA + +The create_captcha() function returns an associative array with this data: + + [array] + ( + 'image' => IMAGE TAG + 'time' => TIMESTAMP (in microtime) + 'word' => CAPTCHA WORD + ) + +The "image" is the actual image tag: + + +The "time" is the micro timestamp used as the image name without the file +extension. It will be a number like this: 1139612155.3422 + +The "word" is the word that appears in the captcha image, which if not +supplied to the function, will be a random string. + + +ADDING A DATABASE + +In order for the captcha function to prevent someone from posting, you will need +to add the information returned from create_captcha() function to your database. +Then, when the data from the form is submitted by the user you will need to verify +that the data exists in the database and has not expired. + +Here is a table prototype: + + CREATE TABLE captcha ( + captcha_id bigint(13) unsigned NOT NULL auto_increment, + captcha_time int(10) unsigned NOT NULL, + ip_address varchar(16) default '0' NOT NULL, + word varchar(20) NOT NULL, + PRIMARY KEY `captcha_id` (`captcha_id`), + KEY `word` (`word`) + ) + + +Here is an example of usage with a DB. + +On the page where the captcha will be shown you'll have something like this: + + $this->load->plugin('captcha'); + $vals = array( + 'img_path' => './captcha/', + 'img_url' => 'http://example.com/captcha/' + ); + + $cap = create_captcha($vals); + + $data = array( + 'captcha_id' => '', + 'captcha_time' => $cap['time'], + 'ip_address' => $this->input->ip_address(), + 'word' => $cap['word'] + ); + + $query = $this->db->insert_string('captcha', $data); + $this->db->query($query); + + echo 'Submit the word you see below:'; + echo $cap['image']; + echo ''; + + +Then, on the page that accepts the submission you'll have something like this: + + // First, delete old captchas + $expiration = time()-7200; // Two hour limit + $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); + + // Then see if a captcha exists: + $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; + $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); + $query = $this->db->query($sql, $binds); + $row = $query->row(); + + if ($row->count == 0) + { + echo "You must submit the word that appears in the image"; + } + +*/ + + + +/** +|========================================================== +| Create Captcha +|========================================================== +| +*/ +function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') +{ + $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); + + foreach ($defaults as $key => $val) + { + if ( ! is_array($data)) + { + if ( ! isset($$key) OR $$key == '') + { + $$key = $val; + } + } + else + { + $$key = ( ! isset($data[$key])) ? $val : $data[$key]; + } + } + + if ($img_path == '' OR $img_url == '') + { + return FALSE; + } + + if ( ! @is_dir($img_path)) + { + return FALSE; + } + + if ( ! is_really_writable($img_path)) + { + return FALSE; + } + + if ( ! extension_loaded('gd')) + { + return FALSE; + } + + // ----------------------------------- + // Remove old images + // ----------------------------------- + + list($usec, $sec) = explode(" ", microtime()); + $now = ((float)$usec + (float)$sec); + + $current_dir = @opendir($img_path); + + while($filename = @readdir($current_dir)) + { + if ($filename != "." and $filename != ".." and $filename != "index.html") + { + $name = str_replace(".jpg", "", $filename); + + if (($name + $expiration) < $now) + { + @unlink($img_path.$filename); + } + } + } + + @closedir($current_dir); + + // ----------------------------------- + // Do we have a "word" yet? + // ----------------------------------- + + if ($word == '') + { + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + $str = ''; + for ($i = 0; $i < 8; $i++) + { + $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); + } + + $word = $str; + } + + // ----------------------------------- + // Determine angle and position + // ----------------------------------- + + $length = strlen($word); + $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; + $x_axis = rand(6, (360/$length)-16); + $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); + + // ----------------------------------- + // Create image + // ----------------------------------- + + // PHP.net recommends imagecreatetruecolor(), but it isn't always available + if (function_exists('imagecreatetruecolor')) + { + $im = imagecreatetruecolor($img_width, $img_height); + } + else + { + $im = imagecreate($img_width, $img_height); + } + + // ----------------------------------- + // Assign colors + // ----------------------------------- + + $bg_color = imagecolorallocate ($im, 255, 255, 255); + $border_color = imagecolorallocate ($im, 153, 102, 102); + $text_color = imagecolorallocate ($im, 204, 153, 153); + $grid_color = imagecolorallocate($im, 255, 182, 182); + $shadow_color = imagecolorallocate($im, 255, 240, 240); + + // ----------------------------------- + // Create the rectangle + // ----------------------------------- + + ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); + + // ----------------------------------- + // Create the spiral pattern + // ----------------------------------- + + $theta = 1; + $thetac = 7; + $radius = 16; + $circles = 20; + $points = 32; + + for ($i = 0; $i < ($circles * $points) - 1; $i++) + { + $theta = $theta + $thetac; + $rad = $radius * ($i / $points ); + $x = ($rad * cos($theta)) + $x_axis; + $y = ($rad * sin($theta)) + $y_axis; + $theta = $theta + $thetac; + $rad1 = $radius * (($i + 1) / $points); + $x1 = ($rad1 * cos($theta)) + $x_axis; + $y1 = ($rad1 * sin($theta )) + $y_axis; + imageline($im, $x, $y, $x1, $y1, $grid_color); + $theta = $theta - $thetac; + } + + // ----------------------------------- + // Write the text + // ----------------------------------- + + $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; + + if ($use_font == FALSE) + { + $font_size = 5; + $x = rand(0, $img_width/($length/3)); + $y = 0; + } + else + { + $font_size = 16; + $x = rand(0, $img_width/($length/1.5)); + $y = $font_size+2; + } + + for ($i = 0; $i < strlen($word); $i++) + { + if ($use_font == FALSE) + { + $y = rand(0 , $img_height/2); + imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); + $x += ($font_size*2); + } + else + { + $y = rand($img_height/2, $img_height-3); + imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); + $x += $font_size; + } + } + + + // ----------------------------------- + // Create the border + // ----------------------------------- + + imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); + + // ----------------------------------- + // Generate the image + // ----------------------------------- + + $img_name = $now.'.jpg'; + + ImageJPEG($im, $img_path.$img_name); + + $img = "\""; + + ImageDestroy($im); + + return array('word' => $word, 'time' => $now, 'image' => $img); +} + + +/* End of file captcha_pi.php */ /* Location: ./system/plugins/captcha_pi.php */ \ No newline at end of file diff --git a/system/plugins/index.html b/system/plugins/index.html index 065d2da5..c942a79c 100644 --- a/system/plugins/index.html +++ b/system/plugins/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php index e165c544..6dadd4ad 100644 --- a/system/plugins/js_calendar_pi.php +++ b/system/plugins/js_calendar_pi.php @@ -1,629 +1,629 @@ -load->plugin('js_calendar'); - -Once loaded you'll add the calendar script to the of your page like this: - - - -The above function will be passed the name of your form. - -Then to show the actual calendar you'll do this: - - -
    - -

    Today

    -
    - - -Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, -and the third tells the calendar whether to highlight the current day or not. - -Lastly, you'll need some CSS for your calendar: - -.calendar { - border: 1px #6975A3 solid; - background-color: transparent; -} -.calheading { - background-color: #7C8BC0; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; -} -.calnavleft { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - padding: 4px; - cursor: pointer; -} -.calnavright { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - text-align: right; - padding: 4px; - cursor: pointer; -} -.caldayheading { - background-color: #000; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - text-align: center; - padding: 6px 2px 6px 2px; -} -.caldaycells{ - color: #000; - background-color: #D1D7E6; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #E0E5F1 solid; - cursor: pointer; -} -.caldaycellhover{ - color: #fff; - background-color: #B3BCD4; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #B3BCD4 solid; - cursor: pointer; -} -.caldayselected{ - background-color: #737FAC; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; - border: 1px #566188 solid; - padding: 3px; - cursor: pointer; -} -.calblanktop { - background-color: #fff; - padding: 4px; -} -.calblankbot { - background-color: #fff; - padding: 4px; -} - - -*/ - -function js_calendar_script($form_name = 'entryform') -{ -$CI =& get_instance(); -$CI->load->language('calendar'); -ob_start(); -?> - - - var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); - document.write('.$field_id.'.write()); - '; -} - - -/* End of file js_calendar_pi.php */ +load->plugin('js_calendar'); + +Once loaded you'll add the calendar script to the of your page like this: + + + +The above function will be passed the name of your form. + +Then to show the actual calendar you'll do this: + + +
    + +

    Today

    +
    + + +Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, +and the third tells the calendar whether to highlight the current day or not. + +Lastly, you'll need some CSS for your calendar: + +.calendar { + border: 1px #6975A3 solid; + background-color: transparent; +} +.calheading { + background-color: #7C8BC0; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; +} +.calnavleft { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + padding: 4px; + cursor: pointer; +} +.calnavright { + background-color: #7C8BC0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + font-weight: bold; + color: #fff; + text-align: right; + padding: 4px; + cursor: pointer; +} +.caldayheading { + background-color: #000; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 10px; + text-align: center; + padding: 6px 2px 6px 2px; +} +.caldaycells{ + color: #000; + background-color: #D1D7E6; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #E0E5F1 solid; + cursor: pointer; +} +.caldaycellhover{ + color: #fff; + background-color: #B3BCD4; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + text-align: center; + padding: 4px; + border: 1px #B3BCD4 solid; + cursor: pointer; +} +.caldayselected{ + background-color: #737FAC; + color: #fff; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + font-weight: bold; + text-align: center; + border: 1px #566188 solid; + padding: 3px; + cursor: pointer; +} +.calblanktop { + background-color: #fff; + padding: 4px; +} +.calblankbot { + background-color: #fff; + padding: 4px; +} + + +*/ + +function js_calendar_script($form_name = 'entryform') +{ +$CI =& get_instance(); +$CI->load->language('calendar'); +ob_start(); +?> + + + var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); + document.write('.$field_id.'.write()); + '; +} + + +/* End of file js_calendar_pi.php */ /* Location: ./system/plugins/js_calendar_pi.php */ \ No newline at end of file diff --git a/system/scaffolding/Scaffolding.php b/system/scaffolding/Scaffolding.php index 28172ca1..1d526701 100644 --- a/system/scaffolding/Scaffolding.php +++ b/system/scaffolding/Scaffolding.php @@ -1,291 +1,291 @@ -CI =& get_instance(); - - $this->CI->load->database("", FALSE, TRUE); - $this->CI->load->library('pagination'); - - // Turn off caching - $this->CI->db->cache_off(); - - /** - * Set the current table name - * This is done when initializing scaffolding: - * $this->load->scaffolding('table_name') - * - */ - $this->current_table = $db_table; - - /** - * Set the path to the "view" files - * We'll manually override the "view" path so that - * the load->view function knows where to look. - */ - - $this->CI->load->_ci_view_path = BASEPATH.'scaffolding/views/'; - - // Set the base URL - $this->base_url = $this->CI->config->site_url().'/'.$this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'both'); - $this->base_uri = $this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'leading'); - - // Set a few globals - $data = array( - 'image_url' => $this->CI->config->system_url().'scaffolding/images/', - 'base_uri' => $this->base_uri, - 'base_url' => $this->base_url, - 'title' => $this->current_table - ); - - $this->CI->load->vars($data); - - // Load the language file and create variables - $this->lang = $this->CI->load->scaffold_language('scaffolding', '', TRUE); - $this->CI->load->vars($this->lang); - - // Load the helper files we plan to use - $this->CI->load->helper(array('url', 'form')); - - - log_message('debug', 'Scaffolding Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * "Add" Page - * - * Shows a form representing the currently selected DB - * so that data can be inserted - * - * @access public - * @return string the HTML "add" page - */ - function add() - { - $data = array( - 'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'], - 'fields' => $this->CI->db->field_data($this->current_table), - 'action' => $this->base_uri.'/insert' - ); - - $this->CI->load->view('add', $data); - } - - // -------------------------------------------------------------------- - - /** - * Insert the data - * - * @access public - * @return void redirects to the view page - */ - function insert() - { - if ($this->CI->db->insert($this->current_table, $_POST) === FALSE) - { - $this->add(); - } - else - { - redirect($this->base_uri.'/view/'); - } - } - - // -------------------------------------------------------------------- - - /** - * "View" Page - * - * Shows a table containing the data in the currently - * selected DB - * - * @access public - * @return string the HTML "view" page - */ - function view() - { - // Fetch the total number of DB rows - $total_rows = $this->CI->db->count_all($this->current_table); - - if ($total_rows < 1) - { - return $this->CI->load->view('no_data'); - } - - // Set the query limit/offset - $per_page = 20; - $offset = $this->CI->uri->segment(4, 0); - - // Run the query - $query = $this->CI->db->get($this->current_table, $per_page, $offset); - - // Now let's get the field names - $fields = $this->CI->db->list_fields($this->current_table); - - // We assume that the column in the first position is the primary field. - $primary = current($fields); - - // Pagination! - $this->CI->pagination->initialize( - array( - 'base_url' => $this->base_url.'/view', - 'total_rows' => $total_rows, - 'per_page' => $per_page, - 'uri_segment' => 4, - 'full_tag_open' => '

    ', - 'full_tag_close' => '

    ' - ) - ); - - $data = array( - 'title' => ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'], - 'query' => $query, - 'fields' => $fields, - 'primary' => $primary, - 'paginate' => $this->CI->pagination->create_links() - ); - - $this->CI->load->view('view', $data); - } - - // -------------------------------------------------------------------- - - /** - * "Edit" Page - * - * Shows a form representing the currently selected DB - * so that data can be edited - * - * @access public - * @return string the HTML "edit" page - */ - function edit() - { - if (FALSE === ($id = $this->CI->uri->segment(4))) - { - return $this->view(); - } - - // Fetch the primary field name - $primary = $this->CI->db->primary($this->current_table); - - // Run the query - $query = $this->CI->db->get_where($this->current_table, array($primary => $id)); - - $data = array( - 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], - 'fields' => $query->field_data(), - 'query' => $query->row(), - 'action' => $this->base_uri.'/update/'.$this->CI->uri->segment(4) - ); - - $this->CI->load->view('edit', $data); - } - - // -------------------------------------------------------------------- - - /** - * Update - * - * @access public - * @return void redirects to the view page - */ - function update() - { - // Fetch the primary key - $primary = $this->CI->db->primary($this->current_table); - - // Now do the query - $this->CI->db->update($this->current_table, $_POST, array($primary => $this->CI->uri->segment(4))); - - redirect($this->base_uri.'/view/'); - } - - // -------------------------------------------------------------------- - - /** - * Delete Confirmation - * - * @access public - * @return string the HTML "delete confirm" page - */ - function delete() - { - if ( ! isset($this->lang['scaff_del_confirm'])) - { - $message = 'Are you sure you want to delete the following row: '.$this->CI->uri->segment(4); - } - else - { - $message = $this->lang['scaff_del_confirm'].' '.$this->CI->uri->segment(4); - } - - $data = array( - 'title' => ( ! isset($this->lang['scaff_delete'])) ? 'Delete Data' : $this->lang['scaff_delete'], - 'message' => $message, - 'no' => anchor(array($this->base_uri, 'view'), ( ! isset($this->lang['scaff_no'])) ? 'No' : $this->lang['scaff_no']), - 'yes' => anchor(array($this->base_uri, 'do_delete', $this->CI->uri->segment(4)), ( ! isset($this->lang['scaff_yes'])) ? 'Yes' : $this->lang['scaff_yes']) - ); - - $this->CI->load->view('delete', $data); - } - - // -------------------------------------------------------------------- - - /** - * Delete - * - * @access public - * @return void redirects to the view page - */ - function do_delete() - { - // Fetch the primary key - $primary = $this->CI->db->primary($this->current_table); - - // Now do the query - $this->CI->db->where($primary, $this->CI->uri->segment(4)); - $this->CI->db->delete($this->current_table); - - header("Refresh:0;url=".site_url(array($this->base_uri, 'view'))); - exit; - } - -} - -/* End of file Scaffolding.php */ +CI =& get_instance(); + + $this->CI->load->database("", FALSE, TRUE); + $this->CI->load->library('pagination'); + + // Turn off caching + $this->CI->db->cache_off(); + + /** + * Set the current table name + * This is done when initializing scaffolding: + * $this->load->scaffolding('table_name') + * + */ + $this->current_table = $db_table; + + /** + * Set the path to the "view" files + * We'll manually override the "view" path so that + * the load->view function knows where to look. + */ + + $this->CI->load->_ci_view_path = BASEPATH.'scaffolding/views/'; + + // Set the base URL + $this->base_url = $this->CI->config->site_url().'/'.$this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'both'); + $this->base_uri = $this->CI->uri->segment(1).$this->CI->uri->slash_segment(2, 'leading'); + + // Set a few globals + $data = array( + 'image_url' => $this->CI->config->system_url().'scaffolding/images/', + 'base_uri' => $this->base_uri, + 'base_url' => $this->base_url, + 'title' => $this->current_table + ); + + $this->CI->load->vars($data); + + // Load the language file and create variables + $this->lang = $this->CI->load->scaffold_language('scaffolding', '', TRUE); + $this->CI->load->vars($this->lang); + + // Load the helper files we plan to use + $this->CI->load->helper(array('url', 'form')); + + + log_message('debug', 'Scaffolding Class Initialized'); + } + + // -------------------------------------------------------------------- + + /** + * "Add" Page + * + * Shows a form representing the currently selected DB + * so that data can be inserted + * + * @access public + * @return string the HTML "add" page + */ + function add() + { + $data = array( + 'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'], + 'fields' => $this->CI->db->field_data($this->current_table), + 'action' => $this->base_uri.'/insert' + ); + + $this->CI->load->view('add', $data); + } + + // -------------------------------------------------------------------- + + /** + * Insert the data + * + * @access public + * @return void redirects to the view page + */ + function insert() + { + if ($this->CI->db->insert($this->current_table, $_POST) === FALSE) + { + $this->add(); + } + else + { + redirect($this->base_uri.'/view/'); + } + } + + // -------------------------------------------------------------------- + + /** + * "View" Page + * + * Shows a table containing the data in the currently + * selected DB + * + * @access public + * @return string the HTML "view" page + */ + function view() + { + // Fetch the total number of DB rows + $total_rows = $this->CI->db->count_all($this->current_table); + + if ($total_rows < 1) + { + return $this->CI->load->view('no_data'); + } + + // Set the query limit/offset + $per_page = 20; + $offset = $this->CI->uri->segment(4, 0); + + // Run the query + $query = $this->CI->db->get($this->current_table, $per_page, $offset); + + // Now let's get the field names + $fields = $this->CI->db->list_fields($this->current_table); + + // We assume that the column in the first position is the primary field. + $primary = current($fields); + + // Pagination! + $this->CI->pagination->initialize( + array( + 'base_url' => $this->base_url.'/view', + 'total_rows' => $total_rows, + 'per_page' => $per_page, + 'uri_segment' => 4, + 'full_tag_open' => '

    ', + 'full_tag_close' => '

    ' + ) + ); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_view'])) ? 'View Data' : $this->lang['scaff_view'], + 'query' => $query, + 'fields' => $fields, + 'primary' => $primary, + 'paginate' => $this->CI->pagination->create_links() + ); + + $this->CI->load->view('view', $data); + } + + // -------------------------------------------------------------------- + + /** + * "Edit" Page + * + * Shows a form representing the currently selected DB + * so that data can be edited + * + * @access public + * @return string the HTML "edit" page + */ + function edit() + { + if (FALSE === ($id = $this->CI->uri->segment(4))) + { + return $this->view(); + } + + // Fetch the primary field name + $primary = $this->CI->db->primary($this->current_table); + + // Run the query + $query = $this->CI->db->get_where($this->current_table, array($primary => $id)); + + $data = array( + 'title' => ( ! isset($this->lang['scaff_edit'])) ? 'Edit Data' : $this->lang['scaff_edit'], + 'fields' => $query->field_data(), + 'query' => $query->row(), + 'action' => $this->base_uri.'/update/'.$this->CI->uri->segment(4) + ); + + $this->CI->load->view('edit', $data); + } + + // -------------------------------------------------------------------- + + /** + * Update + * + * @access public + * @return void redirects to the view page + */ + function update() + { + // Fetch the primary key + $primary = $this->CI->db->primary($this->current_table); + + // Now do the query + $this->CI->db->update($this->current_table, $_POST, array($primary => $this->CI->uri->segment(4))); + + redirect($this->base_uri.'/view/'); + } + + // -------------------------------------------------------------------- + + /** + * Delete Confirmation + * + * @access public + * @return string the HTML "delete confirm" page + */ + function delete() + { + if ( ! isset($this->lang['scaff_del_confirm'])) + { + $message = 'Are you sure you want to delete the following row: '.$this->CI->uri->segment(4); + } + else + { + $message = $this->lang['scaff_del_confirm'].' '.$this->CI->uri->segment(4); + } + + $data = array( + 'title' => ( ! isset($this->lang['scaff_delete'])) ? 'Delete Data' : $this->lang['scaff_delete'], + 'message' => $message, + 'no' => anchor(array($this->base_uri, 'view'), ( ! isset($this->lang['scaff_no'])) ? 'No' : $this->lang['scaff_no']), + 'yes' => anchor(array($this->base_uri, 'do_delete', $this->CI->uri->segment(4)), ( ! isset($this->lang['scaff_yes'])) ? 'Yes' : $this->lang['scaff_yes']) + ); + + $this->CI->load->view('delete', $data); + } + + // -------------------------------------------------------------------- + + /** + * Delete + * + * @access public + * @return void redirects to the view page + */ + function do_delete() + { + // Fetch the primary key + $primary = $this->CI->db->primary($this->current_table); + + // Now do the query + $this->CI->db->where($primary, $this->CI->uri->segment(4)); + $this->CI->db->delete($this->current_table); + + header("Refresh:0;url=".site_url(array($this->base_uri, 'view'))); + exit; + } + +} + +/* End of file Scaffolding.php */ /* Location: ./system/scaffolding/Scaffolding.php */ \ No newline at end of file diff --git a/system/scaffolding/images/index.html b/system/scaffolding/images/index.html index 065d2da5..c942a79c 100644 --- a/system/scaffolding/images/index.html +++ b/system/scaffolding/images/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/scaffolding/index.html b/system/scaffolding/index.html index 065d2da5..c942a79c 100644 --- a/system/scaffolding/index.html +++ b/system/scaffolding/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/scaffolding/views/add.php b/system/scaffolding/views/add.php index cac255ac..cbb12f6f 100644 --- a/system/scaffolding/views/add.php +++ b/system/scaffolding/views/add.php @@ -1,32 +1,32 @@ -load->view('header'); ?> - -

    - - - - - - - -primary_key == 1) continue; ?> - - - - - type == 'blob'): ?> - - - - - - - -
    name; echo ' '.$field->default; ?>
    - - - - - -load->view('footer'); -/* End of file add.php */ -/* Location: ./system/scaffolding/views/add.php */ +load->view('header'); ?> + +

    + + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
    name; echo ' '.$field->default; ?>
    + + + + + +load->view('footer'); +/* End of file add.php */ +/* Location: ./system/scaffolding/views/add.php */ diff --git a/system/scaffolding/views/delete.php b/system/scaffolding/views/delete.php index 87b59bef..d1954219 100644 --- a/system/scaffolding/views/delete.php +++ b/system/scaffolding/views/delete.php @@ -1,9 +1,9 @@ -load->view('header'); ?> - -

    - -

      |   - -load->view('footer'); -/* End of file delete.php */ -/* Location: ./system/scaffolding/views/delete.php */ +load->view('header'); ?> + +

    + +

      |   + +load->view('footer'); +/* End of file delete.php */ +/* Location: ./system/scaffolding/views/delete.php */ diff --git a/system/scaffolding/views/edit.php b/system/scaffolding/views/edit.php index c66259d9..fe553e59 100644 --- a/system/scaffolding/views/edit.php +++ b/system/scaffolding/views/edit.php @@ -1,33 +1,33 @@ -load->view('header'); ?> - - -

    - - - - - - - -primary_key == 1) continue; ?> - - - - - type == 'blob'): ?> - - - - - - - -
    name; ?>
    - - - - - -load->view('footer'); -/* End of file edit.php */ +load->view('header'); ?> + + +

    + + + + + + + +primary_key == 1) continue; ?> + + + + + type == 'blob'): ?> + + + + + + + +
    name; ?>
    + + + + + +load->view('footer'); +/* End of file edit.php */ /* Location: ./system/scaffolding/views/edit.php */ \ No newline at end of file diff --git a/system/scaffolding/views/footer.php b/system/scaffolding/views/footer.php index a287664f..0e71401c 100644 --- a/system/scaffolding/views/footer.php +++ b/system/scaffolding/views/footer.php @@ -1,10 +1,10 @@ - -
    - - - - + +
    + + + + \ No newline at end of file diff --git a/system/scaffolding/views/header.php b/system/scaffolding/views/header.php index a1621ff3..50f234a4 100644 --- a/system/scaffolding/views/header.php +++ b/system/scaffolding/views/header.php @@ -1,29 +1,29 @@ - - - - -<?php echo $title; ?> - - - - - - - - - - - - -
    + + + + +<?php echo $title; ?> + + + + + + + + + + + + +
    \ No newline at end of file diff --git a/system/scaffolding/views/index.html b/system/scaffolding/views/index.html index 065d2da5..c942a79c 100644 --- a/system/scaffolding/views/index.html +++ b/system/scaffolding/views/index.html @@ -1,10 +1,10 @@ - - - 403 Forbidden - - - -

    Directory access is forbidden.

    - - + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + \ No newline at end of file diff --git a/system/scaffolding/views/no_data.php b/system/scaffolding/views/no_data.php index 963341b7..bc81e748 100644 --- a/system/scaffolding/views/no_data.php +++ b/system/scaffolding/views/no_data.php @@ -1,8 +1,8 @@ -load->view('header'); ?> - -

    -

    - -load->view('footer'); -/* End of file no_data.php */ +load->view('header'); ?> + +

    +

    + +load->view('footer'); +/* End of file no_data.php */ /* Location: ./system/scaffolding/views/no_data.php */ \ No newline at end of file diff --git a/system/scaffolding/views/stylesheet.css b/system/scaffolding/views/stylesheet.css index ba6ee0a2..3f487dd0 100644 --- a/system/scaffolding/views/stylesheet.css +++ b/system/scaffolding/views/stylesheet.css @@ -1,143 +1,143 @@ -body { - margin: 0; - padding: 0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - color: #4F5155; - background: #fff url(background.jpg) repeat-x left top; -} - -a { - color: #8B0D00; - background-color: transparent; - text-decoration: none; - font-weight: bold; -} - -a:visited { - color: #8B0D00; - background-color: transparent; - text-decoration: none; -} - -a:hover { - color: #000; - text-decoration: none; - background-color: transparent; -} - - -#header { - margin: 0; - padding: 0; -} - -#header_left { - background-color: transparent; - float: left; - padding: 21px 0 0 32px; - margin: 0 -} - -#header_right { - background-color: transparent; - float: right; - text-align: right; - padding: 35px 50px 20px 0; - margin: 0 -} - -#footer { - margin: 20px 0 15px 0; - padding: 0; -} - -#footer p { - font-size: 10px; - color: #999; - text-align: center; -} - -#outer { - margin: 30px 40px 0 40px; -} - -img { - padding:0; - border: 0; - margin: 0; -} - -.nopad { - padding:0; - border: 0; - margin: 0; -} - -table { - background-color: #efefef; -} - -th { - background-color: #eee; - font-weight: bold; - padding: 6px; - text-align: left; -} - -td { - background-color: #fff; - padding: 6px; -} - - -form { - margin: 0; - padding: 0; -} - -.input { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - width: 600px; - color: #333; - border: 1px solid #B3B4BD; - font-size: 11px; - height: 2em; - padding: 0; - margin: 0; -} - -.textarea { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 12px; - width: 600px; - color: #333; - border: 1px solid #B3B4BD; - padding: 0; - margin: 0; -} - -.select { - background-color: #fff; - font-size: 11px; - font-weight: normal; - color: #333; - padding: 0; - margin: 0 0 3px 0; -} - -.checkbox { - background-color: transparent; - padding: 0; - border: 0; -} - -.submit { - background-color: #8B0D00; - color: #FFF; - font-weight: normal; - border: 1px solid #000; - margin: 6px 0 0 0; - padding: 1px 5px 1px 5px; -} +body { + margin: 0; + padding: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + color: #4F5155; + background: #fff url(background.jpg) repeat-x left top; +} + +a { + color: #8B0D00; + background-color: transparent; + text-decoration: none; + font-weight: bold; +} + +a:visited { + color: #8B0D00; + background-color: transparent; + text-decoration: none; +} + +a:hover { + color: #000; + text-decoration: none; + background-color: transparent; +} + + +#header { + margin: 0; + padding: 0; +} + +#header_left { + background-color: transparent; + float: left; + padding: 21px 0 0 32px; + margin: 0 +} + +#header_right { + background-color: transparent; + float: right; + text-align: right; + padding: 35px 50px 20px 0; + margin: 0 +} + +#footer { + margin: 20px 0 15px 0; + padding: 0; +} + +#footer p { + font-size: 10px; + color: #999; + text-align: center; +} + +#outer { + margin: 30px 40px 0 40px; +} + +img { + padding:0; + border: 0; + margin: 0; +} + +.nopad { + padding:0; + border: 0; + margin: 0; +} + +table { + background-color: #efefef; +} + +th { + background-color: #eee; + font-weight: bold; + padding: 6px; + text-align: left; +} + +td { + background-color: #fff; + padding: 6px; +} + + +form { + margin: 0; + padding: 0; +} + +.input { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + width: 600px; + color: #333; + border: 1px solid #B3B4BD; + font-size: 11px; + height: 2em; + padding: 0; + margin: 0; +} + +.textarea { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 12px; + width: 600px; + color: #333; + border: 1px solid #B3B4BD; + padding: 0; + margin: 0; +} + +.select { + background-color: #fff; + font-size: 11px; + font-weight: normal; + color: #333; + padding: 0; + margin: 0 0 3px 0; +} + +.checkbox { + background-color: transparent; + padding: 0; + border: 0; +} + +.submit { + background-color: #8B0D00; + color: #FFF; + font-weight: normal; + border: 1px solid #000; + margin: 6px 0 0 0; + padding: 1px 5px 1px 5px; +} diff --git a/system/scaffolding/views/view.php b/system/scaffolding/views/view.php index 69c1f45d..a81241d3 100644 --- a/system/scaffolding/views/view.php +++ b/system/scaffolding/views/view.php @@ -1,27 +1,27 @@ -load->view('header'); ?> - - - - - - - - - - -result() as $row): ?> - - - - - - - - -
    EditDelete
     $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
    - - - -load->view('footer'); -/* End of file view.php */ +load->view('header'); ?> + + + + + + + + + + +result() as $row): ?> + + + + + + + + +
    EditDelete
     $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
    + + + +load->view('footer'); +/* End of file view.php */ /* Location: ./system/scaffolding/views/view.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cdadea79..6f23617b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1,957 +1,957 @@ - - - - - - - - - - - - - - - - - - - -Change Log : CodeIgniter User Guide - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Change Log

    - -

    Version 1.7.1

    -

    Release Date: not yet released
    -SVN Revision:

    - -
      -
    • Libraries -
        -
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • -
      • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
      • -
      • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
      • -
      -
    • -
    • Helpers - -
    • -
    - -

    Bug fixes for 1.7.1

    -
      -
    • Fixed a bug in the MySQLi driver when no port is specified
    • -
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • -
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • -
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.
    • -
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • -
    • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
    • -
    • Changed a few docblock comments to reflect actual return values.
    • -
    • Fixed a bug with high ascii characters in subject and from email headers.
    • -
    - - -

    Version 1.7

    -

    Release Date: October 23, 2008
    -SVN Revision: 1541

    - -
      -
    • Libraries -
        -
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • -
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • -
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • -
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • -
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • -
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • -
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • -
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • -
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • -
      • Added set_status_header() function to Output class.
      • -
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • -
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • -
      -
    • -
    • Database -
        -
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • -
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • -
      • Added Active Record caching feature to "update" and "delete" functions.
      • -
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • -
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • -
      • Added driver name variable in each DB driver, based on bug report #4436.
      • -
      -
    • -
    • Helpers -
        -
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • -
      • Added current_url() and uri_segments() to URL helper.
      • -
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • -
      • Added meta() function to HTML helper.
      • -
      • Improved accuracy of calculations in Number helper.
      • -
      • Removed added newlines ("\n") from most form and html helper functions.
      • -
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • -
      • Updated Date helper to match the world's current time zones and offsets.
      • -
      • Modified url_title() in the URL helper to remove characters and digits that are part of - character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • -
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • -
      -
    • -
    • Other Changes -
        -
      • Added PHP Style Guide to docs.
      • -
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • -
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • -
      • Added a file lock check during caching, before trying to write to the file.
      • -
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • -
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • -
      -
    • -
    - -

    Bug fixes for 1.7.0

    -
      -
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • -
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • -
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • -
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • -
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • -
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • -
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • -
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • -
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • -
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • -
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • -
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • -
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • -
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • -
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • -
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • -
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • -
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • -
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • -
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • -
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • -
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • -
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • -
    • Fixed DB backup bug in which field names were not being escaped.
    • -
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • -
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • -
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • -
    • Fixed a spelling error in a Loader error message.
    • -
    • Fixed a bug (5050) with IP validation with empty segments.
    • -
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • -
    - -

    Version 1.6.3

    -

    Release Date: June 26, 2008
    -SVN Revision: 1238

    -

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    -
      -
    • Database -
        -
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • -
      • Added ability to set multiple column non-primary keys to the Forge class
      • -
      • Added ability to set additional database config values in DSN connections via the query string.
      • -
      -
    • -
    • Libraries -
        -
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • -
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • -
      • Added get_post() to the Input class.
      • -
      • Documented get() in the Input class.
      • -
      • Added the ability to automatically output language items as form labels in the Language class.
      • -
      -
    • -
    • Helpers - -
    • -
    • Other changes -
        -
      • Improved security in xss_clean().
      • -
      • Removed an unused Router reference in _display_cache().
      • -
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • -
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • -
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • -
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • -
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • -
      • Documented the language file use of byte_format() in the number helper.
      • -
      -
    • -
    - - -

    Bug fixes for 1.6.3

    - -
      -
    • Added a language key for valid_emails in validation_lang.php.
    • -
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • -
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • -
    • Fixed a syntax error in upload_lang.php.
    • -
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • -
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • -
    • Removed some unused variables from the code (#4563).
    • -
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • -
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • -
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • -
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • -
    - -

    Version 1.6.2

    -

    Release Date: May 13, 2008
    -SVN Revision: 1155

    -
      -
    • Active Record -
        -
      • Added the ability to prevent escaping in having() clauses.
      • -
      • Added rename_table() into DBForge.
      • -
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • -
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • -
      -
    • -
    • Database -
        -
      • Added Strict Mode to database transactions.
      • -
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • -
      -
    • -
    • Config -
        -
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • -
      • Added 'audio/mpg' to list of mime types.
      • -
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      -
    • -
    • Libraries -
        -
      • Added increased security for filename handling in the Upload library.
      • -
      • Added increased security for sessions for client-side data tampering.
      • -
      • The MySQLi forge class is now in sync with MySQL forge.
      • -
      • Added the ability to set CRLF settings via config in the Email class.
      • -
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • -
      • Added a valid_emails rule to the Validation class.
      • -
      • The Zip class now exits within download().
      • -
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • -
      -
    • -
    • Helpers -
        -
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • -
      • Added form_button() in the Form helper.
      • -
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • -
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • -
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • -
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • -
      • The Download helper now exits within force_download().
      • -
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • -
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • -
      -
    • -
    • Plugins -
        -
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • -
      -
    • -
    • Other - Changes -
        -
      • Added ability for xss_clean() to accept arrays.
      • -
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • -
      • Removed "scripts" from the auto-load search path. Scripts were deprecated - in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • -
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • -
      • Added a Common Functions page to the userguide for globally available functions.
      • -
      • Improved security and performance of xss_clean().
      • -
      -
    • -
    - -

    Bugfixes for 1.6.2

    -
      -
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • -
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • -
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • -
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • -
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • -
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • -
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • -
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • -
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • -
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • -
    • Fixed an AR bug with or_where_not_in() (#4171).
    • -
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • -
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • -
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • -
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • -
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • -
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • -
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • -
    • Fixed a bug in the DB class testing the $params argument.
    • -
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • -
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • -
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • -
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • -
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • -
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • -
    • Fixed an array to string conversion error in the Validation library (#4425)
    • -
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • -
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • -
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • -
    - -

    Version 1.6.1

    -

    Release Date: February 12, 2008
    - SVN Revision: 984

    -
      -
    • Active Record - -
    • -
    • Database drivers -
        -
      • Added support for setting client character set and collation for MySQLi.
      • -
      -
    • -
    • Core Changes -
        -
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • -
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • -
      • Added a 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 characters to the end of the default expression.
      • -
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • -
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • -
      -
    • -
    • Helpers -
        -
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • -
      -
    • -
    - - -

    Bugfixes for 1.6.1

    -
      -
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • -
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • -
    • Made Active Record fully database prefix aware (#3384).
    • -
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • -
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • -
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • -
    • Fixed a bug in query binding (#3402).
    • -
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • -
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • -
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • -
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • -
    • Fixed assorted user guide typos.
    • -
    - - - -

    Version 1.6.0

    -

    Release Date: January 30, 2008

    -
      -
    • DBForge -
        -
      • Added DBForge to the database tools.
      • -
      • Moved create_database() and drop_database() into DBForge.
      • -
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • -
      -
    • - -
    • Active Record -
        -
      • Added protect_identifiers() in Active Record.
      • -
      • All AR queries are backticked if appropriate to the database.
      • -
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • -
      • Added support for limit() into update() and delete() statements in Active Record.
      • -
      • Added empty_table() and truncate_table() to Active Record.
      • -
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • -
      • Added count_all_results() function to Active Record.
      • -
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • -
      • Added the ability to use aliases with joins in Active Record.
      • -
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • -
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • -
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • -
      -
    • - -
    • Other Database Related -
        -
      • MySQL driver now requires MySQL 4.1+
      • -
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • -
      • Added $this->db->dbprefix() to manually add database prefixes.
      • -
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • -
      • Added a check for NULL fields in the MySQL database backup utility.
      • -
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • -
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • -
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • -
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • -
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more - in harmony with the global nature of the behavior (#1834).
      • -
      -
    • - -
    • Core changes -
        -
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • -
      • Added the ability to auto-load Models.
      • -
      • Reorganized the URI and Routes classes for better clarity.
      • -
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • -
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • -
      • Deprecated Scaffolding.
      • -
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • -
      -
    • - -
    • Libraries -
        -
      • Changed the load protocol of Models to allow for extension.
      • -
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • -
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • -
      • Removed 'last_visit' from the Session class.
      • -
      • Added a language entry for valid_ip validation error.
      • -
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • -
      • Added an "integer" rule into the Validation library.
      • -
      • Added valid_base64() to the Validation library.
      • -
      • Documented clear() in the Image Processing library.
      • -
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • -
      • Modified Upload class $_FILES error messages to be more precise.
      • -
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • -
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • -
      • Added a few additional mime type variations for CSV.
      • -
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • -
      -
    • - -
    • Helpers & Plugins -
        -
      • Added link_tag() to the HTML helper.
      • -
      • Added img() to the HTML helper.
      • -
      • Added ability to "extend" Helpers.
      • -
      • Added an email helper into core helpers.
      • -
      • Added strip_quotes() function to string helper.
      • -
      • Added reduce_multiples() function to string helper.
      • -
      • Added quotes_to_entities() function to string helper.
      • -
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • -
      • Added support for external urls in form_open().
      • -
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • -
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • -
      -
    • - - -
    • Documentation Changes -
        -
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • -
      • Added titles to all user manual pages.
      • -
      • Added attributes into <html> of userguide for valid html.
      • -
      • Added Zip Encoding Class to the table of contents of the userguide.
      • -
      • Moved part of the userguide menu javascript to an external file.
      • -
      • Documented distinct() in Active Record.
      • -
      • Documented the timezones() function in the Date Helper.
      • -
      • Documented unset_userdata in the Session class.
      • -
      • Documented 2 config options to the Database configuration page.
      • -
      -
    • -
    - -

    Bug fixes for Version 1.6.0

    - -
      -
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • -
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • -
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • -
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • -
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • -
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • -
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • -
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • -
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • -
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • -
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • -
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • -
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • -
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • -
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • -
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • -
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • -
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • -
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • -
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • -
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • -
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • -
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • -
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • -
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • -
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • -
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • -
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • -
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • -
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • -
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • -
    • Removed an extraneous call to loading models (#3286).
    • -
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • -
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • -
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • -
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • -
    • Removed an unused parameter from Profiler (#3332).
    • -
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • -
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • -
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • -
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • -
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • -
    • Fixed a bug in captcha calling an invalid PHP function.
    • -
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • -
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • -
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • -
    • Fixed an example of comma-separated emails in the email library documentation.
    • -
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • -
    • Fixed a typo in the database language file.
    • -
    • Fixed a typo in the image language file "suppor" to "support".
    • -
    • Fixed an example for XML RPC.
    • -
    • Fixed an example of accept_charset() in the User Agent Library.
    • -
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • -
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • -
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • -
    • Added a stripslashes() into the Upload Library.
    • -
    • Fixed a series of grammatical and spelling errors in the language files.
    • -
    • Fixed assorted user guide typos.
    • -
    -

    Version 1.5.4

    -

    Release Date: July 12, 2007

    -
      -
    • Added custom Language files to the autoload options.
    • -
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • -
    • Added array to string into the profiler.
    • -
    • Added some additional mime types in application/config/mimes.php.
    • -
    • Added filename_security() method to Input library.
    • -
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • -
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • -
    • Fixed MSSQL insert_id().
    • -
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • -
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • -
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • -
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • -
    • Fixed a typo in the Calendar library
    • -
    • Fixed a typo in rpcs.php library
    • -
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • -
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • -
    • Fixed an IP validation bug.
    • -
    • Fixed a bug in display of POST keys in the Profiler output
    • -
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • -
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • -
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • -
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • -
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • -
    • Fixed various doc typos.
    • -
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • -
    • Docs now validate to XHTML 1 transitional
    • -
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • -
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • -
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • -
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • -
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • -
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • -
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • -
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • -
    -

    Version 1.5.3

    -

    Release Date: April 15, 2007

    -
      -
    • Added array to string into the profiler
    • -
    • Code Igniter references updated to CodeIgniter
    • -
    • pMachine references updated to EllisLab
    • -
    • Fixed a bug in the repeater function of string helper.
    • -
    • Fixed a bug in ODBC driver
    • -
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • -
    • Fixed a bug in the redirect function of the url helper.
    • -
    • Fixed an undefined variable in Loader
    • -
    • Fixed a version bug in the Postgres driver
    • -
    • Fixed a bug in the textarea function of the form helper for use with strings
    • -
    • Fixed doc typos.
    • -
    -

    Version 1.5.2

    -

    Release Date: February 13, 2007

    -
      -
    • Added subversion information to the downloads page.
    • -
    • Added support for captions in the Table Library
    • -
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • -
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • -
    • Removed unescaped variables in error messages of Input and Router classes
    • -
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • -
    • Fixed a bug in the form helper that gave textarea a value attribute
    • -
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • -
    • Fixed some doc typos.
    • -
    - - -

    Version 1.5.1

    -

    Release Date: November 23, 2006

    -
      -
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • -
    • Added support for naming custom library files in lower or uppercase.
    • -
    • Fixed a bug related to output buffering.
    • -
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • -
    • Fixed a bug that was suppressing errors in controllers.
    • -
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • -
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • -
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • -
    • Fixed some bugs in the Oracle DB driver.
    • -
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • -
    • Fixed some doc typos.
    • -
    -

    Version 1.5.0.1

    -

    Release Date: October 31, 2006

    -
      -
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • -
    • Fixed a bug in the word_wrap() helper function.
    • -
    • Fixed an invalid color Hex number in the Profiler class.
    • -
    • Fixed a corrupted image in the user guide.
    • -
    - - - -

    Version 1.5.0

    -

    Release Date: October 30, 2006

    - -
      -
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • -
    • Added Database Caching Class.
    • -
    • Added transaction support to the database classes.
    • -
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • -
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • -
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • -
    • Added Zip Encoding Library.
    • -
    • Added FTP Library.
    • -
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • -
    • Added support for storing models within sub-folders.
    • -
    • Added Download Helper.
    • -
    • Added simple_query() function to the database classes
    • -
    • Added standard_date() function to the Date Helper.
    • -
    • Added $query->free_result() to database class.
    • -
    • Added $query->list_fields() function to database class
    • -
    • Added $this->db->platform() function
    • -
    • Added new File Helper: get_filenames()
    • -
    • Added new helper: Smiley Helper
    • -
    • Added support for <ul> and <ol> lists in the HTML Helper
    • -
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • -
    • Added the ability to rename or relocate the "application" folder.
    • -
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • -
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • -
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • -
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • -
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • -
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • -
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • -
    • Fixed a bug in the Email class related to SMTP Helo data.
    • -
    • Fixed a bug in the word wrapping helper and function in the email class.
    • -
    • Fixed a bug in the validation class.
    • -
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • -
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • -
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • -
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • -
    • Fixed a pagination bug that was permitting negative values in the URL.
    • -
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • -
    • Changed _get_config() to get_config() since the function is not a private one.
    • -
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • -
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • -
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • -
    - - - - -

    Version 1.4.1

    -

    Release Date: September 21, 2006

    - -
      -
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • -
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • -
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • -
    • Added $this->output->set_header() function, which allows you to set server headers.
    • -
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • -
    • Added Inflector helper.
    • -
    • Added element() function in the array helper.
    • -
    • Added RAND() to active record orderby() function.
    • -
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • -
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • -
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • -
    • Added output compression option to the config file.
    • -
    • Removed the is_numeric test from the db->escape() function.
    • -
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • -
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • -
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • -
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • -
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • -
    • Added some code to allow email attachments to be reset when sending batches of email.
    • -
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own -libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • -
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • -
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • -
    - - - -

    Version 1.4.0

    -

    Release Date: September 17, 2006

    - -
      -
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • -
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • -
    • Added regular expressions support for routing rules.
    • -
    • Added the ability to remap function calls within your controllers.
    • -
    • Added the ability to replace core system classes with your own classes.
    • -
    • Added support for % character in URL.
    • -
    • Added the ability to supply full URLs using the anchor() helper function.
    • -
    • Added mode parameter to file_write() helper.
    • -
    • Added support for changing the port number in the Postgres driver.
    • -
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • -
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • -
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • -
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • -
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • -
    • Updated the form_open() helper to allow the GET method to be used.
    • -
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • -
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • -
    • Updated the Models loader function to allow multiple loads of the same model.
    • -
    • Updated the MS SQL driver so that single quotes are escaped.
    • -
    • Updated the Postgres and ODBC drivers for better compatibility.
    • -
    • Removed a strtolower() call that was changing URL segments to lower case.
    • -
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • -
    • Removed backticks from Postgres class since these are not needed.
    • -
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • -
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • -
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • -
    • Fixed a router bug that was making it too greedy when matching end segments.
    • -
    • Fixed a bug that was preventing multiple discrete database calls.
    • -
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • -
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • -
    • Fixed some missing prefixes when using the database prefix feature.
    • -
    • Fixed a typo in the Calendar class (cal_november).
    • -
    • Fixed a bug in the form_checkbox() helper.
    • -
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • -
    • Fixed an evaluation bug in the database initialization function.
    • -
    • Fixed a minor bug in one of the error messages in the language class.
    • -
    • Fixed a bug in the date helper timespan function.
    • -
    • Fixed an undefined variable in the DB Driver class.
    • -
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • -
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • -
    • Fixed a couple bugs in the Unit Testing class.
    • -
    • Fixed an incorrectly named variable in the Validation class.
    • -
    • Fixed an incorrectly named variable in the URI class.
    • -
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • -
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • -
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • -
    • Fixed some MS SQL bugs.
    • -
    • Fixed some doc typos.
    • -
    - - - -

    Version 1.3.3

    -

    Release Date: June 1, 2006

    - -
      - -
    • Models do not connect automatically to the database as of this version. More info here.
    • -
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • -
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • -
    • Fixed a bug in the active record "having" function.
    • -
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • -
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • -
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • -
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • -
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • -
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • -
    • Fixed a bug in the hash() security helper.
    • -
    • Fixed some typos.
    • -
    - - - - -

    Version 1.3.2

    -

    Release Date: April 17, 2006

    - -
      -
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • -
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • -
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • -
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • -
    • Fixed a couple bugs in the Model class.
    • -
    • Fixed some documentation typos and errata.
    • -
    - - - -

    Version 1.3.1

    -

    Release Date: April 11, 2006

    - -
      -
    • Added a Unit Testing Library.
    • -
    • Added the ability to pass objects to the insert() and update() database functions. -This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • -
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • -
    • Added getwhere function to Active Record class.
    • -
    • Added count_all function to Active Record class.
    • -
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • -
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • -
    • Added a new mime type to the upload class for better compatibility.
    • -
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • -
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • -
    • Fixed a bug in the image library when realpath() returns false.
    • -
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • -
    • Fixed a bug in the "exact_length" function of the validation class.
    • -
    • Fixed some typos in the user guide
    • -
    - - -

    Version 1.3

    -

    Release Date: April 3, 2006

    - -
      -
    • Added support for Models.
    • -
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • -
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • -
    • Added a feature to the database class that lets you run custom function calls.
    • -
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • -
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • -
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • -
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • -
    • Added a new error template for use with native PHP errors.
    • -
    • Added "alternator" function in the string helpers.
    • -
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • -
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • -
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and -all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • -
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • -
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • -
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • -
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • -
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • -
    • Fixed some typos in the default calendar template
    • -
    • Fixed some typos in the user guide
    • -
    - - - - - - - - -

    Version 1.2

    -

    Release Date: March 21, 2006

    - -
      -
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • -
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • -
    • Added new File Helper: delete_files()
    • -
    • Added new URL Helpers: base_url(), index_page()
    • -
    • Added the ability to create your own core libraries and store them in your local application directory.
    • -
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • -
    • Added Javascript Calendar plugin.
    • -
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • -
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • -
    • Fixed a bug in the DB "where" function.
    • -
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • -
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • -
    • Fixed some bugs in the xss_clean function
    • -
    - - - - - -

    Version Beta 1.1

    -

    Release Date: March 10, 2006

    - -
      -
    • Added a Calendaring class.
    • -
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • -
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • -
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • -
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • -
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • -
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • -
    • Fixed a data type error in the form_radio function (form helper)
    • -
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • -
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • -
    • Fixed a pagination problem in the scaffolding.
    • -
    • Fixed a bug in the mysql class "where" function.
    • -
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • -
    • Fixed a bug in the br() function in the HTML helper
    • -
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • -
    • Removed the "style" attributes form the form helpers.
    • -
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • -
    - -

    Version Beta 1.0

    -

    Release Date: February 28, 2006

    -

    First publicly released version.

    - -
    - - - - - - - + + + + + + + + + + + + + + + + + + + +Change Log : CodeIgniter User Guide + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Change Log

    + +

    Version 1.7.1

    +

    Release Date: not yet released
    +SVN Revision:

    + +
      +
    • Libraries +
        +
      • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
      • +
      • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
      • +
      • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
      • +
      +
    • +
    • Helpers + +
    • +
    + +

    Bug fixes for 1.7.1

    +
      +
    • Fixed a bug in the MySQLi driver when no port is specified
    • +
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • +
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • +
    • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.
    • +
    • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
    • +
    • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
    • +
    • Changed a few docblock comments to reflect actual return values.
    • +
    • Fixed a bug with high ascii characters in subject and from email headers.
    • +
    + + +

    Version 1.7

    +

    Release Date: October 23, 2008
    +SVN Revision: 1541

    + +
      +
    • Libraries +
        +
      • Added a new Form Validation Class. It simplifies setting rules and field names, supports arrays as field names, allows groups of validation rules to be saved in a config file, and adds some helper functions for use in view files. Please note that the old Validation class is now deprecated. We will leave it in the library folder for some time so that existing applications that use it will not break, but you are encouraged to migrate to the new version.
      • +
      • Updated the Sessions class so that any custom data being saved gets stored to a database rather than the session cookie (assuming you are using a database to store session data), permitting much more data to be saved.
      • +
      • Added the ability to store libraries in subdirectories within either the main "libraries" or the local application "libraries" folder. Please see the Loader class for more info.
      • +
      • Added the ability to assign library objects to your own variable names when you use $this->load->library(). Please see the Loader class for more info.
      • +
      • Added controller class/method info to Profiler class and support for multiple database connections.
      • +
      • Improved the "auto typography" feature and moved it out of the helper into its own Typography Class.
      • +
      • Improved performance and accuracy of xss_clean(), including reduction of false positives on image/file tests.
      • +
      • Improved Parser class to allow multiple calls to the parse() function. The output of each is appended in the output.
      • +
      • Added max_filename option to set a file name length limit in the File Upload Class.
      • +
      • Added set_status_header() function to Output class.
      • +
      • Modified Pagination class to only output the "First" link when the link for page one would not be shown.
      • +
      • Added support for mb_strlen in the Form Validation class so that multi-byte languages will calculate string lengths properly.
      • +
      +
    • +
    • Database +
        +
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • +
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • +
      • Added Active Record caching feature to "update" and "delete" functions.
      • +
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • +
      • Added port support to MySQL, MySQLi, and MS SQL database drivers.
      • +
      • Added driver name variable in each DB driver, based on bug report #4436.
      • +
      +
    • +
    • Helpers +
        +
      • Added several new "setting" functions to the Form helper that allow POST data to be retrieved and set into forms. These are intended to be used on their own, or with the new Form Validation Class.
      • +
      • Added current_url() and uri_segments() to URL helper.
      • +
      • Altered auto_link() in the URL helper so that email addresses with "+" included will be linked.
      • +
      • Added meta() function to HTML helper.
      • +
      • Improved accuracy of calculations in Number helper.
      • +
      • Removed added newlines ("\n") from most form and html helper functions.
      • +
      • Tightened up validation in the Date helper function human_to_unix(), and eliminated the POSIX regex.
      • +
      • Updated Date helper to match the world's current time zones and offsets.
      • +
      • Modified url_title() in the URL helper to remove characters and digits that are part of + character entities, to allow dashes, underscores, and periods regardless of the $separator, and to allow uppercase characters.
      • +
      • Added support for arbitrary attributes in anchor_popup() of the URL helper.
      • +
      +
    • +
    • Other Changes +
        +
      • Added PHP Style Guide to docs.
      • +
      • Added sanitization in xss_clean() for a deprecated HTML tag that could be abused in user input in Internet Explorer.
      • +
      • Added a few openxml document mime types, and an additional mobile agent to mimes.php and user_agents.php respectively.
      • +
      • Added a file lock check during caching, before trying to write to the file.
      • +
      • Modified Cookie key cleaning to unset a few troublesome key names that can be present in certain environments, preventing CI from halting execution.
      • +
      • Changed the output of the profiler to use style attribute rather than clear, and added the id "codeigniter_profiler" to the container div.
      • +
      +
    • +
    + +

    Bug fixes for 1.7.0

    +
      +
    • Fixed bug in xss_clean() that could remove some desirable tag attributes.
    • +
    • Fixed assorted user guide typos or examples (#4807, #4812, #4840, #4862, #4864, #4899, #4930, #5006, #5071, #5158, #5229, #5254, #5351).
    • +
    • Fixed an edit from 1.6.3 that made the $robots array in user_agents.php go poof.
    • +
    • Fixed a bug in the Email library with quoted-printable encoding improperly encoding space and tab characters.
    • +
    • Modified XSS sanitization to no longer add semicolons after &[single letter], such as in M&M's, B&B, etc.
    • +
    • Modified XSS sanitization to no longer strip XHTML image tags of closing slashes.
    • +
    • Fixed a bug in the Session class when database sessions are used where upon session update all userdata would be errantly written to the session cookie.
    • +
    • Fixed a bug (#4536) in backups with the MySQL driver where some legacy code was causing certain characters to be double escaped.
    • +
    • Fixed a routing bug (#4661) that occurred when the default route pointed to a subfolder.
    • +
    • Fixed the spelling of "Dhaka" in the timezone_menu() function of the Date helper.
    • +
    • Fixed the spelling of "raspberry" in config/smileys.php.
    • +
    • Fixed incorrect parenthesis in form_open() function (#5135).
    • +
    • Fixed a bug that was ignoring case when comparing controller methods (#4560).
    • +
    • Fixed a bug (#4615) that was not setting SMTP authorization settings when using the initialize function.
    • +
    • Fixed a bug in highlight_code() in the Text helper that would leave a stray </span> in certain cases.
    • +
    • Fixed Oracle bug (#3306) that was preventing multiple queries in one action.
    • +
    • Fixed ODBC bug that was ignoring connection params due to its use of a constructor.
    • +
    • Fixed a DB driver bug with num_rows() that would cause an error with the Oracle driver.
    • +
    • Fixed MS SQL bug (#4915). Added brackets around database name in MS SQL driver when selecting the database, in the event that reserved characters are used in the name.
    • +
    • Fixed a DB caching bug (4718) in which the path was incorrect when no URI segments were present.
    • +
    • Fixed Image_lib class bug #4562. A path was not defined for NetPBM.
    • +
    • Fixed Image_lib class bug #4532. When cropping an image with identical height/width settings on output, a copy is made.
    • +
    • Fixed DB_driver bug (4900), in which a database error was not being logged correctly.
    • +
    • Fixed DB backup bug in which field names were not being escaped.
    • +
    • Fixed a DB Active Record caching bug in which multiple calls to cached data were not being honored.
    • +
    • Fixed a bug in the Session class that was disallowing slashes in the serialized array.
    • +
    • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
    • +
    • Fixed a spelling error in a Loader error message.
    • +
    • Fixed a bug (5050) with IP validation with empty segments.
    • +
    • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
    • +
    + +

    Version 1.6.3

    +

    Release Date: June 26, 2008
    +SVN Revision: 1238

    +

    Version 1.6.3 is a security and maintenance release and is recommended for all users.

    +
      +
    • Database +
        +
      • Modified MySQL/MySQLi Forge class to give explicit names to keys
      • +
      • Added ability to set multiple column non-primary keys to the Forge class
      • +
      • Added ability to set additional database config values in DSN connections via the query string.
      • +
      +
    • +
    • Libraries +
        +
      • Set the mime type check in the Upload class to reference the global mimes variable.
      • +
      • Added support for query strings to the Pagination class, automatically detected or explicitly declared.
      • +
      • Added get_post() to the Input class.
      • +
      • Documented get() in the Input class.
      • +
      • Added the ability to automatically output language items as form labels in the Language class.
      • +
      +
    • +
    • Helpers + +
    • +
    • Other changes +
        +
      • Improved security in xss_clean().
      • +
      • Removed an unused Router reference in _display_cache().
      • +
      • Added ability to use xss_clean() to test images for XSS, useful for upload security.
      • +
      • Considerably expanded list of mobile user-agents in config/user_agents.php.
      • +
      • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
      • +
      • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
      • +
      • Removed maxlength and size as automatically added attributes of form_input() in the form helper.
      • +
      • Documented the language file use of byte_format() in the number helper.
      • +
      +
    • +
    + + +

    Bug fixes for 1.6.3

    + +
      +
    • Added a language key for valid_emails in validation_lang.php.
    • +
    • Amended fixes for bug (#3419) with parsing DSN database connections.
    • +
    • Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
    • +
    • Fixed a syntax error in upload_lang.php.
    • +
    • Fixed a bug (#4542) with a regular expression in the Image library.
    • +
    • Fixed a bug (#4561) where orhaving() wasn't properly passing values.
    • +
    • Removed some unused variables from the code (#4563).
    • +
    • Fixed a bug where having() was not adding an = into the statement (#4568).
    • +
    • Fixed assorted user guide typos or examples (#4574, #4706).
    • +
    • Added quoted-printable headers to Email class when the multi-part override is used.
    • +
    • Fixed a double opening <p> tag in the index pages of each system directory.
    • +
    + +

    Version 1.6.2

    +

    Release Date: May 13, 2008
    +SVN Revision: 1155

    +
      +
    • Active Record +
        +
      • Added the ability to prevent escaping in having() clauses.
      • +
      • Added rename_table() into DBForge.
      • +
      • Fixed a bug that wasn't allowing escaping to be turned off if the value of a query was NULL.
      • +
      • DB Forge is now assigned to any models that exist after loading (#3457).
      • +
      +
    • +
    • Database +
        +
      • Added Strict Mode to database transactions.
      • +
      • Escape behaviour in where() clauses has changed; values in those with the "FALSE" argument are no longer escaped (ie: quoted).
      • +
      +
    • +
    • Config +
        +
      • Added 'application/vnd.ms-powerpoint' to list of mime types.
      • +
      • Added 'audio/mpg' to list of mime types.
      • +
      • Added new user-modifiable file constants.php containing file mode and fopen constants.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      +
    • +
    • Libraries +
        +
      • Added increased security for filename handling in the Upload library.
      • +
      • Added increased security for sessions for client-side data tampering.
      • +
      • The MySQLi forge class is now in sync with MySQL forge.
      • +
      • Added the ability to set CRLF settings via config in the Email class.
      • +
      • Unit Testing results are now colour coded, and a change was made to the default template of results.
      • +
      • Added a valid_emails rule to the Validation class.
      • +
      • The Zip class now exits within download().
      • +
      • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
      • +
      +
    • +
    • Helpers +
        +
      • Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
      • +
      • Added form_button() in the Form helper.
      • +
      • Changed the radio() and checkbox() functions to default to not checked by default.
      • +
      • Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
      • +
      • Modified img() in the HTML Helper to remove an unneeded space (#4208).
      • +
      • Modified anchor() in the URL helper to no longer add a default title= attribute (#4209).
      • +
      • The Download helper now exits within force_download().
      • +
      • Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
      • +
      • Added symbolic_permissions() and octal_permissions() to the File helper.
      • +
      +
    • +
    • Plugins +
        +
      • Modified captcha generation to first look for the function imagecreatetruecolor, and fallback to imagecreate if it isn't available (#4226).
      • +
      +
    • +
    • Other + Changes +
        +
      • Added ability for xss_clean() to accept arrays.
      • +
      • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
      • +
      • Removed "scripts" from the auto-load search path. Scripts were deprecated + in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
      • +
      • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
      • +
      • Added a Common Functions page to the userguide for globally available functions.
      • +
      • Improved security and performance of xss_clean().
      • +
      +
    • +
    + +

    Bugfixes for 1.6.2

    +
      +
    • Fixed a bug where SET queries were not being handled as "write" queries.
    • +
    • Fixed a bug (#3191) with ORIG_PATH_INFO URI parsing.
    • +
    • Fixed a bug in DB Forge, when inserting an id field (#3456).
    • +
    • Fixed a bug in the table library that could cause identically constructed rows to be dropped (#3459).
    • +
    • Fixed DB Driver and MySQLi result driver checking for resources instead of objects (#3461).
    • +
    • Fixed an AR_caching error where it wasn't tracking table aliases (#3463).
    • +
    • Fixed a bug in AR compiling, where select statements with arguments got incorrectly escaped (#3478).
    • +
    • Fixed an incorrect documentation of $this->load->language (#3520).
    • +
    • Fixed bugs (#3523, #4350) in get_filenames() with recursion and problems with Windows when $include_path is used.
    • +
    • Fixed a bug (#4153) in the XML-RPC class preventing dateTime.iso8601 from being used.
    • +
    • Fixed an AR bug with or_where_not_in() (#4171).
    • +
    • Fixed a bug with xss_clean() that would add semicolons to GET URI variable strings.
    • +
    • Fixed a bug (#4206) in the Directory Helper where the directory resource was not being closed, and minor improvements.
    • +
    • Fixed a bug in the FTP library where delete_dir() was not working recursively (#4215).
    • +
    • Fixed a Validation bug when set_rules() is used with a non-array field name and rule (#4220).
    • +
    • Fixed a bug (#4223) where DB caching would not work for returned DB objects or multiple DB connections.
    • +
    • Fixed a bug in the Upload library that might output the same error twice (#4390).
    • +
    • Fixed an AR bug when joining with a table alias and table prefix (#4400).
    • +
    • Fixed a bug in the DB class testing the $params argument.
    • +
    • Fixed a bug in the Table library where the integer 0 in cell data would be displayed as a blank cell.
    • +
    • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
    • +
    • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values.
    • +
    • Fixed a bug where SMTP emails were not having dot transformation performed on lines that begin with a dot.
    • +
    • Fixed a bug in display_error() in the DB driver that was instantiating new Language and Exception objects, and not using the error heading.
    • +
    • Fixed a bug (#4413) where a URI containing slashes only e.g. 'http://example.com/index.php?//' would result in PHP errors
    • +
    • Fixed an array to string conversion error in the Validation library (#4425)
    • +
    • Fixed bug (#4451, #4299, #4339) where failed transactions will not rollback when debug mode is enabled.
    • +
    • Fixed a bug (#4506) with overlay_watermark() in the Image library preventing support for PNG-24s with alpha transparency
    • +
    • Fixed assorted user guide typos (#3453, #4364, #4379, #4399, #4408, #4412, #4448, #4488).
    • +
    + +

    Version 1.6.1

    +

    Release Date: February 12, 2008
    + SVN Revision: 984

    +
      +
    • Active Record + +
    • +
    • Database drivers +
        +
      • Added support for setting client character set and collation for MySQLi.
      • +
      +
    • +
    • Core Changes +
        +
      • Modified xss_clean() to be more intelligent with its handling of URL encoded strings.
      • +
      • Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals.
      • +
      • Added a 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 characters to the end of the default expression.
      • +
      • Modified method calling to controllers to show a 404 when a private or protected method is accessed via a URL.
      • +
      • Modified framework initiated 404s to log the controller and method for invalid requests.
      • +
      +
    • +
    • Helpers +
        +
      • Modified get_filenames() in the File Helper to return FALSE if the $source_dir is not readable.
      • +
      +
    • +
    + + +

    Bugfixes for 1.6.1

    +
      +
    • Deprecated is_numeric as a validation rule. Use of numeric and integer are preferred.
    • +
    • Fixed bug (#3379) in DBForge with SQLite for table creation.
    • +
    • Made Active Record fully database prefix aware (#3384).
    • +
    • Fixed a bug where DBForge was outputting invalid SQL in Postgres by adding brackets around the tables in FROM.
    • +
    • Changed the behaviour of Active Record's update() to make the WHERE clause optional (#3395).
    • +
    • Fixed a bug (#3396) where certain POST variables would cause a PHP warning.
    • +
    • Fixed a bug in query binding (#3402).
    • +
    • Changed order of SQL keywords in the Profiler $highlight array so OR would not be highlighted before ORDER BY.
    • +
    • Fixed a bug (#3404) where the MySQLi driver was testing if $this->conn_id was a resource instead of an object.
    • +
    • Fixed a bug (#3419) connecting to a database via a DSN string.
    • +
    • Fixed a bug (#3445) where the routed segment array was not re-indexed to begin with 1 when the default controller is used.
    • +
    • Fixed assorted user guide typos.
    • +
    + + + +

    Version 1.6.0

    +

    Release Date: January 30, 2008

    +
      +
    • DBForge +
        +
      • Added DBForge to the database tools.
      • +
      • Moved create_database() and drop_database() into DBForge.
      • +
      • Added add_field(), add_key(), create_table(), drop_table(), add_column(), drop_column(), modify_column() into DBForge.
      • +
      +
    • + +
    • Active Record +
        +
      • Added protect_identifiers() in Active Record.
      • +
      • All AR queries are backticked if appropriate to the database.
      • +
      • Added where_in(), or_where_in(), where_not_in(), or_where_not_in(), not_like() and or_not_like() to Active Record.
      • +
      • Added support for limit() into update() and delete() statements in Active Record.
      • +
      • Added empty_table() and truncate_table() to Active Record.
      • +
      • Added the ability to pass an array of tables to the delete() statement in Active Record.
      • +
      • Added count_all_results() function to Active Record.
      • +
      • Added select_max(), select_min(), select_avg() and select_sum() to Active Record.
      • +
      • Added the ability to use aliases with joins in Active Record.
      • +
      • Added a third parameter to Active Record's like() clause to control where the wildcard goes.
      • +
      • Added a third parameter to set() in Active Record that withholds escaping data.
      • +
      • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
      • +
      +
    • + +
    • Other Database Related +
        +
      • MySQL driver now requires MySQL 4.1+
      • +
      • Added $this->DB->save_queries variable to DB driver, enabling queries to get saved or not. Previously they were always saved.
      • +
      • Added $this->db->dbprefix() to manually add database prefixes.
      • +
      • Added 'random' as an order_by() option , and removed "rand()" as a listed option as it was MySQL only.
      • +
      • Added a check for NULL fields in the MySQL database backup utility.
      • +
      • Added "constrain_by_prefix" parameter to db->list_table() function. If set to TRUE it will limit the result to only table names with the current prefix.
      • +
      • Deprecated from Active Record; getwhere() for get_where(); groupby() for group_by(); havingor() for having_or(); orderby() for order_by; orwhere() for or_where(); and orlike() for or_like().
      • +
      • Modified csv_from_result() to output CSV data more in the spirit of basic rules of RFC 4180.
      • +
      • Added 'char_set' and 'dbcollat' database configuration settings, to explicitly set the client communication properly.
      • +
      • Removed 'active_r' configuration setting and replaced with a global $active_record setting, which is more + in harmony with the global nature of the behavior (#1834).
      • +
      +
    • + +
    • Core changes +
        +
      • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
      • +
      • Added the ability to auto-load Models.
      • +
      • Reorganized the URI and Routes classes for better clarity.
      • +
      • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
      • +
      • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
      • +
      • Deprecated Scaffolding.
      • +
      • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
      • +
      +
    • + +
    • Libraries +
        +
      • Changed the load protocol of Models to allow for extension.
      • +
      • Strengthened the Encryption library to help protect against man in the middle attacks when MCRYPT_MODE_CBC mode is used.
      • +
      • Added Flashdata variables, session_id regeneration and configurable session update times to the Session class.
      • +
      • Removed 'last_visit' from the Session class.
      • +
      • Added a language entry for valid_ip validation error.
      • +
      • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
      • +
      • Added an "integer" rule into the Validation library.
      • +
      • Added valid_base64() to the Validation library.
      • +
      • Documented clear() in the Image Processing library.
      • +
      • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
      • +
      • Modified Upload class $_FILES error messages to be more precise.
      • +
      • Moved the safe mode and auth checks for the Email library into the constructor.
      • +
      • Modified variable names in _ci_load() method of Loader class to avoid conflicts with view variables.
      • +
      • Added a few additional mime type variations for CSV.
      • +
      • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
      • +
      +
    • + +
    • Helpers & Plugins +
        +
      • Added link_tag() to the HTML helper.
      • +
      • Added img() to the HTML helper.
      • +
      • Added ability to "extend" Helpers.
      • +
      • Added an email helper into core helpers.
      • +
      • Added strip_quotes() function to string helper.
      • +
      • Added reduce_multiples() function to string helper.
      • +
      • Added quotes_to_entities() function to string helper.
      • +
      • Added form_fieldset(), form_fieldset_close(), form_label(), and form_reset() function to form helper.
      • +
      • Added support for external urls in form_open().
      • +
      • Removed support for db_backup in MySQLi due to incompatible functions.
      • +
      • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
      • +
      +
    • + + +
    • Documentation Changes +
        +
      • Added Writing Documentation section for the community to use in writing their own documentation.
      • +
      • Added titles to all user manual pages.
      • +
      • Added attributes into <html> of userguide for valid html.
      • +
      • Added Zip Encoding Class to the table of contents of the userguide.
      • +
      • Moved part of the userguide menu javascript to an external file.
      • +
      • Documented distinct() in Active Record.
      • +
      • Documented the timezones() function in the Date Helper.
      • +
      • Documented unset_userdata in the Session class.
      • +
      • Documented 2 config options to the Database configuration page.
      • +
      +
    • +
    + +

    Bug fixes for Version 1.6.0

    + +
      +
    • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
    • +
    • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
    • +
    • Fixed a bug (#1872) where word_limiter() was not retaining whitespace.
    • +
    • Fixed a bug (#1890) in csv_from_result() where content that included the delimiter would break the file.
    • +
    • Fixed a bug (#2542)in the clean_email() method of the Email class to allow for non-numeric / non-sequential array keys.
    • +
    • Fixed a bug (#2545) in _html_entity_decode_callback() when 'global_xss_filtering' is enabled.
    • +
    • Fixed a bug (#2668) in the parser class where numeric data was ignored.
    • +
    • Fixed a bug (#2679) where the "previous" pagination link would get drawn on the first page.
    • +
    • Fixed a bug (#2702) in _object_to_array that broke some types of inserts and updates.
    • +
    • Fixed a bug (#2732) in the SQLite driver for PHP 4.
    • +
    • Fixed a bug (#2754) in Pagination to scan for non-positive num_links.
    • +
    • Fixed a bug (#2762) in the Session library where user agent matching would fail on user agents ending with a space.
    • +
    • Fixed a bug (#2784) $field_names[] vs $Ffield_names[] in postgres and sqlite drivers.
    • +
    • Fixed a bug (#2810) in the typography helper causing extraneous paragraph tags when string contains tags.
    • +
    • Fixed a bug (#2849) where arguments passed to a subfolder controller method would be incorrectly shifted, dropping the 3rd segment value.
    • +
    • Fixed a bug (#2858) which referenced a wrong variable in the Image class.
    • +
    • Fixed a bug (#2875)when loading plugin files as _plugin. and not _pi.
    • +
    • Fixed a bug (#2912) in get_filenames() in the File Helper where the array wasn't cleared after each call.
    • +
    • Fixed a bug (#2974) in highlight_phrase() that caused an error with slashes.
    • +
    • Fixed a bug (#3003) in the Encryption Library to support modes other than MCRYPT_MODE_ECB
    • +
    • Fixed a bug (#3015) in the User Agent library where more then 2 languages where not reported with languages().
    • +
    • Fixed a bug (#3017) in the Email library where some timezones were calculated incorrectly.
    • +
    • Fixed a bug (#3024) in which master_dim wasn't getting reset by clear() in the Image library.
    • +
    • Fixed a bug (#3156) in Text Helper highlight_code() causing PHP tags to be handled incorrectly.
    • +
    • Fixed a bug (#3166) that prevented num_rows from working in Oracle.
    • +
    • Fixed a bug (#3175) preventing certain libraries from working properly when autoloaded in PHP 4.
    • +
    • Fixed a bug (#3267) in the Typography Helper where unordered list was listed "un.
    • +
    • Fixed a bug (#3268) where the Router could leave '/' as the path.
    • +
    • Fixed a bug (#3279) where the Email class was sending the wrong Content-Transfer-Encoding for some character sets.
    • +
    • Fixed a bug (#3284) where the rsegment array would not be set properly if the requested URI contained more segments than the routed URI.
    • +
    • Removed extraneous load of $CFG in _display_cache() of the Output class (#3285).
    • +
    • Removed an extraneous call to loading models (#3286).
    • +
    • Fixed a bug (#3310) with sanitization of globals in the Input class that could unset CI's global variables.
    • +
    • Fixed a bug (#3314) which would cause the top level path to be deleted in delete_files() of the File helper.
    • +
    • Fixed a bug (#3328) where the smiley helper might return an undefined variable.
    • +
    • Fixed a bug (#3330) in the FTP class where a comparison wasn't getting made.
    • +
    • Removed an unused parameter from Profiler (#3332).
    • +
    • Fixed a bug in database driver where num_rows property wasn't getting updated.
    • +
    • Fixed a bug in the upload library when allowed_files wasn't defined.
    • +
    • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
    • +
    • Fixed a bug in Validation where valid_ip() wasn't called properly.
    • +
    • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
    • +
    • Fixed a bug in captcha calling an invalid PHP function.
    • +
    • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
    • +
    • Fixed a bug that was making validation callbacks required even when not set as such.
    • +
    • Fixed a bug in the XML-RPC library so if a type is specified, a more intelligent decision is made as to the default type.
    • +
    • Fixed an example of comma-separated emails in the email library documentation.
    • +
    • Fixed an example in the Calendar library for Showing Next/Previous Month Links.
    • +
    • Fixed a typo in the database language file.
    • +
    • Fixed a typo in the image language file "suppor" to "support".
    • +
    • Fixed an example for XML RPC.
    • +
    • Fixed an example of accept_charset() in the User Agent Library.
    • +
    • Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor.
    • +
    • Fixed a typo in the String Helper (uniquid changed to uniqid).
    • +
    • Fixed typos in the email Language class (email_attachment_unredable, email_filed_smtp_login), and FTP Class (ftp_unable_to_remame).
    • +
    • Added a stripslashes() into the Upload Library.
    • +
    • Fixed a series of grammatical and spelling errors in the language files.
    • +
    • Fixed assorted user guide typos.
    • +
    +

    Version 1.5.4

    +

    Release Date: July 12, 2007

    +
      +
    • Added custom Language files to the autoload options.
    • +
    • Added stripslashes() to the _clean_input_data() function in the Input class when magic quotes is on so that data will always be un-slashed within the framework.
    • +
    • Added array to string into the profiler.
    • +
    • Added some additional mime types in application/config/mimes.php.
    • +
    • Added filename_security() method to Input library.
    • +
    • Added some additional arguments to the Inflection helper singular() to compensate for words ending in "s". Also added a force parameter to pluralize().
    • +
    • Added $config['charset'] to the config file. Default value is 'UTF-8', used in some string handling functions.
    • +
    • Fixed MSSQL insert_id().
    • +
    • Fixed a logic error in the DB trans_status() function. It was incorrectly returning TRUE on failure and FALSE on success.
    • +
    • Fixed a bug that was allowing multiple load attempts on extended classes.
    • +
    • Fixed a bug in the bootstrap file that was incorrectly attempting to discern the full server path even when it was explicity set by the user.
    • +
    • Fixed a bug in the escape_str() function in the MySQL driver.
    • +
    • Fixed a typo in the Calendar library
    • +
    • Fixed a typo in rpcs.php library
    • +
    • Fixed a bug in the Zip library, providing PC Zip file compatibility with Mac OS X
    • +
    • Fixed a bug in router that was ignoring the scaffolding route for optimization
    • +
    • Fixed an IP validation bug.
    • +
    • Fixed a bug in display of POST keys in the Profiler output
    • +
    • Fixed a bug in display of queries with characters that would be interpreted as HTML in the Profiler output
    • +
    • Fixed a bug in display of Email class print debugger with characters that would be interpreted as HTML in the debugging output
    • +
    • Fixed a bug in the Content-Transfer-Encoding of HTML emails with the quoted-printable MIME type
    • +
    • Fixed a bug where one could unset certain PHP superglobals by setting them via GET or POST data
    • +
    • Fixed an undefined function error in the insert_id() function of the PostgreSQL driver
    • +
    • Fixed various doc typos.
    • +
    • Documented two functions from the String helper that were missing from the user guide: trim_slashes() and reduce_double_slashes().
    • +
    • Docs now validate to XHTML 1 transitional
    • +
    • Updated the XSS Filtering to take into account the IE expression() ability and improved certain deletions to prevent possible exploits
    • +
    • Modified the Router so that when Query Strings are Enabled, the controller trigger and function trigger values are sanitized for filename include security.
    • +
    • Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs
    • +
    • Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.
    • +
    • Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied
    • +
    • Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'
    • +
    • Deprecated the use if is_numeric() in various places since it allows periods. Due to compatibility problems with ctype_digit(), making it unreliable in some installations, the following regular expression was used instead: preg_match("/[^0-9]/", $n)
    • +
    • Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity.
    • +
    +

    Version 1.5.3

    +

    Release Date: April 15, 2007

    +
      +
    • Added array to string into the profiler
    • +
    • Code Igniter references updated to CodeIgniter
    • +
    • pMachine references updated to EllisLab
    • +
    • Fixed a bug in the repeater function of string helper.
    • +
    • Fixed a bug in ODBC driver
    • +
    • Fixed a bug in result_array() that was returning an empty array when no result is produced.
    • +
    • Fixed a bug in the redirect function of the url helper.
    • +
    • Fixed an undefined variable in Loader
    • +
    • Fixed a version bug in the Postgres driver
    • +
    • Fixed a bug in the textarea function of the form helper for use with strings
    • +
    • Fixed doc typos.
    • +
    +

    Version 1.5.2

    +

    Release Date: February 13, 2007

    +
      +
    • Added subversion information to the downloads page.
    • +
    • Added support for captions in the Table Library
    • +
    • Fixed a bug in the download_helper that was causing Internet Explorer to load rather than download
    • +
    • Fixed a bug in the Active Record Join function that was not taking table prefixes into consideration.
    • +
    • Removed unescaped variables in error messages of Input and Router classes
    • +
    • Fixed a bug in the Loader that was causing errors on Libraries loaded twice. A debug message is now silently made in the log.
    • +
    • Fixed a bug in the form helper that gave textarea a value attribute
    • +
    • Fixed a bug in the Image Library that was ignoring resizing the same size image
    • +
    • Fixed some doc typos.
    • +
    + + +

    Version 1.5.1

    +

    Release Date: November 23, 2006

    +
      +
    • Added support for submitting arrays of libraries in the $this->load->library function.
    • +
    • Added support for naming custom library files in lower or uppercase.
    • +
    • Fixed a bug related to output buffering.
    • +
    • Fixed a bug in the active record class that was not resetting query data after a completed query.
    • +
    • Fixed a bug that was suppressing errors in controllers.
    • +
    • Fixed a problem that can cause a loop to occur when the config file is missing.
    • +
    • Fixed a bug that occurred when multiple models were loaded with the third parameter set to TRUE.
    • +
    • Fixed an oversight that was not unsetting globals properly in the input sanitize function.
    • +
    • Fixed some bugs in the Oracle DB driver.
    • +
    • Fixed an incorrectly named variable in the MySQLi result driver.
    • +
    • Fixed some doc typos.
    • +
    +

    Version 1.5.0.1

    +

    Release Date: October 31, 2006

    +
      +
    • Fixed a problem in which duplicate attempts to load helpers and classes were not being stopped.
    • +
    • Fixed a bug in the word_wrap() helper function.
    • +
    • Fixed an invalid color Hex number in the Profiler class.
    • +
    • Fixed a corrupted image in the user guide.
    • +
    + + + +

    Version 1.5.0

    +

    Release Date: October 30, 2006

    + +
      +
    • Added DB utility class, permitting DB backups, CVS or XML files from DB results, and various other functions.
    • +
    • Added Database Caching Class.
    • +
    • Added transaction support to the database classes.
    • +
    • Added Profiler Class which generates a report of Benchmark execution times, queries, and POST data at the bottom of your pages.
    • +
    • Added User Agent Library which allows browsers, robots, and mobile devises to be identified.
    • +
    • Added HTML Table Class , enabling tables to be generated from arrays or database results.
    • +
    • Added Zip Encoding Library.
    • +
    • Added FTP Library.
    • +
    • Added the ability to extend libraries and extend core classes, in addition to being able to replace them.
    • +
    • Added support for storing models within sub-folders.
    • +
    • Added Download Helper.
    • +
    • Added simple_query() function to the database classes
    • +
    • Added standard_date() function to the Date Helper.
    • +
    • Added $query->free_result() to database class.
    • +
    • Added $query->list_fields() function to database class
    • +
    • Added $this->db->platform() function
    • +
    • Added new File Helper: get_filenames()
    • +
    • Added new helper: Smiley Helper
    • +
    • Added support for <ul> and <ol> lists in the HTML Helper
    • +
    • Added the ability to rewrite short tags on-the-fly, converting them to standard PHP statements, for those servers that do not support short tags. This allows the cleaner syntax to be used regardless of whether it's supported by the server.
    • +
    • Added the ability to rename or relocate the "application" folder.
    • +
    • Added more thorough initialization in the upload class so that all class variables are reset.
    • +
    • Added "is_numeric" to validation, which uses the native PHP is_numeric function.
    • +
    • Improved the URI handler to make it more reliable when the $config['uri_protocol'] item is set to AUTO.
    • +
    • Moved most of the functions in the Controller class into the Loader class, allowing fewer reserved function names for controllers when running under PHP 5.
    • +
    • Updated the DB Result class to return an empty array when $query->result() doesn't produce a result.
    • +
    • Updated the input->cookie() and input->post() functions in Input Class to permit arrays contained cookies that are arrays to be run through the XSS filter.
    • +
    • Documented three functions from the Validation class that were missing from the user guide: set_select(), set_radio(), and set_checkbox().
    • +
    • Fixed a bug in the Email class related to SMTP Helo data.
    • +
    • Fixed a bug in the word wrapping helper and function in the email class.
    • +
    • Fixed a bug in the validation class.
    • +
    • Fixed a bug in the typography helper that was incorrectly wrapping block level elements in paragraph tags.
    • +
    • Fixed a problem in the form_prep() function that was double encoding entities.
    • +
    • Fixed a bug that affects some versions of PHP when output buffering is nested.
    • +
    • Fixed a bug that caused CI to stop working when the PHP magic __get() or __set() functions were used within models or controllers.
    • +
    • Fixed a pagination bug that was permitting negative values in the URL.
    • +
    • Fixed an oversight in which the Loader class was not allowed to be exteneded.
    • +
    • Changed _get_config() to get_config() since the function is not a private one.
    • +
    • Deprecated "init" folder. Initialization happens automatically now. Please see documentation.
    • +
    • Deprecated $this->db->field_names() USE $this->db->list_fields()
    • +
    • Deprecated the $config['log_errors'] item from the config.php file. Instead, $config['log_threshold'] can be set to "0" to turn it off.
    • +
    + + + + +

    Version 1.4.1

    +

    Release Date: September 21, 2006

    + +
      +
    • Added a new feature that passes URI segments directly to your function calls as parameters. See the Controllers page for more info.
    • +
    • Added support for a function named _output(), which when used in your controllers will received the final rendered output from the output class. More info in the Controllers page.
    • +
    • Added several new functions in the URI Class to let you retrieve and manipulate URI segments that have been re-routed using the URI Routing feature. Previously, the URI class did not permit you to access any re-routed URI segments, but now it does.
    • +
    • Added $this->output->set_header() function, which allows you to set server headers.
    • +
    • Updated plugins, helpers, and language classes to allow your application folder to contain its own plugins, helpers, and language folders. Previously they were always treated as global for your entire installation. If your application folder contains any of these resources they will be used instead the global ones.
    • +
    • Added Inflector helper.
    • +
    • Added element() function in the array helper.
    • +
    • Added RAND() to active record orderby() function.
    • +
    • Added delete_cookie() and get_cookie() to Cookie helper, even though the input class has a cookie fetching function.
    • +
    • Added Oracle database driver (still undergoing testing so it might have some bugs).
    • +
    • Added the ability to combine pseudo-variables and php variables in the template parser class.
    • +
    • Added output compression option to the config file.
    • +
    • Removed the is_numeric test from the db->escape() function.
    • +
    • Fixed a MySQLi bug that was causing error messages not to contain proper error data.
    • +
    • Fixed a bug in the email class which was causing it to ignore explicitly set alternative headers.
    • +
    • Fixed a bug that was causing a PHP error when the Exceptions class was called within the get_config() function since it was causing problems.
    • +
    • Fixed an oversight in the cookie helper in which the config file cookie settings were not being honored.
    • +
    • Fixed an oversight in the upload class. An item mentioned in the 1.4 changelog was missing.
    • +
    • Added some code to allow email attachments to be reset when sending batches of email.
    • +
    • Deprecated the application/scripts folder. It will continue to work for legacy users, but it is recommended that you create your own +libraries or models instead. It was originally added before CI had user libraries or models, but it's not needed anymore.
    • +
    • Deprecated the $autoload['core'] item from the autoload.php file. Instead, please now use: $autoload['libraries']
    • +
    • Deprecated the following database functions: $this->db->smart_escape_str() and $this->db->fields().
    • +
    + + + +

    Version 1.4.0

    +

    Release Date: September 17, 2006

    + +
      +
    • Added Hooks feature, enabling you to tap into and modify the inner workings of the framework without hacking the core files.
    • +
    • Added the ability to organize controller files into sub-folders. Kudos to Marco for suggesting this (and the next two) feature.
    • +
    • Added regular expressions support for routing rules.
    • +
    • Added the ability to remap function calls within your controllers.
    • +
    • Added the ability to replace core system classes with your own classes.
    • +
    • Added support for % character in URL.
    • +
    • Added the ability to supply full URLs using the anchor() helper function.
    • +
    • Added mode parameter to file_write() helper.
    • +
    • Added support for changing the port number in the Postgres driver.
    • +
    • Moved the list of "allowed URI characters" out of the Router class and into the config file.
    • +
    • Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.
    • +
    • Updated the Upload class to allow the upload field name to be set when calling do_upload().
    • +
    • Updated the Config Library to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).
    • +
    • Updated the URI Protocol code to allow more options so that URLs will work more reliably in different environments.
    • +
    • Updated the form_open() helper to allow the GET method to be used.
    • +
    • Updated the MySQLi execute() function with some code to help prevent lost connection errors.
    • +
    • Updated the SQLite Driver to check for object support before attempting to return results as objects. If unsupported it returns an array.
    • +
    • Updated the Models loader function to allow multiple loads of the same model.
    • +
    • Updated the MS SQL driver so that single quotes are escaped.
    • +
    • Updated the Postgres and ODBC drivers for better compatibility.
    • +
    • Removed a strtolower() call that was changing URL segments to lower case.
    • +
    • Removed some references that were interfering with PHP 4.4.1 compatibility.
    • +
    • Removed backticks from Postgres class since these are not needed.
    • +
    • Renamed display() to _display() in the Output class to make it clear that it's a private function.
    • +
    • Deprecated the hash() function due to a naming conflict with a native PHP function with the same name. Please use dohash() instead.
    • +
    • Fixed an bug that was preventing the input class from unsetting GET variables.
    • +
    • Fixed a router bug that was making it too greedy when matching end segments.
    • +
    • Fixed a bug that was preventing multiple discrete database calls.
    • +
    • Fixed a bug in which loading a language file was producing a "file contains no data" message.
    • +
    • Fixed a session bug caused by the XSS Filtering feature inadvertently changing the case of certain words.
    • +
    • Fixed some missing prefixes when using the database prefix feature.
    • +
    • Fixed a typo in the Calendar class (cal_november).
    • +
    • Fixed a bug in the form_checkbox() helper.
    • +
    • Fixed a bug that was allowing the second segment of the URI to be identical to the class name.
    • +
    • Fixed an evaluation bug in the database initialization function.
    • +
    • Fixed a minor bug in one of the error messages in the language class.
    • +
    • Fixed a bug in the date helper timespan function.
    • +
    • Fixed an undefined variable in the DB Driver class.
    • +
    • Fixed a bug in which dollar signs used as binding replacement values in the DB class would be treated as RegEx back-references.
    • +
    • Fixed a bug in the set_hash() function which was preventing MD5 from being used.
    • +
    • Fixed a couple bugs in the Unit Testing class.
    • +
    • Fixed an incorrectly named variable in the Validation class.
    • +
    • Fixed an incorrectly named variable in the URI class.
    • +
    • Fixed a bug in the config class that was preventing the base URL from being called properly.
    • +
    • Fixed a bug in the validation class that was not permitting callbacks if the form field was empty.
    • +
    • Fixed a problem that was preventing scaffolding from working properly with MySQLi.
    • +
    • Fixed some MS SQL bugs.
    • +
    • Fixed some doc typos.
    • +
    + + + +

    Version 1.3.3

    +

    Release Date: June 1, 2006

    + +
      + +
    • Models do not connect automatically to the database as of this version. More info here.
    • +
    • Updated the Sessions class to utilize the active record class when running session related queries. Previously the queries assumed MySQL syntax.
    • +
    • Updated alternator() function to re-initialize when called with no arguments, allowing multiple calls.
    • +
    • Fixed a bug in the active record "having" function.
    • +
    • Fixed a problem in the validation class which was making checkboxes be ignored when required.
    • +
    • Fixed a bug in the word_limiter() helper function. It was cutting off the fist word.
    • +
    • Fixed a bug in the xss_clean function due to a PHP bug that affects some versions of html_entity_decode.
    • +
    • Fixed a validation bug that was preventing rules from being set twice in one controller.
    • +
    • Fixed a calendar bug that was not letting it use dynamically loaded languages.
    • +
    • Fixed a bug in the active record class when using WHERE clauses with LIKE
    • +
    • Fixed a bug in the hash() security helper.
    • +
    • Fixed some typos.
    • +
    + + + + +

    Version 1.3.2

    +

    Release Date: April 17, 2006

    + +
      +
    • Changed the behavior of the validation class such that if a "required" rule is NOT explicitly stated for a field then all other tests get ignored.
    • +
    • Fixed a bug in the Controller class that was causing it to look in the local "init" folder instead of the main system one.
    • +
    • Fixed a bug in the init_pagination file. The $config item was not being set correctly.
    • +
    • Fixed a bug in the auto typography helper that was causing inconsistent behavior.
    • +
    • Fixed a couple bugs in the Model class.
    • +
    • Fixed some documentation typos and errata.
    • +
    + + + +

    Version 1.3.1

    +

    Release Date: April 11, 2006

    + +
      +
    • Added a Unit Testing Library.
    • +
    • Added the ability to pass objects to the insert() and update() database functions. +This feature enables you to (among other things) use your Model class variables to run queries with. See the Models page for details.
    • +
    • Added the ability to pass objects to the view loading function: $this->load->view('my_view', $object);
    • +
    • Added getwhere function to Active Record class.
    • +
    • Added count_all function to Active Record class.
    • +
    • Added language file for scaffolding and fixed a scaffolding bug that occurs when there are no rows in the specified table.
    • +
    • Added $this->db->last_query(), which allows you to view your last query that was run.
    • +
    • Added a new mime type to the upload class for better compatibility.
    • +
    • Changed how cache files are read to prevent PHP errors if the cache file contains an XML tag, which PHP wants to interpret as a short tag.
    • +
    • Fixed a bug in a couple of the active record functions (where and orderby).
    • +
    • Fixed a bug in the image library when realpath() returns false.
    • +
    • Fixed a bug in the Models that was preventing libraries from being used within them.
    • +
    • Fixed a bug in the "exact_length" function of the validation class.
    • +
    • Fixed some typos in the user guide
    • +
    + + +

    Version 1.3

    +

    Release Date: April 3, 2006

    + +
      +
    • Added support for Models.
    • +
    • Redesigned the database libraries to support additional RDBMs (Postgres, MySQLi, etc.).
    • +
    • Redesigned the Active Record class to enable more varied types of queries with simpler syntax, and advanced features like JOINs.
    • +
    • Added a feature to the database class that lets you run custom function calls.
    • +
    • Added support for private functions in your controllers. Any controller function name that starts with an underscore will not be served by a URI request.
    • +
    • Added the ability to pass your own initialization parameters to your custom core libraries when using $this->load->library()
    • +
    • Added support for running standard query string URLs. These can be optionally enabled in your config file.
    • +
    • Added the ability to specify a "suffix", which will be appended to your URLs. For example, you could add .html to your URLs, making them appear static. This feature is enabled in your config file.
    • +
    • Added a new error template for use with native PHP errors.
    • +
    • Added "alternator" function in the string helpers.
    • +
    • Removed slashing from the input class. After much debate we decided to kill this feature.
    • +
    • Change the commenting style in the scripts to the PEAR standard so that IDEs and tools like phpDocumenter can harvest the comments.
    • +
    • Added better class and function name-spacing to avoid collisions with user developed classes. All CodeIgniter classes are now prefixed with CI_ and +all controller methods are prefixed with _ci to avoid controller collisions. A list of reserved function names can be found here.
    • +
    • Redesigned how the "CI" super object is referenced, depending on whether PHP 4 or 5 is being run, since PHP 5 allows a more graceful way to manage objects that utilizes a bit less resources.
    • +
    • Deprecated: $this->db->use_table() has been deprecated. Please read the Active Record page for information.
    • +
    • Deprecated: $this->db->smart_escape_str() has been deprecated. Please use this instead: $this->db->escape()
    • +
    • Fixed a bug in the exception handler which was preventing some PHP errors from showing up.
    • +
    • Fixed a typo in the URI class. $this->total_segment() should be plural: $this->total_segments()
    • +
    • Fixed some typos in the default calendar template
    • +
    • Fixed some typos in the user guide
    • +
    + + + + + + + + +

    Version 1.2

    +

    Release Date: March 21, 2006

    + +
      +
    • Redesigned some internal aspects of the framework to resolve scoping problems that surfaced during the beta tests. The problem was most notable when instantiating classes in your constructors, particularly if those classes in turn did work in their constructors.
    • +
    • Added a global function named get_instance() allowing the main CodeIgniter object to be accessible throughout your own classes.
    • +
    • Added new File Helper: delete_files()
    • +
    • Added new URL Helpers: base_url(), index_page()
    • +
    • Added the ability to create your own core libraries and store them in your local application directory.
    • +
    • Added an overwrite option to the Upload class, enabling files to be overwritten rather than having the file name appended.
    • +
    • Added Javascript Calendar plugin.
    • +
    • Added search feature to user guide. Note: This is done using Google, which at the time of this writing has not crawled all the pages of the docs.
    • +
    • Updated the parser class so that it allows tag pars within other tag pairs.
    • +
    • Fixed a bug in the DB "where" function.
    • +
    • Fixed a bug that was preventing custom config files to be auto-loaded.
    • +
    • Fixed a bug in the mysql class bind feature that prevented question marks in the replacement data.
    • +
    • Fixed some bugs in the xss_clean function
    • +
    + + + + + +

    Version Beta 1.1

    +

    Release Date: March 10, 2006

    + +
      +
    • Added a Calendaring class.
    • +
    • Added support for running multiple applications that share a common CodeIgniter backend.
    • +
    • Moved the "uri protocol" variable from the index.php file into the config.php file
    • +
    • Fixed a problem that was preventing certain function calls from working within constructors.
    • +
    • Fixed a problem that was preventing the $this->load->library function from working in constructors.
    • +
    • Fixed a bug that occurred when the session class was loaded using the auto-load routine.
    • +
    • Fixed a bug that can happen with PHP versions that do not support the E_STRICT constant
    • +
    • Fixed a data type error in the form_radio function (form helper)
    • +
    • Fixed a bug that was preventing the xss_clean function from being called from the validation class.
    • +
    • Fixed the cookie related config names, which were incorrectly specified as $conf rather than $config
    • +
    • Fixed a pagination problem in the scaffolding.
    • +
    • Fixed a bug in the mysql class "where" function.
    • +
    • Fixed a regex problem in some code that trimmed duplicate slashes.
    • +
    • Fixed a bug in the br() function in the HTML helper
    • +
    • Fixed a syntax mistake in the form_dropdown function in the Form Helper.
    • +
    • Removed the "style" attributes form the form helpers.
    • +
    • Updated the documentation. Added "next/previous" links to each page and fixed various typos.
    • +
    + +

    Version Beta 1.0

    +

    Release Date: February 28, 2006

    +

    First publicly released version.

    + +
    + + + + + + + diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 2a8955c4..871c59a5 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -1,757 +1,757 @@ - - - - - -Active Record : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - -
    - -

    Active Record Class

    - -

    CodeIgniter uses a modified version of the Active Record Database Pattern. -This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. -In some cases only one or two lines of code are necessary to perform a database action. -CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    - -

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax -is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    - -

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

    - - - -

     Selecting Data

    - -

    The following functions allow you to build SQL SELECT statements.

    - -

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    - - -

    $this->db->get();

    - -

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    - -$query = $this->db->get('mytable');
    -
    -// Produces: SELECT * FROM mytable
    - -

    The second and third parameters enable you to set a limit and offset clause:

    - -$query = $this->db->get('mytable', 10, 20);
    -
    -// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    - -

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    - -$query = $this->db->get('mytable');
    -
    -foreach ($query->result() as $row)
    -{
    -    echo $row->title;
    -}
    - -

    Please visit the result functions page for a full discussion regarding result generation.

    - - -

    $this->db->get_where();

    - -

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, -instead of using the db->where() function:

    - -$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); - -

    Please read the about the where function below for more information.

    -

    Note: get_where() was formerly known as getwhere(), which has been deprecated

    - -

    $this->db->select();

    -

    Permits you to write the SELECT portion of your query:

    -

    -$this->db->select('title, content, date');
    -
    -$query = $this->db->get('mytable');
    -
    -// Produces: SELECT title, content, date FROM mytable

    -

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    - -

    $this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.

    -

    $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);
    -$query = $this->db->get('mytable');
    -

    -

    $this->db->select_max();

    -

    Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.

    -

    -$this->db->select_max('age');
    -$query = $this->db->get('members');
    - -// Produces: SELECT MAX(age) as age FROM members
    -
    -$this->db->select_max('age', 'member_age');
    -$query = $this->db->get('members');
    -// Produces: SELECT MAX(age) as member_age FROM members

    - -

    $this->db->select_min();

    -

    Writes a "SELECT MIN(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    -

    -$this->db->select_min('age');
    -$query = $this->db->get('members');
    -// Produces: SELECT MIN(age) as age FROM members

    - -

    $this->db->select_avg();

    -

    Writes a "SELECT AVG(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    -

    -$this->db->select_avg('age');
    -$query = $this->db->get('members');
    -// Produces: SELECT AVG(age) as age FROM members

    - -

    $this->db->select_sum();

    -

    Writes a "SELECT SUM(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    -

    -$this->db->select_sum('age');
    -$query = $this->db->get('members');
    -// Produces: SELECT SUM(age) as age FROM members

    - -

    $this->db->from();

    - -

    Permits you to write the FROM portion of your query:

    - - -$this->db->select('title, content, date');
    -$this->db->from('mytable');
    -
    -$query = $this->db->get();
    -
    -// Produces: SELECT title, content, date FROM mytable
    - -

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method -you prefer.

    - -

    $this->db->join();

    - -

    Permits you to write the JOIN portion of your query:

    - - -$this->db->select('*');
    -$this->db->from('blogs');
    -$this->db->join('comments', 'comments.id = blogs.id');
    -
    -$query = $this->db->get();
    -
    -// Produces:
    -// SELECT * FROM blogs
    -// JOIN comments ON comments.id = blogs.id
    -
    - -

    Multiple function calls can be made if you need several joins in one query.

    - -

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. -Options are: left, right, outer, inner, left outer, and right outer.

    - - -$this->db->join('comments', 'comments.id = blogs.id', 'left');
    -
    -// Produces: LEFT JOIN comments ON comments.id = blogs.id
    - - - - - -

    $this->db->where();

    -

    This function enables you to set WHERE clauses using one of four methods:

    - -

    Note: All values passed to this function are escaped automatically, producing safer queries.

    - -
      -
    1. Simple key/value method: - - $this->db->where('name', $name); -

      // Produces: WHERE name = 'Joe'
      - -

      Notice that the equal sign is added for you.

      - -

      If you use multiple function calls they will be chained together with AND between them:

      - - $this->db->where('name', $name);
      - $this->db->where('title', $title);
      - $this->db->where('status', $status); -

      // WHERE name 'Joe' AND title = 'boss' AND status = 'active'
    2. - -
    3. Custom key/value method: - -

      You can include an operator in the first parameter in order to control the comparison:

      - - $this->db->where('name !=', $name);
      - $this->db->where('id <', $id); -

      // Produces: WHERE name != 'Joe' AND id < 45
    4. -
    5. Associative array method: - - - - $array = array('name' => $name, 'title' => $title, 'status' => $status);

      - - $this->db->where($array); -

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
      - -

      You can include your own operators using this method as well:

      - - - $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      - - $this->db->where($array);
    6. -
    7. Custom string: - -

      You can write your own clauses manually:

      - - - $where = "name='Joe' AND status='boss' OR status='active'";

      - $this->db->where($where);
    8. -
    - - -

    $this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks.

    -

    $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE);
    -

    -

    $this->db->or_where();

    -

    This function is identical to the one above, except that multiple instances are joined by OR:

    - - -$this->db->where('name !=', $name);
    -$this->db->or_where('id >', $id); -
    -
    // Produces: WHERE name != 'Joe' OR id > 50
    - -

    Note: or_where() was formerly known as orwhere(), which has been deprecated.

    - - -

    $this->db->where_in();

    -

    Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate

    -

    - $names = array('Frank', 'Todd', 'James');
    - $this->db->where_in('username', $names);
    - // Produces: WHERE username IN ('Frank', 'Todd', 'James')

    - -

    $this->db->or_where_in();

    -

    Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate

    -

    - $names = array('Frank', 'Todd', 'James');
    - $this->db->or_where_in('username', $names);
    - // Produces: OR username IN ('Frank', 'Todd', 'James')

    - -

    $this->db->where_not_in();

    -

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate

    -

    - $names = array('Frank', 'Todd', 'James');
    - $this->db->where_not_in('username', $names);
    - // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')

    - -

    $this->db->or_where_not_in();

    -

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate

    -

    - $names = array('Frank', 'Todd', 'James');
    - $this->db->or_where_not_in('username', $names);
    - // Produces: OR username NOT IN ('Frank', 'Todd', 'James')

    - -

    $this->db->like();

    -

    This function enables you to generate LIKE clauses, useful for doing searches.

    - -

    Note: All values passed to this function are escaped automatically.

    - - -
      -
    1. Simple key/value method: - - $this->db->like('title', 'match'); -

      // Produces: WHERE title LIKE '%match%'
      - -

      If you use multiple function calls they will be chained together with AND between them:

      - - $this->db->like('title', 'match');
      - $this->db->like('body', 'match'); -

      - // WHERE title LIKE '%match%' AND body LIKE '%match%
      - If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). - $this->db->like('title', 'match', 'before'); -
      - // Produces: WHERE title LIKE '%match'
      -
      - $this->db->like('title', 'match', 'after');
      -// Produces: WHERE title LIKE 'match%'
      -
      - $this->db->like('title', 'match', 'both');
      -// Produces: WHERE title LIKE '%match%'
    2. - -
    3. Associative array method: - - - $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      - - $this->db->like($array); -

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
    4. -
    - - -

    $this->db->or_like();

    -

    This function is identical to the one above, except that multiple instances are joined by OR:

    - - -$this->db->like('title', 'match');
    -$this->db->or_like('body', $match); -
    -
    // WHERE title LIKE '%match%' OR body LIKE '%match%'
    - - - - -

    Note: or_like() was formerly known as orlike(), which has been deprecated.

    -

    $this->db->not_like();

    -

    This function is identical to like(), except that it generates NOT LIKE statements:

    - $this->db->not_like('title', 'match');
    -
    -// WHERE title NOT LIKE '%match%
    -

    $this->db->or_not_like();

    -

    This function is identical to not_like(), except that multiple instances are joined by OR:

    - $this->db->like('title', 'match');
    -$this->db->or_not_like('body', 'match');
    -
    -// WHERE title LIKE '%match% OR body NOT LIKE '%match%'
    -

    $this->db->group_by();

    -

    Permits you to write the GROUP BY portion of your query:

    - -$this->db->group_by("title"); -

    // Produces: GROUP BY title -
    - -

    You can also pass an array of multiple values as well:

    - -$this->db->group_by(array("title", "date")); -
    -
    // Produces: GROUP BY title, date
    - -

    Note: group_by() was formerly known as groupby(), which has been deprecated.

    - -

    $this->db->distinct();
    -

    -

    Adds the "DISTINCT" keyword to a query

    -

    $this->db->distinct();
    - $this->db->get('table');
    -
    - // Produces: SELECT DISTINCT * FROM table

    -

    $this->db->having();

    -

    Permits you to write the HAVING portion of your query. There are 2 possible syntaxe, 1 argument or 2:

    - -$this->db->having('user_id = 45'); -
    -// Produces: HAVING user_id = 45
    -
    -$this->db->having('user_id', 45);
    -// Produces: HAVING user_id = 45
    -
    -
    - -

    You can also pass an array of multiple values as well:

    - - -

    $this->db->having(array('title =' => 'My Title', 'id <' => $id));
    -
    - // Produces: HAVING title = 'My Title', id < 45

    -

    If you are using a database that CodeIgniter escapes queries for, you can prevent escaping content by passing an optional third argument, and setting it to FALSE.

    -

    $this->db->having('user_id', 45);
    -// Produces: HAVING `user_id` = 45 in some databases such as MySQL -
    - $this->db->having('user_id', 45, FALSE);
    -// Produces: HAVING user_id = 45

    -

    $this->db->or_having();

    -

    Identical to having(), only separates multiple clauses with "OR".

    -

    $this->db->order_by();

    -

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc, or random.

    - -$this->db->order_by("title", "desc"); -
    -
    // Produces: ORDER BY title DESC -
    - -

    You can also pass your own string in the first parameter:

    - -$this->db->order_by('title desc, name asc'); -
    -
    // Produces: ORDER BY title DESC, name ASC -
    - -

    Or multiple function calls can be made if you need multiple fields.

    - -

    $this->db->order_by("title", "desc");
    - $this->db->order_by("name", "asc");
    -
    - // Produces: ORDER BY title DESC, name ASC -

    -

    Note: order_by() was formerly known as orderby(), which has been deprecated.

    -

    Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.

    -

    $this->db->limit();

    -

    Lets you limit the number of rows you would like returned by the query:

    - - -$this->db->limit(10);
    -
    -// Produces: LIMIT 10
    - - -

    The second parameter lets you set a result offset.

    - - -$this->db->limit(10, 20);
    -
    -// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    - - -

    $this->db->count_all_results();

    - -

    Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

    -echo $this->db->count_all_results('my_table');
    - -// Produces an integer, like 25
    -
    -$this->db->like('title', 'match');
    -$this->db->from('my_table');
    -echo $this->db->count_all_results();
    -// Produces an integer, like 17
    - -

    $this->db->count_all();

    - -

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    - -echo $this->db->count_all('my_table');
    -
    -// Produces an integer, like 25
    - - - -  -

    Inserting Data

    - -

    $this->db->insert();

    -

    Generates an insert string based on the data you supply, and runs the query. You can either pass an -array or an object to the function. Here is an example using an array:

    - - -$data = array(
    -               'title' => 'My title' ,
    -               'name' => 'My Name' ,
    -               'date' => 'My date'
    -            );
    -
    -$this->db->insert('mytable', $data); -

    -// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
    - -

    The first parameter will contain the table name, the second is an associative array of values.

    - -

    Here is an example using an object:

    - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->insert('mytable', $object); -

    -// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')
    - -

    The first parameter will contain the table name, the second is an associative array of values.

    - -

    Note: All values are escaped automatically producing safer queries.

    - - - - -

    $this->db->set();

    -

    This function enables you to set values for inserts or updates.

    - -

    It can be used instead of passing a data array directly to the insert or update functions:

    - -$this->db->set('name', $name); -
    -$this->db->insert('mytable'); -

    -// Produces: INSERT INTO mytable (name) VALUES ('{$name}')
    - -

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    - -$this->db->set('name', $name);
    -$this->db->set('title', $title);
    -$this->db->set('status', $status);
    -$this->db->insert('mytable');
    -

    set() will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter.

    -

    $this->db->set('field', 'field+1', FALSE);
    - $this->db->insert('mytable');
    - // gives INSERT INTO mytable (field) VALUES (field+1)
    -
    - $this->db->set('field', 'field+1');
    - $this->db->insert('mytable');
    - // gives INSERT INTO mytable (field) VALUES ('field+1')

    -

    You can also pass an associative array to this function:

    - -$array = array('name' => $name, 'title' => $title, 'status' => $status);

    - -$this->db->set($array);
    -$this->db->insert('mytable'); -
    - -

    Or an object:

    - - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->set($object);
    -$this->db->insert('mytable'); -
    - - - -  -

    Updating Data

    - -

    $this->db->update();

    -

    Generates an update string and runs the query based on the data you supply. You can pass an -array or an object to the function. Here is an example using -an array:

    - - -$data = array(
    -               'title' => $title,
    -               'name' => $name,
    -               'date' => $date
    -            );
    -
    -$this->db->where('id', $id);
    -$this->db->update('mytable', $data); -

    -// Produces:
    -// UPDATE mytable
    -// SET title = '{$title}', name = '{$name}', date = '{$date}'
    -// WHERE id = $id
    - -

    Or you can supply an object:

    - - -/*
    -    class Myclass {
    -        var $title = 'My Title';
    -        var $content = 'My Content';
    -        var $date = 'My Date';
    -    }
    -*/
    -
    -$object = new Myclass;
    -
    -$this->db->where('id', $id);
    -$this->db->update('mytable', $object); -
    -
    -// Produces:
    -// UPDATE mytable
    -// SET title = '{$title}', name = '{$name}', date = '{$date}'
    -// WHERE id = $id
    - - - -

    Note: All values are escaped automatically producing safer queries.

    - -

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. -You can optionally pass this information directly into the update function as a string:

    - -$this->db->update('mytable', $data, "id = 4"); - -

    Or as an array:

    - -$this->db->update('mytable', $data, array('id' => $id)); - -

    You may also use the $this->db->set() function described above when performing updates.

    - - -  -

    Deleting Data

    - - - -

    $this->db->delete();

    -

    Generates a delete SQL string and runs the query.

    - - -$this->db->delete('mytable', array('id' => $id)); -

    -// Produces:
    -// DELETE FROM mytable
    -// WHERE id = $id
    - -

    The first parameter is the table name, the second is the where clause. You can also use the where() or or_where() functions instead of passing -the data to the second parameter of the function:

    - -

    $this->db->where('id', $id);
    - $this->db->delete('mytable');
    -
    - // Produces:
    - // DELETE FROM mytable
    - // WHERE id = $id

    -

    An array of table names can be passed into delete() if you would like to delete data from more then 1 table.

    -

    $tables = array('table1', 'table2', 'table3');
    -$this->db->where('id', '5');
    -$this->db->delete($tables);

    -

    If you want to delete all data from a table, you can use the truncate() function, or empty_table().

    -

    $this->db->empty_table();

    -

    Generates a delete SQL string and runs the query. $this->db->empty_table('mytable');
    -
    -// Produces
    -// DELETE FROM mytable

    -

    $this->db->truncate();

    -

    Generates a truncate SQL string and runs the query.

    - $this->db->from('mytable');
    -$this->db->truncate();
    -// or
    -$this->db->truncate('mytable');
    -
    -// Produce:
    -// TRUNCATE mytable
    -
    -

    Note: If the TRUNCATE command isn't available, truncate() will execute as "DELETE FROM table".

    - -

     Method Chaining

    - -

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    - - -$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
    -
    -$query = $this->db->get();
    - -

    Note: Method chaining only works with PHP 5.

    - -

     

    - -

     Active Record Caching

    - -

    While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse at a later point in your script's execution. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.

    - -

    Cached calls are cumulative. If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

    - -

    $this->db->start_cache()

    - -

    This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.

    - -

    $this->db->stop_cache()

    - -

    This function can be called to stop caching.

    - -

    $this->db->flush_cache()

    - -

    This function deletes all items from the Active Record cache.

    - -

    Here's a usage example:

    - -

    $this->db->start_cache();
    -$this->db->select('field1');
    -$this->db->stop_cache();

    -$this->db->get('tablename');
    -
    -//Generates: SELECT `field1` FROM (`tablename`)
    -
    -$this->db->select('field2');
    -$this->db->get('tablename');
    -
    -//Generates: SELECT `field1`, `field2` FROM (`tablename`)
    -
    -$this->db->flush_cache();
    -
    -$this->db->select('field2');
    -$this->db->get('tablename');
    -
    -//Generates: SELECT `field2` FROM (`tablename`)

    - -

    Note: The following statements can be cached: select, from, join, where, like, groupby, having, orderby, set

    -

     

    -
    - - - - - - + + + + + +Active Record : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + +
    + +

    Active Record Class

    + +

    CodeIgniter uses a modified version of the Active Record Database Pattern. +This pattern allows information to be retrieved, inserted, and updated in your database with minimal scripting. +In some cases only one or two lines of code are necessary to perform a database action. +CodeIgniter does not require that each database table be its own class file. It instead provides a more simplified interface.

    + +

    Beyond simplicity, a major benefit to using the Active Record features is that it allows you to create database independent applications, since the query syntax +is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

    + +

    Note: If you intend to write your own queries you can disable this class in your database config file, allowing the core database library and adapter to utilize fewer resources.

    + + + +

     Selecting Data

    + +

    The following functions allow you to build SQL SELECT statements.

    + +

    Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

    + + +

    $this->db->get();

    + +

    Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

    + +$query = $this->db->get('mytable');
    +
    +// Produces: SELECT * FROM mytable
    + +

    The second and third parameters enable you to set a limit and offset clause:

    + +$query = $this->db->get('mytable', 10, 20);
    +
    +// Produces: SELECT * FROM mytable LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    + +

    You'll notice that the above function is assigned to a variable named $query, which can be used to show the results:

    + +$query = $this->db->get('mytable');
    +
    +foreach ($query->result() as $row)
    +{
    +    echo $row->title;
    +}
    + +

    Please visit the result functions page for a full discussion regarding result generation.

    + + +

    $this->db->get_where();

    + +

    Identical to the above function except that it permits you to add a "where" clause in the second parameter, +instead of using the db->where() function:

    + +$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); + +

    Please read the about the where function below for more information.

    +

    Note: get_where() was formerly known as getwhere(), which has been deprecated

    + +

    $this->db->select();

    +

    Permits you to write the SELECT portion of your query:

    +

    +$this->db->select('title, content, date');
    +
    +$query = $this->db->get('mytable');
    +
    +// Produces: SELECT title, content, date FROM mytable

    +

    Note: If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *

    + +

    $this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.

    +

    $this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);
    +$query = $this->db->get('mytable');
    +

    +

    $this->db->select_max();

    +

    Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_max('age');
    +$query = $this->db->get('members');
    + +// Produces: SELECT MAX(age) as age FROM members
    +
    +$this->db->select_max('age', 'member_age');
    +$query = $this->db->get('members');
    +// Produces: SELECT MAX(age) as member_age FROM members

    + +

    $this->db->select_min();

    +

    Writes a "SELECT MIN(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_min('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT MIN(age) as age FROM members

    + +

    $this->db->select_avg();

    +

    Writes a "SELECT AVG(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_avg('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT AVG(age) as age FROM members

    + +

    $this->db->select_sum();

    +

    Writes a "SELECT SUM(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

    +

    +$this->db->select_sum('age');
    +$query = $this->db->get('members');
    +// Produces: SELECT SUM(age) as age FROM members

    + +

    $this->db->from();

    + +

    Permits you to write the FROM portion of your query:

    + + +$this->db->select('title, content, date');
    +$this->db->from('mytable');
    +
    +$query = $this->db->get();
    +
    +// Produces: SELECT title, content, date FROM mytable
    + +

    Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method +you prefer.

    + +

    $this->db->join();

    + +

    Permits you to write the JOIN portion of your query:

    + + +$this->db->select('*');
    +$this->db->from('blogs');
    +$this->db->join('comments', 'comments.id = blogs.id');
    +
    +$query = $this->db->get();
    +
    +// Produces:
    +// SELECT * FROM blogs
    +// JOIN comments ON comments.id = blogs.id
    +
    + +

    Multiple function calls can be made if you need several joins in one query.

    + +

    If you need something other than a natural JOIN you can specify it via the third parameter of the function. +Options are: left, right, outer, inner, left outer, and right outer.

    + + +$this->db->join('comments', 'comments.id = blogs.id', 'left');
    +
    +// Produces: LEFT JOIN comments ON comments.id = blogs.id
    + + + + + +

    $this->db->where();

    +

    This function enables you to set WHERE clauses using one of four methods:

    + +

    Note: All values passed to this function are escaped automatically, producing safer queries.

    + +
      +
    1. Simple key/value method: + + $this->db->where('name', $name); +

      // Produces: WHERE name = 'Joe'
      + +

      Notice that the equal sign is added for you.

      + +

      If you use multiple function calls they will be chained together with AND between them:

      + + $this->db->where('name', $name);
      + $this->db->where('title', $title);
      + $this->db->where('status', $status); +

      // WHERE name 'Joe' AND title = 'boss' AND status = 'active'
    2. + +
    3. Custom key/value method: + +

      You can include an operator in the first parameter in order to control the comparison:

      + + $this->db->where('name !=', $name);
      + $this->db->where('id <', $id); +

      // Produces: WHERE name != 'Joe' AND id < 45
    4. +
    5. Associative array method: + + + + $array = array('name' => $name, 'title' => $title, 'status' => $status);

      + + $this->db->where($array); +

      // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
      + +

      You can include your own operators using this method as well:

      + + + $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

      + + $this->db->where($array);
    6. +
    7. Custom string: + +

      You can write your own clauses manually:

      + + + $where = "name='Joe' AND status='boss' OR status='active'";

      + $this->db->where($where);
    8. +
    + + +

    $this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks.

    +

    $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE);
    +

    +

    $this->db->or_where();

    +

    This function is identical to the one above, except that multiple instances are joined by OR:

    + + +$this->db->where('name !=', $name);
    +$this->db->or_where('id >', $id); +
    +
    // Produces: WHERE name != 'Joe' OR id > 50
    + +

    Note: or_where() was formerly known as orwhere(), which has been deprecated.

    + + +

    $this->db->where_in();

    +

    Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->where_in('username', $names);
    + // Produces: WHERE username IN ('Frank', 'Todd', 'James')

    + +

    $this->db->or_where_in();

    +

    Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->or_where_in('username', $names);
    + // Produces: OR username IN ('Frank', 'Todd', 'James')

    + +

    $this->db->where_not_in();

    +

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->where_not_in('username', $names);
    + // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')

    + +

    $this->db->or_where_not_in();

    +

    Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate

    +

    + $names = array('Frank', 'Todd', 'James');
    + $this->db->or_where_not_in('username', $names);
    + // Produces: OR username NOT IN ('Frank', 'Todd', 'James')

    + +

    $this->db->like();

    +

    This function enables you to generate LIKE clauses, useful for doing searches.

    + +

    Note: All values passed to this function are escaped automatically.

    + + +
      +
    1. Simple key/value method: + + $this->db->like('title', 'match'); +

      // Produces: WHERE title LIKE '%match%'
      + +

      If you use multiple function calls they will be chained together with AND between them:

      + + $this->db->like('title', 'match');
      + $this->db->like('body', 'match'); +

      + // WHERE title LIKE '%match%' AND body LIKE '%match%
      + If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). + $this->db->like('title', 'match', 'before'); +
      + // Produces: WHERE title LIKE '%match'
      +
      + $this->db->like('title', 'match', 'after');
      +// Produces: WHERE title LIKE 'match%'
      +
      + $this->db->like('title', 'match', 'both');
      +// Produces: WHERE title LIKE '%match%'
    2. + +
    3. Associative array method: + + + $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

      + + $this->db->like($array); +

      // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
    4. +
    + + +

    $this->db->or_like();

    +

    This function is identical to the one above, except that multiple instances are joined by OR:

    + + +$this->db->like('title', 'match');
    +$this->db->or_like('body', $match); +
    +
    // WHERE title LIKE '%match%' OR body LIKE '%match%'
    + + + + +

    Note: or_like() was formerly known as orlike(), which has been deprecated.

    +

    $this->db->not_like();

    +

    This function is identical to like(), except that it generates NOT LIKE statements:

    + $this->db->not_like('title', 'match');
    +
    +// WHERE title NOT LIKE '%match%
    +

    $this->db->or_not_like();

    +

    This function is identical to not_like(), except that multiple instances are joined by OR:

    + $this->db->like('title', 'match');
    +$this->db->or_not_like('body', 'match');
    +
    +// WHERE title LIKE '%match% OR body NOT LIKE '%match%'
    +

    $this->db->group_by();

    +

    Permits you to write the GROUP BY portion of your query:

    + +$this->db->group_by("title"); +

    // Produces: GROUP BY title +
    + +

    You can also pass an array of multiple values as well:

    + +$this->db->group_by(array("title", "date")); +
    +
    // Produces: GROUP BY title, date
    + +

    Note: group_by() was formerly known as groupby(), which has been deprecated.

    + +

    $this->db->distinct();
    +

    +

    Adds the "DISTINCT" keyword to a query

    +

    $this->db->distinct();
    + $this->db->get('table');
    +
    + // Produces: SELECT DISTINCT * FROM table

    +

    $this->db->having();

    +

    Permits you to write the HAVING portion of your query. There are 2 possible syntaxe, 1 argument or 2:

    + +$this->db->having('user_id = 45'); +
    +// Produces: HAVING user_id = 45
    +
    +$this->db->having('user_id', 45);
    +// Produces: HAVING user_id = 45
    +
    +
    + +

    You can also pass an array of multiple values as well:

    + + +

    $this->db->having(array('title =' => 'My Title', 'id <' => $id));
    +
    + // Produces: HAVING title = 'My Title', id < 45

    +

    If you are using a database that CodeIgniter escapes queries for, you can prevent escaping content by passing an optional third argument, and setting it to FALSE.

    +

    $this->db->having('user_id', 45);
    +// Produces: HAVING `user_id` = 45 in some databases such as MySQL +
    + $this->db->having('user_id', 45, FALSE);
    +// Produces: HAVING user_id = 45

    +

    $this->db->or_having();

    +

    Identical to having(), only separates multiple clauses with "OR".

    +

    $this->db->order_by();

    +

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. +The second parameter lets you set the direction of the result. Options are asc or desc, or random.

    + +$this->db->order_by("title", "desc"); +
    +
    // Produces: ORDER BY title DESC +
    + +

    You can also pass your own string in the first parameter:

    + +$this->db->order_by('title desc, name asc'); +
    +
    // Produces: ORDER BY title DESC, name ASC +
    + +

    Or multiple function calls can be made if you need multiple fields.

    + +

    $this->db->order_by("title", "desc");
    + $this->db->order_by("name", "asc");
    +
    + // Produces: ORDER BY title DESC, name ASC +

    +

    Note: order_by() was formerly known as orderby(), which has been deprecated.

    +

    Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.

    +

    $this->db->limit();

    +

    Lets you limit the number of rows you would like returned by the query:

    + + +$this->db->limit(10);
    +
    +// Produces: LIMIT 10
    + + +

    The second parameter lets you set a result offset.

    + + +$this->db->limit(10, 20);
    +
    +// Produces: LIMIT 20, 10 (in MySQL. Other databases have slightly different syntax)
    + + +

    $this->db->count_all_results();

    + +

    Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

    +echo $this->db->count_all_results('my_table');
    + +// Produces an integer, like 25
    +
    +$this->db->like('title', 'match');
    +$this->db->from('my_table');
    +echo $this->db->count_all_results();
    +// Produces an integer, like 17
    + +

    $this->db->count_all();

    + +

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    + +echo $this->db->count_all('my_table');
    +
    +// Produces an integer, like 25
    + + + +  +

    Inserting Data

    + +

    $this->db->insert();

    +

    Generates an insert string based on the data you supply, and runs the query. You can either pass an +array or an object to the function. Here is an example using an array:

    + + +$data = array(
    +               'title' => 'My title' ,
    +               'name' => 'My Name' ,
    +               'date' => 'My date'
    +            );
    +
    +$this->db->insert('mytable', $data); +

    +// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
    + +

    The first parameter will contain the table name, the second is an associative array of values.

    + +

    Here is an example using an object:

    + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->insert('mytable', $object); +

    +// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')
    + +

    The first parameter will contain the table name, the second is an associative array of values.

    + +

    Note: All values are escaped automatically producing safer queries.

    + + + + +

    $this->db->set();

    +

    This function enables you to set values for inserts or updates.

    + +

    It can be used instead of passing a data array directly to the insert or update functions:

    + +$this->db->set('name', $name); +
    +$this->db->insert('mytable'); +

    +// Produces: INSERT INTO mytable (name) VALUES ('{$name}')
    + +

    If you use multiple function called they will be assembled properly based on whether you are doing an insert or an update:

    + +$this->db->set('name', $name);
    +$this->db->set('title', $title);
    +$this->db->set('status', $status);
    +$this->db->insert('mytable');
    +

    set() will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter.

    +

    $this->db->set('field', 'field+1', FALSE);
    + $this->db->insert('mytable');
    + // gives INSERT INTO mytable (field) VALUES (field+1)
    +
    + $this->db->set('field', 'field+1');
    + $this->db->insert('mytable');
    + // gives INSERT INTO mytable (field) VALUES ('field+1')

    +

    You can also pass an associative array to this function:

    + +$array = array('name' => $name, 'title' => $title, 'status' => $status);

    + +$this->db->set($array);
    +$this->db->insert('mytable'); +
    + +

    Or an object:

    + + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->set($object);
    +$this->db->insert('mytable'); +
    + + + +  +

    Updating Data

    + +

    $this->db->update();

    +

    Generates an update string and runs the query based on the data you supply. You can pass an +array or an object to the function. Here is an example using +an array:

    + + +$data = array(
    +               'title' => $title,
    +               'name' => $name,
    +               'date' => $date
    +            );
    +
    +$this->db->where('id', $id);
    +$this->db->update('mytable', $data); +

    +// Produces:
    +// UPDATE mytable
    +// SET title = '{$title}', name = '{$name}', date = '{$date}'
    +// WHERE id = $id
    + +

    Or you can supply an object:

    + + +/*
    +    class Myclass {
    +        var $title = 'My Title';
    +        var $content = 'My Content';
    +        var $date = 'My Date';
    +    }
    +*/
    +
    +$object = new Myclass;
    +
    +$this->db->where('id', $id);
    +$this->db->update('mytable', $object); +
    +
    +// Produces:
    +// UPDATE mytable
    +// SET title = '{$title}', name = '{$name}', date = '{$date}'
    +// WHERE id = $id
    + + + +

    Note: All values are escaped automatically producing safer queries.

    + +

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. +You can optionally pass this information directly into the update function as a string:

    + +$this->db->update('mytable', $data, "id = 4"); + +

    Or as an array:

    + +$this->db->update('mytable', $data, array('id' => $id)); + +

    You may also use the $this->db->set() function described above when performing updates.

    + + +  +

    Deleting Data

    + + + +

    $this->db->delete();

    +

    Generates a delete SQL string and runs the query.

    + + +$this->db->delete('mytable', array('id' => $id)); +

    +// Produces:
    +// DELETE FROM mytable
    +// WHERE id = $id
    + +

    The first parameter is the table name, the second is the where clause. You can also use the where() or or_where() functions instead of passing +the data to the second parameter of the function:

    + +

    $this->db->where('id', $id);
    + $this->db->delete('mytable');
    +
    + // Produces:
    + // DELETE FROM mytable
    + // WHERE id = $id

    +

    An array of table names can be passed into delete() if you would like to delete data from more then 1 table.

    +

    $tables = array('table1', 'table2', 'table3');
    +$this->db->where('id', '5');
    +$this->db->delete($tables);

    +

    If you want to delete all data from a table, you can use the truncate() function, or empty_table().

    +

    $this->db->empty_table();

    +

    Generates a delete SQL string and runs the query. $this->db->empty_table('mytable');
    +
    +// Produces
    +// DELETE FROM mytable

    +

    $this->db->truncate();

    +

    Generates a truncate SQL string and runs the query.

    + $this->db->from('mytable');
    +$this->db->truncate();
    +// or
    +$this->db->truncate('mytable');
    +
    +// Produce:
    +// TRUNCATE mytable
    +
    +

    Note: If the TRUNCATE command isn't available, truncate() will execute as "DELETE FROM table".

    + +

     Method Chaining

    + +

    Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:

    + + +$this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
    +
    +$query = $this->db->get();
    + +

    Note: Method chaining only works with PHP 5.

    + +

     

    + +

     Active Record Caching

    + +

    While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse at a later point in your script's execution. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.

    + +

    Cached calls are cumulative. If you make 2 cached select() calls, and then 2 uncached select() calls, this will result in 4 select() calls. There are three Caching functions available:

    + +

    $this->db->start_cache()

    + +

    This function must be called to begin caching. All Active Record queries of the correct type (see below for supported queries) are stored for later use.

    + +

    $this->db->stop_cache()

    + +

    This function can be called to stop caching.

    + +

    $this->db->flush_cache()

    + +

    This function deletes all items from the Active Record cache.

    + +

    Here's a usage example:

    + +

    $this->db->start_cache();
    +$this->db->select('field1');
    +$this->db->stop_cache();

    +$this->db->get('tablename');
    +
    +//Generates: SELECT `field1` FROM (`tablename`)
    +
    +$this->db->select('field2');
    +$this->db->get('tablename');
    +
    +//Generates: SELECT `field1`, `field2` FROM (`tablename`)
    +
    +$this->db->flush_cache();
    +
    +$this->db->select('field2');
    +$this->db->get('tablename');
    +
    +//Generates: SELECT `field2` FROM (`tablename`)

    + +

    Note: The following statements can be cached: select, from, join, where, like, groupby, having, orderby, set

    +

     

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 9016ffe0..485d7f4c 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -1,220 +1,220 @@ - - - - - -Database Caching Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - -

    Database Caching Class

    - -

    The Database Caching Class permits you to cache your queries as text files for reduced database load.

    - -

    Important:  This class is initialized automatically by the database driver -when caching is enabled. Do NOT load this class manually.

    - -Also note:  Not all query result functions are available when you use caching. Please read this page carefully.

    - -

    Enabling Caching

    - -

    Caching is enabled in three steps:

    - -
      -
    • Create a writable directory on your server where the cache files can be stored.
    • -
    • Set the path to your cache folder in your application/config/database.php file.
    • -
    • Enable the caching feature, either globally by setting the preference in your application/config/database.php file, or manually as described below.
    • -
    - -

    Once enabled, caching will happen automatically whenever a page is loaded that contains database queries.

    - - -

    How Does Caching Work?

    - -

    CodeIgniter's query caching system happens dynamically when your pages are viewed. -When caching is enabled, the first time a web page is loaded, the query result object will -be serialized and stored in a text file on your server. The next time the page is loaded the cache file will be used instead of -accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

    - -

    Only read-type (SELECT) queries can be cached, since these are the only type of queries that produce a result. -Write-type (INSERT, UPDATE, etc.) queries, since they don't generate a result, will not be cached by the system.

    - -

    Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system -permits you clear caches associated with individual pages, or you can delete the entire collection of cache files. -Typically you'll want to use the housekeeping functions described below to delete cache files after certain -events take place, like when you've added new information to your database.

    - -

    Will Caching Improve Your Site's Performance?

    - -

    Getting a performance gain as a result of caching depends on many factors. -If you have a highly optimized database under very little load, you probably won't see a performance boost. -If your database is under heavy use you probably will see an improved response, assuming your file-system is not -overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database -operation to a file-system one.

    - -

    In some clustered server environments, for example, caching may be detrimental since file-system operations are so intense. -On single servers in shared environments, caching will probably be beneficial. Unfortunately there is no -single answer to the question of whether you should cache your database. It really depends on your situation.

    - -

    How are Cache Files Stored?

    - -

    CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into -sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the -first two segments of your URI (the controller class name and function name).

    - -

    For example, let's say you have a controller called blog with a function called comments that -contains three queries. The caching system will create a cache folder -called blog+comments, into which it will write three cache files.

    - -

    If you use dynamic queries that change based on information in your URI (when using pagination, for example), each instance of -the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have -queries.

    - - -

    Managing your Cache Files

    - -

    Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog -that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the -controller function that serves up your comments. You'll find two delete functions described below that help you -clear data.

    - - -

    Not All Database Functions Work with Caching

    - -

    Lastly, we need to point out that the result object that is cached is a simplified version of the full result object. For that reason, -some of the query result functions are not available for use.

    - -

    The following functions ARE NOT available when using a cached result object:

    - -
      -
    • num_fields()
    • -
    • field_names()
    • -
    • field_data()
    • -
    • free_result()
    • -
    - -

    Also, the two database resources (result_id and conn_id) are not available when caching, since result resources only -pertain to run-time operations.

    - - -
    - -

    Function Reference

    - - - -

    $this->db->cache_on()  /   $this->db->cache_off()

    - -

    Manually enables/disables caching. This can be useful if you want to -keep certain queries from being cached. Example:

    - - -// Turn caching on
    -$this->db->cache_on();
    -$query = $this->db->query("SELECT * FROM mytable");
    -
    -// Turn caching off for this one query
    -$this->db->cache_off();
    -$query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'");
    -
    -// Turn caching back on
    -$this->db->cache_on();
    -$query = $this->db->query("SELECT * FROM another_table"); -
    - - -

    $this->db->cache_delete()

    - -

    Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.

    - -

    The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing -a page at example.com/index.php/blog/comments, the caching system will put all cache files associated with it in a folder -called blog+comments. To delete those particular cache files you will use:

    - -$this->db->cache_delete('blog', 'comments'); - -

    If you do not use any parameters the current URI will be used when determining what should be cleared.

    - - -

    $this->db->cache_delete_all()

    - -

    Clears all existing cache files. Example:

    - -$this->db->cache_delete_all(); - - - - - - - - - - -
    - - - - - - + + + + + +Database Caching Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + +

    Database Caching Class

    + +

    The Database Caching Class permits you to cache your queries as text files for reduced database load.

    + +

    Important:  This class is initialized automatically by the database driver +when caching is enabled. Do NOT load this class manually.

    + +Also note:  Not all query result functions are available when you use caching. Please read this page carefully.

    + +

    Enabling Caching

    + +

    Caching is enabled in three steps:

    + +
      +
    • Create a writable directory on your server where the cache files can be stored.
    • +
    • Set the path to your cache folder in your application/config/database.php file.
    • +
    • Enable the caching feature, either globally by setting the preference in your application/config/database.php file, or manually as described below.
    • +
    + +

    Once enabled, caching will happen automatically whenever a page is loaded that contains database queries.

    + + +

    How Does Caching Work?

    + +

    CodeIgniter's query caching system happens dynamically when your pages are viewed. +When caching is enabled, the first time a web page is loaded, the query result object will +be serialized and stored in a text file on your server. The next time the page is loaded the cache file will be used instead of +accessing your database. Your database usage can effectively be reduced to zero for any pages that have been cached.

    + +

    Only read-type (SELECT) queries can be cached, since these are the only type of queries that produce a result. +Write-type (INSERT, UPDATE, etc.) queries, since they don't generate a result, will not be cached by the system.

    + +

    Cache files DO NOT expire. Any queries that have been cached will remain cached until you delete them. The caching system +permits you clear caches associated with individual pages, or you can delete the entire collection of cache files. +Typically you'll want to use the housekeeping functions described below to delete cache files after certain +events take place, like when you've added new information to your database.

    + +

    Will Caching Improve Your Site's Performance?

    + +

    Getting a performance gain as a result of caching depends on many factors. +If you have a highly optimized database under very little load, you probably won't see a performance boost. +If your database is under heavy use you probably will see an improved response, assuming your file-system is not +overly taxed. Remember that caching simply changes how your information is retrieved, shifting it from being a database +operation to a file-system one.

    + +

    In some clustered server environments, for example, caching may be detrimental since file-system operations are so intense. +On single servers in shared environments, caching will probably be beneficial. Unfortunately there is no +single answer to the question of whether you should cache your database. It really depends on your situation.

    + +

    How are Cache Files Stored?

    + +

    CodeIgniter places the result of EACH query into its own cache file. Sets of cache files are further organized into +sub-folders corresponding to your controller functions. To be precise, the sub-folders are named identically to the +first two segments of your URI (the controller class name and function name).

    + +

    For example, let's say you have a controller called blog with a function called comments that +contains three queries. The caching system will create a cache folder +called blog+comments, into which it will write three cache files.

    + +

    If you use dynamic queries that change based on information in your URI (when using pagination, for example), each instance of +the query will produce its own cache file. It's possible, therefore, to end up with many times more cache files than you have +queries.

    + + +

    Managing your Cache Files

    + +

    Since cache files do not expire, you'll need to build deletion routines into your application. For example, let's say you have a blog +that allows user commenting. Whenever a new comment is submitted you'll want to delete the cache files associated with the +controller function that serves up your comments. You'll find two delete functions described below that help you +clear data.

    + + +

    Not All Database Functions Work with Caching

    + +

    Lastly, we need to point out that the result object that is cached is a simplified version of the full result object. For that reason, +some of the query result functions are not available for use.

    + +

    The following functions ARE NOT available when using a cached result object:

    + +
      +
    • num_fields()
    • +
    • field_names()
    • +
    • field_data()
    • +
    • free_result()
    • +
    + +

    Also, the two database resources (result_id and conn_id) are not available when caching, since result resources only +pertain to run-time operations.

    + + +
    + +

    Function Reference

    + + + +

    $this->db->cache_on()  /   $this->db->cache_off()

    + +

    Manually enables/disables caching. This can be useful if you want to +keep certain queries from being cached. Example:

    + + +// Turn caching on
    +$this->db->cache_on();
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +// Turn caching off for this one query
    +$this->db->cache_off();
    +$query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'");
    +
    +// Turn caching back on
    +$this->db->cache_on();
    +$query = $this->db->query("SELECT * FROM another_table"); +
    + + +

    $this->db->cache_delete()

    + +

    Deletes the cache files associated with a particular page. This is useful if you need to clear caching after you update your database.

    + +

    The caching system saves your cache files to folders that correspond to the URI of the page you are viewing. For example, if you are viewing +a page at example.com/index.php/blog/comments, the caching system will put all cache files associated with it in a folder +called blog+comments. To delete those particular cache files you will use:

    + +$this->db->cache_delete('blog', 'comments'); + +

    If you do not use any parameters the current URI will be used when determining what should be cleared.

    + + +

    $this->db->cache_delete_all()

    + +

    Clears all existing cache files. Example:

    + +$this->db->cache_delete_all(); + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 8ecccce2..ae940afa 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -1,118 +1,118 @@ - - - - - -Custom Function Calls : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - -

    Custom Function Calls

    - -

    $this->db->call_function();

    - -

    This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform independent manner. -For example, lets say you want to call the mysql_get_client_info() function, which is not natively supported -by CodeIgniter. You could do so like this: -

    - -$this->db->call_function('get_client_info'); - -

    You must supply the name of the function, without the mysql_ prefix, in the first parameter. The prefix is added -automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. -Obviously not all function calls are identical between platforms, so there are limits to how useful this function can be in terms of portability.

    - -

    Any parameters needed by the function you are calling will be added to the second parameter.

    - -$this->db->call_function('some_function', $param1, $param2, etc..); - - -

    Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

    - -$this->db->conn_id; - -

    The result ID can be accessed from within your result object, like this:

    - -$query = $this->db->query("SOME QUERY");
    -
    -$query->result_id;
    - - - - - - - - - - - - - -
    - - - - - - + + + + + +Custom Function Calls : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + +

    Custom Function Calls

    + +

    $this->db->call_function();

    + +

    This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform independent manner. +For example, lets say you want to call the mysql_get_client_info() function, which is not natively supported +by CodeIgniter. You could do so like this: +

    + +$this->db->call_function('get_client_info'); + +

    You must supply the name of the function, without the mysql_ prefix, in the first parameter. The prefix is added +automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. +Obviously not all function calls are identical between platforms, so there are limits to how useful this function can be in terms of portability.

    + +

    Any parameters needed by the function you are calling will be added to the second parameter.

    + +$this->db->call_function('some_function', $param1, $param2, etc..); + + +

    Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

    + +$this->db->conn_id; + +

    The result ID can be accessed from within your result object, like this:

    + +$query = $this->db->query("SOME QUERY");
    +
    +$query->result_id;
    + + + + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index f2da5808..c6991aaa 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -1,157 +1,157 @@ - - - - - -Database Configuration : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Database Configuration

    - -

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). -The config file is located at:

    - -

    application/config/database.php

    - -

    The config settings are stored in a multi-dimensional array with this prototype:

    - -$db['default']['hostname'] = "localhost";
    -$db['default']['username'] = "root";
    -$db['default']['password'] = "";
    -$db['default']['database'] = "database_name";
    -$db['default']['dbdriver'] = "mysql";
    -$db['default']['dbprefix'] = "";
    -$db['default']['pconnect'] = TRUE;
    -$db['default']['db_debug'] = FALSE;
    -$db['default']['cache_on'] = FALSE;
    -$db['default']['cachedir'] = "";
    -$db['default']['char_set'] = "utf8";
    -$db['default']['dbcollat'] = "utf8_general_ci";
    - -

    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, production, test, etc.) -under a single installation, you can set up a connection group for each, then switch between groups as needed. -For example, to set up a "test" environment you would do this:

    - -$db['test']['hostname'] = "localhost";
    -$db['test']['username'] = "root";
    -$db['test']['password'] = "";
    -$db['test']['database'] = "database_name";
    -$db['test']['dbdriver'] = "mysql";
    -$db['test']['dbprefix'] = "";
    -$db['test']['pconnect'] = TRUE;
    -$db['test']['db_debug'] = FALSE;
    -$db['test']['cache_on'] = FALSE;
    -$db['test']['cachedir'] = "";
    -$db['test']['char_set'] = "utf8";
    -$db['test']['dbcollat'] = "utf8_general_ci";
    - - -

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    - -$active_group = "test"; - -

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" -for the primary connection, but it too can be renamed to something more relevant to your project.

    - -

    Active Record

    - -

    The Active Record Class is globally enabled or disabled by setting the $active_record variable in the database configuration file to TRUE/FALSE (boolean). If you are not using the active record class, setting it to FALSE will utilize fewer resources when the database classes are initialized.

    - -$active_record = TRUE; - -

    Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.

    - -

    Explanation of Values:

    - -
      -
    • hostname - The hostname of your database server. Often this is "localhost".
    • -
    • 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, postgres, odbc, etc. Must be specified in lower case.
    • -
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • -
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • -
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • -
    • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
    • -
    • cachedir - The absolute server path to your database query cache directory.
    • -
    • char_set - The character set used in communicating with the database.
    • -
    • dbcollat - The character collation used in communicating with the database.
    • -
    • port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    • -
    - -

    Note: Depending on what database platform you are using (MySQL, Postgres, etc.) -not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and -the database name will be the path to your database file. The information above assumes you are using MySQL.

    - - - -
    - - - - - - + + + + + +Database Configuration : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Database Configuration

    + +

    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). +The config file is located at:

    + +

    application/config/database.php

    + +

    The config settings are stored in a multi-dimensional array with this prototype:

    + +$db['default']['hostname'] = "localhost";
    +$db['default']['username'] = "root";
    +$db['default']['password'] = "";
    +$db['default']['database'] = "database_name";
    +$db['default']['dbdriver'] = "mysql";
    +$db['default']['dbprefix'] = "";
    +$db['default']['pconnect'] = TRUE;
    +$db['default']['db_debug'] = FALSE;
    +$db['default']['cache_on'] = FALSE;
    +$db['default']['cachedir'] = "";
    +$db['default']['char_set'] = "utf8";
    +$db['default']['dbcollat'] = "utf8_general_ci";
    + +

    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, production, test, etc.) +under a single installation, you can set up a connection group for each, then switch between groups as needed. +For example, to set up a "test" environment you would do this:

    + +$db['test']['hostname'] = "localhost";
    +$db['test']['username'] = "root";
    +$db['test']['password'] = "";
    +$db['test']['database'] = "database_name";
    +$db['test']['dbdriver'] = "mysql";
    +$db['test']['dbprefix'] = "";
    +$db['test']['pconnect'] = TRUE;
    +$db['test']['db_debug'] = FALSE;
    +$db['test']['cache_on'] = FALSE;
    +$db['test']['cachedir'] = "";
    +$db['test']['char_set'] = "utf8";
    +$db['test']['dbcollat'] = "utf8_general_ci";
    + + +

    Then, to globally tell the system to use that group you would set this variable located in the config file:

    + +$active_group = "test"; + +

    Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" +for the primary connection, but it too can be renamed to something more relevant to your project.

    + +

    Active Record

    + +

    The Active Record Class is globally enabled or disabled by setting the $active_record variable in the database configuration file to TRUE/FALSE (boolean). If you are not using the active record class, setting it to FALSE will utilize fewer resources when the database classes are initialized.

    + +$active_record = TRUE; + +

    Note: that some CodeIgniter classes such as Sessions require Active Records be enabled to access certain functionality.

    + +

    Explanation of Values:

    + +
      +
    • hostname - The hostname of your database server. Often this is "localhost".
    • +
    • 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, postgres, odbc, etc. Must be specified in lower case.
    • +
    • dbprefix - An optional table prefix which will added to the table name when running Active Record queries. This permits multiple CodeIgniter installations to share one database.
    • +
    • pconnect - TRUE/FALSE (boolean) - Whether to use a persistent connection.
    • +
    • db_debug - TRUE/FALSE (boolean) - Whether database errors should be displayed.
    • +
    • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
    • +
    • cachedir - The absolute server path to your database query cache directory.
    • +
    • char_set - The character set used in communicating with the database.
    • +
    • dbcollat - The character collation used in communicating with the database.
    • +
    • port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    • +
    + +

    Note: Depending on what database platform you are using (MySQL, Postgres, etc.) +not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and +the database name will be the path to your database file. The information above assumes you are using MySQL.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 8ece6dce..90f90110 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -1,181 +1,181 @@ - - - - - -Connecting to your Database : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Connecting to your Database

    - -

    There are two ways to connect to a database:

    - -

    Automatically Connecting

    - -

    The "auto connect" feature will load and instantiate the database class with every page load. -To enable "auto connecting", add the word database to the library array, as indicated in the following file:

    - -

    application/config/autoload.php

    - -

    Manually Connecting

    - -

    If only some of your pages require database connectivity you can manually connect to your database by adding this -line of code in any function where it is needed, or in your class constructor to make the database -available globally in that class.

    - -$this->load->database(); - -

    If the above function does not contain any information in the first parameter it will connect -to the group specified in your database config file. For most people, this is the preferred method of use.

    - -

    Available Parameters

    - -
      -
    1. The database connection values, passed either as an array or a DSN string.
    2. -
    3. TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below).
    4. -
    5. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set to FALSE by default.
    6. -
    - - -

    Manuallly Connecting to a Database

    - -

    The first parameter of this function can optionally be used to specify a particular database group -from your config file, or you can even submit connection values for a database that is not specified in your config file. -Examples:

    - -

    To choose a specific group from your config file you can do this:

    - -$this->load->database('group_name'); - -

    Where group_name is the name of the connection group from your config 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);
    - -

    For information on each of these values please see the configuration page.

    - -

    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);
    - -

    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);
    - -

    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); -
    - -

    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 as indicated above).

    - -

    By setting the second parameter to TRUE (boolean) the function will return the database object.

    - -
    -

    When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with:

    - -

    $this->db->query();
    $this->db->result();
    etc...

    - -

    You will instead use:

    - -

    $DB1->query();
    $DB1->result();
    etc...

    - -
    - - - - - -
    - - - - - - + + + + + +Connecting to your Database : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Connecting to your Database

    + +

    There are two ways to connect to a database:

    + +

    Automatically Connecting

    + +

    The "auto connect" feature will load and instantiate the database class with every page load. +To enable "auto connecting", add the word database to the library array, as indicated in the following file:

    + +

    application/config/autoload.php

    + +

    Manually Connecting

    + +

    If only some of your pages require database connectivity you can manually connect to your database by adding this +line of code in any function where it is needed, or in your class constructor to make the database +available globally in that class.

    + +$this->load->database(); + +

    If the above function does not contain any information in the first parameter it will connect +to the group specified in your database config file. For most people, this is the preferred method of use.

    + +

    Available Parameters

    + +
      +
    1. The database connection values, passed either as an array or a DSN string.
    2. +
    3. TRUE/FALSE (boolean). Whether to return the connection ID (see Connecting to Multiple Databases below).
    4. +
    5. TRUE/FALSE (boolean). Whether to enable the Active Record class. Set to FALSE by default.
    6. +
    + + +

    Manuallly Connecting to a Database

    + +

    The first parameter of this function can optionally be used to specify a particular database group +from your config file, or you can even submit connection values for a database that is not specified in your config file. +Examples:

    + +

    To choose a specific group from your config file you can do this:

    + +$this->load->database('group_name'); + +

    Where group_name is the name of the connection group from your config 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);
    + +

    For information on each of these values please see the configuration page.

    + +

    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);
    + +

    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);
    + +

    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); +
    + +

    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 as indicated above).

    + +

    By setting the second parameter to TRUE (boolean) the function will return the database object.

    + +
    +

    When you connect this way, you will use your object name to issue commands rather than the syntax used throughout this guide. In other words, rather than issuing commands with:

    + +

    $this->db->query();
    $this->db->result();
    etc...

    + +

    You will instead use:

    + +

    $DB1->query();
    $DB1->result();
    etc...

    + +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 4182390f..49d27299 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -1,217 +1,217 @@ - - - - - -Database Quick Start : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Database Quick Start: Example Code

    - -

    The following page contains example code showing how the database class is used. For complete details please -read the individual pages describing each function.

    - - -

    Initializing the Database Class

    - -

    The following code loads and initializes the database class based on your configuration settings:

    - -$this->load->database(); - -

    Once loaded the class is ready to be used as described below.

    - -

    Note: If all your pages require database access you can connect automatically. See the connecting page for details.

    - - -

    Standard Query With Multiple Results (Object Version)

    - -$query = $this->db->query('SELECT name, title, email FROM my_table');
    -
    -foreach ($query->result() as $row)
    -{
    -    echo $row->title;
    -    echo $row->name;
    -    echo $row->email;
    -}
    -
    -echo 'Total Results: ' . $query->num_rows(); -
    - -

    The above result() function returns an array of objects. Example: $row->title

    - - -

    Standard Query With Multiple Results (Array Version)

    - -$query = $this->db->query('SELECT name, title, email FROM my_table');
    -
    -foreach ($query->result_array() as $row)
    -{
    -    echo $row['title'];
    -    echo $row['name'];
    -    echo $row['email'];
    -}
    - -

    The above result_array() function returns an array of standard array indexes. Example: $row['title']

    - - -

    Testing for Results

    - -

    If you run queries that might not produce a result, you are encouraged to test for a result first -using the num_rows() function:

    - - -$query = $this->db->query("YOUR QUERY");
    -
    -if ($query->num_rows() > 0)
    -{
    -   foreach ($query->result() as $row)
    -   {
    -      echo $row->title;
    -      echo $row->name;
    -      echo $row->body;
    -   }
    -} -
    - - - - -

    Standard Query With Single Result

    - -$query = $this->db->query('SELECT name FROM my_table LIMIT 1');
    -
    -$row = $query->row();
    -echo $row->name;
    -
    - -

    The above row() function returns an object. Example: $row->name

    - - -

    Standard Query With Single Result (Array version)

    - -$query = $this->db->query('SELECT name FROM my_table LIMIT 1');
    -
    -$row = $query->row_array();
    -echo $row['name'];
    -
    - -

    The above row_array() function returns an array. Example: $row['name']

    - - -

    Standard Insert

    - - -$sql = "INSERT INTO mytable (title, name)
    -        VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";
    -
    -$this->db->query($sql);
    -
    -echo $this->db->affected_rows(); -
    - - - - -

    Active Record Query

    - -

    The Active Record Pattern gives you a simplified means of retrieving data:

    - - -$query = $this->db->get('table_name');
    -
    -foreach ($query->result() as $row)
    -{
    -    echo $row->title;
    -}
    - -

    The above get() function retrieves all the results from the supplied table. -The Active Record class contains a full compliment of functions -for working with data.

    - - -

    Active Record Insert

    - - -$data = array(
    -               'title' => $title,
    -               'name' => $name,
    -               'date' => $date
    -            );
    -
    -$this->db->insert('mytable', $data); -

    -// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
    - - - - -
    - - - - - - + + + + + +Database Quick Start : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Database Quick Start: Example Code

    + +

    The following page contains example code showing how the database class is used. For complete details please +read the individual pages describing each function.

    + + +

    Initializing the Database Class

    + +

    The following code loads and initializes the database class based on your configuration settings:

    + +$this->load->database(); + +

    Once loaded the class is ready to be used as described below.

    + +

    Note: If all your pages require database access you can connect automatically. See the connecting page for details.

    + + +

    Standard Query With Multiple Results (Object Version)

    + +$query = $this->db->query('SELECT name, title, email FROM my_table');
    +
    +foreach ($query->result() as $row)
    +{
    +    echo $row->title;
    +    echo $row->name;
    +    echo $row->email;
    +}
    +
    +echo 'Total Results: ' . $query->num_rows(); +
    + +

    The above result() function returns an array of objects. Example: $row->title

    + + +

    Standard Query With Multiple Results (Array Version)

    + +$query = $this->db->query('SELECT name, title, email FROM my_table');
    +
    +foreach ($query->result_array() as $row)
    +{
    +    echo $row['title'];
    +    echo $row['name'];
    +    echo $row['email'];
    +}
    + +

    The above result_array() function returns an array of standard array indexes. Example: $row['title']

    + + +

    Testing for Results

    + +

    If you run queries that might not produce a result, you are encouraged to test for a result first +using the num_rows() function:

    + + +$query = $this->db->query("YOUR QUERY");
    +
    +if ($query->num_rows() > 0)
    +{
    +   foreach ($query->result() as $row)
    +   {
    +      echo $row->title;
    +      echo $row->name;
    +      echo $row->body;
    +   }
    +} +
    + + + + +

    Standard Query With Single Result

    + +$query = $this->db->query('SELECT name FROM my_table LIMIT 1');
    +
    +$row = $query->row();
    +echo $row->name;
    +
    + +

    The above row() function returns an object. Example: $row->name

    + + +

    Standard Query With Single Result (Array version)

    + +$query = $this->db->query('SELECT name FROM my_table LIMIT 1');
    +
    +$row = $query->row_array();
    +echo $row['name'];
    +
    + +

    The above row_array() function returns an array. Example: $row['name']

    + + +

    Standard Insert

    + + +$sql = "INSERT INTO mytable (title, name)
    +        VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")";
    +
    +$this->db->query($sql);
    +
    +echo $this->db->affected_rows(); +
    + + + + +

    Active Record Query

    + +

    The Active Record Pattern gives you a simplified means of retrieving data:

    + + +$query = $this->db->get('table_name');
    +
    +foreach ($query->result() as $row)
    +{
    +    echo $row->title;
    +}
    + +

    The above get() function retrieves all the results from the supplied table. +The Active Record class contains a full compliment of functions +for working with data.

    + + +

    Active Record Insert

    + + +$data = array(
    +               'title' => $title,
    +               'name' => $name,
    +               'date' => $date
    +            );
    +
    +$this->db->insert('mytable', $data); +

    +// Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}')
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index ed8f63d6..067d5b69 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -1,163 +1,163 @@ - - - - - -Field Data : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - -
    - - - -
    - - - -
    - - -

    Field Data

    - - -

    $this->db->list_fields()

    -

    Returns an array containing the field names. This query can be called two ways:

    - - -

    1. You can supply the table name and call it from the $this->db-> object:

    - - -$fields = $this->db->list_fields('table_name');

    - -foreach ($fields as $field)
    -{
    -   echo $field;
    -} -
    - -

    2. You can gather the field names associated with any query you run by calling the function -from your query result object:

    - - -$query = $this->db->query('SELECT * FROM some_table'); -

    - -foreach ($query->list_fields() as $field)
    -{
    -   echo $field;
    -} -
    - - -

    $this->db->field_exists()

    - -

    Sometimes it's helpful to know whether a particular field exists before performing an action. -Returns a boolean TRUE/FALSE. Usage example:

    - - -if ($this->db->field_exists('field_name', 'table_name'))
    -{
    -   // some code...
    -} -
    - -

    Note: Replace field_name with the name of the column you are looking for, and replace -table_name with the name of the table you are looking for.

    - - -

    $this->db->field_data()

    -

    Returns an array of objects containing field information.

    -

    Sometimes it's helpful to gather the field names or other metadata, like the column type, max length, etc.

    - - -

    Note: Not all databases provide meta-data.

    - -

    Usage example:

    - - -$fields = $this->db->field_data('table_name');

    - -foreach ($fields as $field)
    -{
    -   echo $field->name;
    -   echo $field->type;
    -   echo $field->max_length;
    -   echo $field->primary_key;
    -} -
    - -

    If you have run a query already you can use the result object instead of supplying the table name:

    - - -$query = $this->db->query("YOUR QUERY");
    -$fields = $query->field_data(); -
    - - -

    The following data is available from this function if supported by your database:

    - -
      -
    • name - column name
    • -
    • max_length - maximum length of the column
    • -
    • primary_key - 1 if the column is a primary key
    • -
    • type - the type of the column
    • -
    - - -
    - - - - - - + + + + + +Field Data : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + +
    + + + +
    + + + +
    + + +

    Field Data

    + + +

    $this->db->list_fields()

    +

    Returns an array containing the field names. This query can be called two ways:

    + + +

    1. You can supply the table name and call it from the $this->db-> object:

    + + +$fields = $this->db->list_fields('table_name');

    + +foreach ($fields as $field)
    +{
    +   echo $field;
    +} +
    + +

    2. You can gather the field names associated with any query you run by calling the function +from your query result object:

    + + +$query = $this->db->query('SELECT * FROM some_table'); +

    + +foreach ($query->list_fields() as $field)
    +{
    +   echo $field;
    +} +
    + + +

    $this->db->field_exists()

    + +

    Sometimes it's helpful to know whether a particular field exists before performing an action. +Returns a boolean TRUE/FALSE. Usage example:

    + + +if ($this->db->field_exists('field_name', 'table_name'))
    +{
    +   // some code...
    +} +
    + +

    Note: Replace field_name with the name of the column you are looking for, and replace +table_name with the name of the table you are looking for.

    + + +

    $this->db->field_data()

    +

    Returns an array of objects containing field information.

    +

    Sometimes it's helpful to gather the field names or other metadata, like the column type, max length, etc.

    + + +

    Note: Not all databases provide meta-data.

    + +

    Usage example:

    + + +$fields = $this->db->field_data('table_name');

    + +foreach ($fields as $field)
    +{
    +   echo $field->name;
    +   echo $field->type;
    +   echo $field->max_length;
    +   echo $field->primary_key;
    +} +
    + +

    If you have run a query already you can use the result object instead of supplying the table name:

    + + +$query = $this->db->query("YOUR QUERY");
    +$fields = $query->field_data(); +
    + + +

    The following data is available from this function if supported by your database:

    + +
      +
    • name - column name
    • +
    • max_length - maximum length of the column
    • +
    • primary_key - 1 if the column is a primary key
    • +
    • type - the type of the column
    • +
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 3feb487d..409ca277 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -1,234 +1,234 @@ - - - - - -Database Forge Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - -

    Database Forge Class

    - -

    The Database Forge Class contains functions that help you manage your database.

    - -

    Table of Contents

    - - - - -

    Initializing the Forge Class

    - -

    Important:  In order to initialize the Forge class, your database driver must -already be running, since the forge class relies on it.

    - -

    Load the Forge Class as follows:

    - -$this->load->dbforge() - -

    Once initialized you will access the functions using the $this->dbforge object:

    - -$this->dbforge->some_function() -

    $this->dbforge->create_database('db_name')

    - -

    Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - -if ($this->dbforge->create_database('my_db'))
    -{
    -    echo 'Database created!';
    -}
    - - - - -

    $this->dbforge->drop_database('db_name')

    - -

    Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - -if ($this->dbforge->drop_database('my_db'))
    -{
    -    echo 'Database deleted!';
    -}
    - - -

    Creating and Dropping Tables

    -

    There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this.

    -

    Adding fields

    -

    Fields are created via an associative array. Within the array you must include a 'type' key that relates to the datatype of the field. For example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR) also require a 'constraint' key.

    -

    $fields = array(
    -                        'users' => array(
    -                                                  'type' => 'VARCHAR',
    -                                                  'constraint' => '100',
    -                                           ),
    -                 );
    -
    -// will translate to "users VARCHAR(100)" when the field is added.

    -

    Additionally, the following key/values can be used:

    -
      -
    • unsigned/true : to generate "UNSIGNED" in the field definition.
    • -
    • default/value : to generate a default value in the field definition.
    • -
    • null/true : to generate "NULL" in the field definition. Without this, the field will default to "NOT NULL".
    • -
    • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer.
    • -
    -

    $fields = array(
    -                         'blog_id' => array(
    -                                                  'type' => 'INT',
    -                                                  'constraint' => 5,
    -                                                  'unsigned' => TRUE,
    -                                                  'auto_increment' => TRUE
    -                                           ),
    -                         'blog_title' => array(
    -                                                 'type' => 'VARCHAR',
    -                                                 'constraint' => '100',
    -                                          ),
    -                        'blog_author' => array(
    -                                                 'type' =>'VARCHAR',
    -                                                 'constraint' => '100',
    -                                                 'default' => 'King of Town',
    -                                          ),
    -                        'blog_description' => array(
    -                                                 'type' => 'TEXT',
    -                                                 'null' => TRUE,
    -                                          ),
    -                );
    -

    -

    After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

    -

    $this->dbforge->add_field()

    -

    The add fields function will accept the above array.

    -

    Passing strings as fields

    -

    If you know exactly how you want a field to be created, you can pass the string into the field definitions with add_field()

    -

    $this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");

    -

    Note: Multiple calls to add_field() are cumulative.

    -

    Creating an id field

    -

    There is a special exception for creating id fields. A field with type id will automatically be assinged as an INT(9) auto_incrementing Primary Key.

    -

    $this->dbforge->add_field('id');
    - // gives id INT(9) NOT NULL AUTO_INCREMENT

    -

    Adding Keys

    -

    Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().

    -

    Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.

    -

    $this->dbforge->add_key('blog_id', TRUE);
    - // gives PRIMARY KEY `blog_id` (`blog_id`)
    -
    - $this->dbforge->add_key('blog_id', TRUE);
    - $this->dbforge->add_key('site_id', TRUE);
    - // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
    -
    - $this->dbforge->add_key('blog_name');
    - // gives KEY `blog_name` (`blog_name`)
    -
    - $this->dbforge->add_key(array('blog_name', 'blog_label'));
    - // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)

    -

    Creating a table

    -

    After fields and keys have been declared, you can create a new table with

    -

    $this->dbforge->create_table('table_name');
    -// gives CREATE TABLE table_name

    -

    An optional second parameter set to TRUE adds an "IF NOT EXISTS" clause into the definition

    -

    $this->dbforge->create_table('table_name', TRUE);
    -// gives CREATE TABLE IF NOT EXISTS table_name

    -

    Dropping a table

    -

    Executes a DROP TABLE sql

    -

    $this->dbforge->drop_table('table_name');
    - // gives DROP TABLE IF EXISTS table_name

    -

    Renaming a table

    -

    Executes a TABLE rename

    -

    $this->dbforge->rename_table('old_table_name', 'new_table_name');
    - // gives ALTER TABLE old_table_name RENAME TO new_table_name

    -

    Modifying Tables

    -

    $this->dbforge->add_column()

    -

    The add_column() function is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields.

    -

    $fields = array(
    -                         'preferences' => array('type' => 'TEXT')
    -);
    -$this->dbforge->add_column('table_name', $fields);
    -
    -// gives ALTER TABLE table_name ADD preferences TEXT

    -

    $this->dbforge->drop_column()

    -

    Used to remove a column from a table.

    -

    $this->dbforge->drop_column('table_name', 'column_to_drop');

    -

    $this->dbforge->modify_column()

    -

    The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    -

    $fields = array(
    -                        'old_name' => array(
    -                                                         'name' => 'new_name',
    -                                                         'type' => 'TEXT',
    -                                                ),
    -);
    -$this->dbforge->modify_column('table_name', $fields);
    -
    - // gives ALTER TABLE table_name CHANGE old_name new_name TEXT

    -

     

    -
    - - - - - - + + + + + +Database Forge Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + +

    Database Forge Class

    + +

    The Database Forge Class contains functions that help you manage your database.

    + +

    Table of Contents

    + + + + +

    Initializing the Forge Class

    + +

    Important:  In order to initialize the Forge class, your database driver must +already be running, since the forge class relies on it.

    + +

    Load the Forge Class as follows:

    + +$this->load->dbforge() + +

    Once initialized you will access the functions using the $this->dbforge object:

    + +$this->dbforge->some_function() +

    $this->dbforge->create_database('db_name')

    + +

    Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + +if ($this->dbforge->create_database('my_db'))
    +{
    +    echo 'Database created!';
    +}
    + + + + +

    $this->dbforge->drop_database('db_name')

    + +

    Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + +if ($this->dbforge->drop_database('my_db'))
    +{
    +    echo 'Database deleted!';
    +}
    + + +

    Creating and Dropping Tables

    +

    There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this.

    +

    Adding fields

    +

    Fields are created via an associative array. Within the array you must include a 'type' key that relates to the datatype of the field. For example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR) also require a 'constraint' key.

    +

    $fields = array(
    +                        'users' => array(
    +                                                  'type' => 'VARCHAR',
    +                                                  'constraint' => '100',
    +                                           ),
    +                 );
    +
    +// will translate to "users VARCHAR(100)" when the field is added.

    +

    Additionally, the following key/values can be used:

    +
      +
    • unsigned/true : to generate "UNSIGNED" in the field definition.
    • +
    • default/value : to generate a default value in the field definition.
    • +
    • null/true : to generate "NULL" in the field definition. Without this, the field will default to "NOT NULL".
    • +
    • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer.
    • +
    +

    $fields = array(
    +                         'blog_id' => array(
    +                                                  'type' => 'INT',
    +                                                  'constraint' => 5,
    +                                                  'unsigned' => TRUE,
    +                                                  'auto_increment' => TRUE
    +                                           ),
    +                         'blog_title' => array(
    +                                                 'type' => 'VARCHAR',
    +                                                 'constraint' => '100',
    +                                          ),
    +                        'blog_author' => array(
    +                                                 'type' =>'VARCHAR',
    +                                                 'constraint' => '100',
    +                                                 'default' => 'King of Town',
    +                                          ),
    +                        'blog_description' => array(
    +                                                 'type' => 'TEXT',
    +                                                 'null' => TRUE,
    +                                          ),
    +                );
    +

    +

    After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

    +

    $this->dbforge->add_field()

    +

    The add fields function will accept the above array.

    +

    Passing strings as fields

    +

    If you know exactly how you want a field to be created, you can pass the string into the field definitions with add_field()

    +

    $this->dbforge->add_field("label varchar(100) NOT NULL DEFAULT 'default label'");

    +

    Note: Multiple calls to add_field() are cumulative.

    +

    Creating an id field

    +

    There is a special exception for creating id fields. A field with type id will automatically be assinged as an INT(9) auto_incrementing Primary Key.

    +

    $this->dbforge->add_field('id');
    + // gives id INT(9) NOT NULL AUTO_INCREMENT

    +

    Adding Keys

    +

    Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().

    +

    Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.

    +

    $this->dbforge->add_key('blog_id', TRUE);
    + // gives PRIMARY KEY `blog_id` (`blog_id`)
    +
    + $this->dbforge->add_key('blog_id', TRUE);
    + $this->dbforge->add_key('site_id', TRUE);
    + // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
    +
    + $this->dbforge->add_key('blog_name');
    + // gives KEY `blog_name` (`blog_name`)
    +
    + $this->dbforge->add_key(array('blog_name', 'blog_label'));
    + // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)

    +

    Creating a table

    +

    After fields and keys have been declared, you can create a new table with

    +

    $this->dbforge->create_table('table_name');
    +// gives CREATE TABLE table_name

    +

    An optional second parameter set to TRUE adds an "IF NOT EXISTS" clause into the definition

    +

    $this->dbforge->create_table('table_name', TRUE);
    +// gives CREATE TABLE IF NOT EXISTS table_name

    +

    Dropping a table

    +

    Executes a DROP TABLE sql

    +

    $this->dbforge->drop_table('table_name');
    + // gives DROP TABLE IF EXISTS table_name

    +

    Renaming a table

    +

    Executes a TABLE rename

    +

    $this->dbforge->rename_table('old_table_name', 'new_table_name');
    + // gives ALTER TABLE old_table_name RENAME TO new_table_name

    +

    Modifying Tables

    +

    $this->dbforge->add_column()

    +

    The add_column() function is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields.

    +

    $fields = array(
    +                         'preferences' => array('type' => 'TEXT')
    +);
    +$this->dbforge->add_column('table_name', $fields);
    +
    +// gives ALTER TABLE table_name ADD preferences TEXT

    +

    $this->dbforge->drop_column()

    +

    Used to remove a column from a table.

    +

    $this->dbforge->drop_column('table_name', 'column_to_drop');

    +

    $this->dbforge->modify_column()

    +

    The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    +

    $fields = array(
    +                        'old_name' => array(
    +                                                         'name' => 'new_name',
    +                                                         'type' => 'TEXT',
    +                                                ),
    +);
    +$this->dbforge->modify_column('table_name', $fields);
    +
    + // gives ALTER TABLE table_name CHANGE old_name new_name TEXT

    +

     

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 0647e2a8..9fcb7661 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -1,151 +1,151 @@ - - - - - -Query Helper Functions : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - - -
    - - - -
    - - -

    Query Helper Functions

    - - -

    $this->db->insert_id()

    -

    The insert ID number when performing database inserts.

    - -

    $this->db->affected_rows()

    -

    Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).

    -

    Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the -correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

    - - -

    $this->db->count_all();

    -

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    -echo $this->db->count_all('my_table');
    -
    -// Produces an integer, like 25 -
    - - -

    $this->db->platform()

    -

    Outputs the database platform you are running (MySQL, MS SQL, Postgres, etc...):

    -echo $this->db->platform(); - - -

    $this->db->version()

    -

    Outputs the database version you are running:

    -echo $this->db->version(); - - -

    $this->db->last_query();

    -

    Returns the last query that was run (the query string, not the result). Example:

    - -$str = $this->db->last_query();
    -
    -// Produces: SELECT * FROM sometable.... -
    - - -

    The following two functions help simplify the process of writing database INSERTs and UPDATEs.

    - - -

    $this->db->insert_string();

    -

    This function simplifies the process of writing database inserts. It returns a correctly formatted SQL insert string. Example:

    - -$data = array('name' => $name, 'email' => $email, 'url' => $url);
    -
    -$str = $this->db->insert_string('table_name', $data); -
    - -

    The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

    -INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com') - -

    Note: Values are automatically escaped, producing safer queries.

    - - - -

    $this->db->update_string();

    -

    This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. Example:

    - -$data = array('name' => $name, 'email' => $email, 'url' => $url);
    -
    -$where = "author_id = 1 AND status = 'active'"; -

    -$str = $this->db->update_string('table_name', $data, $where); -
    - -

    The first parameter is the table name, the second is an associative array with the data to be updated, and the third parameter is the "where" clause. The above example produces:

    - UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active' - -

    Note: Values are automatically escaped, producing safer queries.

    - - -
    - - - - - - + + + + + +Query Helper Functions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + + +
    + + + +
    + + +

    Query Helper Functions

    + + +

    $this->db->insert_id()

    +

    The insert ID number when performing database inserts.

    + +

    $this->db->affected_rows()

    +

    Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).

    +

    Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the +correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

    + + +

    $this->db->count_all();

    +

    Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

    +echo $this->db->count_all('my_table');
    +
    +// Produces an integer, like 25 +
    + + +

    $this->db->platform()

    +

    Outputs the database platform you are running (MySQL, MS SQL, Postgres, etc...):

    +echo $this->db->platform(); + + +

    $this->db->version()

    +

    Outputs the database version you are running:

    +echo $this->db->version(); + + +

    $this->db->last_query();

    +

    Returns the last query that was run (the query string, not the result). Example:

    + +$str = $this->db->last_query();
    +
    +// Produces: SELECT * FROM sometable.... +
    + + +

    The following two functions help simplify the process of writing database INSERTs and UPDATEs.

    + + +

    $this->db->insert_string();

    +

    This function simplifies the process of writing database inserts. It returns a correctly formatted SQL insert string. Example:

    + +$data = array('name' => $name, 'email' => $email, 'url' => $url);
    +
    +$str = $this->db->insert_string('table_name', $data); +
    + +

    The first parameter is the table name, the second is an associative array with the data to be inserted. The above example produces:

    +INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com') + +

    Note: Values are automatically escaped, producing safer queries.

    + + + +

    $this->db->update_string();

    +

    This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. Example:

    + +$data = array('name' => $name, 'email' => $email, 'url' => $url);
    +
    +$where = "author_id = 1 AND status = 'active'"; +

    +$str = $this->db->update_string('table_name', $data, $where); +
    + +

    The first parameter is the table name, the second is an associative array with the data to be updated, and the third parameter is the "where" clause. The above example produces:

    + UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active' + +

    Note: Values are automatically escaped, producing safer queries.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 73f814c3..b4ce57cc 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -1,99 +1,99 @@ - - - - - -The Database Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - -

    The Database Class

    - -

    CodeIgniter comes with a full-featured and very fast abstracted database class that supports both traditional -structures and Active Record patterns. The database functions offer clear, simple syntax.

    - - - - -
    - - - - - - + + + + + +The Database Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + +

    The Database Class

    + +

    CodeIgniter comes with a full-featured and very fast abstracted database class that supports both traditional +structures and Active Record patterns. The database functions offer clear, simple syntax.

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 35f2da78..84c5f7f1 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -1,146 +1,146 @@ - - - - - -Queries : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - - -
    - - - -
    - - -

    Queries

    - -

    $this->db->query();

    - -

    To submit a query, use the following function:

    - -$this->db->query('YOUR QUERY HERE'); - -

    The query() function returns a database result object when "read" type queries are run, -which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE -depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this:

    - -$query = $this->db->query('YOUR QUERY HERE'); - -

    $this->db->simple_query();

    - -

    This is a simplified version of the $this->db->query() function. It ONLY returns TRUE/FALSE on success or failure. -It DOES NOT return a database result set, nor does it set the query timer, or compile bind data, or store your query for debugging. -It simply lets you submit a query. Most users will rarely use this function.

    - - -

    Adding Database prefixes manually

    -

    If you have configured a database prefix and would like to add it in manually for, you can use the following.

    -

    $this->db->dbprefix('tablename');
    -// outputs prefix_tablename

    - - -

    Protecting identifiers

    -

    In many databases it is advisable to protect table and field names - for example with backticks in MySQL. Active Record queries are automatically protected, however if you need to manually protect an identifier you can use:

    -

    $this->db->protect_identifiers('table_name');

    - -

    This function will also add a table prefix to your table, assuming you have a prefix specified in your database config file. To enable the prefixing set TRUE (boolen) via the second parameter:

    -

    $this->db->protect_identifiers('table_name', TRUE);

    - - -

    Escaping Queries

    -

    It's a very good security practice to escape your data before submitting it into your database. -CodeIgniter has two functions that help you do this:

    - -
      -
    1. $this->db->escape() This function determines the data type so that it -can escape only string data. It also automatically adds single quotes around the data so you don't have to: - -$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
    2. - -
    3. $this->db->escape_str() This function escapes the data passed to it, regardless of type. -Most of the time you'll use the above function rather than this one. Use the function like this: - -$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
    4. -
    - - -

    Query Bindings

    - - -

    Bindings enable you to simplify your query syntax by letting the system put the queries together for you. Consider the following example:

    - - -$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"; -

    -$this->db->query($sql, array(3, 'live', 'Rick')); -
    - -

    The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.

    -

    The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

    - - - -
    - - - - - - + + + + + +Queries : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + + +
    + + + +
    + + +

    Queries

    + +

    $this->db->query();

    + +

    To submit a query, use the following function:

    + +$this->db->query('YOUR QUERY HERE'); + +

    The query() function returns a database result object when "read" type queries are run, +which you can use to show your results. When "write" type queries are run it simply returns TRUE or FALSE +depending on success or failure. When retrieving data you will typically assign the query to your own variable, like this:

    + +$query = $this->db->query('YOUR QUERY HERE'); + +

    $this->db->simple_query();

    + +

    This is a simplified version of the $this->db->query() function. It ONLY returns TRUE/FALSE on success or failure. +It DOES NOT return a database result set, nor does it set the query timer, or compile bind data, or store your query for debugging. +It simply lets you submit a query. Most users will rarely use this function.

    + + +

    Adding Database prefixes manually

    +

    If you have configured a database prefix and would like to add it in manually for, you can use the following.

    +

    $this->db->dbprefix('tablename');
    +// outputs prefix_tablename

    + + +

    Protecting identifiers

    +

    In many databases it is advisable to protect table and field names - for example with backticks in MySQL. Active Record queries are automatically protected, however if you need to manually protect an identifier you can use:

    +

    $this->db->protect_identifiers('table_name');

    + +

    This function will also add a table prefix to your table, assuming you have a prefix specified in your database config file. To enable the prefixing set TRUE (boolen) via the second parameter:

    +

    $this->db->protect_identifiers('table_name', TRUE);

    + + +

    Escaping Queries

    +

    It's a very good security practice to escape your data before submitting it into your database. +CodeIgniter has two functions that help you do this:

    + +
      +
    1. $this->db->escape() This function determines the data type so that it +can escape only string data. It also automatically adds single quotes around the data so you don't have to: + +$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
    2. + +
    3. $this->db->escape_str() This function escapes the data passed to it, regardless of type. +Most of the time you'll use the above function rather than this one. Use the function like this: + +$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
    4. +
    + + +

    Query Bindings

    + + +

    Bindings enable you to simplify your query syntax by letting the system put the queries together for you. Consider the following example:

    + + +$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"; +

    +$this->db->query($sql, array(3, 'live', 'Rick')); +
    + +

    The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.

    +

    The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/results.html b/user_guide/database/results.html index a6ca6219..7f8879e3 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -1,238 +1,238 @@ - - - - - -Generating Query Results : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - - -

    Generating Query Results

    - - -

    There are several ways to generate query results:

    - -

    result()

    - -

    This function returns the query result as an array of objects, or an empty array on failure. - - Typically you'll use this in a foreach loop, like this:

    - - - $query = $this->db->query("YOUR QUERY");
    -
    - foreach ($query->result() as $row)
    - {
    -    echo $row->title;
    -    echo $row->name;
    -    echo $row->body;
    - }
    - -

    The above function is an alias of result_object().

    - -

    If you run queries that might not produce a result, you are encouraged to test the result first:

    - - - $query = $this->db->query("YOUR QUERY");
    -
    - if ($query->num_rows() > 0)
    - {
    -    foreach ($query->result() as $row)
    -    {
    -       echo $row->title;
    -       echo $row->name;
    -       echo $row->body;
    -    }
    - } -
    - -

    result_array()

    - -

    This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

    - - $query = $this->db->query("YOUR QUERY");
    -
    - foreach ($query->result_array() as $row)
    - {
    -    echo $row['title'];
    -    echo $row['name'];
    -    echo $row['body'];
    - }
    - - -

    row()

    - -

    This function returns a single result row. If your query has more than one row, it returns only the first row. - The result is returned as an object. Here's a usage example:

    - - $query = $this->db->query("YOUR QUERY");
    -
    - if ($query->num_rows() > 0)
    - {
    -    $row = $query->row(); -

    -    echo $row->title;
    -    echo $row->name;
    -    echo $row->body;
    - } -
    - -

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    - - $row = $query->row(5); - - -

    row_array()

    - -

    Identical to the above row() function, except it returns an array. Example:

    - - - $query = $this->db->query("YOUR QUERY");
    -
    - if ($query->num_rows() > 0)
    - {
    -    $row = $query->row_array(); -

    -    echo $row['title'];
    -    echo $row['name'];
    -    echo $row['body'];
    - } -
    - - -

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    - - $row = $query->row_array(5); - - -

    In addition, you can walk forward/backwards/first/last through your results using these variations:

    - -

    - $row = $query->first_row()
    - $row = $query->last_row()
    - $row = $query->next_row()
    - $row = $query->previous_row() -

    - -

    By default they return an object unless you put the word "array" in the parameter:

    - -

    - $row = $query->first_row('array')
    - $row = $query->last_row('array')
    - $row = $query->next_row('array')
    - $row = $query->previous_row('array') -

    - - - -

    Result Helper Functions

    - - -

    $query->num_rows()

    -

    The number of rows returned by the query. Note: In this example, $query is the variable that the query result object is assigned to:

    - -$query = $this->db->query('SELECT * FROM my_table');

    -echo $query->num_rows(); -
    - -

    $query->num_fields()

    -

    The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:

    - -$query = $this->db->query('SELECT * FROM my_table');

    -echo $query->num_fields(); -
    - - - -

    $query->free_result()

    -

    It frees the memory associated with the result and deletes the result resource ID. Normally PHP frees its memory automatically at the end of script -execution. However, if you are running a lot of queries in a particular script you might want to free the result after each query result has been -generated in order to cut down on memory consumptions. Example: -

    - -$query = $this->db->query('SELECT title FROM my_table');

    -foreach ($query->result() as $row)
    -{
    -   echo $row->title;
    -}
    -$query->free_result(); // The $query result object will no longer be available
    -
    -$query2 = $this->db->query('SELECT name FROM some_table');

    -$row = $query2->row();
    -echo $row->name;
    -$query2->free_result(); // The $query2 result object will no longer be available -
    - - - - - -
    - - - - - - + + + + + +Generating Query Results : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + + +

    Generating Query Results

    + + +

    There are several ways to generate query results:

    + +

    result()

    + +

    This function returns the query result as an array of objects, or an empty array on failure. + + Typically you'll use this in a foreach loop, like this:

    + + + $query = $this->db->query("YOUR QUERY");
    +
    + foreach ($query->result() as $row)
    + {
    +    echo $row->title;
    +    echo $row->name;
    +    echo $row->body;
    + }
    + +

    The above function is an alias of result_object().

    + +

    If you run queries that might not produce a result, you are encouraged to test the result first:

    + + + $query = $this->db->query("YOUR QUERY");
    +
    + if ($query->num_rows() > 0)
    + {
    +    foreach ($query->result() as $row)
    +    {
    +       echo $row->title;
    +       echo $row->name;
    +       echo $row->body;
    +    }
    + } +
    + +

    result_array()

    + +

    This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

    + + $query = $this->db->query("YOUR QUERY");
    +
    + foreach ($query->result_array() as $row)
    + {
    +    echo $row['title'];
    +    echo $row['name'];
    +    echo $row['body'];
    + }
    + + +

    row()

    + +

    This function returns a single result row. If your query has more than one row, it returns only the first row. + The result is returned as an object. Here's a usage example:

    + + $query = $this->db->query("YOUR QUERY");
    +
    + if ($query->num_rows() > 0)
    + {
    +    $row = $query->row(); +

    +    echo $row->title;
    +    echo $row->name;
    +    echo $row->body;
    + } +
    + +

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    + + $row = $query->row(5); + + +

    row_array()

    + +

    Identical to the above row() function, except it returns an array. Example:

    + + + $query = $this->db->query("YOUR QUERY");
    +
    + if ($query->num_rows() > 0)
    + {
    +    $row = $query->row_array(); +

    +    echo $row['title'];
    +    echo $row['name'];
    +    echo $row['body'];
    + } +
    + + +

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    + + $row = $query->row_array(5); + + +

    In addition, you can walk forward/backwards/first/last through your results using these variations:

    + +

    + $row = $query->first_row()
    + $row = $query->last_row()
    + $row = $query->next_row()
    + $row = $query->previous_row() +

    + +

    By default they return an object unless you put the word "array" in the parameter:

    + +

    + $row = $query->first_row('array')
    + $row = $query->last_row('array')
    + $row = $query->next_row('array')
    + $row = $query->previous_row('array') +

    + + + +

    Result Helper Functions

    + + +

    $query->num_rows()

    +

    The number of rows returned by the query. Note: In this example, $query is the variable that the query result object is assigned to:

    + +$query = $this->db->query('SELECT * FROM my_table');

    +echo $query->num_rows(); +
    + +

    $query->num_fields()

    +

    The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:

    + +$query = $this->db->query('SELECT * FROM my_table');

    +echo $query->num_fields(); +
    + + + +

    $query->free_result()

    +

    It frees the memory associated with the result and deletes the result resource ID. Normally PHP frees its memory automatically at the end of script +execution. However, if you are running a lot of queries in a particular script you might want to free the result after each query result has been +generated in order to cut down on memory consumptions. Example: +

    + +$query = $this->db->query('SELECT title FROM my_table');

    +foreach ($query->result() as $row)
    +{
    +   echo $row->title;
    +}
    +$query->free_result(); // The $query result object will no longer be available
    +
    +$query2 = $this->db->query('SELECT name FROM some_table');

    +$row = $query2->row();
    +echo $row->name;
    +$query2->free_result(); // The $query2 result object will no longer be available +
    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 7f8e461e..3f333933 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -1,113 +1,113 @@ - - - - - -Table Data : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - - - -

    Table Data

    - -

    These functions let you fetch table information.

    - -

    $this->db->list_tables();

    - -

    Returns an array containing the names of all the tables in the database you are currently connected to. Example:

    - -$tables = $this->db->list_tables();
    -
    -foreach ($tables as $table)
    -{
    -   echo $table;
    -} -
    - - -

    $this->db->table_exists();

    - -

    Sometimes it's helpful to know whether a particular table exists before running an operation on it. -Returns a boolean TRUE/FALSE. Usage example:

    - - -if ($this->db->table_exists('table_name'))
    -{
    -   // some code...
    -} -
    - -

    Note: Replace table_name with the name of the table you are looking for.

    - - - - - -
    - - - - - - + + + + + +Table Data : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + + + +

    Table Data

    + +

    These functions let you fetch table information.

    + +

    $this->db->list_tables();

    + +

    Returns an array containing the names of all the tables in the database you are currently connected to. Example:

    + +$tables = $this->db->list_tables();
    +
    +foreach ($tables as $table)
    +{
    +   echo $table;
    +} +
    + + +

    $this->db->table_exists();

    + +

    Sometimes it's helpful to know whether a particular table exists before running an operation on it. +Returns a boolean TRUE/FALSE. Usage example:

    + + +if ($this->db->table_exists('table_name'))
    +{
    +   // some code...
    +} +
    + +

    Note: Replace table_name with the name of the table you are looking for.

    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 8652aad1..1276cdc3 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -1,200 +1,200 @@ - - - - - -Transactions : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - - -
    - - - -
    - - -

    Transactions

    - -

    CodeIgniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need -to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively.

    - -

    If you are not familiar with -transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you -have a basic understanding of transactions. -

    - -

    CodeIgniter's Approach to Transactions

    - -

    CodeIgniter utilizes an approach to transactions that is very similar to the process used by the popular database class ADODB. We've chosen that approach -because it greatly simplifies the process of running transactions. In most cases all that is required are two lines of code.

    - -

    Traditionally, transactions have required a fair amount of work to implement since they demand that you to keep track of your queries -and determine whether to commit or rollback based on the success or failure of your queries. This is particularly cumbersome with -nested queries. In contrast, -we've implemented a smart transaction system that does all this for you automatically (you can also manage your transactions manually if you choose to, -but there's really no benefit).

    - -

    Running Transactions

    - -

    To run your queries using transactions you will use the $this->db->trans_start() and $this->db->trans_complete() functions as follows:

    - - -$this->db->trans_start();
    -$this->db->query('AN SQL QUERY...');
    -$this->db->query('ANOTHER QUERY...');
    -$this->db->query('AND YET ANOTHER QUERY...');
    -$this->db->trans_complete(); -
    - -

    You can run as many queries as you want between the start/complete functions and they will all be committed or rolled back based on success or failure -of any given query.

    - - -

    Strict Mode

    - -

    By default CodeIgniter runs all transactions in Strict Mode. When strict mode is enabled, if you are running multiple groups of -transactions, if one group fails all groups will be rolled back. If strict mode is disabled, each group is treated independently, meaning -a failure of one group will not affect any others.

    - -

    Strict Mode can be disabled as follows:

    - -$this->db->trans_strict(FALSE); - - -

    Managing Errors

    - -

    If you have error reporting enabled in your config/database.php file you'll see a standard error message if the commit was unsuccessful. If debugging is turned off, you can -manage your own errors like this:

    - - -$this->db->trans_start();
    -$this->db->query('AN SQL QUERY...');
    -$this->db->query('ANOTHER QUERY...');
    -$this->db->trans_complete();
    -
    -if ($this->db->trans_status() === FALSE)
    -{
    -    // generate an error... or use the log_message() function to log your error
    -} -
    - - -

    Enabling Transactions

    - -

    Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you -can do so using $this->db->trans_off():

    - - -$this->db->trans_off()

    - -$this->db->trans_start();
    -$this->db->query('AN SQL QUERY...');
    -$this->db->trans_complete(); -
    - -

    When transactions are disabled, your queries will be auto-commited, just as they are when running queries without transactions.

    - - -

    Test Mode

    - -

    You can optionally put the transaction system into "test mode", which will cause your queries to be rolled back -- even if the queries produce a valid result. -To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE:

    - - -$this->db->trans_start(TRUE); // Query will be rolled back
    -$this->db->query('AN SQL QUERY...');
    -$this->db->trans_complete(); -
    - - -

    Running Transactions Manually

    - -

    If you would like to run transactions manually you can do so as follows:

    - - -$this->db->trans_begin();

    - -$this->db->query('AN SQL QUERY...');
    -$this->db->query('ANOTHER QUERY...');
    -$this->db->query('AND YET ANOTHER QUERY...');
    - -
    - -if ($this->db->trans_status() === FALSE)
    -{
    -    $this->db->trans_rollback();
    -}
    -else
    -{
    -    $this->db->trans_commit();
    -}
    -
    - -

    Note: Make sure to use $this->db->trans_begin() when running manual transactions, NOT -$this->db->trans_start().

    - - - - -
    - - - - - - + + + + + +Transactions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + + +
    + + + +
    + + +

    Transactions

    + +

    CodeIgniter's database abstraction allows you to use transactions with databases that support transaction-safe table types. In MySQL, you'll need +to be running InnoDB or BDB table types rather than the more common MyISAM. Most other database platforms support transactions natively.

    + +

    If you are not familiar with +transactions we recommend you find a good online resource to learn about them for your particular database. The information below assumes you +have a basic understanding of transactions. +

    + +

    CodeIgniter's Approach to Transactions

    + +

    CodeIgniter utilizes an approach to transactions that is very similar to the process used by the popular database class ADODB. We've chosen that approach +because it greatly simplifies the process of running transactions. In most cases all that is required are two lines of code.

    + +

    Traditionally, transactions have required a fair amount of work to implement since they demand that you to keep track of your queries +and determine whether to commit or rollback based on the success or failure of your queries. This is particularly cumbersome with +nested queries. In contrast, +we've implemented a smart transaction system that does all this for you automatically (you can also manage your transactions manually if you choose to, +but there's really no benefit).

    + +

    Running Transactions

    + +

    To run your queries using transactions you will use the $this->db->trans_start() and $this->db->trans_complete() functions as follows:

    + + +$this->db->trans_start();
    +$this->db->query('AN SQL QUERY...');
    +$this->db->query('ANOTHER QUERY...');
    +$this->db->query('AND YET ANOTHER QUERY...');
    +$this->db->trans_complete(); +
    + +

    You can run as many queries as you want between the start/complete functions and they will all be committed or rolled back based on success or failure +of any given query.

    + + +

    Strict Mode

    + +

    By default CodeIgniter runs all transactions in Strict Mode. When strict mode is enabled, if you are running multiple groups of +transactions, if one group fails all groups will be rolled back. If strict mode is disabled, each group is treated independently, meaning +a failure of one group will not affect any others.

    + +

    Strict Mode can be disabled as follows:

    + +$this->db->trans_strict(FALSE); + + +

    Managing Errors

    + +

    If you have error reporting enabled in your config/database.php file you'll see a standard error message if the commit was unsuccessful. If debugging is turned off, you can +manage your own errors like this:

    + + +$this->db->trans_start();
    +$this->db->query('AN SQL QUERY...');
    +$this->db->query('ANOTHER QUERY...');
    +$this->db->trans_complete();
    +
    +if ($this->db->trans_status() === FALSE)
    +{
    +    // generate an error... or use the log_message() function to log your error
    +} +
    + + +

    Enabling Transactions

    + +

    Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you +can do so using $this->db->trans_off():

    + + +$this->db->trans_off()

    + +$this->db->trans_start();
    +$this->db->query('AN SQL QUERY...');
    +$this->db->trans_complete(); +
    + +

    When transactions are disabled, your queries will be auto-commited, just as they are when running queries without transactions.

    + + +

    Test Mode

    + +

    You can optionally put the transaction system into "test mode", which will cause your queries to be rolled back -- even if the queries produce a valid result. +To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE:

    + + +$this->db->trans_start(TRUE); // Query will be rolled back
    +$this->db->query('AN SQL QUERY...');
    +$this->db->trans_complete(); +
    + + +

    Running Transactions Manually

    + +

    If you would like to run transactions manually you can do so as follows:

    + + +$this->db->trans_begin();

    + +$this->db->query('AN SQL QUERY...');
    +$this->db->query('ANOTHER QUERY...');
    +$this->db->query('AND YET ANOTHER QUERY...');
    + +
    + +if ($this->db->trans_status() === FALSE)
    +{
    +    $this->db->trans_rollback();
    +}
    +else
    +{
    +    $this->db->trans_commit();
    +}
    +
    + +

    Note: Make sure to use $this->db->trans_begin() when running manual transactions, NOT +$this->db->trans_start().

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index e6847b37..6d3f6f31 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -1,295 +1,295 @@ - - - - - -Database Utility Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - - -
    - - - -
    - -

    Database Utility Class

    - -

    The Database Utility Class contains functions that help you manage your database.

    - -

    Table of Contents

    - - - - - -

    Initializing the Utility Class

    - -

    Important:  In order to initialize the Utility class, your database driver must -already be running, since the utilities class relies on it.

    - -

    Load the Utility Class as follows:

    - -$this->load->dbutil() - -

    Once initialized you will access the functions using the $this->dbutil object:

    - -$this->dbutil->some_function() - -

    $this->dbutil->list_databases()

    -

    Returns an array of database names:

    - - -$dbs = $this->dbutil->list_databases();
    -
    -foreach($dbs as $db)
    -{
    -    echo $db;
    -}
    -

    $this->dbutil->optimize_table('table_name');

    - -

    Note:  This features is only available for MySQL/MySQLi databases.

    - - -

    Permits you to optimize a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - - -if ($this->dbutil->optimize_table('table_name'))
    -{
    -    echo 'Success!';
    -} -
    - -

    Note: Not all database platforms support table optimization.

    - - -

    $this->dbutil->repair_table('table_name');

    - -

    Note:  This features is only available for MySQL/MySQLi databases.

    - - -

    Permits you to repair a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    - - -if ($this->dbutil->repair_table('table_name'))
    -{
    -    echo 'Success!';
    -} -
    - -

    Note: Not all database platforms support table repairs.

    - - -

    $this->dbutil->optimize_database();

    - -

    Note:  This features is only available for MySQL/MySQLi databases.

    - -

    Permits you to optimize the database your DB class is currently connected to. Returns an array containing the DB status messages or FALSE on failure.

    - - -$result = $this->dbutil->optimize_database();
    -
    -if ($result !== FALSE)
    -{
    -    print_r($result);
    -} -
    - -

    Note: Not all database platforms support table optimization.

    - - -

    $this->dbutil->csv_from_result($db_result)

    - -

    Permits you to generate a CSV file from a query result. The first parameter of the function must contain the result object from your query. -Example:

    - - -$this->load->dbutil();
    -
    -$query = $this->db->query("SELECT * FROM mytable");
    -
    -echo $this->dbutil->csv_from_result($query); -
    - -

    The second and third parameters allows you to -set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:

    - - -$delimiter = ",";
    -$newline = "\r\n";
    -
    -echo $this->dbutil->csv_from_result($query, $delimiter, $newline); -
    - -

    Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. -If you need to write the file use the File Helper.

    - - -

    $this->dbutil->xml_from_result($db_result)

    - -

    Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second -may contain an optional array of config parameters. Example:

    - - -$this->load->dbutil();
    -
    -$query = $this->db->query("SELECT * FROM mytable");
    -
    -$config = array (
    -                  'root'    => 'root',
    -                  'element' => 'element',
    -                  'newline' => "\n",
    -                  'tab'    => "\t"
    -                );
    -
    -echo $this->dbutil->xml_from_result($query, $config); -
    - -

    Important:  This function will NOT write the XML file for you. It simply creates the XML layout. -If you need to write the file use the File Helper.

    - - -

    $this->dbutil->backup()

    - -

    Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

    - -

    Note:  This features is only available for MySQL databases.

    - -

    Note: Due to the limited execution time and memory available to PHP, backing up very large -databases may not be possible. If your database is very large you might need to backup directly from your SQL server -via the command line, or have your server admin do it for you if you do not have root privileges.

    - -

    Usage Example

    - - -// Load the DB utility class
    -$this->load->dbutil();

    - -// Backup your entire database and assign it to a variable
    -$backup =& $this->dbutil->backup(); - -

    -// Load the file helper and write the file to your server
    -$this->load->helper('file');
    -write_file('/path/to/mybackup.gz', $backup); - -

    -// Load the download helper and send the file to your desktop
    -$this->load->helper('download');
    -force_download('mybackup.gz', $backup); -
    - -

    Setting Backup Preferences

    - -

    Backup preferences are set by submitting an array of values to the first parameter of the backup function. Example:

    - -$prefs = array(
    -                'tables'      => array('table1', 'table2'),  // Array of tables to backup.
    -                'ignore'      => array(),           // List of tables to omit from the backup
    -                'format'      => 'txt',             // gzip, zip, txt
    -                'filename'    => 'mybackup.sql',    // File name - NEEDED ONLY WITH ZIP FILES
    -                'add_drop'    => TRUE,              // Whether to add DROP TABLE statements to backup file
    -                'add_insert'  => TRUE,              // Whether to add INSERT data to backup file
    -                'newline'     => "\n"               // Newline character used in backup file
    -              );
    -
    -$this->dbutil->backup($prefs); -
    - - -

    Description of Backup Preferences

    - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    tablesempty arrayNoneAn array of tables you want backed up. If left blank all tables will be exported.
    ignoreempty arrayNoneAn array of tables you want the backup routine to ignore.
    formatgzipgzip, zip, txtThe file format of the export file.
    filenamethe current date/timeNoneThe name of the backed-up file. The name is needed only if you are using zip compression.
    add_dropTRUETRUE/FALSEWhether to include DROP TABLE statements in your SQL export file.
    add_insertTRUETRUE/FALSEWhether to include INSERT statements in your SQL export file.
    newline"\n""\n", "\r", "\r\n"Type of newline to use in your SQL export file.
    - - -
    - - - - - - + + + + + +Database Utility Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + + +
    + + + +
    + +

    Database Utility Class

    + +

    The Database Utility Class contains functions that help you manage your database.

    + +

    Table of Contents

    + + + + + +

    Initializing the Utility Class

    + +

    Important:  In order to initialize the Utility class, your database driver must +already be running, since the utilities class relies on it.

    + +

    Load the Utility Class as follows:

    + +$this->load->dbutil() + +

    Once initialized you will access the functions using the $this->dbutil object:

    + +$this->dbutil->some_function() + +

    $this->dbutil->list_databases()

    +

    Returns an array of database names:

    + + +$dbs = $this->dbutil->list_databases();
    +
    +foreach($dbs as $db)
    +{
    +    echo $db;
    +}
    +

    $this->dbutil->optimize_table('table_name');

    + +

    Note:  This features is only available for MySQL/MySQLi databases.

    + + +

    Permits you to optimize a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + + +if ($this->dbutil->optimize_table('table_name'))
    +{
    +    echo 'Success!';
    +} +
    + +

    Note: Not all database platforms support table optimization.

    + + +

    $this->dbutil->repair_table('table_name');

    + +

    Note:  This features is only available for MySQL/MySQLi databases.

    + + +

    Permits you to repair a table using the table name specified in the first parameter. Returns TRUE/FALSE based on success or failure:

    + + +if ($this->dbutil->repair_table('table_name'))
    +{
    +    echo 'Success!';
    +} +
    + +

    Note: Not all database platforms support table repairs.

    + + +

    $this->dbutil->optimize_database();

    + +

    Note:  This features is only available for MySQL/MySQLi databases.

    + +

    Permits you to optimize the database your DB class is currently connected to. Returns an array containing the DB status messages or FALSE on failure.

    + + +$result = $this->dbutil->optimize_database();
    +
    +if ($result !== FALSE)
    +{
    +    print_r($result);
    +} +
    + +

    Note: Not all database platforms support table optimization.

    + + +

    $this->dbutil->csv_from_result($db_result)

    + +

    Permits you to generate a CSV file from a query result. The first parameter of the function must contain the result object from your query. +Example:

    + + +$this->load->dbutil();
    +
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +echo $this->dbutil->csv_from_result($query); +
    + +

    The second and third parameters allows you to +set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:

    + + +$delimiter = ",";
    +$newline = "\r\n";
    +
    +echo $this->dbutil->csv_from_result($query, $delimiter, $newline); +
    + +

    Important:  This function will NOT write the CSV file for you. It simply creates the CSV layout. +If you need to write the file use the File Helper.

    + + +

    $this->dbutil->xml_from_result($db_result)

    + +

    Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second +may contain an optional array of config parameters. Example:

    + + +$this->load->dbutil();
    +
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +$config = array (
    +                  'root'    => 'root',
    +                  'element' => 'element',
    +                  'newline' => "\n",
    +                  'tab'    => "\t"
    +                );
    +
    +echo $this->dbutil->xml_from_result($query, $config); +
    + +

    Important:  This function will NOT write the XML file for you. It simply creates the XML layout. +If you need to write the file use the File Helper.

    + + +

    $this->dbutil->backup()

    + +

    Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

    + +

    Note:  This features is only available for MySQL databases.

    + +

    Note: Due to the limited execution time and memory available to PHP, backing up very large +databases may not be possible. If your database is very large you might need to backup directly from your SQL server +via the command line, or have your server admin do it for you if you do not have root privileges.

    + +

    Usage Example

    + + +// Load the DB utility class
    +$this->load->dbutil();

    + +// Backup your entire database and assign it to a variable
    +$backup =& $this->dbutil->backup(); + +

    +// Load the file helper and write the file to your server
    +$this->load->helper('file');
    +write_file('/path/to/mybackup.gz', $backup); + +

    +// Load the download helper and send the file to your desktop
    +$this->load->helper('download');
    +force_download('mybackup.gz', $backup); +
    + +

    Setting Backup Preferences

    + +

    Backup preferences are set by submitting an array of values to the first parameter of the backup function. Example:

    + +$prefs = array(
    +                'tables'      => array('table1', 'table2'),  // Array of tables to backup.
    +                'ignore'      => array(),           // List of tables to omit from the backup
    +                'format'      => 'txt',             // gzip, zip, txt
    +                'filename'    => 'mybackup.sql',    // File name - NEEDED ONLY WITH ZIP FILES
    +                'add_drop'    => TRUE,              // Whether to add DROP TABLE statements to backup file
    +                'add_insert'  => TRUE,              // Whether to add INSERT data to backup file
    +                'newline'     => "\n"               // Newline character used in backup file
    +              );
    +
    +$this->dbutil->backup($prefs); +
    + + +

    Description of Backup Preferences

    + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    tablesempty arrayNoneAn array of tables you want backed up. If left blank all tables will be exported.
    ignoreempty arrayNoneAn array of tables you want the backup routine to ignore.
    formatgzipgzip, zip, txtThe file format of the export file.
    filenamethe current date/timeNoneThe name of the backed-up file. The name is needed only if you are using zip compression.
    add_dropTRUETRUE/FALSEWhether to include DROP TABLE statements in your SQL export file.
    add_insertTRUETRUE/FALSEWhether to include INSERT statements in your SQL export file.
    newline"\n""\n", "\r", "\r\n"Type of newline to use in your SQL export file.
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 42ebdd1b..24088abd 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -1,86 +1,86 @@ - - - - - -Writing Documentation : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Writing Documentation

    - -

    To help facilitate a consistent, easy-to-read documentation style for CodeIgniter projects, Ellislab is making the markup and CSS from the CodeIgniter user guide freely available to the community for their use. For your convenience, a template file has been created that includes the primary blocks of markup used with brief samples.

    - -

    Files

    - - - - -
    - - - - - - - + + + + + +Writing Documentation : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Writing Documentation

    + +

    To help facilitate a consistent, easy-to-read documentation style for CodeIgniter projects, Ellislab is making the markup and CSS from the CodeIgniter user guide freely available to the community for their use. For your convenience, a template file has been created that includes the primary blocks of markup used with brief samples.

    + +

    Files

    + + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index 84f559d5..b6c7dbd6 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -1,128 +1,128 @@ - - - - - -CodeIgniter Project Documentation Template - - - - - - - - - - - - - - -
    - - - - - -

    Project Title

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Foo Class

    - -

    Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

    - -

    Important:  This is an important note with EMPHASIS.

    - -

    Features:

    - -
      -
    • Foo
    • -
    • Bar
    • -
    - -

    Usage Heading

    - -

    Within a text string, highlight variables using <var></var> tags, and highlight code using the <dfn></dfn> tags.

    - -

    Sub-heading

    - -

    Put code examples within <code></code> tags:

    - - - $this->load->library('foo');
    -
    - $this->foo->bar('bat'); -
    - - -

    Table Preferences

    - -

    Use tables where appropriate for long lists of preferences.

    - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    fooFooNoneDescription of foo.
    barBarbat, bag, or bakDescription of bar.
    - -

    Foo Function Reference

    - -

    $this->foo->bar()

    -

    Description

    -$this->foo->bar('baz') - -
    - - - - - - + + + + + +CodeIgniter Project Documentation Template + + + + + + + + + + + + + + +
    + + + + + +

    Project Title

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Foo Class

    + +

    Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

    + +

    Important:  This is an important note with EMPHASIS.

    + +

    Features:

    + +
      +
    • Foo
    • +
    • Bar
    • +
    + +

    Usage Heading

    + +

    Within a text string, highlight variables using <var></var> tags, and highlight code using the <dfn></dfn> tags.

    + +

    Sub-heading

    + +

    Put code examples within <code></code> tags:

    + + + $this->load->library('foo');
    +
    + $this->foo->bar('bat'); +
    + + +

    Table Preferences

    + +

    Use tables where appropriate for long lists of preferences.

    + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    fooFooNoneDescription of foo.
    barBarbat, bag, or bakDescription of bar.
    + +

    Foo Function Reference

    + +

    $this->foo->bar()

    +

    Description

    +$this->foo->bar('baz') + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index a8e86039..ed9d1c83 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -1,147 +1,147 @@ - - - - - -Alternate PHP Syntax for View Files : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Alternate PHP Syntax for View Files

    - -

    If you do not utilize CodeIgniter's template engine, you'll be using pure PHP -in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use -PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, -and eliminate "echo" statements.

    - -

    Automatic Short Tag Support

    - -

    Note: If you find that the syntax described in this page does not work on your server it might -be that "short tags" are disabled in your PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, -allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your -config/config.php file.

    - -

    Please note that if you do use this feature, if PHP errors are encountered -in your view files, the error message and line number will not be accurately shown. Instead, all errors -will be shown as eval() errors.

    - - -

    Alternative Echos

    - -

    Normally to echo, or print out a variable you would do this:

    - -<?php echo $variable; ?> - -

    With the alternative syntax you can instead do it this way:

    - -<?=$variable?> - - - -

    Alternative Control Structures

    - -

    Controls structures, like if, for, foreach, and while can be -written in a simplified format as well. Here is an example using foreach:

    - - -<ul>
    -
    -<?php foreach($todo as $item): ?>
    -
    -<li><?=$item?></li>
    -
    -<?php endforeach; ?>
    -
    -</ul>
    - -

    Notice that there are no braces. Instead, the end brace is replaced with endforeach. -Each of the control structures listed above has a similar closing syntax: -endif, endfor, endforeach, and endwhile

    - -

    Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is -important!

    - -

    Here is another example, using if/elseif/else. Notice the colons:

    - - -<?php if ($username == 'sally'): ?>
    -
    -   <h3>Hi Sally</h3>
    -
    -<?php elseif ($username == 'joe'): ?>
    -
    -   <h3>Hi Joe</h3>
    -
    -<?php else: ?>
    -
    -   <h3>Hi unknown user</h3>
    -
    -<?php endif; ?>
    - - - -
    - - - - - - + + + + + +Alternate PHP Syntax for View Files : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Alternate PHP Syntax for View Files

    + +

    If you do not utilize CodeIgniter's template engine, you'll be using pure PHP +in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use +PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, +and eliminate "echo" statements.

    + +

    Automatic Short Tag Support

    + +

    Note: If you find that the syntax described in this page does not work on your server it might +be that "short tags" are disabled in your PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, +allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your +config/config.php file.

    + +

    Please note that if you do use this feature, if PHP errors are encountered +in your view files, the error message and line number will not be accurately shown. Instead, all errors +will be shown as eval() errors.

    + + +

    Alternative Echos

    + +

    Normally to echo, or print out a variable you would do this:

    + +<?php echo $variable; ?> + +

    With the alternative syntax you can instead do it this way:

    + +<?=$variable?> + + + +

    Alternative Control Structures

    + +

    Controls structures, like if, for, foreach, and while can be +written in a simplified format as well. Here is an example using foreach:

    + + +<ul>
    +
    +<?php foreach($todo as $item): ?>
    +
    +<li><?=$item?></li>
    +
    +<?php endforeach; ?>
    +
    +</ul>
    + +

    Notice that there are no braces. Instead, the end brace is replaced with endforeach. +Each of the control structures listed above has a similar closing syntax: +endif, endfor, endforeach, and endwhile

    + +

    Also notice that instead of using a semicolon after each structure (except the last one), there is a colon. This is +important!

    + +

    Here is another example, using if/elseif/else. Notice the colons:

    + + +<?php if ($username == 'sally'): ?>
    +
    +   <h3>Hi Sally</h3>
    +
    +<?php elseif ($username == 'joe'): ?>
    +
    +   <h3>Hi Joe</h3>
    +
    +<?php else: ?>
    +
    +   <h3>Hi unknown user</h3>
    +
    +<?php endif; ?>
    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 9a1d6cd8..274eb50f 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -1,117 +1,117 @@ - - - - - -Creating Ancillary Classes : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Creating Ancillary Classes

    - -

    In some cases you may want to develop classes that exist apart from your controllers but have the ability to -utilize all of CodeIgniter's resources. This is easily possible as you'll see.

    - -

    get_instance()

    - - -

    Any class that you instantiate within your controller functions can access CodeIgniter's native resources simply by using the get_instance() function. -This function returns the main CodeIgniter object.

    - -

    Normally, to call any of the available CodeIgniter functions requires you to use the $this construct:

    - - -$this->load->helper('url');
    -$this->load->library('session');
    -$this->config->item('base_url');
    -etc. -
    - -

    $this, however, only works within your controllers, your models, or your views. -If you would like to use CodeIgniter's classes from within your own custom classes you can do so as follows:

    - - -

    First, assign the CodeIgniter object to a variable:

    - -$CI =& get_instance(); - -

    Once you've assigned the object to a variable, you'll use that variable instead of $this:

    - - -$CI =& get_instance();

    -$CI->load->helper('url');
    -$CI->load->library('session');
    -$CI->config->item('base_url');
    -etc. -
    - -

    Note: You'll notice that the above get_instance() function is being passed by reference: -

    -$CI =& get_instance(); -

    -This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it.

    -
    - - - - - - + + + + + +Creating Ancillary Classes : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Creating Ancillary Classes

    + +

    In some cases you may want to develop classes that exist apart from your controllers but have the ability to +utilize all of CodeIgniter's resources. This is easily possible as you'll see.

    + +

    get_instance()

    + + +

    Any class that you instantiate within your controller functions can access CodeIgniter's native resources simply by using the get_instance() function. +This function returns the main CodeIgniter object.

    + +

    Normally, to call any of the available CodeIgniter functions requires you to use the $this construct:

    + + +$this->load->helper('url');
    +$this->load->library('session');
    +$this->config->item('base_url');
    +etc. +
    + +

    $this, however, only works within your controllers, your models, or your views. +If you would like to use CodeIgniter's classes from within your own custom classes you can do so as follows:

    + + +

    First, assign the CodeIgniter object to a variable:

    + +$CI =& get_instance(); + +

    Once you've assigned the object to a variable, you'll use that variable instead of $this:

    + + +$CI =& get_instance();

    +$CI->load->helper('url');
    +$CI->load->library('session');
    +$CI->config->item('base_url');
    +etc. +
    + +

    Note: You'll notice that the above get_instance() function is being passed by reference: +

    +$CI =& get_instance(); +

    +This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it.

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index b4bfae50..2ab547d8 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -1,101 +1,101 @@ - - - - - -Auto-loading Resources : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Auto-loading Resources

    - -

    CodeIgniter comes with an "Auto-load" feature that permits libraries, helpers, and plugins to be initialized -automatically every time the system runs. If you need certain resources globally throughout your application you should -consider auto-loading them for convenience.

    - -

    The following items can be loaded automatically:

    - -
      -
    • Core classes found in the "libraries" folder
    • -
    • Helper files found in the "helpers" folder
    • -
    • Plugins found in the "plugins" folder
    • -
    • Custom config files found in the "config" folder
    • -
    • Language files found in the "system/language" folder
    • -
    • Models found in the "models" folder
    • -
    - -

    To autoload resources, open the application/config/autoload.php file and add the item you want -loaded to the autoload array. You'll find instructions in that file corresponding to each -type of item.

    - -

    Note: Do not include the file extension (.php) when adding items to the autoload array.

    - - - - - - -
    - - - - - - + + + + + +Auto-loading Resources : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Auto-loading Resources

    + +

    CodeIgniter comes with an "Auto-load" feature that permits libraries, helpers, and plugins to be initialized +automatically every time the system runs. If you need certain resources globally throughout your application you should +consider auto-loading them for convenience.

    + +

    The following items can be loaded automatically:

    + +
      +
    • Core classes found in the "libraries" folder
    • +
    • Helper files found in the "helpers" folder
    • +
    • Plugins found in the "plugins" folder
    • +
    • Custom config files found in the "config" folder
    • +
    • Language files found in the "system/language" folder
    • +
    • Models found in the "models" folder
    • +
    + +

    To autoload resources, open the application/config/autoload.php file and add the item you want +loaded to the autoload array. You'll find instructions in that file corresponding to each +type of item.

    + +

    Note: Do not include the file extension (.php) when adding items to the autoload array.

    + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 0a6d9d65..df433523 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -1,115 +1,115 @@ - - - - - -Web Page Caching : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Web Page Caching

    - -

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    - -

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the -server resources, memory, and processing cycles utilized, which affect your page load speeds. -By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    - - -

    How Does Caching Work?

    - -

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. -When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved -and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    - -

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    - -

    Enabling Caching

    - -

    To enable caching, put the following tag in any of your controller functions:

    - -$this->output->cache(n); - -

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    - -

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems -most logical to you. Once the tag is in place, your pages will begin being cached.

    - -

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    -

    Note: Before the cache files can be written you must set the file permissions on your -system/cache folder such that it is writable.

    - -

    Deleting Caches

    - -

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: -Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you -will need to manually delete it from your cache folder.

    - - - -
    - - - - - - + + + + + +Web Page Caching : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Web Page Caching

    + +

    CodeIgniter lets you cache your pages in order to achieve maximum performance.

    + +

    Although CodeIgniter is quite fast, the amount of dynamic information you display in your pages will correlate directly to the +server resources, memory, and processing cycles utilized, which affect your page load speeds. +By caching your pages, since they are saved in their fully rendered state, you can achieve performance that nears that of static web pages.

    + + +

    How Does Caching Work?

    + +

    Caching can be enabled on a per-page basis, and you can set the length of time that a page should remain cached before being refreshed. +When a page is loaded for the first time, the cache file will be written to your system/cache folder. On subsequent page loads the cache file will be retrieved +and sent to the requesting user's browser. If it has expired, it will be deleted and refreshed before being sent to the browser.

    + +

    Note: The Benchmark tag is not cached so you can still view your page load speed when caching is enabled.

    + +

    Enabling Caching

    + +

    To enable caching, put the following tag in any of your controller functions:

    + +$this->output->cache(n); + +

    Where n is the number of minutes you wish the page to remain cached between refreshes.

    + +

    The above tag can go anywhere within a function. It is not affected by the order that it appears, so place it wherever it seems +most logical to you. Once the tag is in place, your pages will begin being cached.

    + +

    Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

    +

    Note: Before the cache files can be written you must set the file permissions on your +system/cache folder such that it is writable.

    + +

    Deleting Caches

    + +

    If you no longer wish to cache a file you can remove the caching tag and it will no longer be refreshed when it expires. Note: +Removing the tag will not delete the cache immediately. It will have to expire normally. If you need to remove it earlier you +will need to manually delete it from your cache folder.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 432ba02c..7f49e398 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -1,90 +1,90 @@ - - - - - -Common Functions : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Common Functions

    - -

    CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.

    -

    is_really_writable('path/to/file')

    -

    is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

    -if (is_really_writable('file.txt'))
    -{
    -    echo "I could write to this if I wanted to";
    -}
    -else
    -{
    -    echo "File is not writable";
    -}
    -

    config_item('item_key')

    -

    The Config library is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.

    -

    show_error('message'), show_404('page'), log_message('level', 'message')

    -

    These are each outlined on the Error Handling page.

    -
    - - - - - - + + + + + +Common Functions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Common Functions

    + +

    CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.

    +

    is_really_writable('path/to/file')

    +

    is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

    +if (is_really_writable('file.txt'))
    +{
    +    echo "I could write to this if I wanted to";
    +}
    +else
    +{
    +    echo "File is not writable";
    +}
    +

    config_item('item_key')

    +

    The Config library is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.

    +

    show_error('message'), show_404('page'), log_message('level', 'message')

    +

    These are each outlined on the Error Handling page.

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index cb7f80ea..f11d0921 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -1,385 +1,385 @@ - - - - - -Controllers : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Controllers

    - -

    Controllers are the heart of your application, as they determine how HTTP requests should be handled.

    - - - - - - -

    What is a Controller?

    - -

    A Controller is simply a class file that is named in a way that can be associated with a URI.

    - -

    Consider this URI:

    - -example.com/index.php/blog/ - -

    In the above example, CodeIgniter would attempt to find a controller named blog.php and load it.

    - -

    When a controller's name matches the first segment of a URI, it will be loaded.

    - - -

    Let's try it:  Hello World!

    - -

    Let's create a simple controller so you can see it in action. Using your text editor, create a file called blog.php, and put the following code in it:

    - - - - - - -

    Then save the file to your application/controllers/ folder.

    - -

    Now visit the your site using a URL similar to this:

    - -example.com/index.php/blog/ - -

    If you did it right, you should see Hello World!.

    - -

    Note: Class names must start with an uppercase letter. In other words, this is valid:

    - -<?php
    -class Blog extends Controller {
    -
    -}
    -?>
    - -

    This is not valid:

    - -<?php
    -class blog extends Controller {
    -
    -}
    -?>
    - -

    Also, always make sure your controller extends the parent controller class so that it can inherit all its functions.

    - - - - -

    Functions

    - -

    In the above example the function name is index(). The "index" function is always loaded by default if the -second segment of the URI is empty. Another way to show your "Hello World" message would be this:

    - -example.com/index.php/blog/index/ - -

    The second segment of the URI determines which function in the controller gets called.

    - -

    Let's try it. Add a new function to your controller:

    - - - - -

    Now load the following URL to see the comment function:

    - -example.com/index.php/blog/comments/ - -

    You should see your new message.

    - - -

    Passing URI Segments to your Functions

    - -

    If your URI contains more then two segments they will be passed to your function as parameters.

    - -

    For example, lets say you have a URI like this:

    - -example.com/index.php/products/shoes/sandals/123 - -

    Your function will be passed URI segments 3 and 4 ("sandals" and "123"):

    - - -<?php
    -class Products extends Controller {
    -
    -    function shoes($sandals, $id)
    -    {
    -        echo $sandals;
    -        echo $id;
    -    }
    -}
    -?> -
    - -

    Important:  If you are using the URI Routing feature, the segments -passed to your function will be the re-routed ones.

    - - - -

    Defining a Default Controller

    - -

    CodeIgniter can be told to load a default controller when a URI is not present, -as will be the case when only your site root URL is requested. To specify a default controller, open -your application/config/routes.php file and set this variable:

    - -$route['default_controller'] = 'Blog'; - -

    Where Blog is the name of the controller class you want used. If you now load your main index.php file without -specifying any URI segments you'll see your Hello World message by default.

    - - - - -

    Remapping Function Calls

    - -

    As noted above, the second segment of the URI typically determines which function in the controller gets called. -CodeIgniter permits you to override this behavior through the use of the _remap() function:

    - -function _remap()
    -{
    -    // Some code here...
    -}
    - -

    Important:  If your controller contains a function named _remap(), it will always -get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called, -allowing you to define your own function routing rules.

    - -

    The overridden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:

    - -function _remap($method)
    -{
    -    if ($method == 'some_method')
    -    {
    -        $this->$method();
    -    }
    -    else
    -    {
    -        $this->default_method();
    -    }
    -}
    - - - - - - -

    Processing Output

    - -

    CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this can be found in the -Views and Output class pages. In some cases, however, you might want to -post-process the finalized data in some way and send it to the browser yourself. CodeIgniter permits you to -add a function named _output() to your controller that will receive the finalized output data.

    - -

    Important:  If your controller contains a function named _output(), it will always -be called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.

    - -

    Here is an example:

    - - -function _output($output)
    -{
    -    echo $output;
    -}
    - -

    Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered, -cache files written (if you have caching enabled), and headers will be sent (if you use that feature) -before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate -since they will not take into acccount any further processing you do. For an alternate way to control output before any of the final processing is done, please see -the available methods in the Output Class.

    - - -

    Private Functions

    - - -

    In some cases you may want certain functions hidden from public access. To make a function private, simply add an -underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this:

    - - -function _utility()
    -{
    -  // some code
    -}
    - -

    Trying to access it via the URL, like this, will not work:

    - -example.com/index.php/blog/_utility/ - - - - -

    Organizing Your Controllers into Sub-folders

    - -

    If you are building a large application you might find it convenient to organize your controllers into sub-folders. CodeIgniter permits you to do this.

    - -

    Simply create folders within your application/controllers directory and place your controller classes within them.

    - -

    Note:  When using this feature the first segment of your URI must specify the folder. For example, lets say you have a controller -located here:

    - -application/controllers/products/shoes.php - -

    To call the above controller your URI will look something like this:

    - -example.com/index.php/products/shoes/show/123 - -

    Each of your sub-folders may contain a default controller which will be -called if the URL contains only the sub-folder. Simply name your default controller as specified in your -application/config/routes.php file

    - - -

    CodeIgniter also permits you to remap your URIs using its URI Routing feature.

    - - -

    Class Constructors

    - - -

    If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:

    - -parent::Controller(); - -

    The reason this line is necessary is because your local constructor will be overriding the one in the parent controller class so we need to manually call it.

    - - -

    If you are not familiar with constructors, in PHP 4, a constructor is simply a function that has the exact same name as the class:

    - - -<?php
    -class Blog extends Controller {
    -
    -       function Blog()
    -       {
    -            parent::Controller();
    -       }
    -}
    -?>
    - -

    In PHP 5, constructors use the following syntax:

    - - -<?php
    -class Blog extends Controller {
    -
    -       function __construct()
    -       {
    -            parent::Controller();
    -       }
    -}
    -?>
    - -

    Constructors are useful if you need to set some default values, or run a default process when your class is instantiated. -Constructors can't return a value, but they can do some default work.

    - - -

    Reserved Function Names

    - -

    Since your controller classes will extend the main application controller you -must be careful not to name your functions identically to the ones used by that class, otherwise your local functions -will override them. See Reserved Names for a full list.

    - -

    That's it!

    - -

    That, in a nutshell, is all there is to know about controllers.

    - - - -
    - - - - - - + + + + + +Controllers : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Controllers

    + +

    Controllers are the heart of your application, as they determine how HTTP requests should be handled.

    + + + + + + +

    What is a Controller?

    + +

    A Controller is simply a class file that is named in a way that can be associated with a URI.

    + +

    Consider this URI:

    + +example.com/index.php/blog/ + +

    In the above example, CodeIgniter would attempt to find a controller named blog.php and load it.

    + +

    When a controller's name matches the first segment of a URI, it will be loaded.

    + + +

    Let's try it:  Hello World!

    + +

    Let's create a simple controller so you can see it in action. Using your text editor, create a file called blog.php, and put the following code in it:

    + + + + + + +

    Then save the file to your application/controllers/ folder.

    + +

    Now visit the your site using a URL similar to this:

    + +example.com/index.php/blog/ + +

    If you did it right, you should see Hello World!.

    + +

    Note: Class names must start with an uppercase letter. In other words, this is valid:

    + +<?php
    +class Blog extends Controller {
    +
    +}
    +?>
    + +

    This is not valid:

    + +<?php
    +class blog extends Controller {
    +
    +}
    +?>
    + +

    Also, always make sure your controller extends the parent controller class so that it can inherit all its functions.

    + + + + +

    Functions

    + +

    In the above example the function name is index(). The "index" function is always loaded by default if the +second segment of the URI is empty. Another way to show your "Hello World" message would be this:

    + +example.com/index.php/blog/index/ + +

    The second segment of the URI determines which function in the controller gets called.

    + +

    Let's try it. Add a new function to your controller:

    + + + + +

    Now load the following URL to see the comment function:

    + +example.com/index.php/blog/comments/ + +

    You should see your new message.

    + + +

    Passing URI Segments to your Functions

    + +

    If your URI contains more then two segments they will be passed to your function as parameters.

    + +

    For example, lets say you have a URI like this:

    + +example.com/index.php/products/shoes/sandals/123 + +

    Your function will be passed URI segments 3 and 4 ("sandals" and "123"):

    + + +<?php
    +class Products extends Controller {
    +
    +    function shoes($sandals, $id)
    +    {
    +        echo $sandals;
    +        echo $id;
    +    }
    +}
    +?> +
    + +

    Important:  If you are using the URI Routing feature, the segments +passed to your function will be the re-routed ones.

    + + + +

    Defining a Default Controller

    + +

    CodeIgniter can be told to load a default controller when a URI is not present, +as will be the case when only your site root URL is requested. To specify a default controller, open +your application/config/routes.php file and set this variable:

    + +$route['default_controller'] = 'Blog'; + +

    Where Blog is the name of the controller class you want used. If you now load your main index.php file without +specifying any URI segments you'll see your Hello World message by default.

    + + + + +

    Remapping Function Calls

    + +

    As noted above, the second segment of the URI typically determines which function in the controller gets called. +CodeIgniter permits you to override this behavior through the use of the _remap() function:

    + +function _remap()
    +{
    +    // Some code here...
    +}
    + +

    Important:  If your controller contains a function named _remap(), it will always +get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called, +allowing you to define your own function routing rules.

    + +

    The overridden function call (typically the second segment of the URI) will be passed as a parameter the _remap() function:

    + +function _remap($method)
    +{
    +    if ($method == 'some_method')
    +    {
    +        $this->$method();
    +    }
    +    else
    +    {
    +        $this->default_method();
    +    }
    +}
    + + + + + + +

    Processing Output

    + +

    CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this can be found in the +Views and Output class pages. In some cases, however, you might want to +post-process the finalized data in some way and send it to the browser yourself. CodeIgniter permits you to +add a function named _output() to your controller that will receive the finalized output data.

    + +

    Important:  If your controller contains a function named _output(), it will always +be called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.

    + +

    Here is an example:

    + + +function _output($output)
    +{
    +    echo $output;
    +}
    + +

    Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered, +cache files written (if you have caching enabled), and headers will be sent (if you use that feature) +before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate +since they will not take into acccount any further processing you do. For an alternate way to control output before any of the final processing is done, please see +the available methods in the Output Class.

    + + +

    Private Functions

    + + +

    In some cases you may want certain functions hidden from public access. To make a function private, simply add an +underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this:

    + + +function _utility()
    +{
    +  // some code
    +}
    + +

    Trying to access it via the URL, like this, will not work:

    + +example.com/index.php/blog/_utility/ + + + + +

    Organizing Your Controllers into Sub-folders

    + +

    If you are building a large application you might find it convenient to organize your controllers into sub-folders. CodeIgniter permits you to do this.

    + +

    Simply create folders within your application/controllers directory and place your controller classes within them.

    + +

    Note:  When using this feature the first segment of your URI must specify the folder. For example, lets say you have a controller +located here:

    + +application/controllers/products/shoes.php + +

    To call the above controller your URI will look something like this:

    + +example.com/index.php/products/shoes/show/123 + +

    Each of your sub-folders may contain a default controller which will be +called if the URL contains only the sub-folder. Simply name your default controller as specified in your +application/config/routes.php file

    + + +

    CodeIgniter also permits you to remap your URIs using its URI Routing feature.

    + + +

    Class Constructors

    + + +

    If you intend to use a constructor in any of your Controllers, you MUST place the following line of code in it:

    + +parent::Controller(); + +

    The reason this line is necessary is because your local constructor will be overriding the one in the parent controller class so we need to manually call it.

    + + +

    If you are not familiar with constructors, in PHP 4, a constructor is simply a function that has the exact same name as the class:

    + + +<?php
    +class Blog extends Controller {
    +
    +       function Blog()
    +       {
    +            parent::Controller();
    +       }
    +}
    +?>
    + +

    In PHP 5, constructors use the following syntax:

    + + +<?php
    +class Blog extends Controller {
    +
    +       function __construct()
    +       {
    +            parent::Controller();
    +       }
    +}
    +?>
    + +

    Constructors are useful if you need to set some default values, or run a default process when your class is instantiated. +Constructors can't return a value, but they can do some default work.

    + + +

    Reserved Function Names

    + +

    Since your controller classes will extend the main application controller you +must be careful not to name your functions identically to the ones used by that class, otherwise your local functions +will override them. See Reserved Names for a full list.

    + +

    That's it!

    + +

    That, in a nutshell, is all there is to know about controllers.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index a8168239..ca95ad33 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -1,185 +1,185 @@ - - - - - -Creating Core System Classes : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Creating Core System Classes

    - -

    Every time CodeIgniter runs there are several base classes that are initialized automatically as part of the core framework. -It is possible, however, to swap any of the core system classes with your own versions or even extend the core versions.

    - -

    Most users will never have any need to do this, -but the option to replace or extend them does exist for those who would like to significantly alter the CodeIgniter core. -

    - -

    Note:  Messing with a core system class has a lot of implications, so make sure you -know what you are doing before attempting it.

    - - -

    System Class List

    - -

    The following is a list of the core system files that are invoked every time CodeIgniter runs:

    - -
      -
    • Benchmark
    • -
    • Config
    • -
    • Controller
    • -
    • Exceptions
    • -
    • Hooks
    • -
    • Input
    • -
    • Language
    • -
    • Loader
    • -
    • Log
    • -
    • Output
    • -
    • Router
    • -
    • URI
    • -
    - -

    Replacing Core Classes

    - -

    To use one of your own system classes instead of a default one simply place your version inside your local application/libraries directory:

    - -application/libraries/some-class.php - -

    If this directory does not exist you can create it.

    - -

    Any file named identically to one from the list above will be used instead of the one normally used.

    - -

    Please note that your class must use CI as a prefix. For example, if your file is named Input.php the class will be named:

    - - -class CI_Input {

    - -} -
    - - - -

    Extending Core Class

    - -

    If all you need to do is add some functionality to an existing library - perhaps add a function or two - then -it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. -Extending a class is nearly identical to replacing a class with a couple exceptions:

    - -
      -
    • The class declaration must extend the parent class.
    • -
    • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
    • -
    - -

    For example, to extend the native Input class you'll create a file named application/libraries/MY_Input.php, and declare your class with:

    - - -class MY_Input extends CI_Input {

    - -}
    - -

    Note: If you need to use a constructor in your class make sure you extend the parent constructor:

    - - -class MY_Input extends CI_Input {
    -
    -    function My_Input()
    -    {
    -        parent::CI_Input();
    -    }
    -}
    - -

    Tip:  Any functions in your class that are named identically to the functions in the parent class will be used instead of the native ones -(this is known as "method overriding"). -This allows you to substantially alter the CodeIgniter core.

    - -

    If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.

    - -class Welcome extends MY_Controller {
    -
    -    function Welcome()
    -    {
    -        parent::MY_Controller();
    -    }
    -
    -    function index()
    -    {
    -        $this->load->view('welcome_message');
    -    }
    -}
    - -

    Setting Your Own Prefix

    - -

    To set your own sub-class prefix, open your application/config/config.php file and look for this item:

    - -$config['subclass_prefix'] = 'MY_'; - -

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    - - - - -
    - - - - - - + + + + + +Creating Core System Classes : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Creating Core System Classes

    + +

    Every time CodeIgniter runs there are several base classes that are initialized automatically as part of the core framework. +It is possible, however, to swap any of the core system classes with your own versions or even extend the core versions.

    + +

    Most users will never have any need to do this, +but the option to replace or extend them does exist for those who would like to significantly alter the CodeIgniter core. +

    + +

    Note:  Messing with a core system class has a lot of implications, so make sure you +know what you are doing before attempting it.

    + + +

    System Class List

    + +

    The following is a list of the core system files that are invoked every time CodeIgniter runs:

    + +
      +
    • Benchmark
    • +
    • Config
    • +
    • Controller
    • +
    • Exceptions
    • +
    • Hooks
    • +
    • Input
    • +
    • Language
    • +
    • Loader
    • +
    • Log
    • +
    • Output
    • +
    • Router
    • +
    • URI
    • +
    + +

    Replacing Core Classes

    + +

    To use one of your own system classes instead of a default one simply place your version inside your local application/libraries directory:

    + +application/libraries/some-class.php + +

    If this directory does not exist you can create it.

    + +

    Any file named identically to one from the list above will be used instead of the one normally used.

    + +

    Please note that your class must use CI as a prefix. For example, if your file is named Input.php the class will be named:

    + + +class CI_Input {

    + +} +
    + + + +

    Extending Core Class

    + +

    If all you need to do is add some functionality to an existing library - perhaps add a function or two - then +it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. +Extending a class is nearly identical to replacing a class with a couple exceptions:

    + +
      +
    • The class declaration must extend the parent class.
    • +
    • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
    • +
    + +

    For example, to extend the native Input class you'll create a file named application/libraries/MY_Input.php, and declare your class with:

    + + +class MY_Input extends CI_Input {

    + +}
    + +

    Note: If you need to use a constructor in your class make sure you extend the parent constructor:

    + + +class MY_Input extends CI_Input {
    +
    +    function My_Input()
    +    {
    +        parent::CI_Input();
    +    }
    +}
    + +

    Tip:  Any functions in your class that are named identically to the functions in the parent class will be used instead of the native ones +(this is known as "method overriding"). +This allows you to substantially alter the CodeIgniter core.

    + +

    If you are extending the Controller core class, then be sure to extend your new class in your application controller's constructors.

    + +class Welcome extends MY_Controller {
    +
    +    function Welcome()
    +    {
    +        parent::MY_Controller();
    +    }
    +
    +    function index()
    +    {
    +        $this->load->view('welcome_message');
    +    }
    +}
    + +

    Setting Your Own Prefix

    + +

    To set your own sub-class prefix, open your application/config/config.php file and look for this item:

    + +$config['subclass_prefix'] = 'MY_'; + +

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 15dfcec1..beac1959 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -1,298 +1,298 @@ - - - - - -Creating Libraries : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Creating Libraries

    - -

    When we use the term "Libraries" we are normally referring to the classes that are located in the libraries -directory and described in the Class Reference of this user guide. In this case, however, we will instead describe how you can create -your own libraries within your application/libraries directory in order to maintain separation between your local resources -and the global framework resources.

    - -

    As an added bonus, CodeIgniter permits your libraries to extend native classes if you simply need to add some functionality -to an existing library. Or you can even replace native libraries just by placing identically named versions in your application/libraries folder.

    - -

    In summary:

    - -
      -
    • You can create entirely new libraries.
    • -
    • You can extend native libraries.
    • -
    • You can replace native libraries.
    • -
    - -

    The page below explains these three concepts in detail.

    - -

    Note: The Database classes can not be extended or replaced with your own classes, -nor can the Loader class in PHP 4. All other classes are able to be replaced/extended.

    - - -

    Storage

    - -

    Your library classes should be placed within your application/libraries folder, as this is where CodeIgniter will look for them when -they are initialized.

    - - -

    Naming Conventions

    - -
      -
    • File names must be capitalized. For example:  Myclass.php
    • -
    • Class declarations must be capitalized. For example:  class Myclass
    • -
    • Class names and file names must match.
    • -
    - - -

    The Class File

    - -

    Classes should have this basic prototype (Note: We are using the name Someclass purely as an example):

    - -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); -

    -class Someclass {
    -
    -    function some_function()
    -    {
    -    }
    -}

    -?>
    - - -

    Using Your Class

    - -

    From within any of your Controller functions you can initialize your class using the standard:

    - -$this->load->library('someclass'); - -

    Where someclass is the file name, without the ".php" file extension. You can submit the file name capitalized or lower case. -CodeIgniter doesn't care.

    - -

    Once loaded you can access your class using the lower case version:

    - -$this->someclass->some_function();  // Object instances will always be lower case - - - - -

    Passing Parameters When Initializing Your Class

    - -

    In the library loading function you can dynamically pass data via the second parameter and it will be passed to your class -constructor:

    - - -$params = array('type' => 'large', 'color' => 'red');
    -
    -$this->load->library('Someclass', $params);
    - -

    If you use this feature you must set up your class constructor to expect data:

    - -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    -
    -class Someclass {
    -
    -    function Someclass($params)
    -    {
    -        // Do something with $params
    -    }
    -}

    -?>
    - -

    You can also pass parameters stored in a config file. Simply create a config file named identically to the class file name -and store it in your application/config/ folder. Note that if you dynamically pass parameters as described above, -the config file option will not be available.

    - - - - - - - -

    Utilizing CodeIgniter Resources within Your Library

    - - -

    To access CodeIgniter's native resources within your library use the get_instance() function. -This function returns the CodeIgniter super object.

    - -

    Normally from within your controller functions you will call any of the available CodeIgniter functions using the $this construct:

    - - -$this->load->helper('url');
    -$this->load->library('session');
    -$this->config->item('base_url');
    -etc. -
    - -

    $this, however, only works directly within your controllers, your models, or your views. -If you would like to use CodeIgniter's classes from within your own custom classes you can do so as follows:

    - - -

    First, assign the CodeIgniter object to a variable:

    - -$CI =& get_instance(); - -

    Once you've assigned the object to a variable, you'll use that variable instead of $this:

    - - -$CI =& get_instance();
    -
    -$CI->load->helper('url');
    -$CI->load->library('session');
    -$CI->config->item('base_url');
    -etc. -
    - -

    Note: You'll notice that the above get_instance() function is being passed by reference: -

    -$CI =& get_instance(); -
    -
    -This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it. -

    -Also, please note: If you are running PHP 4 it's usually best to avoid calling get_instance() -from within your class constructors. PHP 4 has trouble referencing the CI super object within application constructors -since objects do not exist until the class is fully instantiated.

    - - -

    Replacing Native Libraries with Your Versions

    - -

    Simply by naming your class files identically to a native library will cause CodeIgniter to use it instead of the native one. To use this -feature you must name the file and the class declaration exactly the same as the native library. For example, to replace the native Email library -you'll create a file named application/libraries/Email.php, and declare your class with:

    - - -class CI_Email {

    - -}
    - -

    Note that most native classes are prefixed with CI_.

    - -

    To load your library you'll see the standard loading function:

    - -$this->load->library('email'); - -

    Note: At this time the Database classes can not be replaced with your own versions.

    - - -

    Extending Native Libraries

    - -

    If all you need to do is add some functionality to an existing library - perhaps add a function or two - then -it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. -Extending a class is nearly identical to replacing a class with a couple exceptions:

    - -
      -
    • The class declaration must extend the parent class.
    • -
    • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
    • -
    - -

    For example, to extend the native Email class you'll create a file named application/libraries/MY_Email.php, and declare your class with:

    - - -class MY_Email extends CI_Email {

    - -}
    - -

    Note: If you need to use a constructor in your class make sure you extend the parent constructor:

    - - - -class MY_Email extends CI_Email {
    -
    -    function My_Email()
    -    {
    -        parent::CI_Email();
    -    }
    -}
    - - -

    Loading Your Sub-class

    - -

    To load your sub-class you'll use the standard syntax normally used. DO NOT include your prefix. For example, -to load the example above, which extends the Email class, you will use:

    - -$this->load->library('email'); - -

    Once loaded you will use the class variable as you normally would for the class you are extending. In the case of -the email class all calls will use:

    - - -$this->email->some_function(); - - -

    Setting Your Own Prefix

    - -

    To set your own sub-class prefix, open your application/config/config.php file and look for this item:

    - -$config['subclass_prefix'] = 'MY_'; - -

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    - - - -
    - - - - - - + + + + + +Creating Libraries : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Creating Libraries

    + +

    When we use the term "Libraries" we are normally referring to the classes that are located in the libraries +directory and described in the Class Reference of this user guide. In this case, however, we will instead describe how you can create +your own libraries within your application/libraries directory in order to maintain separation between your local resources +and the global framework resources.

    + +

    As an added bonus, CodeIgniter permits your libraries to extend native classes if you simply need to add some functionality +to an existing library. Or you can even replace native libraries just by placing identically named versions in your application/libraries folder.

    + +

    In summary:

    + +
      +
    • You can create entirely new libraries.
    • +
    • You can extend native libraries.
    • +
    • You can replace native libraries.
    • +
    + +

    The page below explains these three concepts in detail.

    + +

    Note: The Database classes can not be extended or replaced with your own classes, +nor can the Loader class in PHP 4. All other classes are able to be replaced/extended.

    + + +

    Storage

    + +

    Your library classes should be placed within your application/libraries folder, as this is where CodeIgniter will look for them when +they are initialized.

    + + +

    Naming Conventions

    + +
      +
    • File names must be capitalized. For example:  Myclass.php
    • +
    • Class declarations must be capitalized. For example:  class Myclass
    • +
    • Class names and file names must match.
    • +
    + + +

    The Class File

    + +

    Classes should have this basic prototype (Note: We are using the name Someclass purely as an example):

    + +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +

    +class Someclass {
    +
    +    function some_function()
    +    {
    +    }
    +}

    +?>
    + + +

    Using Your Class

    + +

    From within any of your Controller functions you can initialize your class using the standard:

    + +$this->load->library('someclass'); + +

    Where someclass is the file name, without the ".php" file extension. You can submit the file name capitalized or lower case. +CodeIgniter doesn't care.

    + +

    Once loaded you can access your class using the lower case version:

    + +$this->someclass->some_function();  // Object instances will always be lower case + + + + +

    Passing Parameters When Initializing Your Class

    + +

    In the library loading function you can dynamically pass data via the second parameter and it will be passed to your class +constructor:

    + + +$params = array('type' => 'large', 'color' => 'red');
    +
    +$this->load->library('Someclass', $params);
    + +

    If you use this feature you must set up your class constructor to expect data:

    + +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    +
    +class Someclass {
    +
    +    function Someclass($params)
    +    {
    +        // Do something with $params
    +    }
    +}

    +?>
    + +

    You can also pass parameters stored in a config file. Simply create a config file named identically to the class file name +and store it in your application/config/ folder. Note that if you dynamically pass parameters as described above, +the config file option will not be available.

    + + + + + + + +

    Utilizing CodeIgniter Resources within Your Library

    + + +

    To access CodeIgniter's native resources within your library use the get_instance() function. +This function returns the CodeIgniter super object.

    + +

    Normally from within your controller functions you will call any of the available CodeIgniter functions using the $this construct:

    + + +$this->load->helper('url');
    +$this->load->library('session');
    +$this->config->item('base_url');
    +etc. +
    + +

    $this, however, only works directly within your controllers, your models, or your views. +If you would like to use CodeIgniter's classes from within your own custom classes you can do so as follows:

    + + +

    First, assign the CodeIgniter object to a variable:

    + +$CI =& get_instance(); + +

    Once you've assigned the object to a variable, you'll use that variable instead of $this:

    + + +$CI =& get_instance();
    +
    +$CI->load->helper('url');
    +$CI->load->library('session');
    +$CI->config->item('base_url');
    +etc. +
    + +

    Note: You'll notice that the above get_instance() function is being passed by reference: +

    +$CI =& get_instance(); +
    +
    +This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it. +

    +Also, please note: If you are running PHP 4 it's usually best to avoid calling get_instance() +from within your class constructors. PHP 4 has trouble referencing the CI super object within application constructors +since objects do not exist until the class is fully instantiated.

    + + +

    Replacing Native Libraries with Your Versions

    + +

    Simply by naming your class files identically to a native library will cause CodeIgniter to use it instead of the native one. To use this +feature you must name the file and the class declaration exactly the same as the native library. For example, to replace the native Email library +you'll create a file named application/libraries/Email.php, and declare your class with:

    + + +class CI_Email {

    + +}
    + +

    Note that most native classes are prefixed with CI_.

    + +

    To load your library you'll see the standard loading function:

    + +$this->load->library('email'); + +

    Note: At this time the Database classes can not be replaced with your own versions.

    + + +

    Extending Native Libraries

    + +

    If all you need to do is add some functionality to an existing library - perhaps add a function or two - then +it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. +Extending a class is nearly identical to replacing a class with a couple exceptions:

    + +
      +
    • The class declaration must extend the parent class.
    • +
    • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
    • +
    + +

    For example, to extend the native Email class you'll create a file named application/libraries/MY_Email.php, and declare your class with:

    + + +class MY_Email extends CI_Email {

    + +}
    + +

    Note: If you need to use a constructor in your class make sure you extend the parent constructor:

    + + + +class MY_Email extends CI_Email {
    +
    +    function My_Email()
    +    {
    +        parent::CI_Email();
    +    }
    +}
    + + +

    Loading Your Sub-class

    + +

    To load your sub-class you'll use the standard syntax normally used. DO NOT include your prefix. For example, +to load the example above, which extends the Email class, you will use:

    + +$this->load->library('email'); + +

    Once loaded you will use the class variable as you normally would for the class you are extending. In the case of +the email class all calls will use:

    + + +$this->email->some_function(); + + +

    Setting Your Own Prefix

    + +

    To set your own sub-class prefix, open your application/config/config.php file and look for this item:

    + +$config['subclass_prefix'] = 'MY_'; + +

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index be52fe83..5dae4d76 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -1,86 +1,86 @@ - - - - - -Credits : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Credits

    - -

    CodeIgniter was originally developed by Rick Ellis (CEO of -Ellislab, Inc.). The framework was written for performance in the real -world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of -ExpressionEngine.

    - -

    It is currently developed and maintained by the ExpressionEngine Development Team.

    - -

    A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and for -bringing frameworks into the general consciousness of the web community.

    - -
    - - - - - - + + + + + +Credits : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Credits

    + +

    CodeIgniter was originally developed by Rick Ellis (CEO of +Ellislab, Inc.). The framework was written for performance in the real +world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of +ExpressionEngine.

    + +

    It is currently developed and maintained by the ExpressionEngine Development Team.

    + +

    A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and for +bringing frameworks into the general consciousness of the web community.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 07dc1b3d..036eacae 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -1,137 +1,137 @@ - - - - - -Error Handling : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Error Handling

    - -

    CodeIgniter lets you build error reporting into your applications using the functions described below. -In addition, it has an error logging class that permits error and debugging messages to be saved as text files.

    - -

    Note: By default, CodeIgniter displays all PHP errors. You might -wish to change this behavior once your development is complete. You'll find the error_reporting() -function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files -from being written if there are errors.

    - -

    Unlike most systems in CodeIgniter, the error functions are simple procedural interfaces that are available -globally throughout the application. This approach permits error messages to get triggered without having to worry -about class/function scoping.

    - -

    The following functions let you generate errors:

    - -

    show_error('message')

    -

    This function will display the error message supplied to it using the following error template:

    -

    application/errors/error_general.php

    - -

    show_404('page')

    -

    This function will display the 404 error message supplied to it using the following error template:

    -

    application/errors/error_404.php

    - -

    The function expects the string passed to it to be the file path to the page that isn't found. -Note that CodeIgniter automatically shows 404 messages if controllers are not found.

    - - -

    log_message('level', 'message')

    - -

    This function lets you write messages to your log files. You must supply one of three "levels" -in the first parameter, indicating what type of message it is (debug, error, info), with the message -itself in the second parameter. Example:

    - - -if ($some_var == "")
    -{
    -    log_message('error', 'Some variable did not contain a value.');
    -}
    -else
    -{
    -    log_message('debug', 'Some variable was correctly set');
    -}
    -
    -log_message('info', 'The purpose of some variable is to provide some value.');
    -
    - -

    There are three message types:

    - -
      -
    1. Error Messages. These are actual errors, such as PHP errors or user errors.
    2. -
    3. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.
    4. -
    5. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application.
    6. -
    - - -

    Note: In order for the log file to actually be written, the - "logs" folder must be writable. In addition, you must set the "threshold" for logging. -You might, for example, only want error messages to be logged, and not the other two types. -If you set it to zero logging will be disabled.

    - - - -
    - - - - - - + + + + + +Error Handling : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Error Handling

    + +

    CodeIgniter lets you build error reporting into your applications using the functions described below. +In addition, it has an error logging class that permits error and debugging messages to be saved as text files.

    + +

    Note: By default, CodeIgniter displays all PHP errors. You might +wish to change this behavior once your development is complete. You'll find the error_reporting() +function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files +from being written if there are errors.

    + +

    Unlike most systems in CodeIgniter, the error functions are simple procedural interfaces that are available +globally throughout the application. This approach permits error messages to get triggered without having to worry +about class/function scoping.

    + +

    The following functions let you generate errors:

    + +

    show_error('message')

    +

    This function will display the error message supplied to it using the following error template:

    +

    application/errors/error_general.php

    + +

    show_404('page')

    +

    This function will display the 404 error message supplied to it using the following error template:

    +

    application/errors/error_404.php

    + +

    The function expects the string passed to it to be the file path to the page that isn't found. +Note that CodeIgniter automatically shows 404 messages if controllers are not found.

    + + +

    log_message('level', 'message')

    + +

    This function lets you write messages to your log files. You must supply one of three "levels" +in the first parameter, indicating what type of message it is (debug, error, info), with the message +itself in the second parameter. Example:

    + + +if ($some_var == "")
    +{
    +    log_message('error', 'Some variable did not contain a value.');
    +}
    +else
    +{
    +    log_message('debug', 'Some variable was correctly set');
    +}
    +
    +log_message('info', 'The purpose of some variable is to provide some value.');
    +
    + +

    There are three message types:

    + +
      +
    1. Error Messages. These are actual errors, such as PHP errors or user errors.
    2. +
    3. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info.
    4. +
    5. Informational Messages. These are the lowest priority messages, simply giving information regarding some process. CodeIgniter doesn't natively generate any info messages but you may want to in your application.
    6. +
    + + +

    Note: In order for the log file to actually be written, the + "logs" folder must be writable. In addition, you must set the "threshold" for logging. +You might, for example, only want error messages to be logged, and not the other two types. +If you set it to zero logging will be disabled.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 090456fc..02f4511b 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -1,185 +1,185 @@ - - - - - -Helper Functions : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Helper Functions

    - -

    Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular -category. There are URL Helpers, that assist in creating links, there are Form Helpers -that help you create form elements, Text Helpers perform various text formatting routines, -Cookie Helpers set and read cookies, File Helpers help you deal with files, etc. -

    - -

    Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. -Each helper function performs one specific task, with no dependence on other functions.

    - -

    CodeIgniter does not load Helper Files by default, so the first step in using -a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

    - -

    Helpers are typically stored in your system/helpers, or system/application/helpers directory. CodeIgniter will look first in your system/application/helpers -directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global -system/helpers folder.

    - - -

    Loading a Helper

    - -

    Loading a helper file is quite simple using the following function:

    - -$this->load->helper('name'); - -

    Where name is the file name of the helper, without the .php file extension or the "helper" part.

    - -

    For example, to load the URL Helper file, which is named url_helper.php, you would do this:

    - -$this->load->helper('url'); - -

    A helper can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), -as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available -automatically in any function, or you can load a helper in a specific function that needs it.

    - -

    Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

    - - -

    Loading Multiple Helpers

    - -

    If you need to load more than one helper you can specify them in an array, like this:

    - -$this->load->helper( array('helper1', 'helper2', 'helper3') ); - -

    Auto-loading Helpers

    - -

    If you find that you need a particular helper globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. -This is done by opening the application/config/autoload.php file and adding the helper to the autoload array.

    - - -

    Using a Helper

    - -

    Once you've loaded the Helper File containing the function you intend to use, you'll call it the way you would a standard PHP function.

    - -

    For example, to create a link using the anchor() function in one of your view files you would do this:

    - -<?php echo anchor('blog/comments', 'Click Here');?> - -

    Where "Click Here" is the name of the link, and "blog/comments" is the URI to the controller/function you wish to link to.

    - -

    "Extending" Helpers

    - -

    To "extend" Helpers, create a file in your application/helpers/ folder with an identical name to the existing Helper, but prefixed with MY_ (this item is configurable. See below.).

    - -

    If all you need to do is add some functionality to an existing helper - perhaps add a function or two, or change how a particular - helper function operates - then it's overkill to replace the entire helper with your version. In this case it's better to simply - "extend" the Helper. The term "extend" is used loosely since Helper functions are procedural and discrete and cannot be extended - in the traditional programmatic sense. Under the hood, this gives you the ability to add to the functions a Helper provides, - or to modify how the native Helper functions operate.

    - -

    For example, to extend the native Array Helper you'll create a file named application/helpers/MY_array_helper.php, and add or override functions:

    - - -// any_in_array() is not in the Array Helper, so it defines a new function
    -function any_in_array($needle, $haystack)
    -{
    -    $needle = (is_array($needle)) ? $needle : array($needle);
    -
    -    foreach ($needle as $item)
    -    {
    -        if (in_array($item, $haystack))
    -        {
    -            return TRUE;
    -        }
    -        }
    -
    -    return FALSE;
    -}
    -
    -// random_element() is included in Array Helper, so it overrides the native function
    -function random_element($array)
    -{
    -    shuffle($array);
    -    return array_pop($array);
    -}
    -
    - -

    Setting Your Own Prefix

    - -

    The filename prefix for "extending" Helpers is the same used to extend libraries and Core classes. To set your own prefix, open your application/config/config.php file and look for this item:

    - -$config['subclass_prefix'] = 'MY_'; - -

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    - - -

    Now What?

    - -

    In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.

    - - -
    - - - - - - + + + + + +Helper Functions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Helper Functions

    + +

    Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular +category. There are URL Helpers, that assist in creating links, there are Form Helpers +that help you create form elements, Text Helpers perform various text formatting routines, +Cookie Helpers set and read cookies, File Helpers help you deal with files, etc. +

    + +

    Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. +Each helper function performs one specific task, with no dependence on other functions.

    + +

    CodeIgniter does not load Helper Files by default, so the first step in using +a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

    + +

    Helpers are typically stored in your system/helpers, or system/application/helpers directory. CodeIgniter will look first in your system/application/helpers +directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global +system/helpers folder.

    + + +

    Loading a Helper

    + +

    Loading a helper file is quite simple using the following function:

    + +$this->load->helper('name'); + +

    Where name is the file name of the helper, without the .php file extension or the "helper" part.

    + +

    For example, to load the URL Helper file, which is named url_helper.php, you would do this:

    + +$this->load->helper('url'); + +

    A helper can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), +as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available +automatically in any function, or you can load a helper in a specific function that needs it.

    + +

    Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

    + + +

    Loading Multiple Helpers

    + +

    If you need to load more than one helper you can specify them in an array, like this:

    + +$this->load->helper( array('helper1', 'helper2', 'helper3') ); + +

    Auto-loading Helpers

    + +

    If you find that you need a particular helper globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. +This is done by opening the application/config/autoload.php file and adding the helper to the autoload array.

    + + +

    Using a Helper

    + +

    Once you've loaded the Helper File containing the function you intend to use, you'll call it the way you would a standard PHP function.

    + +

    For example, to create a link using the anchor() function in one of your view files you would do this:

    + +<?php echo anchor('blog/comments', 'Click Here');?> + +

    Where "Click Here" is the name of the link, and "blog/comments" is the URI to the controller/function you wish to link to.

    + +

    "Extending" Helpers

    + +

    To "extend" Helpers, create a file in your application/helpers/ folder with an identical name to the existing Helper, but prefixed with MY_ (this item is configurable. See below.).

    + +

    If all you need to do is add some functionality to an existing helper - perhaps add a function or two, or change how a particular + helper function operates - then it's overkill to replace the entire helper with your version. In this case it's better to simply + "extend" the Helper. The term "extend" is used loosely since Helper functions are procedural and discrete and cannot be extended + in the traditional programmatic sense. Under the hood, this gives you the ability to add to the functions a Helper provides, + or to modify how the native Helper functions operate.

    + +

    For example, to extend the native Array Helper you'll create a file named application/helpers/MY_array_helper.php, and add or override functions:

    + + +// any_in_array() is not in the Array Helper, so it defines a new function
    +function any_in_array($needle, $haystack)
    +{
    +    $needle = (is_array($needle)) ? $needle : array($needle);
    +
    +    foreach ($needle as $item)
    +    {
    +        if (in_array($item, $haystack))
    +        {
    +            return TRUE;
    +        }
    +        }
    +
    +    return FALSE;
    +}
    +
    +// random_element() is included in Array Helper, so it overrides the native function
    +function random_element($array)
    +{
    +    shuffle($array);
    +    return array_pop($array);
    +}
    +
    + +

    Setting Your Own Prefix

    + +

    The filename prefix for "extending" Helpers is the same used to extend libraries and Core classes. To set your own prefix, open your application/config/config.php file and look for this item:

    + +$config['subclass_prefix'] = 'MY_'; + +

    Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix.

    + + +

    Now What?

    + +

    In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index dcea24de..ae2a3db0 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -1,167 +1,167 @@ - - - - - -Hooks : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Hooks - Extending the Framework Core

    - -

    CodeIgniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files. -When CodeIgniter runs it follows a specific execution process, diagramed in the Application Flow page. -There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process. -For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of -your own scripts in some other location. -

    - -

    Enabling Hooks

    - -

    The hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file:

    - -$config['enable_hooks'] = TRUE; - - -

    Defining a Hook

    - -

    Hooks are defined in application/config/hooks.php file. Each hook is specified as an array with this prototype:

    - - -$hook['pre_controller'] = array(
    -                                'class'    => 'MyClass',
    -                                'function' => 'Myfunction',
    -                                'filename' => 'Myclass.php',
    -                                'filepath' => 'hooks',
    -                                'params'   => array('beer', 'wine', 'snacks')
    -                                );
    - -

    Notes:
    The array index correlates to the name of the particular hook point you want to -use. In the above example the hook point is pre_controller. A list of hook points is found below. -The following items should be defined in your associative hook array:

    - -
      -
    • class  The name of the class you wish to invoke. If you prefer to use a procedural function instead of a class, leave this item blank.
    • -
    • function  The function name you wish to call.
    • -
    • filename  The file name containing your class/function.
    • -
    • filepath  The name of the directory containing your script. Note: Your script must be located in a directory INSIDE your application folder, so the file path is relative to that folder. For example, if your script is located in application/hooks, you will simply use hooks as your filepath. If your script is located in application/hooks/utilities you will use hooks/utilities as your filepath. No trailing slash.
    • -
    • params  Any parameters you wish to pass to your script. This item is optional.
    • -
    - - -

    Multiple Calls to the Same Hook

    - -

    If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this:

    - - -$hook['pre_controller'][] = array(
    -                                'class'    => 'MyClass',
    -                                'function' => 'Myfunction',
    -                                'filename' => 'Myclass.php',
    -                                'filepath' => 'hooks',
    -                                'params'   => array('beer', 'wine', 'snacks')
    -                                );
    -
    -$hook['pre_controller'][] = array(
    -                                'class'    => 'MyOtherClass',
    -                                'function' => 'MyOtherfunction',
    -                                'filename' => 'Myotherclass.php',
    -                                'filepath' => 'hooks',
    -                                'params'   => array('red', 'yellow', 'blue')
    -                                );
    - -

    Notice the brackets after each array index:

    - -$hook['pre_controller'][] - -

    This permits you to have the same hook point with multiple scripts. The order you define your array will be the execution order.

    - - -

    Hook Points

    - -

    The following is a list of available hook points.

    - -
      -
    • pre_system
      - Called very early during system execution. Only the benchmark and hooks class have been loaded at this point. No routing or other processes have happened.
    • -
    • pre_controller
      - Called immediately prior to any of your controllers being called. All base classes, routing, and security checks have been done.
    • -
    • post_controller_constructor
      - Called immediately after your controller is instantiated, but prior to any method calls happening.
    • -
    • post_controller
      - Called immediately after your controller is fully executed.
    • -
    • display_override
      - Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to - use your own display methodology. Note that you will need to reference the CI superobject with $this->CI =& get_instance() and then the finalized data will be available by calling $this->CI->output->get_output()
    • -
    • cache_override
      - Enables you to call your own function instead of the _display_cache() function in the output class. This permits you to use your own cache display mechanism.
    • -
    • scaffolding_override
      - Permits a scaffolding request to trigger your own script instead.
    • -
    • post_system
      - Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.
    • -
    -
    - - - - - - + + + + + +Hooks : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Hooks - Extending the Framework Core

    + +

    CodeIgniter's Hooks feature provides a means to tap into and modify the inner workings of the framework without hacking the core files. +When CodeIgniter runs it follows a specific execution process, diagramed in the Application Flow page. +There may be instances, however, where you'd like to cause some action to take place at a particular stage in the execution process. +For example, you might want to run a script right before your controllers get loaded, or right after, or you might want to trigger one of +your own scripts in some other location. +

    + +

    Enabling Hooks

    + +

    The hooks feature can be globally enabled/disabled by setting the following item in the application/config/config.php file:

    + +$config['enable_hooks'] = TRUE; + + +

    Defining a Hook

    + +

    Hooks are defined in application/config/hooks.php file. Each hook is specified as an array with this prototype:

    + + +$hook['pre_controller'] = array(
    +                                'class'    => 'MyClass',
    +                                'function' => 'Myfunction',
    +                                'filename' => 'Myclass.php',
    +                                'filepath' => 'hooks',
    +                                'params'   => array('beer', 'wine', 'snacks')
    +                                );
    + +

    Notes:
    The array index correlates to the name of the particular hook point you want to +use. In the above example the hook point is pre_controller. A list of hook points is found below. +The following items should be defined in your associative hook array:

    + +
      +
    • class  The name of the class you wish to invoke. If you prefer to use a procedural function instead of a class, leave this item blank.
    • +
    • function  The function name you wish to call.
    • +
    • filename  The file name containing your class/function.
    • +
    • filepath  The name of the directory containing your script. Note: Your script must be located in a directory INSIDE your application folder, so the file path is relative to that folder. For example, if your script is located in application/hooks, you will simply use hooks as your filepath. If your script is located in application/hooks/utilities you will use hooks/utilities as your filepath. No trailing slash.
    • +
    • params  Any parameters you wish to pass to your script. This item is optional.
    • +
    + + +

    Multiple Calls to the Same Hook

    + +

    If want to use the same hook point with more then one script, simply make your array declaration multi-dimensional, like this:

    + + +$hook['pre_controller'][] = array(
    +                                'class'    => 'MyClass',
    +                                'function' => 'Myfunction',
    +                                'filename' => 'Myclass.php',
    +                                'filepath' => 'hooks',
    +                                'params'   => array('beer', 'wine', 'snacks')
    +                                );
    +
    +$hook['pre_controller'][] = array(
    +                                'class'    => 'MyOtherClass',
    +                                'function' => 'MyOtherfunction',
    +                                'filename' => 'Myotherclass.php',
    +                                'filepath' => 'hooks',
    +                                'params'   => array('red', 'yellow', 'blue')
    +                                );
    + +

    Notice the brackets after each array index:

    + +$hook['pre_controller'][] + +

    This permits you to have the same hook point with multiple scripts. The order you define your array will be the execution order.

    + + +

    Hook Points

    + +

    The following is a list of available hook points.

    + +
      +
    • pre_system
      + Called very early during system execution. Only the benchmark and hooks class have been loaded at this point. No routing or other processes have happened.
    • +
    • pre_controller
      + Called immediately prior to any of your controllers being called. All base classes, routing, and security checks have been done.
    • +
    • post_controller_constructor
      + Called immediately after your controller is instantiated, but prior to any method calls happening.
    • +
    • post_controller
      + Called immediately after your controller is fully executed.
    • +
    • display_override
      + Overrides the _display() function, used to send the finalized page to the web browser at the end of system execution. This permits you to + use your own display methodology. Note that you will need to reference the CI superobject with $this->CI =& get_instance() and then the finalized data will be available by calling $this->CI->output->get_output()
    • +
    • cache_override
      + Enables you to call your own function instead of the _display_cache() function in the output class. This permits you to use your own cache display mechanism.
    • +
    • scaffolding_override
      + Permits a scaffolding request to trigger your own script instead.
    • +
    • post_system
      + Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.
    • +
    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 29a2d62f..f1c17527 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -1,94 +1,94 @@ - - - - - -Using CodeIgniter Libraries : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Using CodeIgniter Libraries

    - - -

    All of the available libraries are located in your system/libraries folder. -In most cases, to use one of these classes involves initializing it within a controller using the following initialization function:

    - -$this->load->library('class name'); - -

    Where class name is the name of the class you want to invoke. For example, to load the validation class you would do this:

    - -$this->load->library('validation'); - -

    Once initialized you can use it as indicated in the user guide page corresponding to that class.

    - -

    Creating Your Own Libraries

    - -

    Please read the section of the user guide that discusses how to create your own libraries

    - - - -
    - - - - - - + + + + + +Using CodeIgniter Libraries : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Using CodeIgniter Libraries

    + + +

    All of the available libraries are located in your system/libraries folder. +In most cases, to use one of these classes involves initializing it within a controller using the following initialization function:

    + +$this->load->library('class name'); + +

    Where class name is the name of the class you want to invoke. For example, to load the validation class you would do this:

    + +$this->load->library('validation'); + +

    Once initialized you can use it as indicated in the user guide page corresponding to that class.

    + +

    Creating Your Own Libraries

    + +

    Please read the section of the user guide that discusses how to create your own libraries

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index f1600d90..60f51f7f 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -1,133 +1,133 @@ - - - - - -Managing your Applications : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Managing your Applications

    - -

    By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your -system/application/ directory. It is possible, however, to have multiple sets of applications that share a single -CodeIgniter installation, or even to rename or relocate your application folder.

    - -

    Renaming the Application Folder

    - -

    If you would like to rename your application folder you may do so as long as you open your main index.php -file and set its name using the $application_folder variable:

    - -$application_folder = "application"; - -

    Relocating your Application Folder

    - -

    It is possible to move your application folder to a different location on your server than your system folder. -To do so open your main index.php and set a full server path in the $application_folder variable.

    - - -$application_folder = "/Path/to/your/application"; - - -

    Running Multiple Applications with one CodeIgniter Installation

    - -

    If you would like to share a common CodeIgniter installation to manage several different applications simply -put all of the directories located inside your application folder into their -own sub-folder.

    - -

    For example, let's say you want to create two applications, "foo" and "bar". You will structure your -application folder like this:

    - -system/application/foo/
    -system/application/foo/config/
    -system/application/foo/controllers/
    -system/application/foo/errors/
    -system/application/foo/libraries/
    -system/application/foo/models/
    -system/application/foo/views/
    -system/application/bar/
    -system/application/bar/config/
    -system/application/bar/controllers/
    -system/application/bar/errors/
    -system/application/bar/libraries/
    -system/application/bar/models/
    -system/application/bar/views/
    - - -

    To select a particular application for use requires that you open your main index.php file and set the $application_folder -variable. For example, to select the "foo" application for use you would do this:

    - -$application_folder = "application/foo"; - -

    Note:  Each of your applications will need its own index.php file which -calls the desired application. The index.php file can be named anything you want.

    - - - - - -
    - - - - - - + + + + + +Managing your Applications : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Managing your Applications

    + +

    By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your +system/application/ directory. It is possible, however, to have multiple sets of applications that share a single +CodeIgniter installation, or even to rename or relocate your application folder.

    + +

    Renaming the Application Folder

    + +

    If you would like to rename your application folder you may do so as long as you open your main index.php +file and set its name using the $application_folder variable:

    + +$application_folder = "application"; + +

    Relocating your Application Folder

    + +

    It is possible to move your application folder to a different location on your server than your system folder. +To do so open your main index.php and set a full server path in the $application_folder variable.

    + + +$application_folder = "/Path/to/your/application"; + + +

    Running Multiple Applications with one CodeIgniter Installation

    + +

    If you would like to share a common CodeIgniter installation to manage several different applications simply +put all of the directories located inside your application folder into their +own sub-folder.

    + +

    For example, let's say you want to create two applications, "foo" and "bar". You will structure your +application folder like this:

    + +system/application/foo/
    +system/application/foo/config/
    +system/application/foo/controllers/
    +system/application/foo/errors/
    +system/application/foo/libraries/
    +system/application/foo/models/
    +system/application/foo/views/
    +system/application/bar/
    +system/application/bar/config/
    +system/application/bar/controllers/
    +system/application/bar/errors/
    +system/application/bar/libraries/
    +system/application/bar/models/
    +system/application/bar/views/
    + + +

    To select a particular application for use requires that you open your main index.php file and set the $application_folder +variable. For example, to select the "foo" application for use you would do this:

    + +$application_folder = "application/foo"; + +

    Note:  Each of your applications will need its own index.php file which +calls the desired application. The index.php file can be named anything you want.

    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/models.html b/user_guide/general/models.html index b061d06c..c566bf61 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -1,251 +1,251 @@ - - - - - -Models : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Models

    - -

    Models are optionally available for those who want to use a more traditional MVC approach.

    - - - - - - - -

    What is a Model?

    - -

    Models are PHP classes that are designed to work with information in your database. For example, let's say -you use CodeIgniter to manage a blog. You might have a model class that contains functions to insert, update, and -retrieve your blog data. Here is an example of what such a model class might look like:

    - - -class Blogmodel extends Model {
    -
    -    var $title   = '';
    -    var $content = '';
    -    var $date    = '';
    -
    -    function Blogmodel()
    -    {
    -        // Call the Model constructor
    -        parent::Model();
    -    }
    -    
    -    function get_last_ten_entries()
    -    {
    -        $query = $this->db->get('entries', 10);
    -        return $query->result();
    -    }
    -
    -    function insert_entry()
    -    {
    -        $this->title   = $_POST['title']; // please read the below note
    -        $this->content = $_POST['content'];
    -        $this->date    = time();
    -
    -        $this->db->insert('entries', $this);
    -    }
    -
    -    function update_entry()
    -    {
    -        $this->title   = $_POST['title'];
    -        $this->content = $_POST['content'];
    -        $this->date    = time();
    -
    -        $this->db->update('entries', $this, array('id' => $_POST['id']));
    -    }
    -
    -}
    - -

    Note: The functions in the above example use the Active Record database functions.

    -

    Note: For the sake of simplicity in this example we're using $_POST directly. This is generally bad practice, and a more common approach would be to use the Input Class $this->input->post('title')

    -

    Anatomy of a Model

    - -

    Model classes are stored in your application/models/ folder. They can be nested within sub-folders if you -want this type of organization.

    - -

    The basic prototype for a model class is this:

    - - - -class Model_name extends Model {
    -
    -    function Model_name()
    -    {
    -        parent::Model();
    -    }
    -}
    - -

    Where Model_name is the name of your class. Class names must have the first letter capitalized with the rest of the name lowercase. -Make sure your class extends the base Model class.

    - -

    The file name will be a lower case version of your class name. For example, if your class is this:

    - - -class User_model extends Model {
    -
    -    function User_model()
    -    {
    -        parent::Model();
    -    }
    -}
    - -

    Your file will be this:

    - -application/models/user_model.php - - - -

    Loading a Model

    - -

    Your models will typically be loaded and called from within your controller functions. -To load a model you will use the following function:

    - -$this->load->model('Model_name'); - -

    If you model is located in a sub-folder, include the relative path from your models folder. For example, if -you have a model located at application/models/blog/queries.php you'll load it using:

    - -$this->load->model('blog/queries'); - - -

    Once loaded, you will access your model functions using an object with the same name as your class:

    - - -$this->load->model('Model_name');
    -
    -$this->Model_name->function(); -
    - -

    If you would like your model assigned to a different object name you can specify it via the second parameter of the loading -function:

    - - - -$this->load->model('Model_name', 'fubar');
    -
    -$this->fubar->function(); -
    - -

    Here is an example of a controller, that loads a model, then serves a view:

    - - -class Blog_controller extends Controller {
    -
    -    function blog()
    -    {
    -        $this->load->model('Blog');
    -
    -        $data['query'] = $this->Blog->get_last_ten_entries();

    -        $this->load->view('blog', $data);
    -    }
    -}
    - -

    Auto-loading Models

    -

    If you find that you need a particular model globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the model to the autoload array.

    - - -

    Connecting to your Database

    - -

    When a model is loaded it does NOT connect automatically to your database. The following options for connecting are available to you:

    - -
      -
    • You can connect using the standard database methods described here, either from within your Controller class or your Model class.
    • -
    • You can tell the model loading function to auto-connect by passing TRUE (boolean) via the third parameter, -and connectivity settings, as defined in your database config file will be used: - - $this->load->model('Model_name', '', TRUE); -
    • - - -
    • You can manually pass database connectivity settings via the third parameter: - - - $config['hostname'] = "localhost";
      - $config['username'] = "myusername";
      - $config['password'] = "mypassword";
      - $config['database'] = "mydatabase";
      - $config['dbdriver'] = "mysql";
      - $config['dbprefix'] = "";
      - $config['pconnect'] = FALSE;
      - $config['db_debug'] = TRUE;
      -
      - $this->load->model('Model_name', '', $config);
    • -
    - - -
    - - - - - - + + + + + +Models : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Models

    + +

    Models are optionally available for those who want to use a more traditional MVC approach.

    + + + + + + + +

    What is a Model?

    + +

    Models are PHP classes that are designed to work with information in your database. For example, let's say +you use CodeIgniter to manage a blog. You might have a model class that contains functions to insert, update, and +retrieve your blog data. Here is an example of what such a model class might look like:

    + + +class Blogmodel extends Model {
    +
    +    var $title   = '';
    +    var $content = '';
    +    var $date    = '';
    +
    +    function Blogmodel()
    +    {
    +        // Call the Model constructor
    +        parent::Model();
    +    }
    +    
    +    function get_last_ten_entries()
    +    {
    +        $query = $this->db->get('entries', 10);
    +        return $query->result();
    +    }
    +
    +    function insert_entry()
    +    {
    +        $this->title   = $_POST['title']; // please read the below note
    +        $this->content = $_POST['content'];
    +        $this->date    = time();
    +
    +        $this->db->insert('entries', $this);
    +    }
    +
    +    function update_entry()
    +    {
    +        $this->title   = $_POST['title'];
    +        $this->content = $_POST['content'];
    +        $this->date    = time();
    +
    +        $this->db->update('entries', $this, array('id' => $_POST['id']));
    +    }
    +
    +}
    + +

    Note: The functions in the above example use the Active Record database functions.

    +

    Note: For the sake of simplicity in this example we're using $_POST directly. This is generally bad practice, and a more common approach would be to use the Input Class $this->input->post('title')

    +

    Anatomy of a Model

    + +

    Model classes are stored in your application/models/ folder. They can be nested within sub-folders if you +want this type of organization.

    + +

    The basic prototype for a model class is this:

    + + + +class Model_name extends Model {
    +
    +    function Model_name()
    +    {
    +        parent::Model();
    +    }
    +}
    + +

    Where Model_name is the name of your class. Class names must have the first letter capitalized with the rest of the name lowercase. +Make sure your class extends the base Model class.

    + +

    The file name will be a lower case version of your class name. For example, if your class is this:

    + + +class User_model extends Model {
    +
    +    function User_model()
    +    {
    +        parent::Model();
    +    }
    +}
    + +

    Your file will be this:

    + +application/models/user_model.php + + + +

    Loading a Model

    + +

    Your models will typically be loaded and called from within your controller functions. +To load a model you will use the following function:

    + +$this->load->model('Model_name'); + +

    If you model is located in a sub-folder, include the relative path from your models folder. For example, if +you have a model located at application/models/blog/queries.php you'll load it using:

    + +$this->load->model('blog/queries'); + + +

    Once loaded, you will access your model functions using an object with the same name as your class:

    + + +$this->load->model('Model_name');
    +
    +$this->Model_name->function(); +
    + +

    If you would like your model assigned to a different object name you can specify it via the second parameter of the loading +function:

    + + + +$this->load->model('Model_name', 'fubar');
    +
    +$this->fubar->function(); +
    + +

    Here is an example of a controller, that loads a model, then serves a view:

    + + +class Blog_controller extends Controller {
    +
    +    function blog()
    +    {
    +        $this->load->model('Blog');
    +
    +        $data['query'] = $this->Blog->get_last_ten_entries();

    +        $this->load->view('blog', $data);
    +    }
    +}
    + +

    Auto-loading Models

    +

    If you find that you need a particular model globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the model to the autoload array.

    + + +

    Connecting to your Database

    + +

    When a model is loaded it does NOT connect automatically to your database. The following options for connecting are available to you:

    + +
      +
    • You can connect using the standard database methods described here, either from within your Controller class or your Model class.
    • +
    • You can tell the model loading function to auto-connect by passing TRUE (boolean) via the third parameter, +and connectivity settings, as defined in your database config file will be used: + + $this->load->model('Model_name', '', TRUE); +
    • + + +
    • You can manually pass database connectivity settings via the third parameter: + + + $config['hostname'] = "localhost";
      + $config['username'] = "myusername";
      + $config['password'] = "mypassword";
      + $config['database'] = "mydatabase";
      + $config['dbdriver'] = "mysql";
      + $config['dbprefix'] = "";
      + $config['pconnect'] = FALSE;
      + $config['db_debug'] = TRUE;
      +
      + $this->load->model('Model_name', '', $config);
    • +
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 8471840a..d902ad05 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -1,127 +1,127 @@ - - - - - -Plugins : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Plugins

    - -

    Plugins work almost identically to Helpers. The main difference is that a plugin usually -provides a single function, whereas a Helper is usually a collection of functions. Helpers are also considered a part of -the core system; plugins are intended to be created and shared by our community.

    - -

    Plugins should be saved to your system/plugins directory or you can create a folder called plugins inside -your application folder and store them there. CodeIgniter will look first in your system/application/plugins -directory. If the directory does not exist or the specified plugin is not located there CI will instead look in your global -system/plugins folder.

    - - -

    Loading a Plugin

    - -

    Loading a plugin file is quite simple using the following function:

    - -$this->load->plugin('name'); - -

    Where name is the file name of the plugin, without the .php file extension or the "plugin" part.

    - -

    For example, to load the Captcha plugin, which is named captcha_pi.php, you will do this:

    - -$this->load->plugin('captcha'); - - - -

    A plugin can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), -as long as you load it before you use it. You can load your plugins in your controller constructor so that they become available -automatically in any function, or you can load a plugin in a specific function that needs it.

    - -

    Note: The Plugin loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

    - - -

    Loading Multiple Plugins

    - -

    If you need to load more than one plugin you can specify them in an array, like this:

    - -$this->load->plugin( array('plugin1', 'plugin2', 'plugin3') ); - -

    Auto-loading Plugins

    - -

    If you find that you need a particular plugin globally throughout your application, you can tell CodeIgniter to auto-load it -during system initialization. This is done by opening the application/config/autoload.php file and adding the plugin to the autoload array.

    - - -

    Using a Plugin

    - -

    Once you've loaded the Plugin, you'll call it the way you would a standard PHP function.

    - - - - -
    - - - - - - + + + + + +Plugins : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Plugins

    + +

    Plugins work almost identically to Helpers. The main difference is that a plugin usually +provides a single function, whereas a Helper is usually a collection of functions. Helpers are also considered a part of +the core system; plugins are intended to be created and shared by our community.

    + +

    Plugins should be saved to your system/plugins directory or you can create a folder called plugins inside +your application folder and store them there. CodeIgniter will look first in your system/application/plugins +directory. If the directory does not exist or the specified plugin is not located there CI will instead look in your global +system/plugins folder.

    + + +

    Loading a Plugin

    + +

    Loading a plugin file is quite simple using the following function:

    + +$this->load->plugin('name'); + +

    Where name is the file name of the plugin, without the .php file extension or the "plugin" part.

    + +

    For example, to load the Captcha plugin, which is named captcha_pi.php, you will do this:

    + +$this->load->plugin('captcha'); + + + +

    A plugin can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice), +as long as you load it before you use it. You can load your plugins in your controller constructor so that they become available +automatically in any function, or you can load a plugin in a specific function that needs it.

    + +

    Note: The Plugin loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.

    + + +

    Loading Multiple Plugins

    + +

    If you need to load more than one plugin you can specify them in an array, like this:

    + +$this->load->plugin( array('plugin1', 'plugin2', 'plugin3') ); + +

    Auto-loading Plugins

    + +

    If you find that you need a particular plugin globally throughout your application, you can tell CodeIgniter to auto-load it +during system initialization. This is done by opening the application/config/autoload.php file and adding the plugin to the autoload array.

    + + +

    Using a Plugin

    + +

    Once you've loaded the Plugin, you'll call it the way you would a standard PHP function.

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index a9c2a646..c06db92f 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -1,104 +1,104 @@ - - - - - -Profiling Your Application : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Profiling Your Application

    - -

    The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. -This information can be useful during development in order to help with debugging and optimization.

    - - -

    Initializing the Class

    - -

    Important:  This class does NOT need to be initialized. It is loaded automatically by the -Output Class if profiling is enabled as shown below.

    - -

    Enabling the Profiler

    - -

    To enable the profiler place the following function anywhere within your Controller functions:

    -$this->output->enable_profiler(TRUE); - -

    When enabled a report will be generated and inserted at the bottom of your pages.

    - -

    To disable the profiler you will use:

    -$this->output->enable_profiler(FALSE); - -

    Setting Benchmark Points

    - -

    In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.

    - -

    Please read the information on setting Benchmark points in Benchmark Class page.

    - - - -
    - - - - - - + + + + + +Profiling Your Application : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Profiling Your Application

    + +

    The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. +This information can be useful during development in order to help with debugging and optimization.

    + + +

    Initializing the Class

    + +

    Important:  This class does NOT need to be initialized. It is loaded automatically by the +Output Class if profiling is enabled as shown below.

    + +

    Enabling the Profiler

    + +

    To enable the profiler place the following function anywhere within your Controller functions:

    +$this->output->enable_profiler(TRUE); + +

    When enabled a report will be generated and inserted at the bottom of your pages.

    + +

    To disable the profiler you will use:

    +$this->output->enable_profiler(FALSE); + +

    Setting Benchmark Points

    + +

    In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.

    + +

    Please read the information on setting Benchmark points in Benchmark Class page.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index edeced0a..ff2a0481 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -1,77 +1,77 @@ - - - - - -Quick Reference Chart : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Quick Reference Chart

    - -

    For a PDF version of this chart, click here.

    - -

    - -
    - - - - - - + + + + + +Quick Reference Chart : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Quick Reference Chart

    + +

    For a PDF version of this chart, click here.

    + +

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 742cd193..d47903f7 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -1,82 +1,82 @@ - - - - - -Server Requirements : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Server Requirements

    - -
      -
    • PHP version 4.3.2 or newer.
    • -
    • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
    • -
    - - - -
    - - - - - - - + + + + + +Server Requirements : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Server Requirements

    + +
      +
    • PHP version 4.3.2 or newer.
    • +
    • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
    • +
    + + + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 10c44747..bdd7e22f 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -1,155 +1,155 @@ - - - - - -Reserved Names : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Reserved Names

    - -

    In order to help out, CodeIgniter uses a series of functions and names in its operation. Because of this, some names cannot be used by a developer. Following is a list of reserved names that cannot be used.

    -

    Controller names

    -

    Since your controller classes will extend the main application controller you -must be careful not to name your functions identically to the ones used by that class, otherwise your local functions -will override them. The following -is a list of reserved names. Do not name your controller functions any of these:

    -
      -
    • Controller
    • -
    • CI_Base
    • -
    • _ci_initialize
    • -
    • _ci_scaffolding
    • -
    -


    - If you are running PHP 4 there are some additional reserved names. These ONLY apply if you are running PHP 4.

    -
      -
    • CI_Loader
    • -
    • config
    • -
    • database
    • -
    • dbutil
    • -
    • dbforge
    • -
    • file
    • -
    • helper
    • -
    • helpers
    • -
    • language
    • -
    • library
    • -
    • model
    • -
    • plugin
    • -
    • plugins
    • -
    • scaffolding
    • -
    • script
    • -
    • view
    • -
    • vars
    • -
    • _ci_assign_to_models
    • -
    • _ci_autoloader
    • -
    • _ci_init_class
    • -
    • _ci_init_scaffolding
    • -
    • _ci_is_instance
    • -
    • _ci_load
    • -
    • _ci_load_class
    • -
    • _ci_object_to_array
    • -
    -

    Functions

    -
      -
    • is_really_writable()
    • -
    • load_class()
    • -
    • get_config()
    • -
    • config_item()
    • -
    • show_error()
    • -
    • show_404()
    • -
    • log_message()
    • -
    • _exception_handler()
    • -
    • get_instance()
    • -
    -

    Variables

    -
      -
    • $config
    • -
    • $mimes
    • -
    • $lang
    • -
    -

    Constants

    -
      -
    • EXT
    • -
    • FCPATH
    • -
    • SELF
    • -
    • BASEPATH
    • -
    • APPPATH
    • -
    • CI_VERSION
    • -
    • FILE_READ_MODE
    • -
    • FILE_WRITE_MODE
    • -
    • DIR_READ_MODE
    • -
    • DIR_WRITE_MODE
    • -
    • FOPEN_READ
    • -
    • FOPEN_READ_WRITE
    • -
    • FOPEN_WRITE_CREATE_DESTRUCTIVE
    • -
    • FOPEN_READ_WRITE_CREATE_DESTRUCTIVE
    • -
    • FOPEN_WRITE_CREATE
    • -
    • FOPEN_READ_WRITE_CREATE
    • -
    • FOPEN_WRITE_CREATE_STRICT
    • -
    • FOPEN_READ_WRITE_CREATE_STRICT
    • -
    -
    - - - - - - + + + + + +Reserved Names : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Reserved Names

    + +

    In order to help out, CodeIgniter uses a series of functions and names in its operation. Because of this, some names cannot be used by a developer. Following is a list of reserved names that cannot be used.

    +

    Controller names

    +

    Since your controller classes will extend the main application controller you +must be careful not to name your functions identically to the ones used by that class, otherwise your local functions +will override them. The following +is a list of reserved names. Do not name your controller functions any of these:

    +
      +
    • Controller
    • +
    • CI_Base
    • +
    • _ci_initialize
    • +
    • _ci_scaffolding
    • +
    +


    + If you are running PHP 4 there are some additional reserved names. These ONLY apply if you are running PHP 4.

    +
      +
    • CI_Loader
    • +
    • config
    • +
    • database
    • +
    • dbutil
    • +
    • dbforge
    • +
    • file
    • +
    • helper
    • +
    • helpers
    • +
    • language
    • +
    • library
    • +
    • model
    • +
    • plugin
    • +
    • plugins
    • +
    • scaffolding
    • +
    • script
    • +
    • view
    • +
    • vars
    • +
    • _ci_assign_to_models
    • +
    • _ci_autoloader
    • +
    • _ci_init_class
    • +
    • _ci_init_scaffolding
    • +
    • _ci_is_instance
    • +
    • _ci_load
    • +
    • _ci_load_class
    • +
    • _ci_object_to_array
    • +
    +

    Functions

    +
      +
    • is_really_writable()
    • +
    • load_class()
    • +
    • get_config()
    • +
    • config_item()
    • +
    • show_error()
    • +
    • show_404()
    • +
    • log_message()
    • +
    • _exception_handler()
    • +
    • get_instance()
    • +
    +

    Variables

    +
      +
    • $config
    • +
    • $mimes
    • +
    • $lang
    • +
    +

    Constants

    +
      +
    • EXT
    • +
    • FCPATH
    • +
    • SELF
    • +
    • BASEPATH
    • +
    • APPPATH
    • +
    • CI_VERSION
    • +
    • FILE_READ_MODE
    • +
    • FILE_WRITE_MODE
    • +
    • DIR_READ_MODE
    • +
    • DIR_WRITE_MODE
    • +
    • FOPEN_READ
    • +
    • FOPEN_READ_WRITE
    • +
    • FOPEN_WRITE_CREATE_DESTRUCTIVE
    • +
    • FOPEN_READ_WRITE_CREATE_DESTRUCTIVE
    • +
    • FOPEN_WRITE_CREATE
    • +
    • FOPEN_READ_WRITE_CREATE
    • +
    • FOPEN_WRITE_CREATE_STRICT
    • +
    • FOPEN_READ_WRITE_CREATE_STRICT
    • +
    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 80c8ab0d..062dc193 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -1,176 +1,176 @@ - - - - - -URI Routing : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    URI Routing

    - -

    Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. -The segments in a URI normally follow this pattern:

    - -example.com/class/function/id/ - -

    In some instances, however, you may want to remap this relationship so that a different class/function can be called -instead of the one corresponding to the URL.

    - -

    For example, lets say you want your URLs to have this prototype:

    - -

    -example.com/product/1/
    -example.com/product/2/
    -example.com/product/3/
    -example.com/product/4/ -

    - -

    Normally the second segment of the URL is reserved for the function name, but in the example above it instead has a product ID. -To overcome this, CodeIgniter allows you to remap the URI handler.

    - - -

    Setting your own routing rules

    - -

    Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that -permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions

    - - -

    Wildcards

    - -

    A typical wildcard route might look something like this:

    - -$route['product/:num'] = "catalog/product_lookup"; - -

    In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. -In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, -the "catalog" class and the "product_lookup" method are instead used.

    - -

    You can match literal values or you can use two wildcard types:

    - -

    -:num
    -:any -

    - -

    :num will match a segment containing only numbers.
    -:any will match a segment containing any character. -

    - -

    Note: Routes will run in the order they are defined. -Higher routes will always take precedence over lower ones.

    - -

    Examples

    - -

    Here are a few routing examples:

    - -$route['journals'] = "blogs"; -

    A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.

    - -$route['blog/joe'] = "blogs/users/34"; -

    A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    - -$route['product/:any'] = "catalog/product_lookup"; -

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    - -$route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; -

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

    - -

    Important: Do not use leading/trailing slashes.

    - -

    Regular Expressions

    - -

    If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.

    - -

    Note:  If you use back-references you must use the dollar syntax rather than the double backslash syntax.

    - -

    A typical RegEx route might look something like this:

    - -$route['products/([a-z]+)/(\d+)'] = "$1/id_$2"; - -

    In the above example, a URI similar to products/shirts/123 would instead call the shirts controller class and the id_123 function.

    - -

    You can also mix and match wildcards with regular expressions.

    - -

    Reserved Routes

    - -

    There are two reserved routes:

    - -$route['default_controller'] = 'welcome'; - -

    This route indicates which controller class should be loaded if the URI contains no data, which will be the case -when people load your root URL. In the above example, the "welcome" class would be loaded. You -are encouraged to always have a default route otherwise a 404 page will appear by default.

    - -$route['scaffolding_trigger'] = 'scaffolding'; - -

    This route lets you set a secret word, which when present in the URL, triggers the scaffolding feature. -Please read the Scaffolding page for details.

    - -

    Important:  The reserved routes must come before any wildcard or regular expression routes.

    - -
    - - - - - - + + + + + +URI Routing : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    URI Routing

    + +

    Typically there is a one-to-one relationship between a URL string and its corresponding controller class/method. +The segments in a URI normally follow this pattern:

    + +example.com/class/function/id/ + +

    In some instances, however, you may want to remap this relationship so that a different class/function can be called +instead of the one corresponding to the URL.

    + +

    For example, lets say you want your URLs to have this prototype:

    + +

    +example.com/product/1/
    +example.com/product/2/
    +example.com/product/3/
    +example.com/product/4/ +

    + +

    Normally the second segment of the URL is reserved for the function name, but in the example above it instead has a product ID. +To overcome this, CodeIgniter allows you to remap the URI handler.

    + + +

    Setting your own routing rules

    + +

    Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that +permits you to specify your own routing criteria. Routes can either be specified using wildcards or Regular Expressions

    + + +

    Wildcards

    + +

    A typical wildcard route might look something like this:

    + +$route['product/:num'] = "catalog/product_lookup"; + +

    In a route, the array key contains the URI to be matched, while the array value contains the destination it should be re-routed to. +In the above example, if the literal word "product" is found in the first segment of the URL, and a number is found in the second segment, +the "catalog" class and the "product_lookup" method are instead used.

    + +

    You can match literal values or you can use two wildcard types:

    + +

    +:num
    +:any +

    + +

    :num will match a segment containing only numbers.
    +:any will match a segment containing any character. +

    + +

    Note: Routes will run in the order they are defined. +Higher routes will always take precedence over lower ones.

    + +

    Examples

    + +

    Here are a few routing examples:

    + +$route['journals'] = "blogs"; +

    A URL containing the word "journals" in the first segment will be remapped to the "blogs" class.

    + +$route['blog/joe'] = "blogs/users/34"; +

    A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    + +$route['product/:any'] = "catalog/product_lookup"; +

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    + +$route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; +

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup_by_id" method passing in the match as a variable to the function.

    + +

    Important: Do not use leading/trailing slashes.

    + +

    Regular Expressions

    + +

    If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references.

    + +

    Note:  If you use back-references you must use the dollar syntax rather than the double backslash syntax.

    + +

    A typical RegEx route might look something like this:

    + +$route['products/([a-z]+)/(\d+)'] = "$1/id_$2"; + +

    In the above example, a URI similar to products/shirts/123 would instead call the shirts controller class and the id_123 function.

    + +

    You can also mix and match wildcards with regular expressions.

    + +

    Reserved Routes

    + +

    There are two reserved routes:

    + +$route['default_controller'] = 'welcome'; + +

    This route indicates which controller class should be loaded if the URI contains no data, which will be the case +when people load your root URL. In the above example, the "welcome" class would be loaded. You +are encouraged to always have a default route otherwise a 404 page will appear by default.

    + +$route['scaffolding_trigger'] = 'scaffolding'; + +

    This route lets you set a secret word, which when present in the URL, triggers the scaffolding feature. +Please read the Scaffolding page for details.

    + +

    Important:  The reserved routes must come before any wildcard or regular expression routes.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index f5925240..cc948481 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -1,146 +1,146 @@ - - - - - -Scaffolding : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Scaffolding

    - -

    CodeIgniter's Scaffolding feature provides a fast and very convenient way to add, edit, or delete information in your database -during development.

    - -

    Very Important: Scaffolding is intended for development use only. It provides very little -security other than a "secret" word, so anyone who has access to your CodeIgniter site can potentially edit or delete your information. -If you use scaffolding make sure you disable it immediately after you are through using it. DO NOT leave it enabled on a live site. -And please, set a secret word before you use it.

    - - -

    Why would someone use scaffolding?

    - -

    Here's a typical scenario: You create a new database table during development and you'd like a quick way to insert some data -into it to work with. Without scaffolding your choices are either to write some inserts using the command line or to use a -database management tool like phpMyAdmin. With CodeIgniter's scaffolding feature you can quickly add some data using its browser -interface. And when you are through using the data you can easily delete it.

    - -

    Setting a Secret Word

    - -

    Before enabling scaffolding please take a moment to set a secret word. This word, when encountered in your URL, -will launch the scaffolding interface, so please pick something obscure that no one is likely to guess.

    - -

    To set a secret word, open your application/config/routes.php file and look for this item:

    - -$route['scaffolding_trigger'] = ''; - -

    Once you've found it add your own unique word.

    - -

    Note: The scaffolding word can not start with an underscore.

    - - -

    Enabling Scaffolding

    - -

    Note: The information on this page assumes you already know how controllers work, and that you have -a working one available. It also assumes you have configured CodeIgniter to auto-connect to your database. -If not, the information here won't be very relevant, so you are encouraged to go through those sections first. -Lastly, it assumes you understand what a class constructor is. If not, read the last section of the controllers -page.

    - -

    To enable scaffolding you will initialize it in your constructor like this:

    - - -<?php
    -class Blog extends Controller {
    -
    -       function Blog()
    -       {
    -            parent::Controller();

    -            $this->load->scaffolding('table_name');
    -       }
    -}
    -?>
    - -

    Where table_name is the name of the table (table, not database) you wish to work with.

    - -

    Once you've initialized scaffolding, you will access it with this URL prototype:

    - -example.com/index.php/class/secret_word/ - -

    For example, using a controller named Blog, and abracadabra as the secret word, -you would access scaffolding like this:

    - -example.com/index.php/blog/abracadabra/ - -

    The scaffolding interface should be self-explanatory. You can add, edit or delete records.

    - - -

    A Final Note:

    - -

    The scaffolding feature will only work with tables that contain a primary key, as this is information is needed to perform the various -database functions.

    - - -
    - - - - - - + + + + + +Scaffolding : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Scaffolding

    + +

    CodeIgniter's Scaffolding feature provides a fast and very convenient way to add, edit, or delete information in your database +during development.

    + +

    Very Important: Scaffolding is intended for development use only. It provides very little +security other than a "secret" word, so anyone who has access to your CodeIgniter site can potentially edit or delete your information. +If you use scaffolding make sure you disable it immediately after you are through using it. DO NOT leave it enabled on a live site. +And please, set a secret word before you use it.

    + + +

    Why would someone use scaffolding?

    + +

    Here's a typical scenario: You create a new database table during development and you'd like a quick way to insert some data +into it to work with. Without scaffolding your choices are either to write some inserts using the command line or to use a +database management tool like phpMyAdmin. With CodeIgniter's scaffolding feature you can quickly add some data using its browser +interface. And when you are through using the data you can easily delete it.

    + +

    Setting a Secret Word

    + +

    Before enabling scaffolding please take a moment to set a secret word. This word, when encountered in your URL, +will launch the scaffolding interface, so please pick something obscure that no one is likely to guess.

    + +

    To set a secret word, open your application/config/routes.php file and look for this item:

    + +$route['scaffolding_trigger'] = ''; + +

    Once you've found it add your own unique word.

    + +

    Note: The scaffolding word can not start with an underscore.

    + + +

    Enabling Scaffolding

    + +

    Note: The information on this page assumes you already know how controllers work, and that you have +a working one available. It also assumes you have configured CodeIgniter to auto-connect to your database. +If not, the information here won't be very relevant, so you are encouraged to go through those sections first. +Lastly, it assumes you understand what a class constructor is. If not, read the last section of the controllers +page.

    + +

    To enable scaffolding you will initialize it in your constructor like this:

    + + +<?php
    +class Blog extends Controller {
    +
    +       function Blog()
    +       {
    +            parent::Controller();

    +            $this->load->scaffolding('table_name');
    +       }
    +}
    +?>
    + +

    Where table_name is the name of the table (table, not database) you wish to work with.

    + +

    Once you've initialized scaffolding, you will access it with this URL prototype:

    + +example.com/index.php/class/secret_word/ + +

    For example, using a controller named Blog, and abracadabra as the secret word, +you would access scaffolding like this:

    + +example.com/index.php/blog/abracadabra/ + +

    The scaffolding interface should be self-explanatory. You can add, edit or delete records.

    + + +

    A Final Note:

    + +

    The scaffolding feature will only work with tables that contain a primary key, as this is information is needed to perform the various +database functions.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 8b6eba8c..236b29b4 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -1,153 +1,153 @@ - - - - - -Security : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Security

    - -

    This page describes some "best practices" regarding web security, and details -CodeIgniter's internal security features.

    - - -

    URI Security

    - -

    CodeIgniter is fairly restrictive regarding which characters it allows in your URI strings in order to help -minimize the possibility that malicious data can be passed to your application. URIs may only contain the following: -

    - -
      -
    • Alpha-numeric text
    • -
    • Tilde: ~
    • -
    • Period: .
    • -
    • Colon: :
    • -
    • Underscore: _
    • -
    • Dash: -
    • -
    - -

    GET, POST, and COOKIE Data

    - -

    GET data is simply disallowed by CodeIgniter since the system utilizes URI segments rather than traditional URL query strings (unless -you have the query string option enabled in your config file). The global GET -array is unset by the Input class during system initialization.

    - -

    Register_globals

    - -

    During system initialization all global variables are unset, except those found in the $_POST and $_COOKIE arrays. The unsetting -routine is effectively the same as register_globals = off.

    - - -

    magic_quotes_runtime

    - -

    The magic_quotes_runtime directive is turned off during system initialization so that you don't have to remove slashes when -retrieving data from your database.

    - -

    Best Practices

    - -

    Before accepting any data into your application, whether it be POST data from a form submission, COOKIE data, URI data, -XML-RPC data, or even data from the SERVER array, you are encouraged to practice this three step approach:

    - -
      -
    1. Filter the data as if it were tainted.
    2. -
    3. Validate the data to ensure it conforms to the correct type, length, size, etc. (sometimes this step can replace step one)
    4. -
    5. Escape the data before submitting it into your database.
    6. -
    - -

    CodeIgniter provides the following functions to assist in this process:

    - -
      - -
    • XSS Filtering

      - -

      CodeIgniter comes with a Cross Site Scripting filter. This filter looks for commonly -used techniques to embed malicious Javascript into your data, or other types of code that attempt to hijack cookies -or do other malicious things. The XSS Filter is described here. -

      -
    • - -
    • Validate the data

      - -

      CodeIgniter has a Form Validation Class that assists you in validating, filtering, and prepping -your data.

      -
    • - -
    • Escape all data before database insertion

      - -

      Never insert information into your database without escaping it. Please see the section that discusses -queries for more information.

      - -
    • - -
    - - - - -
    - - - - - - + + + + + +Security : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Security

    + +

    This page describes some "best practices" regarding web security, and details +CodeIgniter's internal security features.

    + + +

    URI Security

    + +

    CodeIgniter is fairly restrictive regarding which characters it allows in your URI strings in order to help +minimize the possibility that malicious data can be passed to your application. URIs may only contain the following: +

    + +
      +
    • Alpha-numeric text
    • +
    • Tilde: ~
    • +
    • Period: .
    • +
    • Colon: :
    • +
    • Underscore: _
    • +
    • Dash: -
    • +
    + +

    GET, POST, and COOKIE Data

    + +

    GET data is simply disallowed by CodeIgniter since the system utilizes URI segments rather than traditional URL query strings (unless +you have the query string option enabled in your config file). The global GET +array is unset by the Input class during system initialization.

    + +

    Register_globals

    + +

    During system initialization all global variables are unset, except those found in the $_POST and $_COOKIE arrays. The unsetting +routine is effectively the same as register_globals = off.

    + + +

    magic_quotes_runtime

    + +

    The magic_quotes_runtime directive is turned off during system initialization so that you don't have to remove slashes when +retrieving data from your database.

    + +

    Best Practices

    + +

    Before accepting any data into your application, whether it be POST data from a form submission, COOKIE data, URI data, +XML-RPC data, or even data from the SERVER array, you are encouraged to practice this three step approach:

    + +
      +
    1. Filter the data as if it were tainted.
    2. +
    3. Validate the data to ensure it conforms to the correct type, length, size, etc. (sometimes this step can replace step one)
    4. +
    5. Escape the data before submitting it into your database.
    6. +
    + +

    CodeIgniter provides the following functions to assist in this process:

    + +
      + +
    • XSS Filtering

      + +

      CodeIgniter comes with a Cross Site Scripting filter. This filter looks for commonly +used techniques to embed malicious Javascript into your data, or other types of code that attempt to hijack cookies +or do other malicious things. The XSS Filter is described here. +

      +
    • + +
    • Validate the data

      + +

      CodeIgniter has a Form Validation Class that assists you in validating, filtering, and prepping +your data.

      +
    • + +
    • Escape all data before database insertion

      + +

      Never insert information into your database without escaping it. Please see the section that discusses +queries for more information.

      + +
    • + +
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index faa1a8ff..43385d06 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -1,649 +1,649 @@ - - - - - -Style Guide : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    General Style and Syntax

    - -

    The following page describes the coding rules use adhere to when developing CodeIgniter.

    - - -

    Table of Contents

    - - -

    PHP Closing Tag

    -
    -

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced - by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should - OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. - This allows you to still identify a file as being complete and not truncated.

    -INCORRECT: -<?php - -echo "Here's my code!"; - -?> - -CORRECT: -<?php - -echo "Here's my code!"; - -/* End of file myfile.php */ -/* Location: ./system/modules/mymodule/myfile.php */ - -
    - - -

    Class and Method Naming

    -
    -

    Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

    - - INCORRECT: -class superclass -class SuperClass - -CORRECT: -class Super_class - -

    Notice that the Class and constructor methods are identically named and cased:

    - - class Super_class { - - function Super_class() - { - - } -} - -

    Examples of improper and proper method naming:

    - - INCORRECT: -function fileproperties() // not descriptive and needs underscore separator -function fileProperties() // not descriptive and uses CamelCase -function getfileproperties() // Better! But still missing underscore separator -function getFileProperties() // uses CamelCase -function get_the_file_properties_from_the_file() // wordy - -CORRECT: -function get_file_properties() // descriptive, underscore separator, and all lowercase letters - -
    - - -

    Variable Names

    -
    -

    The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

    -INCORRECT: -$j = 'foo'; // single letter variables should only be used in for() loops -$Str // contains uppercase letters -$bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning -$groupid // multiple words, needs underscore separator -$name_of_last_city_used // too long - -CORRECT: -for ($j = 0; $j < 10; $j++) -$str -$buffer -$group_id -$last_city - -
    - - -

    Commenting

    -
    -

    In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

    - -

    DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:

    - -/** - * Super Class - * - * @package Package Name - * @subpackage Subpackage - * @category Category - * @author Author Name - * @link http://example.com - */ -class Super_class { - -/** - * Encodes string for use in XML - * - * @access public - * @param string - * @return string - */ -function xml_encode($str) - -

    Use single line comments within code, leaving a blank line between large comment blocks and code.

    - -// break up the string by newlines -$parts = explode("\n", $str); - -// A longer comment that needs to give greater detail on what is -// occurring and why can use multiple single-line comments. Try to -// keep the width reasonable, around 70 characters is the easiest to -// read. Don't hesitate to link to permanent external resources -// that may provide greater detail: -// -// http://example.com/information_about_something/in_particular/ - -$parts = $this->foo($parts); - -
    - - -

    Constants

    -
    -

    Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use ExpressionEngine constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

    -INCORRECT: -myConstant // missing underscore separator and not fully uppercase -N // no single-letter constants -S_C_VER // not descriptive -$str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants - -CORRECT: -MY_CONSTANT -NEWLINE -SUPER_CLASS_VERSION -$str = str_replace(LD.'foo'.RD, 'bar', $str); - -
    - - -

    TRUE, FALSE, and NULL

    -
    -

    TRUE, FALSE, and NULL keywords should always be fully uppercase.

    -INCORRECT: -if ($foo == true) -$bar = false; -function foo($bar = null) - -CORRECT: -if ($foo == TRUE) -$bar = FALSE; -function foo($bar = NULL) -
    - - - -

    Logical Operators

    -
    -

    Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). - && is preferred over AND but either are acceptable, and a space should always precede and follow !.

    -INCORRECT: -if ($foo || $bar) -if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications -if (!$foo) -if (! is_array($foo)) - -CORRECT: -if ($foo OR $bar) -if ($foo && $bar) // recommended -if ( ! $foo) -if ( ! is_array($foo)) - -
    - - - -

    Comparing Return Values and Typecasting

    -
    -

    Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

    -

    Use the same stringency in returning and checking your own variables. Use === and !== as necessary. - -INCORRECT: -// If 'foo' is at the beginning of the string, strpos will return a 0, -// resulting in this conditional evaluating as TRUE -if (strpos($str, 'foo') == FALSE) - -CORRECT: -if (strpos($str, 'foo') === FALSE) - - -INCORRECT: -function build_string($str = "") -{ - if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument? - { - - } -} - -CORRECT: -function build_string($str = "") -{ - if ($str === "") - { - - } -} - -

    See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":

    - -$str = (string) $str; // cast $str as a string - -
    - - -

    Debugging Code

    -
    -

    No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

    - -// print_r($foo); -
    - - - -

    Whitespace in Files

    -
    -

    No whitespace can precede the opening PHP tag or follow the closing PHP tag. ExpressionEngine output is buffered, so whitespace in your files can cause output to begin before ExpressionEngine outputs its content, leading to errors and an inability for ExpressionEngine to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

    - -

    INCORRECT:

    - -<?php - // ...there is whitespace and a linebreak above the opening PHP tag - // as well as whitespace after the closing PHP tag -?> - -

    CORRECT:

    -<?php - // this sample has no whitespace before or after the opening and closing PHP tags -?> - -
    - - -

    Compatibility

    -
    -

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    -
    - - - -

    Class and File Names using Common Words

    -
    -

    When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

    - -INCORRECT: -class Email pi.email.php -class Xml ext.xml.php -class Import mod.import.php - -CORRECT: -class Pre_email pi.pre_email.php -class Pre_xml ext.pre_xml.php -class Pre_import mod.pre_import.php - -
    - - -

    Database Table Names

    -
    -

    Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as ExpressionEngine's database class will automatically convert 'exp_' to what is actually being used.

    - -INCORRECT: -email_addresses // missing both prefixes -pre_email_addresses // missing exp_ prefix -exp_email_addresses // missing unique prefix - -CORRECT: -exp_pre_email_addresses - - -

    NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington -

    - - - -

    One File per Class

    -
    -

    Use separate files for each class your add-on uses, unless the classes are closely related. An example of ExpressionEngine files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

    -
    - - - -

    Whitespace

    -
    -

    Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

    -
    - - - -

    Line Breaks

    -
    -

    Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

    -
    - - - -

    Code Indenting

    -
    -

    Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

    - -INCORRECT: -function foo($bar) { - // ... -} - -foreach ($arr as $key => $val) { - // ... -} - -if ($foo == $bar) { - // ... -} else { - // ... -} - -for ($i = 0; $i < 10; $i++) - { - for ($j = 0; $j < 10; $j++) - { - // ... - } - } - -CORRECT: -function foo($bar) -{ - // ... -} - -foreach ($arr as $key => $val) -{ - // ... -} - -if ($foo == $bar) -{ - // ... -} -else -{ - // ... -} - -for ($i = 0; $i < 10; $i++) -{ - for ($j = 0; $j < 10; $j++) - { - // ... - } -} -
    - - -

    Bracket and Parenthetic Spacing

    -
    -

    In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

    - -INCORRECT: -$arr[ $foo ] = 'foo'; - -CORRECT: -$arr[$foo] = 'foo'; // no spaces around array keys - - -INCORRECT: -function foo ( $bar ) -{ - -} - -CORRECT: -function foo($bar) // no spaces around parenthesis in function declarations -{ - -} - - -INCORRECT: -foreach( $query->result() as $row ) - -CORRECT: -foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis - -
    - - - -

    Localized Text in Control Panel

    -
    -

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    - -INCORRECT: -return "Invalid Selection"; - -CORRECT: -return $LANG->line('invalid_selection'); -
    - - - -

    Private Methods and Variables

    -
    -

    Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

    - -convert_text() // public method -_convert_text() // private method -
    - - - -

    PHP Errors

    -
    -

    Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

    - -

    Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:

    - -if (ini_get('display_errors') == 1) -{ - exit "Enabled"; -} - -

    On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:

    - -ini_set('display_errors', 1); - -

    NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

    -
    - - - -

    Short Open Tags

    -
    -

    Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

    - -INCORRECT: -<? echo $foo; ?> - -<?=$foo?> - -CORRECT: -<?php echo $foo; ?> -
    - - - -

    One Statement Per Line

    -
    -

    Never combine statements on one line.

    - -INCORRECT: -$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag); - -CORRECT: -$foo = 'this'; -$bar = 'that'; -$bat = str_replace($foo, $bar, $bag); - -
    - - - -

    Strings

    -
    -

    Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

    - -INCORRECT: -"My String" // no variable parsing, so no use for double quotes -"My string $foo" // needs braces -'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly - -CORRECT: -'My String' -"My string {$foo}" -"SELECT foo FROM bar WHERE baz = 'bag'" -
    - - - -

    SQL Queries

    -
    -

    MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

    - -

    Break up long queries into multiple lines for legibility, preferably breaking for each clause.

    - -INCORRECT: -// keywords are lowercase and query is too long for -// a single line (... indicates continuation of line) -$query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses -...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); - -CORRECT: -$query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz - FROM exp_pre_email_addresses - WHERE foo != 'oof' - AND baz != 'zab' - ORDER BY foobaz - LIMIT 5, 100"); -
    - - - -

    Default Function Arguments

    -
    -

    Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

    - -function foo($bar = '', $baz = FALSE) -
    - - - -

    Overlapping Tag Parameters

    -
    -

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    -
    - - -
    - - - -
    - - - - - - + + + + + +Style Guide : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    General Style and Syntax

    + +

    The following page describes the coding rules use adhere to when developing CodeIgniter.

    + + +

    Table of Contents

    + + +

    PHP Closing Tag

    +
    +

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced + by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should + OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. + This allows you to still identify a file as being complete and not truncated.

    +INCORRECT: +<?php + +echo "Here's my code!"; + +?> + +CORRECT: +<?php + +echo "Here's my code!"; + +/* End of file myfile.php */ +/* Location: ./system/modules/mymodule/myfile.php */ + +
    + + +

    Class and Method Naming

    +
    +

    Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

    + + INCORRECT: +class superclass +class SuperClass + +CORRECT: +class Super_class + +

    Notice that the Class and constructor methods are identically named and cased:

    + + class Super_class { + + function Super_class() + { + + } +} + +

    Examples of improper and proper method naming:

    + + INCORRECT: +function fileproperties() // not descriptive and needs underscore separator +function fileProperties() // not descriptive and uses CamelCase +function getfileproperties() // Better! But still missing underscore separator +function getFileProperties() // uses CamelCase +function get_the_file_properties_from_the_file() // wordy + +CORRECT: +function get_file_properties() // descriptive, underscore separator, and all lowercase letters + +
    + + +

    Variable Names

    +
    +

    The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

    +INCORRECT: +$j = 'foo'; // single letter variables should only be used in for() loops +$Str // contains uppercase letters +$bufferedText // uses CamelCasing, and could be shortened without losing semantic meaning +$groupid // multiple words, needs underscore separator +$name_of_last_city_used // too long + +CORRECT: +for ($j = 0; $j < 10; $j++) +$str +$buffer +$group_id +$last_city + +
    + + +

    Commenting

    +
    +

    In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

    + +

    DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:

    + +/** + * Super Class + * + * @package Package Name + * @subpackage Subpackage + * @category Category + * @author Author Name + * @link http://example.com + */ +class Super_class { + +/** + * Encodes string for use in XML + * + * @access public + * @param string + * @return string + */ +function xml_encode($str) + +

    Use single line comments within code, leaving a blank line between large comment blocks and code.

    + +// break up the string by newlines +$parts = explode("\n", $str); + +// A longer comment that needs to give greater detail on what is +// occurring and why can use multiple single-line comments. Try to +// keep the width reasonable, around 70 characters is the easiest to +// read. Don't hesitate to link to permanent external resources +// that may provide greater detail: +// +// http://example.com/information_about_something/in_particular/ + +$parts = $this->foo($parts); + +
    + + +

    Constants

    +
    +

    Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use ExpressionEngine constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

    +INCORRECT: +myConstant // missing underscore separator and not fully uppercase +N // no single-letter constants +S_C_VER // not descriptive +$str = str_replace('{foo}', 'bar', $str); // should use LD and RD constants + +CORRECT: +MY_CONSTANT +NEWLINE +SUPER_CLASS_VERSION +$str = str_replace(LD.'foo'.RD, 'bar', $str); + +
    + + +

    TRUE, FALSE, and NULL

    +
    +

    TRUE, FALSE, and NULL keywords should always be fully uppercase.

    +INCORRECT: +if ($foo == true) +$bar = false; +function foo($bar = null) + +CORRECT: +if ($foo == TRUE) +$bar = FALSE; +function foo($bar = NULL) +
    + + + +

    Logical Operators

    +
    +

    Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). + && is preferred over AND but either are acceptable, and a space should always precede and follow !.

    +INCORRECT: +if ($foo || $bar) +if ($foo AND $bar) // okay but not recommended for common syntax highlighting applications +if (!$foo) +if (! is_array($foo)) + +CORRECT: +if ($foo OR $bar) +if ($foo && $bar) // recommended +if ( ! $foo) +if ( ! is_array($foo)) + +
    + + + +

    Comparing Return Values and Typecasting

    +
    +

    Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

    +

    Use the same stringency in returning and checking your own variables. Use === and !== as necessary. + +INCORRECT: +// If 'foo' is at the beginning of the string, strpos will return a 0, +// resulting in this conditional evaluating as TRUE +if (strpos($str, 'foo') == FALSE) + +CORRECT: +if (strpos($str, 'foo') === FALSE) + + +INCORRECT: +function build_string($str = "") +{ + if ($str == "") // uh-oh! What if FALSE or the integer 0 is passed as an argument? + { + + } +} + +CORRECT: +function build_string($str = "") +{ + if ($str === "") + { + + } +} + +

    See also information regarding typecasting, which can be quite useful. Typecasting has a slightly different effect which may be desirable. When casting a variable as a string, for instance, NULL and boolean FALSE variables become empty strings, 0 (and other numbers) become strings of digits, and boolean TRUE becomes "1":

    + +$str = (string) $str; // cast $str as a string + +
    + + +

    Debugging Code

    +
    +

    No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

    + +// print_r($foo); +
    + + + +

    Whitespace in Files

    +
    +

    No whitespace can precede the opening PHP tag or follow the closing PHP tag. ExpressionEngine output is buffered, so whitespace in your files can cause output to begin before ExpressionEngine outputs its content, leading to errors and an inability for ExpressionEngine to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

    + +

    INCORRECT:

    + +<?php + // ...there is whitespace and a linebreak above the opening PHP tag + // as well as whitespace after the closing PHP tag +?> + +

    CORRECT:

    +<?php + // this sample has no whitespace before or after the opening and closing PHP tags +?> + +
    + + +

    Compatibility

    +
    +

    Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

    +
    + + + +

    Class and File Names using Common Words

    +
    +

    When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

    + +INCORRECT: +class Email pi.email.php +class Xml ext.xml.php +class Import mod.import.php + +CORRECT: +class Pre_email pi.pre_email.php +class Pre_xml ext.pre_xml.php +class Pre_import mod.pre_import.php + +
    + + +

    Database Table Names

    +
    +

    Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as ExpressionEngine's database class will automatically convert 'exp_' to what is actually being used.

    + +INCORRECT: +email_addresses // missing both prefixes +pre_email_addresses // missing exp_ prefix +exp_email_addresses // missing unique prefix + +CORRECT: +exp_pre_email_addresses + + +

    NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington +

    + + + +

    One File per Class

    +
    +

    Use separate files for each class your add-on uses, unless the classes are closely related. An example of ExpressionEngine files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

    +
    + + + +

    Whitespace

    +
    +

    Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

    +
    + + + +

    Line Breaks

    +
    +

    Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

    +
    + + + +

    Code Indenting

    +
    +

    Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

    + +INCORRECT: +function foo($bar) { + // ... +} + +foreach ($arr as $key => $val) { + // ... +} + +if ($foo == $bar) { + // ... +} else { + // ... +} + +for ($i = 0; $i < 10; $i++) + { + for ($j = 0; $j < 10; $j++) + { + // ... + } + } + +CORRECT: +function foo($bar) +{ + // ... +} + +foreach ($arr as $key => $val) +{ + // ... +} + +if ($foo == $bar) +{ + // ... +} +else +{ + // ... +} + +for ($i = 0; $i < 10; $i++) +{ + for ($j = 0; $j < 10; $j++) + { + // ... + } +} +
    + + +

    Bracket and Parenthetic Spacing

    +
    +

    In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

    + +INCORRECT: +$arr[ $foo ] = 'foo'; + +CORRECT: +$arr[$foo] = 'foo'; // no spaces around array keys + + +INCORRECT: +function foo ( $bar ) +{ + +} + +CORRECT: +function foo($bar) // no spaces around parenthesis in function declarations +{ + +} + + +INCORRECT: +foreach( $query->result() as $row ) + +CORRECT: +foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis + +
    + + + +

    Localized Text in Control Panel

    +
    +

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    + +INCORRECT: +return "Invalid Selection"; + +CORRECT: +return $LANG->line('invalid_selection'); +
    + + + +

    Private Methods and Variables

    +
    +

    Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

    + +convert_text() // public method +_convert_text() // private method +
    + + + +

    PHP Errors

    +
    +

    Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

    + +

    Make sure that while developing your add-on, error reporting is enabled for ALL users, and that display_errors is enabled in the PHP environment. You can check this setting with:

    + +if (ini_get('display_errors') == 1) +{ + exit "Enabled"; +} + +

    On some servers where display_errors is disabled, and you do not have the ability to change this in the php.ini, you can often enable it with:

    + +ini_set('display_errors', 1); + +

    NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

    +
    + + + +

    Short Open Tags

    +
    +

    Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

    + +INCORRECT: +<? echo $foo; ?> + +<?=$foo?> + +CORRECT: +<?php echo $foo; ?> +
    + + + +

    One Statement Per Line

    +
    +

    Never combine statements on one line.

    + +INCORRECT: +$foo = 'this'; $bar = 'that'; $bat = str_replace($foo, $bar, $bag); + +CORRECT: +$foo = 'this'; +$bar = 'that'; +$bat = str_replace($foo, $bar, $bag); + +
    + + + +

    Strings

    +
    +

    Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

    + +INCORRECT: +"My String" // no variable parsing, so no use for double quotes +"My string $foo" // needs braces +'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly + +CORRECT: +'My String' +"My string {$foo}" +"SELECT foo FROM bar WHERE baz = 'bag'" +
    + + + +

    SQL Queries

    +
    +

    MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

    + +

    Break up long queries into multiple lines for legibility, preferably breaking for each clause.

    + +INCORRECT: +// keywords are lowercase and query is too long for +// a single line (... indicates continuation of line) +$query = $this->db->query("select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses +...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"); + +CORRECT: +$query = $this->db->query("SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz + FROM exp_pre_email_addresses + WHERE foo != 'oof' + AND baz != 'zab' + ORDER BY foobaz + LIMIT 5, 100"); +
    + + + +

    Default Function Arguments

    +
    +

    Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

    + +function foo($bar = '', $baz = FALSE) +
    + + + +

    Overlapping Tag Parameters

    +
    +

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    +
    + + +
    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 36e19d6c..2c9d5f8e 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -1,151 +1,151 @@ - - - - - -CodeIgniter URLs : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    CodeIgniter URLs

    - -

    By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string" -approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    - -example.com/news/article/my_article - -

    Note: Query string URLs can be optionally enabled, as described below.

    - -

    URI Segments

    - -

    The segments in the URL, in following with the Model-View-Controller approach, usually represent:

    - -example.com/class/function/ID - -
      -
    1. The first segment represents the controller class that should be invoked.
    2. -
    3. The second segment represents the class function, or method, that should be called.
    4. -
    5. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.
    6. -
    - -

    The URI Class and the URL Helper -contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the -URI Routing feature for more flexibility.

    - - - -

    Removing the index.php file

    - -

    By default, the index.php file will be included in your URLs:

    - -example.com/index.php/news/article/my_article - -

    You can easily remove this file by using a .htaccess file with some simple rules. Here is an example - of such a file, using the "negative" method in which everything is redirected except the specified items:

    - -RewriteEngine on
    -RewriteCond $1 !^(index\.php|images|robots\.txt)
    -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.

    - - -

    Adding a URL Suffix

    - -

    In your config/config.php file you can specify a suffix that will be added to all URLs generated -by CodeIgniter. For example, if a URL is this:

    - -example.com/index.php/products/view/shoes - -

    You can optionally add a suffix, like .html, making the page appear to be of a certain type:

    - -example.com/index.php/products/view/shoes.html - - -

    Enabling Query Strings

    - -

    In some cases you might prefer to use query strings URLs:

    - -index.php?c=products&m=view&id=345 - -

    CodeIgniter optionally supports this capability, which can be enabled in your application/config.php file. If you -open your config file you'll see these items:

    - -$config['enable_query_strings'] = FALSE;
    -$config['controller_trigger'] = 'c';
    -$config['function_trigger'] = 'm';
    - -

    If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then -be accessible using the "trigger" words you've set to invoke your controllers and methods:

    - -index.php?c=controller&m=method - -

    Please note: If you are using query strings you will have to build your own URLs, rather than utilizing -the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with -segment based URLs.

    - - -
    - - - - - - + + + + + +CodeIgniter URLs : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    CodeIgniter URLs

    + +

    By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string" +approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    + +example.com/news/article/my_article + +

    Note: Query string URLs can be optionally enabled, as described below.

    + +

    URI Segments

    + +

    The segments in the URL, in following with the Model-View-Controller approach, usually represent:

    + +example.com/class/function/ID + +
      +
    1. The first segment represents the controller class that should be invoked.
    2. +
    3. The second segment represents the class function, or method, that should be called.
    4. +
    5. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.
    6. +
    + +

    The URI Class and the URL Helper +contain functions that make it easy to work with your URI data. In addition, your URLs can be remapped using the +URI Routing feature for more flexibility.

    + + + +

    Removing the index.php file

    + +

    By default, the index.php file will be included in your URLs:

    + +example.com/index.php/news/article/my_article + +

    You can easily remove this file by using a .htaccess file with some simple rules. Here is an example + of such a file, using the "negative" method in which everything is redirected except the specified items:

    + +RewriteEngine on
    +RewriteCond $1 !^(index\.php|images|robots\.txt)
    +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.

    + + +

    Adding a URL Suffix

    + +

    In your config/config.php file you can specify a suffix that will be added to all URLs generated +by CodeIgniter. For example, if a URL is this:

    + +example.com/index.php/products/view/shoes + +

    You can optionally add a suffix, like .html, making the page appear to be of a certain type:

    + +example.com/index.php/products/view/shoes.html + + +

    Enabling Query Strings

    + +

    In some cases you might prefer to use query strings URLs:

    + +index.php?c=products&m=view&id=345 + +

    CodeIgniter optionally supports this capability, which can be enabled in your application/config.php file. If you +open your config file you'll see these items:

    + +$config['enable_query_strings'] = FALSE;
    +$config['controller_trigger'] = 'c';
    +$config['function_trigger'] = 'm';
    + +

    If you change "enable_query_strings" to TRUE this feature will become active. Your controllers and functions will then +be accessible using the "trigger" words you've set to invoke your controllers and methods:

    + +index.php?c=controller&m=method + +

    Please note: If you are using query strings you will have to build your own URLs, rather than utilizing +the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with +segment based URLs.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/general/views.html b/user_guide/general/views.html index ff600602..a8c3d602 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -1,274 +1,274 @@ - - - - - -Views : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Views

    - -

    A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. -In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type -of hierarchy.

    - -

    Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the -traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page -you should do so before continuing.

    - -

    Using the example controller you created in the controller page, let's add a view to it.

    - -

    Creating a View

    - -

    Using your text editor, create a file called blogview.php, and put this in it:

    - - - -

    Then save the file in your application/views/ folder.

    - -

    Loading a View

    - -

    To load a particular view file you will use the following function:

    - -$this->load->view('name'); - -

    Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.

    - - -

    Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

    - - - - - -

    If you visit the your site using the URL you did earlier you should see your new view. The URL was similar to this:

    - -example.com/index.php/blog/ - -

    Loading multiple views

    -

    CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more then one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:

    -

    <?php
    -
    -class Page extends Controller {

    - -    function index()
    -   {
    -      $data['page_title'] = 'Your title';
    -      $this->load->view('header');
    -      $this->load->view('menu');
    -      $this->load->view('content', $data);
    -      $this->load->view('footer');
    -   }
    -
    -}
    - ?>

    -

    In the example above, we are using "dynamically added data", which you will see below.

    -

    Storing Views within Sub-folders

    -

    Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need -to include the folder name loading the view. Example:

    - -$this->load->view('folder_name/file_name'); - - -

    Adding Dynamic Data to the View

    - -

    Data is passed from the controller to the view by way of an array or an object in the second -parameter of the view loading function. Here is an example using an array:

    - -$data = array(
    -               'title' => 'My Title',
    -               'heading' => 'My Heading',
    -               'message' => 'My Message'
    -          );
    -
    -$this->load->view('blogview', $data);
    - -

    And here's an example using an object:

    - -$data = new Someclass();
    -$this->load->view('blogview', $data);
    - -

    Note: If you use an object, the class variables will be turned into array elements.

    - - -

    Let's try it with your controller file. Open it add this code:

    - - - - -

    Now open your view file and change the text to variables that correspond to the array keys in your data:

    - - - - -

    Then load the page at the URL you've been using and you should see the variables replaced.

    - -

    Creating Loops

    - -

    The data array you pass to your view files is not limited to simple variables. You can -pass multi dimensional arrays, which can be looped to generate multiple rows. For example, if you -pull data from your database it will typically be in the form of a multi-dimensional array.

    - -

    Here's a simple example. Add this to your controller:

    - - - - -

    Now open your view file and create a loop:

    - - - -

    Note: You'll notice that in the example above we are using PHP's alternative syntax. If you -are not familiar with it you can read about it here.

    - -

    Returning views as data

    - -

    There is a third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

    - -$string = $this->load->view('myfile', '', true); - -
    - - - - - - + + + + + +Views : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Views

    + +

    A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. +In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type +of hierarchy.

    + +

    Views are never called directly, they must be loaded by a controller. Remember that in an MVC framework, the Controller acts as the +traffic cop, so it is responsible for fetching a particular view. If you have not read the Controllers page +you should do so before continuing.

    + +

    Using the example controller you created in the controller page, let's add a view to it.

    + +

    Creating a View

    + +

    Using your text editor, create a file called blogview.php, and put this in it:

    + + + +

    Then save the file in your application/views/ folder.

    + +

    Loading a View

    + +

    To load a particular view file you will use the following function:

    + +$this->load->view('name'); + +

    Where name is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.

    + + +

    Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

    + + + + + +

    If you visit the your site using the URL you did earlier you should see your new view. The URL was similar to this:

    + +example.com/index.php/blog/ + +

    Loading multiple views

    +

    CodeIgniter will intelligently handle multiple calls to $this->load->view from within a controller. If more then one call happens they will be appended together. For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look something like this:

    +

    <?php
    +
    +class Page extends Controller {

    + +    function index()
    +   {
    +      $data['page_title'] = 'Your title';
    +      $this->load->view('header');
    +      $this->load->view('menu');
    +      $this->load->view('content', $data);
    +      $this->load->view('footer');
    +   }
    +
    +}
    + ?>

    +

    In the example above, we are using "dynamically added data", which you will see below.

    +

    Storing Views within Sub-folders

    +

    Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need +to include the folder name loading the view. Example:

    + +$this->load->view('folder_name/file_name'); + + +

    Adding Dynamic Data to the View

    + +

    Data is passed from the controller to the view by way of an array or an object in the second +parameter of the view loading function. Here is an example using an array:

    + +$data = array(
    +               'title' => 'My Title',
    +               'heading' => 'My Heading',
    +               'message' => 'My Message'
    +          );
    +
    +$this->load->view('blogview', $data);
    + +

    And here's an example using an object:

    + +$data = new Someclass();
    +$this->load->view('blogview', $data);
    + +

    Note: If you use an object, the class variables will be turned into array elements.

    + + +

    Let's try it with your controller file. Open it add this code:

    + + + + +

    Now open your view file and change the text to variables that correspond to the array keys in your data:

    + + + + +

    Then load the page at the URL you've been using and you should see the variables replaced.

    + +

    Creating Loops

    + +

    The data array you pass to your view files is not limited to simple variables. You can +pass multi dimensional arrays, which can be looped to generate multiple rows. For example, if you +pull data from your database it will typically be in the form of a multi-dimensional array.

    + +

    Here's a simple example. Add this to your controller:

    + + + + +

    Now open your view file and create a loop:

    + + + +

    Note: You'll notice that in the example above we are using PHP's alternative syntax. If you +are not familiar with it you can read about it here.

    + +

    Returning views as data

    + +

    There is a third optional parameter lets you change the behavior of the function so that it returns data as a string +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

    + +$string = $this->load->view('myfile', '', true); + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 2a6bad3e..a7392d3f 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -1,119 +1,119 @@ - - - - - -Array Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Array Helper

    - -

    The Array Helper file contains functions that assist in working with arrays.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('array'); - -

    The following functions are available:

    - -

    element()

    - -

    Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If -a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:

    - - -$array = array('color' => 'red', 'shape' => 'round', 'size' => '');
    -
    -// returns "red"
    -echo element('color', $array);
    -
    -// returns NULL
    -echo element('size', $array, NULL); -
    - - -

    random_element()

    - -

    Takes an array as input and returns a random element from it. Usage example:

    - -$quotes = array(
    -            "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
    -            "Don't stay in bed, unless you can make money in bed. - George Burns",
    -            "We didn't lose the game; we just ran out of time. - Vince Lombardi",
    -            "If everything seems under control, you're not going fast enough. - Mario Andretti",
    -            "Reality is merely an illusion, albeit a very persistent one. - Albert Einstein",
    -            "Chance favors the prepared mind - Louis Pasteur"
    -            );
    -
    -echo random_element($quotes);
    - - - - -
    - - - - - - + + + + + +Array Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Array Helper

    + +

    The Array Helper file contains functions that assist in working with arrays.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('array'); + +

    The following functions are available:

    + +

    element()

    + +

    Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If +a value exists it is returned. If a value does not exist it returns FALSE, or whatever you've specified as the default value via the third parameter. Example:

    + + +$array = array('color' => 'red', 'shape' => 'round', 'size' => '');
    +
    +// returns "red"
    +echo element('color', $array);
    +
    +// returns NULL
    +echo element('size', $array, NULL); +
    + + +

    random_element()

    + +

    Takes an array as input and returns a random element from it. Usage example:

    + +$quotes = array(
    +            "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson",
    +            "Don't stay in bed, unless you can make money in bed. - George Burns",
    +            "We didn't lose the game; we just ran out of time. - Vince Lombardi",
    +            "If everything seems under control, you're not going fast enough. - Mario Andretti",
    +            "Reality is merely an illusion, albeit a very persistent one. - Albert Einstein",
    +            "Chance favors the prepared mind - Louis Pasteur"
    +            );
    +
    +echo random_element($quotes);
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index 7f32a557..7a30c768 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -1,118 +1,118 @@ - - - - - -Compatibility Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Compatibility Helper

    - -

    The Compatibility Helper file contains PHP 4 implementations of some PHP 5 only native PHP functions and constants. This can be useful - if you'd like to take advantage of some of these native function but your application may end up running on a PHP 4 server. - In these cases, it may be advantageous to Auto-load the Compatibility Helper so you - do not have to load it in each controller.

    - -

    Note: There are a few compatibility functions that are in CodeIgniter's native Compat.php file. - You may use those functions without loading this helper. The functions are split between that file and this Helper so that only - functions required by the framework are included by default. This way, whether or not you load the additional functions in this Helper - remains your choice.

    - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('compatibility'); - -

    Available Constants

    -

    The following constants are available:

    - -

    PHP_EOL

    -

    The newline character for the server's current OS, e.g. on Windows systems "\r\n", on *nix "\n". - -

    Available Functions

    -

    The following functions are available (see linked PHP documentation for documentation):

    - -

    file_put_contents() - The fourth parameter, $context, is not supported.

    - -

    fputcsv()

    - -

    http_build_query()

    - -

    str_ireplace() - The fourth parameter, $count, is not supported, as PHP 4 would make it become required.

    - -

    stripos()

    - - - - - - - -
    - - - - - - + + + + + +Compatibility Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Compatibility Helper

    + +

    The Compatibility Helper file contains PHP 4 implementations of some PHP 5 only native PHP functions and constants. This can be useful + if you'd like to take advantage of some of these native function but your application may end up running on a PHP 4 server. + In these cases, it may be advantageous to Auto-load the Compatibility Helper so you + do not have to load it in each controller.

    + +

    Note: There are a few compatibility functions that are in CodeIgniter's native Compat.php file. + You may use those functions without loading this helper. The functions are split between that file and this Helper so that only + functions required by the framework are included by default. This way, whether or not you load the additional functions in this Helper + remains your choice.

    + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('compatibility'); + +

    Available Constants

    +

    The following constants are available:

    + +

    PHP_EOL

    +

    The newline character for the server's current OS, e.g. on Windows systems "\r\n", on *nix "\n". + +

    Available Functions

    +

    The following functions are available (see linked PHP documentation for documentation):

    + +

    file_put_contents() - The fourth parameter, $context, is not supported.

    + +

    fputcsv()

    + +

    http_build_query()

    + +

    str_ireplace() - The fourth parameter, $count, is not supported, as PHP 4 would make it become required.

    + +

    stripos()

    + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index f30528af..99438bbc 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -1,148 +1,148 @@ - - - - - -Cookie Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Cookie Helper

    - -

    The Cookie Helper file contains functions that assist in working with cookies.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('cookie'); - -

    The following functions are available:

    - -

    set_cookie()

    - -

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: -Array Method, and Discrete Parameters:

    - -

    Array Method

    - -

    Using this method, an associative array is passed to the first parameter:

    - -$cookie = array(
    -                   'name'   => 'The Cookie Name',
    -                   'value'  => 'The Value',
    -                   'expire' => '86500',
    -                   'domain' => '.some-domain.com',
    -                   'path'   => '/',
    -                   'prefix' => 'myprefix_',
    -               );
    -
    -set_cookie($cookie); -
    - -

    Notes:

    - -

    Only the name and value are required.

    - -

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to -zero the cookie will only last as long as the browser is open.

    -

    To delete a cookie set it with the expiration blank.

    -

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    -

    The path is usually not needed since the function sets a root path.

    -

    The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

    - -

    Discrete Parameters

    - -

    If you prefer, you can set the cookie by passing data using individual parameters:

    - -set_cookie($name, $value, $expire, $domain, $path, $prefix); - -

    get_cookie()

    - -

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    - -get_cookie('some_cookie'); - -

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    - -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    - -

    get_cookie('some_cookie', TRUE);

    -

    delete_cookie()

    - -

    Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

    - -delete_cookie("name"); - -

    This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array -of values in the first parameter or you can set discrete parameters.

    - -delete_cookie($name, $domain, $path, $prefix) - - -
    - - - - - - + + + + + +Cookie Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Cookie Helper

    + +

    The Cookie Helper file contains functions that assist in working with cookies.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('cookie'); + +

    The following functions are available:

    + +

    set_cookie()

    + +

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +Array Method, and Discrete Parameters:

    + +

    Array Method

    + +

    Using this method, an associative array is passed to the first parameter:

    + +$cookie = array(
    +                   'name'   => 'The Cookie Name',
    +                   'value'  => 'The Value',
    +                   'expire' => '86500',
    +                   'domain' => '.some-domain.com',
    +                   'path'   => '/',
    +                   'prefix' => 'myprefix_',
    +               );
    +
    +set_cookie($cookie); +
    + +

    Notes:

    + +

    Only the name and value are required.

    + +

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to +zero the cookie will only last as long as the browser is open.

    +

    To delete a cookie set it with the expiration blank.

    +

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    +

    The path is usually not needed since the function sets a root path.

    +

    The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

    + +

    Discrete Parameters

    + +

    If you prefer, you can set the cookie by passing data using individual parameters:

    + +set_cookie($name, $value, $expire, $domain, $path, $prefix); + +

    get_cookie()

    + +

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    + +get_cookie('some_cookie'); + +

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    + +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    + +

    get_cookie('some_cookie', TRUE);

    +

    delete_cookie()

    + +

    Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

    + +delete_cookie("name"); + +

    This function is otherwise identical to set_cookie(), except that it does not have the value and expiration parameters. You can submit an array +of values in the first parameter or you can set discrete parameters.

    + +delete_cookie($name, $domain, $path, $prefix) + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 7a7b4d70..e11fb0c8 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -1,408 +1,408 @@ - - - - - -Date Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Date Helper

    - -

    The Date Helper file contains functions that help you work with dates.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('date'); - - -

    The following functions are available:

    - -

    now()

    - -

    Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" -setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you -run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function. -

    - - - - -

    mdate()

    - -

    This function is identical to PHPs date() function, except that it lets you -use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

    - -

    The benefit of doing dates this way is that you don't have to worry about escaping any characters that -are not date codes, as you would normally have to do with the date() function. Example:

    - -$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
    -$time = time();
    -
    -echo mdate($datestring, $time);
    - -

    If a timestamp is not included in the second parameter the current time will be used.

    - - -

    standard_date()

    - -

    Lets you generate a date string in one of several standardized formats. Example:

    - - -$format = 'DATE_RFC822';
    -$time = time();
    -
    -echo standard_date($format, $time); -
    - -

    The first parameter must contain the format, the second parameter must contain the date as a Unix timestamp.

    - -

    Supported formats:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ConstantDescriptionExample
    DATE_ATOMAtom2005-08-15T16:13:03+0000
    DATE_COOKIEHTTP CookiesSun, 14 Aug 2005 16:13:03 UTC
    DATE_ISO8601ISO-86012005-08-14T16:13:03+0000
    DATE_RFC822RFC 822Sun, 14 Aug 2005 16:13:03 UTC
    DATE_RFC850RFC 850Sunday, 14-Aug-05 16:13:03 UTC
    DATE_RFC1036RFC 1036Sunday, 14-Aug-05 16:13:03 UTC
    DATE_RFC1123RFC 1123Sun, 14 Aug 2005 16:13:03 UTC
    DATE_RFC2822RFC 2822Sun, 14 Aug 2005 16:13:03 +0000
    DATE_RSSRSSSun, 14 Aug 2005 16:13:03 UTC
    DATE_W3CWorld Wide Web Consortium2005-08-14T16:13:03+0000
    - -

    local_to_gmt()

    - -

    Takes a Unix timestamp as input and returns it as GMT. Example:

    - -$now = time();
    -
    -$gmt = local_to_gmt($now);
    - - -

    gmt_to_local()

    - -

    Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the -timezone and Daylight Saving time submitted. Example:

    - - -$timestamp = '1140153693';
    -$timezone = 'UM8';
    -$daylight_saving = TRUE;
    -
    -echo gmt_to_local($timestamp, $timezone, $daylight_saving);
    - -

    Note: For a list of timezones see the reference at the bottom of this page.

    - -

    mysql_to_unix()

    - -

    Takes a MySQL Timestamp as input and returns it as Unix. Example:

    - -$mysql = '20061124092345';
    -
    -$unix = mysql_to_unix($mysql);
    - - -

    unix_to_human()

    - -

    Takes a Unix timestamp as input and returns it in a human readable format with this prototype:

    - -YYYY-MM-DD HH:MM:SS AM/PM - -

    This can be useful if you need to display a date in a form field for submission.

    - -

    The time can be formatted with or without seconds, and it can be set to European or US format. If only -the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:

    - -$now = time();
    -
    -echo unix_to_human($now); // U.S. time, no seconds
    -
    -echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds
    -
    -echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
    - - -

    human_to_unix()

    - -

    The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is -useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if -the date string passed to it is not formatted as indicated above. Example:

    - -$now = time();
    -
    -$human = unix_to_human($now);
    -
    -$unix = human_to_unix($human);
    - - - - - -

    timespan()

    - -

    Formats a unix timestamp so that is appears similar to this:

    - -1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes - -

    The first parameter must contain a Unix timestamp. The second parameter must contain a -timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose -for this function is to show how much time has elapsed from some point in time in the past to now. Example:

    - -$post_date = '1079621429';
    -$now = time();
    -
    -echo timespan($post_date, $now);
    - -

    Note: The text generated by this function is found in the following language file: language/<your_lang>/date_lang.php

    - - -

    days_in_month()

    - -

    Returns the number of days in a given month/year. Takes leap years into account. Example:

    -echo days_in_month(06, 2005); - -

    If the second parameter is empty, the current year will be used.

    -

    timezones()

    -

    Takes a timezone reference (for a list of valid timezones, see the "Timezone Reference" below) and returns the number of hours offset from UTC.

    -

    echo timezones('UM5');

    -

    This function is useful when used with timezone_menu().

    -

    timezone_menu()

    -

    Generates a pull-down menu of timezones, like this one:

    - -
    - -
    - -

    This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

    - -

    The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

    - -echo timezone_menu('UM8'); - -

    Please see the timezone reference below to see the values of this menu.

    - -

    The second parameter lets you set a CSS class name for the menu.

    - -

    Note: The text contained in the menu is found in the following language file: language/<your_lang>/date_lang.php

    - - - -

    Timezone Reference

    - -

    The following table indicates each timezone and its location.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Time ZoneLocation
    UM12(UTC - 12:00) Enitwetok, Kwajalien
    UM11(UTC - 11:00) Nome, Midway Island, Samoa
    UM10(UTC - 10:00) Hawaii
    UM9(UTC - 9:00) Alaska
    UM8(UTC - 8:00) Pacific Time
    UM7(UTC - 7:00) Mountain Time
    UM6(UTC - 6:00) Central Time, Mexico City
    UM5(UTC - 5:00) Eastern Time, Bogota, Lima, Quito
    UM4(UTC - 4:00) Atlantic Time, Caracas, La Paz
    UM25(UTC - 3:30) Newfoundland
    UM3(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.
    UM2(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena
    UM1(UTC - 1:00) Azores, Cape Verde Islands
    UTC(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia
    UP1(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome
    UP2(UTC + 2:00) Kaliningrad, South Africa, Warsaw
    UP3(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi
    UP25(UTC + 3:30) Tehran
    UP4(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi
    UP35(UTC + 4:30) Kabul
    UP5(UTC + 5:00) Islamabad, Karachi, Tashkent
    UP45(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi
    UP6(UTC + 6:00) Almaty, Colomba, Dhaka
    UP7(UTC + 7:00) Bangkok, Hanoi, Jakarta
    UP8(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei
    UP9(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk
    UP85(UTC + 9:30) Adelaide, Darwin
    UP10(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok
    UP11(UTC + 11:00) Magadan, New Caledonia, Solomon Islands
    UP12(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island
    - - -
    - - - - - - + + + + + +Date Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Date Helper

    + +

    The Date Helper file contains functions that help you work with dates.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('date'); + + +

    The following functions are available:

    + +

    now()

    + +

    Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" +setting in your config file. If you do not intend to set your master time reference to GMT (which you'll typically do if you +run a site that lets each user set their own timezone settings) there is no benefit to using this function over PHP's time() function. +

    + + + + +

    mdate()

    + +

    This function is identical to PHPs date() function, except that it lets you +use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc.

    + +

    The benefit of doing dates this way is that you don't have to worry about escaping any characters that +are not date codes, as you would normally have to do with the date() function. Example:

    + +$datestring = "Year: %Y Month: %m Day: %d - %h:%i %a";
    +$time = time();
    +
    +echo mdate($datestring, $time);
    + +

    If a timestamp is not included in the second parameter the current time will be used.

    + + +

    standard_date()

    + +

    Lets you generate a date string in one of several standardized formats. Example:

    + + +$format = 'DATE_RFC822';
    +$time = time();
    +
    +echo standard_date($format, $time); +
    + +

    The first parameter must contain the format, the second parameter must contain the date as a Unix timestamp.

    + +

    Supported formats:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ConstantDescriptionExample
    DATE_ATOMAtom2005-08-15T16:13:03+0000
    DATE_COOKIEHTTP CookiesSun, 14 Aug 2005 16:13:03 UTC
    DATE_ISO8601ISO-86012005-08-14T16:13:03+0000
    DATE_RFC822RFC 822Sun, 14 Aug 2005 16:13:03 UTC
    DATE_RFC850RFC 850Sunday, 14-Aug-05 16:13:03 UTC
    DATE_RFC1036RFC 1036Sunday, 14-Aug-05 16:13:03 UTC
    DATE_RFC1123RFC 1123Sun, 14 Aug 2005 16:13:03 UTC
    DATE_RFC2822RFC 2822Sun, 14 Aug 2005 16:13:03 +0000
    DATE_RSSRSSSun, 14 Aug 2005 16:13:03 UTC
    DATE_W3CWorld Wide Web Consortium2005-08-14T16:13:03+0000
    + +

    local_to_gmt()

    + +

    Takes a Unix timestamp as input and returns it as GMT. Example:

    + +$now = time();
    +
    +$gmt = local_to_gmt($now);
    + + +

    gmt_to_local()

    + +

    Takes a Unix timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the +timezone and Daylight Saving time submitted. Example:

    + + +$timestamp = '1140153693';
    +$timezone = 'UM8';
    +$daylight_saving = TRUE;
    +
    +echo gmt_to_local($timestamp, $timezone, $daylight_saving);
    + +

    Note: For a list of timezones see the reference at the bottom of this page.

    + +

    mysql_to_unix()

    + +

    Takes a MySQL Timestamp as input and returns it as Unix. Example:

    + +$mysql = '20061124092345';
    +
    +$unix = mysql_to_unix($mysql);
    + + +

    unix_to_human()

    + +

    Takes a Unix timestamp as input and returns it in a human readable format with this prototype:

    + +YYYY-MM-DD HH:MM:SS AM/PM + +

    This can be useful if you need to display a date in a form field for submission.

    + +

    The time can be formatted with or without seconds, and it can be set to European or US format. If only +the timestamp is submitted it will return the time without seconds formatted for the U.S. Examples:

    + +$now = time();
    +
    +echo unix_to_human($now); // U.S. time, no seconds
    +
    +echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds
    +
    +echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
    + + +

    human_to_unix()

    + +

    The opposite of the above function. Takes a "human" time as input and returns it as Unix. This function is +useful if you accept "human" formatted dates submitted via a form. Returns FALSE (boolean) if +the date string passed to it is not formatted as indicated above. Example:

    + +$now = time();
    +
    +$human = unix_to_human($now);
    +
    +$unix = human_to_unix($human);
    + + + + + +

    timespan()

    + +

    Formats a unix timestamp so that is appears similar to this:

    + +1 Year, 10 Months, 2 Weeks, 5 Days, 10 Hours, 16 Minutes + +

    The first parameter must contain a Unix timestamp. The second parameter must contain a +timestamp that is greater that the first timestamp. If the second parameter empty, the current time will be used. The most common purpose +for this function is to show how much time has elapsed from some point in time in the past to now. Example:

    + +$post_date = '1079621429';
    +$now = time();
    +
    +echo timespan($post_date, $now);
    + +

    Note: The text generated by this function is found in the following language file: language/<your_lang>/date_lang.php

    + + +

    days_in_month()

    + +

    Returns the number of days in a given month/year. Takes leap years into account. Example:

    +echo days_in_month(06, 2005); + +

    If the second parameter is empty, the current year will be used.

    +

    timezones()

    +

    Takes a timezone reference (for a list of valid timezones, see the "Timezone Reference" below) and returns the number of hours offset from UTC.

    +

    echo timezones('UM5');

    +

    This function is useful when used with timezone_menu().

    +

    timezone_menu()

    +

    Generates a pull-down menu of timezones, like this one:

    + +
    + +
    + +

    This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

    + +

    The first parameter lets you set the "selected" state of the menu. For example, to set Pacific time as the default you will do this:

    + +echo timezone_menu('UM8'); + +

    Please see the timezone reference below to see the values of this menu.

    + +

    The second parameter lets you set a CSS class name for the menu.

    + +

    Note: The text contained in the menu is found in the following language file: language/<your_lang>/date_lang.php

    + + + +

    Timezone Reference

    + +

    The following table indicates each timezone and its location.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Time ZoneLocation
    UM12(UTC - 12:00) Enitwetok, Kwajalien
    UM11(UTC - 11:00) Nome, Midway Island, Samoa
    UM10(UTC - 10:00) Hawaii
    UM9(UTC - 9:00) Alaska
    UM8(UTC - 8:00) Pacific Time
    UM7(UTC - 7:00) Mountain Time
    UM6(UTC - 6:00) Central Time, Mexico City
    UM5(UTC - 5:00) Eastern Time, Bogota, Lima, Quito
    UM4(UTC - 4:00) Atlantic Time, Caracas, La Paz
    UM25(UTC - 3:30) Newfoundland
    UM3(UTC - 3:00) Brazil, Buenos Aires, Georgetown, Falkland Is.
    UM2(UTC - 2:00) Mid-Atlantic, Ascention Is., St Helena
    UM1(UTC - 1:00) Azores, Cape Verde Islands
    UTC(UTC) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia
    UP1(UTC + 1:00) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome
    UP2(UTC + 2:00) Kaliningrad, South Africa, Warsaw
    UP3(UTC + 3:00) Baghdad, Riyadh, Moscow, Nairobi
    UP25(UTC + 3:30) Tehran
    UP4(UTC + 4:00) Adu Dhabi, Baku, Muscat, Tbilisi
    UP35(UTC + 4:30) Kabul
    UP5(UTC + 5:00) Islamabad, Karachi, Tashkent
    UP45(UTC + 5:30) Bombay, Calcutta, Madras, New Delhi
    UP6(UTC + 6:00) Almaty, Colomba, Dhaka
    UP7(UTC + 7:00) Bangkok, Hanoi, Jakarta
    UP8(UTC + 8:00) Beijing, Hong Kong, Perth, Singapore, Taipei
    UP9(UTC + 9:00) Osaka, Sapporo, Seoul, Tokyo, Yakutsk
    UP85(UTC + 9:30) Adelaide, Darwin
    UP10(UTC + 10:00) Melbourne, Papua New Guinea, Sydney, Vladivostok
    UP11(UTC + 11:00) Magadan, New Caledonia, Solomon Islands
    UP12(UTC + 12:00) Auckland, Wellington, Fiji, Marshall Island
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index cbd743e3..5263bc6c 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -1,140 +1,140 @@ - - - - - -Directory Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Directory Helper

    - -

    The Directory Helper file contains functions that assist in working with directories.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('directory'); - -

    The following functions are available:

    - -

    directory_map('source directory')

    - -

    This function reads the directory path specified in the first parameter -and builds an array representation of it and all its contained files. Example:

    - -$map = directory_map('./mydirectory/'); - -

    Note: Paths are almost always relative to your main index.php file.

    - - - -

    Sub-folders contained within the directory will be mapped as well. If you wish to map -only the top level directory set the second parameter to true (boolean):

    - -$map = directory_map('./mydirectory/', 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:

    - -Array
    -(
    -   [libraries] => Array
    -   (
    -       [0] => benchmark.html
    -       [1] => config.html
    -       [database] => Array
    -       (
    -             [0] => active_record.html
    -             [1] => binds.html
    -             [2] => configuration.html
    -             [3] => connecting.html
    -             [4] => examples.html
    -             [5] => fields.html
    -             [6] => index.html
    -             [7] => queries.html
    -        )
    -       [2] => email.html
    -       [3] => file_uploading.html
    -       [4] => image_lib.html
    -       [5] => input.html
    -       [6] => language.html
    -       [7] => loader.html
    -       [8] => pagination.html
    -       [9] => uri.html
    -)
    - - - - - - - -
    - - - - - - + + + + + +Directory Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Directory Helper

    + +

    The Directory Helper file contains functions that assist in working with directories.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('directory'); + +

    The following functions are available:

    + +

    directory_map('source directory')

    + +

    This function reads the directory path specified in the first parameter +and builds an array representation of it and all its contained files. Example:

    + +$map = directory_map('./mydirectory/'); + +

    Note: Paths are almost always relative to your main index.php file.

    + + + +

    Sub-folders contained within the directory will be mapped as well. If you wish to map +only the top level directory set the second parameter to true (boolean):

    + +$map = directory_map('./mydirectory/', 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:

    + +Array
    +(
    +   [libraries] => Array
    +   (
    +       [0] => benchmark.html
    +       [1] => config.html
    +       [database] => Array
    +       (
    +             [0] => active_record.html
    +             [1] => binds.html
    +             [2] => configuration.html
    +             [3] => connecting.html
    +             [4] => examples.html
    +             [5] => fields.html
    +             [6] => index.html
    +             [7] => queries.html
    +        )
    +       [2] => email.html
    +       [3] => file_uploading.html
    +       [4] => image_lib.html
    +       [5] => input.html
    +       [6] => language.html
    +       [7] => loader.html
    +       [8] => pagination.html
    +       [9] => uri.html
    +)
    + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index d9bf6938..6de99034 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -1,112 +1,112 @@ - - - - - -Download Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Download Helper

    - -

    The Download Helper lets you download data to your desktop.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('download'); - -

    The following functions are available:

    - -

    force_download('filename', 'data')

    - -

    Generates server headers which force data to be downloaded to your desktop. Useful with file downloads. -The first parameter is the name you want the downloaded file to be named, the second parameter is the file data. -Example:

    - - -$data = 'Here is some text!';
    -$name = 'mytext.txt';
    -
    -force_download($name, $data); -
    - -

    If you want to download an existing file from your server you'll need to read the file into a string:

    - - -$data = file_get_contents("/path/to/photo.jpg"); // Read the file's contents
    -$name = 'myphoto.jpg';
    -
    -force_download($name, $data); -
    - - - - -
    - - - - - - + + + + + +Download Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Download Helper

    + +

    The Download Helper lets you download data to your desktop.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('download'); + +

    The following functions are available:

    + +

    force_download('filename', 'data')

    + +

    Generates server headers which force data to be downloaded to your desktop. Useful with file downloads. +The first parameter is the name you want the downloaded file to be named, the second parameter is the file data. +Example:

    + + +$data = 'Here is some text!';
    +$name = 'mytext.txt';
    +
    +force_download($name, $data); +
    + +

    If you want to download an existing file from your server you'll need to read the file into a string:

    + + +$data = file_get_contents("/path/to/photo.jpg"); // Read the file's contents
    +$name = 'myphoto.jpg';
    +
    +force_download($name, $data); +
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 732e5154..11c6d1ca 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -1,102 +1,102 @@ - - - - - -Email Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Email Helper

    - -

    The Email Helper provides some assistive functions for working with Email. For a more robust email solution, see CodeIgniter's Email Class.

    - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -

    $this->load->helper('email');

    - -

    The following functions are available:

    - -

    valid_email('email')

    - -

    Checks if an email is a correctly formatted email. Note that is doesn't actually prove the email will recieve mail, simply that it is a validly formed address.

    -

    It returns TRUE/FALSE

    - $this->load->helper('email');
    -
    -if (valid_email('email@somesite.com'))
    -{
    -    echo 'email is valid';
    -}
    -else
    -{
    -    echo 'email is not valid';
    -}
    -

    send_email('recipient', 'subject', 'message')

    -

    Sends an email using PHP's native mail() function. For a more robust email solution, see CodeIgniter's Email Class.

    -
    - - - - - - + + + + + +Email Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Email Helper

    + +

    The Email Helper provides some assistive functions for working with Email. For a more robust email solution, see CodeIgniter's Email Class.

    + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +

    $this->load->helper('email');

    + +

    The following functions are available:

    + +

    valid_email('email')

    + +

    Checks if an email is a correctly formatted email. Note that is doesn't actually prove the email will recieve mail, simply that it is a validly formed address.

    +

    It returns TRUE/FALSE

    + $this->load->helper('email');
    +
    +if (valid_email('email@somesite.com'))
    +{
    +    echo 'email is valid';
    +}
    +else
    +{
    +    echo 'email is not valid';
    +}
    +

    send_email('recipient', 'subject', 'message')

    +

    Sends an email using PHP's native mail() function. For a more robust email solution, see CodeIgniter's Email Class.

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index e534f50d..b16201c1 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -1,178 +1,178 @@ - - - - - -File Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    File Helper

    - -

    The File Helper file contains functions that assist in working with files.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('file'); - -

    The following functions are available:

    - -

    read_file('path')

    - -

    Returns the data contained in the file specified in the path. Example:

    - -$string = read_file('./path/to/file.php'); - -

    The path can be a relative or full server path. Returns FALSE (boolean) on failure.

    - -

    Note: The path is relative to your main site index.php file, NOT your controller or view files. -CodeIgniter uses a front controller so paths are always relative to the main site index.

    - -

    If your server is running an open_basedir restriction this function -might not work if you are trying to access a file above the calling script.

    - -

    write_file('path', $data)

    - -

    Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

    - - -$data = 'Some file data';
    -
    -if ( ! write_file('./path/to/file.php', $data))
    -{
    -     echo 'Unable to write the file';
    -}
    -else
    -{
    -     echo 'File written!';
    -}
    - -

    You can optionally set the write mode via the third parameter:

    - -write_file('./path/to/file.php', $data, 'r+'); - -

    The default mode is wb. Please see the PHP user guide for mode options.

    - -

    Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). -If the file does not already exist, the directory containing it must be writable.

    - -

    Note: The path is relative to your main site index.php file, NOT your controller or view files. -CodeIgniter uses a front controller so paths are always relative to the main site index.

    - -

    delete_files('path')

    - -

    Deletes ALL files contained in the supplied path. Example:

    -delete_files('./path/to/directory/'); - -

    If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:

    - -delete_files('./path/to/directory/', TRUE); - -

    Note: The files must be writable or owned by the system in order to be deleted.

    - -

    get_filenames('path/to/directory/')

    - -

    Takes a server path as input and returns an array containing the names of all files contained within it. The file path -can optionally be added to the file names by setting the second parameter to TRUE.

    - -

    get_dir_file_info('path/to/directory/')

    - -

    Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Any sub-folders contained within the specified path are read as well.

    - -

    get_file_info('path/to/file', $file_information)

    - -

    Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

    - -

    Note: The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.

    -

    get_mime_by_extension('file')

    - -

    Translates a file extension into a mime type based on config/mimes.php. Returns FALSE if it can't determine the type, or open the mime config file.

    -

    -$file = "somefile.png";
    -echo $file . ' is has a mime type of ' . get_mime_by_extension($file);
    -

    -

    Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

    - -

    symbolic_permissions($perms)

    - -

    Takes numeric permissions (such as is returned by fileperms() and returns standard symbolic notation of file permissions.

    - -echo symbolic_permissions(fileperms('./index.php'));
    -
    -// -rw-r--r--
    - -

    octal_permissions($perms)

    - -

    Takes numeric permissions (such as is returned by fileperms() and returns a three character octal notation of file permissions.

    - -echo octal_permissions(fileperms('./index.php'));
    -
    -// 644
    - -
    - - - - - - - + + + + + +File Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    File Helper

    + +

    The File Helper file contains functions that assist in working with files.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('file'); + +

    The following functions are available:

    + +

    read_file('path')

    + +

    Returns the data contained in the file specified in the path. Example:

    + +$string = read_file('./path/to/file.php'); + +

    The path can be a relative or full server path. Returns FALSE (boolean) on failure.

    + +

    Note: The path is relative to your main site index.php file, NOT your controller or view files. +CodeIgniter uses a front controller so paths are always relative to the main site index.

    + +

    If your server is running an open_basedir restriction this function +might not work if you are trying to access a file above the calling script.

    + +

    write_file('path', $data)

    + +

    Writes data to the file specified in the path. If the file does not exist the function will create it. Example:

    + + +$data = 'Some file data';
    +
    +if ( ! write_file('./path/to/file.php', $data))
    +{
    +     echo 'Unable to write the file';
    +}
    +else
    +{
    +     echo 'File written!';
    +}
    + +

    You can optionally set the write mode via the third parameter:

    + +write_file('./path/to/file.php', $data, 'r+'); + +

    The default mode is wb. Please see the PHP user guide for mode options.

    + +

    Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.). +If the file does not already exist, the directory containing it must be writable.

    + +

    Note: The path is relative to your main site index.php file, NOT your controller or view files. +CodeIgniter uses a front controller so paths are always relative to the main site index.

    + +

    delete_files('path')

    + +

    Deletes ALL files contained in the supplied path. Example:

    +delete_files('./path/to/directory/'); + +

    If the second parameter is set to true, any directories contained within the supplied root path will be deleted as well. Example:

    + +delete_files('./path/to/directory/', TRUE); + +

    Note: The files must be writable or owned by the system in order to be deleted.

    + +

    get_filenames('path/to/directory/')

    + +

    Takes a server path as input and returns an array containing the names of all files contained within it. The file path +can optionally be added to the file names by setting the second parameter to TRUE.

    + +

    get_dir_file_info('path/to/directory/')

    + +

    Reads the specified directory and builds an array containing the filenames, filesize, dates, and permissions. Any sub-folders contained within the specified path are read as well.

    + +

    get_file_info('path/to/file', $file_information)

    + +

    Given a file and path, returns the name, path, size, date modified. Second parameter allows you to explicitly declare what information you want returned; options are: name, server_path, size, date, readable, writable, executable, fileperms. Returns FALSE if the file cannot be found.

    + +

    Note: The "writable" uses the PHP function is_writable() which is known to have issues on the IIS webserver. Consider using fileperms instead, which returns information from PHP's fileperms() function.

    +

    get_mime_by_extension('file')

    + +

    Translates a file extension into a mime type based on config/mimes.php. Returns FALSE if it can't determine the type, or open the mime config file.

    +

    +$file = "somefile.png";
    +echo $file . ' is has a mime type of ' . get_mime_by_extension($file);
    +

    +

    Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.

    + +

    symbolic_permissions($perms)

    + +

    Takes numeric permissions (such as is returned by fileperms() and returns standard symbolic notation of file permissions.

    + +echo symbolic_permissions(fileperms('./index.php'));
    +
    +// -rw-r--r--
    + +

    octal_permissions($perms)

    + +

    Takes numeric permissions (such as is returned by fileperms() and returns a three character octal notation of file permissions.

    + +echo octal_permissions(fileperms('./index.php'));
    +
    +// 644
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index dfaa38ec..730acb6d 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -1,475 +1,475 @@ - - - - - -Form Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Form Helper

    - -

    The Form Helper file contains functions that assist in working with forms.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('form'); - -

    The following functions are available:

    - - - -

    form_open()

    - -

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you -add form attributes and hidden input fields.

    - -

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable -in the event your URLs ever change.

    - -

    Here's a simple example:

    - -echo form_open('email/send'); - -

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    - -<form method="post" action="http:/example.com/index.php/email/send" /> - -

    Adding Attributes

    - -

    Attributes can be added by passing an associative array to the second parameter, like this:

    - - -$attributes = array('class' => 'email', 'id' => 'myform');
    -
    -echo form_open('email/send', $attributes);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/example.com/index.php/email/send"  class="email"  id="myform" /> - -

    Adding Hidden Input Fields

    - -

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    - - -$hidden = array('username' => 'Joe', 'member_id' => '234');
    -
    -echo form_open('email/send', '', $hidden);
    - -

    The above example would create a form similar to this:

    - -<form method="post" action="http:/example.com/index.php/email/send">
    -<input type="hidden" name="username" value="Joe" />
    -<input type="hidden" name="member_id" value="234" />
    - - -

    form_open_multipart()

    - -

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, -which is necessary if you would like to use the form to upload files with.

    - -

    form_hidden()

    - -

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    - -form_hidden('username', 'johndoe');
    -
    -// Would produce:

    -<input type="hidden" name="username" value="johndoe" />
    - -

    Or you can submit an associative array to create multiple fields:

    - -$data = array(
    -              'name'  => 'John Doe',
    -              'email' => 'john@example.com',
    -              'url'   => 'http://example.com'
    -            );
    -
    -echo form_hidden($data);
    -
    -// Would produce:

    -<input type="hidden" name="name" value="John Doe" />
    -<input type="hidden" name="email" value="john@example.com" />
    -<input type="hidden" name="url" value="http://example.com" />
    - - - - -

    form_input()

    - -

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first -and second parameter:

    - -echo form_input('username', 'johndoe'); - -

    Or you can pass an associative array containing any data you wish your form to contain:

    - -$data = array(
    -              'name'        => 'username',
    -              'id'          => 'username',
    -              'value'       => 'johndoe',
    -              'maxlength'   => '100',
    -              'size'        => '50',
    -              'style'       => 'width:50%',
    -            );
    -
    -echo form_input($data);
    -
    -// Would produce:

    -<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    - -

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the -third parameter:

    - -$js = 'onClick="some_function()"';
    -
    -echo form_input('username', 'johndoe', $js);
    - -

    form_password()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "password" type.

    - -

    form_upload()

    - -

    This function is identical in all respects to the form_input() function above -except that is sets it as a "file" type, allowing it to be used to upload files.

    - -

    form_textarea()

    - -

    This function is identical in all respects to the form_input() function above -except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above -example, you will instead specify "rows" and "cols".

    - - -

    form_dropdown()

    - -

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, -the second parameter will contain an associative array of options, and the third parameter will contain the -value you wish to be selected. You can also pass an array through the third parameter, and CodeIgniter will create a multiple select for you. Example:

    - -$options = array(
    -                  'small'  => 'Small Shirt',
    -                  'med'    => 'Medium Shirt',
    -                  'large'   => 'Large Shirt',
    -                  'xlarge' => 'Extra Large Shirt',
    -                );
    -
    -$shirts_on_sale = array('small', 'large');
    -
    -echo form_dropdown('shirts', $options, 'large');
    -
    -// Would produce:
    -
    -<select name="shirts">
    -<option value="small">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    -<option value="large" selected="selected">Large Shirt</option>
    -<option value="xlarge">Extra Large Shirt</option>
    -</select>
    -
    -echo form_dropdown('shirts', $options, $shirts_on_sale);
    -
    -// Would produce:
    -
    -<select name="shirts" multiple="multiple">
    -<option value="small" selected="selected">Small Shirt</option>
    -<option value="med">Medium Shirt</option>
    -<option value="large" selected="selected">Large Shirt</option>
    -<option value="xlarge">Extra Large Shirt</option>
    -</select>
    - - -

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onChange="some_function()"';
    -
    -echo form_dropdown('shirts', $options, 'large', $js);
    - - -

    form_fieldset()

    - -

    Lets you generate fieldset/legend fields.

    -echo form_fieldset('Address Information');
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close(); -
    -
    -// Produces
    -<fieldset> -
    -<legend>Address Information</legend> -
    -<p>form content here</p> -
    -</fieldset>
    -

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    -

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    - echo form_fieldset('Address Information', $attributes);
    -echo "<p>fieldset content here</p>\n";
    -echo form_fieldset_close();
    -
    -// Produces
    -<fieldset id="address_info" class="address_info">
    -<legend>Address Information</legend>
    -<p>form content here</p>
    -</fieldset>

    -

    form_fieldset_close()

    -

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it - which will be added below the tag. For example:

    -$string = "</div></div>";
    -
    -echo fieldset_close($string);
    -
    -// Would produce:
    -</fieldset>
    -</div></div>
    -

    form_checkbox()

    -

    Lets you generate a checkbox field. Simple example:

    -echo form_checkbox('newsletter', 'accept', TRUE);
    -
    -// Would produce:
    -
    -<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    -

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    -

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    - -$data = array(
    -    'name'        => 'newsletter',
    -    'id'          => 'newsletter',
    -    'value'       => 'accept',
    -    'checked'     => TRUE,
    -    'style'       => 'margin:10px',
    -    );
    -
    -echo form_checkbox($data);
    -
    -// Would produce:

    -<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    - -

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the -fourth parameter:

    - -$js = 'onClick="some_function()"';
    -
    - echo form_checkbox('newsletter', 'accept', TRUE, $js)
    - - -

    form_radio()

    -

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    - - -

    form_submit()

    - -

    Lets you generate a standard submit button. Simple example:

    -echo form_submit('mysubmit', 'Submit Post!');
    -
    -// Would produce:
    -
    -<input type="submit" name="mysubmit" value="Submit Post!" />
    -

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. - The third parameter lets you add extra data to your form, like JavaScript.

    -

    form_label()

    -

    Lets you generate a <label>. Simple example:

    -echo form_label('What is your Name', 'username');
    -
    -// Would produce: -
    -<label for="username">What is your Name</label>
    -

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    -

    $attributes = array(
    -    'class' => 'mycustomclass',
    -    'style' => 'color: #000;',
    -);
    - echo form_label('What is your Name', 'username', $attributes);
    -
    -// Would produce:
    -<label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    -

    form_reset()

    - -

    Lets you generate a standard reset button. Use is identical to form_submit().

    - -

    form_button()

    - -

    Lets you generate a standard button element. You can minimally pass the button name and content in the first and second parameter:

    - -echo form_button('name','content');
    -
    -// Would produce
    -<button name="name" type="submit">Content</button> -
    - -Or you can pass an associative array containing any data you wish your form to contain: - -$data = array(
    -    'name' => 'button',
    -    'id' => 'button',
    -    'value' => 'true',
    -    'type' => 'reset',
    -    'content' => 'Reset'
    -);
    -
    -echo form_button($data);
    -
    -// Would produce:
    -<button name="button" id="button" value="true" type="reset">Reset</button> -
    - -If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter: - -$js = 'onClick="some_function()"';

    -echo form_button('mybutton', 'Click Me', $js); -
    - - -

    form_close()

    - -

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it -which will be added below the tag. For example:

    - -$string = "</div></div>";
    -
    -echo form_close($string);
    -
    -// Would produce:
    -
    -</form>
    -</div></div>
    - - - - - -

    form_prep()

    - -

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    - -$string = 'Here is a string containing "quoted" text.';
    -
    -<input type="text" name="myform" value="$string" />
    - -

    Since the above string contains a set of quotes it will cause the form to break. -The form_prep function converts HTML so that it can be used safely:

    - -<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> - -

    Note: If you use any of the form helper functions listed in this page the form -values will be prepped automatically, so there is no need to call this function. Use it only if you are -creating your own form elements.

    - - -

    set_value()

    - -

    Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. -The second (optional) parameter allows you to set a default value for the form. Example:

    - -<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> - -

    The above form will show "0" when loaded for the first time.

    - -

    set_select()

    - -

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter -must contain the name of the select menu, the second parameter must contain the value of -each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

    - -

    Example:

    - - -<select name="myselect">
    -<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    -<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    -<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    -</select> -
    - - -

    set_checkbox()

    - -

    Permits you to display a checkbox in the state it was submitted. The first parameter -must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

    - -<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
    -<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
    - - -

    set_radio()

    - -

    Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

    - -<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    -<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    - - - - -
    - - - - - - + + + + + +Form Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Form Helper

    + +

    The Form Helper file contains functions that assist in working with forms.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('form'); + +

    The following functions are available:

    + + + +

    form_open()

    + +

    Creates an opening form tag with a base URL built from your config preferences. It will optionally let you +add form attributes and hidden input fields.

    + +

    The main benefit of using this tag rather than hard coding your own HTML is that it permits your site to be more portable +in the event your URLs ever change.

    + +

    Here's a simple example:

    + +echo form_open('email/send'); + +

    The above example would create a form that points to your base URL plus the "email/send" URI segments, like this:

    + +<form method="post" action="http:/example.com/index.php/email/send" /> + +

    Adding Attributes

    + +

    Attributes can be added by passing an associative array to the second parameter, like this:

    + + +$attributes = array('class' => 'email', 'id' => 'myform');
    +
    +echo form_open('email/send', $attributes);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/example.com/index.php/email/send"  class="email"  id="myform" /> + +

    Adding Hidden Input Fields

    + +

    Hidden fields can be added by passing an associative array to the third parameter, like this:

    + + +$hidden = array('username' => 'Joe', 'member_id' => '234');
    +
    +echo form_open('email/send', '', $hidden);
    + +

    The above example would create a form similar to this:

    + +<form method="post" action="http:/example.com/index.php/email/send">
    +<input type="hidden" name="username" value="Joe" />
    +<input type="hidden" name="member_id" value="234" />
    + + +

    form_open_multipart()

    + +

    This function is absolutely identical to the form_open() tag above except that it adds a multipart attribute, +which is necessary if you would like to use the form to upload files with.

    + +

    form_hidden()

    + +

    Lets you generate hidden input fields. You can either submit a name/value string to create one field:

    + +form_hidden('username', 'johndoe');
    +
    +// Would produce:

    +<input type="hidden" name="username" value="johndoe" />
    + +

    Or you can submit an associative array to create multiple fields:

    + +$data = array(
    +              'name'  => 'John Doe',
    +              'email' => 'john@example.com',
    +              'url'   => 'http://example.com'
    +            );
    +
    +echo form_hidden($data);
    +
    +// Would produce:

    +<input type="hidden" name="name" value="John Doe" />
    +<input type="hidden" name="email" value="john@example.com" />
    +<input type="hidden" name="url" value="http://example.com" />
    + + + + +

    form_input()

    + +

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first +and second parameter:

    + +echo form_input('username', 'johndoe'); + +

    Or you can pass an associative array containing any data you wish your form to contain:

    + +$data = array(
    +              'name'        => 'username',
    +              'id'          => 'username',
    +              'value'       => 'johndoe',
    +              'maxlength'   => '100',
    +              'size'        => '50',
    +              'style'       => 'width:50%',
    +            );
    +
    +echo form_input($data);
    +
    +// Would produce:

    +<input type="text" name="username" id="username" value="johndoe" maxlength="100" size="50" style="width:50%" />
    + +

    If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the +third parameter:

    + +$js = 'onClick="some_function()"';
    +
    +echo form_input('username', 'johndoe', $js);
    + +

    form_password()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "password" type.

    + +

    form_upload()

    + +

    This function is identical in all respects to the form_input() function above +except that is sets it as a "file" type, allowing it to be used to upload files.

    + +

    form_textarea()

    + +

    This function is identical in all respects to the form_input() function above +except that it generates a "textarea" type. Note: Instead of the "maxlength" and "size" attributes in the above +example, you will instead specify "rows" and "cols".

    + + +

    form_dropdown()

    + +

    Lets you create a standard drop-down field. The first parameter will contain the name of the field, +the second parameter will contain an associative array of options, and the third parameter will contain the +value you wish to be selected. You can also pass an array through the third parameter, and CodeIgniter will create a multiple select for you. Example:

    + +$options = array(
    +                  'small'  => 'Small Shirt',
    +                  'med'    => 'Medium Shirt',
    +                  'large'   => 'Large Shirt',
    +                  'xlarge' => 'Extra Large Shirt',
    +                );
    +
    +$shirts_on_sale = array('small', 'large');
    +
    +echo form_dropdown('shirts', $options, 'large');
    +
    +// Would produce:
    +
    +<select name="shirts">
    +<option value="small">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected="selected">Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    +
    +echo form_dropdown('shirts', $options, $shirts_on_sale);
    +
    +// Would produce:
    +
    +<select name="shirts" multiple="multiple">
    +<option value="small" selected="selected">Small Shirt</option>
    +<option value="med">Medium Shirt</option>
    +<option value="large" selected="selected">Large Shirt</option>
    +<option value="xlarge">Extra Large Shirt</option>
    +</select>
    + + +

    If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onChange="some_function()"';
    +
    +echo form_dropdown('shirts', $options, 'large', $js);
    + + +

    form_fieldset()

    + +

    Lets you generate fieldset/legend fields.

    +echo form_fieldset('Address Information');
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close(); +
    +
    +// Produces
    +<fieldset> +
    +<legend>Address Information</legend> +
    +<p>form content here</p> +
    +</fieldset>
    +

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    +

    $attributes = array('id' => 'address_info', 'class' => 'address_info');
    + echo form_fieldset('Address Information', $attributes);
    +echo "<p>fieldset content here</p>\n";
    +echo form_fieldset_close();
    +
    +// Produces
    +<fieldset id="address_info" class="address_info">
    +<legend>Address Information</legend>
    +<p>form content here</p>
    +</fieldset>

    +

    form_fieldset_close()

    +

    Produces a closing </fieldset> tag. The only advantage to using this function is it permits you to pass data to it + which will be added below the tag. For example:

    +$string = "</div></div>";
    +
    +echo fieldset_close($string);
    +
    +// Would produce:
    +</fieldset>
    +</div></div>
    +

    form_checkbox()

    +

    Lets you generate a checkbox field. Simple example:

    +echo form_checkbox('newsletter', 'accept', TRUE);
    +
    +// Would produce:
    +
    +<input type="checkbox" name="newsletter" value="accept" checked="checked" />
    +

    The third parameter contains a boolean TRUE/FALSE to determine whether the box should be checked or not.

    +

    Similar to the other form functions in this helper, you can also pass an array of attributes to the function:

    + +$data = array(
    +    'name'        => 'newsletter',
    +    'id'          => 'newsletter',
    +    'value'       => 'accept',
    +    'checked'     => TRUE,
    +    'style'       => 'margin:10px',
    +    );
    +
    +echo form_checkbox($data);
    +
    +// Would produce:

    +<input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" />
    + +

    As with other functions, if you would like the tag to contain additional data, like JavaScript, you can pass it as a string in the +fourth parameter:

    + +$js = 'onClick="some_function()"';
    +
    + echo form_checkbox('newsletter', 'accept', TRUE, $js)
    + + +

    form_radio()

    +

    This function is identical in all respects to the form_checkbox() function above except that is sets it as a "radio" type.

    + + +

    form_submit()

    + +

    Lets you generate a standard submit button. Simple example:

    +echo form_submit('mysubmit', 'Submit Post!');
    +
    +// Would produce:
    +
    +<input type="submit" name="mysubmit" value="Submit Post!" />
    +

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes. + The third parameter lets you add extra data to your form, like JavaScript.

    +

    form_label()

    +

    Lets you generate a <label>. Simple example:

    +echo form_label('What is your Name', 'username');
    +
    +// Would produce: +
    +<label for="username">What is your Name</label>
    +

    Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes.

    +

    $attributes = array(
    +    'class' => 'mycustomclass',
    +    'style' => 'color: #000;',
    +);
    + echo form_label('What is your Name', 'username', $attributes);
    +
    +// Would produce:
    +<label for="username" class="mycustomclass" style="color: #000;">What is your Name</label>

    +

    form_reset()

    + +

    Lets you generate a standard reset button. Use is identical to form_submit().

    + +

    form_button()

    + +

    Lets you generate a standard button element. You can minimally pass the button name and content in the first and second parameter:

    + +echo form_button('name','content');
    +
    +// Would produce
    +<button name="name" type="submit">Content</button> +
    + +Or you can pass an associative array containing any data you wish your form to contain: + +$data = array(
    +    'name' => 'button',
    +    'id' => 'button',
    +    'value' => 'true',
    +    'type' => 'reset',
    +    'content' => 'Reset'
    +);
    +
    +echo form_button($data);
    +
    +// Would produce:
    +<button name="button" id="button" value="true" type="reset">Reset</button> +
    + +If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter: + +$js = 'onClick="some_function()"';

    +echo form_button('mybutton', 'Click Me', $js); +
    + + +

    form_close()

    + +

    Produces a closing </form> tag. The only advantage to using this function is it permits you to pass data to it +which will be added below the tag. For example:

    + +$string = "</div></div>";
    +
    +echo form_close($string);
    +
    +// Would produce:
    +
    +</form>
    +</div></div>
    + + + + + +

    form_prep()

    + +

    Allows you to safely use HTML and characters such as quotes within form elements without breaking out of the form. Consider this example:

    + +$string = 'Here is a string containing "quoted" text.';
    +
    +<input type="text" name="myform" value="$string" />
    + +

    Since the above string contains a set of quotes it will cause the form to break. +The form_prep function converts HTML so that it can be used safely:

    + +<input type="text" name="myform" value="<?php echo form_prep($string); ?>" /> + +

    Note: If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this function. Use it only if you are +creating your own form elements.

    + + +

    set_value()

    + +

    Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. +The second (optional) parameter allows you to set a default value for the form. Example:

    + +<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> + +

    The above form will show "0" when loaded for the first time.

    + +

    set_select()

    + +

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

    + +

    Example:

    + + +<select name="myselect">
    +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    +</select> +
    + + +

    set_checkbox()

    + +

    Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

    + +<input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> />
    +<input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> />
    + + +

    set_radio()

    + +

    Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

    + +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 98b2c255..3b4ffb13 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -1,368 +1,368 @@ - - - - - -HTML Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    HTML Helper

    - -

    The HTML Helper file contains functions that assist in working with HTML.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('html'); - -

    The following functions are available:

    - -

    br()

    -

    Generates line break tags (<br />) based on the number you submit. Example:

    -echo br(3); -

    The above would produce: <br /><br /><br />

    - -

    heading()

    -

    Lets you create HTML <h1> tags. The first parameter will contain the data, the -second the size of the heading. Example:

    -echo heading('Welcome!', 3); -

    The above would produce: <h3>Welcome!</h3>

    -

    img()

    -

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    -echo img('images/picture.jpg');
    -// gives <img src="http://site.com/images/picture.jpg" />
    -

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    -

    echo img('images/picture.jpg', TRUE);
    -// gives <img src="http://site.com/index.php/images/picture.jpg" />

    -

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    -

    $image_properties = array(
    -           'src' => 'images/picture.jpg',
    -           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    -           'class' => 'post_images',
    -           'width' => '200',
    -           'height' => '200',
    -           'title' => 'That was quite a night',
    -           'rel' => 'lightbox',
    - );
    -
    - img($image_properties);
    - // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    -

    link_tag()

    -

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. -echo link_tag('css/mystyles.css');
    -// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    -

    Further examples:

    - - - echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    - // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> -
    -
    - echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    - // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    -

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    -

    - $link = array(
    -           'href' => 'css/printer.css',
    -           'rel' => 'stylesheet',
    -           'type' => 'text/css',
    -           'media' => 'print'
    - );
    -
    - echo link_tag($link);
    - // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    - -

    nbs()

    -

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    -echo nbs(3); -

    The above would produce: &nbsp;&nbsp;&nbsp;

    - -

    ol()  and  ul()

    - -

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'red',
    -            'blue',
    -            'green',
    -            'yellow'
    -            );
    -
    -$attributes = array(
    -                    'class' => 'boldlist',
    -                    'id'    => 'mylist'
    -                    );
    -
    -echo ul($list, $attributes);
    -
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>red</li>
    -  <li>blue</li>
    -  <li>green</li>
    -  <li>yellow</li>
    -</ul> -
    - -

    Here is a more complex example, using a multi-dimensional array:

    - - -$this->load->helper('html');
    -
    -$list = array(
    -            'colors' => array(
    -                                'red',
    -                                'blue',
    -                                'green'
    -                            ),
    -            'shapes' => array(
    -                                'round',
    -                                'square',
    -                                'circles' => array(
    -                                                    'ellipse',
    -                                                    'oval',
    -                                                    'sphere'
    -                                                    )
    -                            ),
    -            'moods'    => array(
    -                                'happy',
    -                                'upset' => array(
    -                                                    'defeated' => array(
    -                                                                        'dejected',
    -                                                                        'disheartened',
    -                                                                        'depressed'
    -                                                                        ),
    -                                                    'annoyed',
    -                                                    'cross',
    -                                                    'angry'
    -                                                )
    -                            )
    -            );
    -
    -
    -echo ul($list);
    - -

    The above code will produce this:

    - - -<ul class="boldlist" id="mylist">
    -  <li>colors
    -    <ul>
    -      <li>red</li>
    -      <li>blue</li>
    -      <li>green</li>
    -    </ul>
    -  </li>
    -  <li>shapes
    -    <ul>
    -      <li>round</li>
    -      <li>suare</li>
    -      <li>circles
    -        <ul>
    -          <li>elipse</li>
    -          <li>oval</li>
    -          <li>sphere</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -  <li>moods
    -    <ul>
    -      <li>happy</li>
    -      <li>upset
    -        <ul>
    -          <li>defeated
    -            <ul>
    -              <li>dejected</li>
    -              <li>disheartened</li>
    -              <li>depressed</li>
    -            </ul>
    -          </li>
    -          <li>annoyed</li>
    -          <li>cross</li>
    -          <li>angry</li>
    -        </ul>
    -      </li>
    -    </ul>
    -  </li>
    -</ul> -
    - - - -

    meta()

    - -

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    - - -echo meta('description', 'My Great site');
    -// Generates: <meta name="description" content="My Great Site" />
    -

    - -echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    -// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    - -

    - -echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    -// Generates: <meta name="robots" content="no-cache" />
    - -

    - -$meta = array(
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'description', 'content' => 'My Great Site'),
    -        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    -        array('name' => 'robots', 'content' => 'no-cache'),
    -        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    -    );
    -
    -echo meta($meta); -
    -// Generates:
    -// <meta name="robots" content="no-cache" />
    -// <meta name="description" content="My Great Site" />
    -// <meta name="keywords" content="love, passion, intrigue, deception" />
    -// <meta name="robots" content="no-cache" />
    -// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> -
    - - -

    doctype()

    - -

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    - - -echo docytype();
    -// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    -
    -echo doctype('html4-trans');
    -// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -
    - -

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DoctypeOptionResult
    XHTML 1.1doctype('xhtml11')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    XHTML 1.0 Strictdoctype('xhtml1-strict')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    XHTML 1.0 Transitionaldoctype('xhtml1-trans')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 Framesetdoctype('xhtml1-frame')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    HTML 5doctype('html5')<!DOCTYPE html>
    HTML 4 Strictdoctype('html4-strict')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    HTML 4 Transitionaldoctype('html4-trans')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTML 4 Framesetdoctype('html4-frame')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    - - - - -
    - - - - - - + + + + + +HTML Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    HTML Helper

    + +

    The HTML Helper file contains functions that assist in working with HTML.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('html'); + +

    The following functions are available:

    + +

    br()

    +

    Generates line break tags (<br />) based on the number you submit. Example:

    +echo br(3); +

    The above would produce: <br /><br /><br />

    + +

    heading()

    +

    Lets you create HTML <h1> tags. The first parameter will contain the data, the +second the size of the heading. Example:

    +echo heading('Welcome!', 3); +

    The above would produce: <h3>Welcome!</h3>

    +

    img()

    +

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    +echo img('images/picture.jpg');
    +// gives <img src="http://site.com/images/picture.jpg" />
    +

    There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.

    +

    echo img('images/picture.jpg', TRUE);
    +// gives <img src="http://site.com/index.php/images/picture.jpg" />

    +

    Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.

    +

    $image_properties = array(
    +           'src' => 'images/picture.jpg',
    +           'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',
    +           'class' => 'post_images',
    +           'width' => '200',
    +           'height' => '200',
    +           'title' => 'That was quite a night',
    +           'rel' => 'lightbox',
    + );
    +
    + img($image_properties);
    + // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    +

    link_tag()

    +

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. +echo link_tag('css/mystyles.css');
    +// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    +

    Further examples:

    + + + echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    + // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> +
    +
    + echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    + // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
    +

    Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.

    +

    + $link = array(
    +           'href' => 'css/printer.css',
    +           'rel' => 'stylesheet',
    +           'type' => 'text/css',
    +           'media' => 'print'
    + );
    +
    + echo link_tag($link);
    + // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    + +

    nbs()

    +

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    +echo nbs(3); +

    The above would produce: &nbsp;&nbsp;&nbsp;

    + +

    ol()  and  ul()

    + +

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'red',
    +            'blue',
    +            'green',
    +            'yellow'
    +            );
    +
    +$attributes = array(
    +                    'class' => 'boldlist',
    +                    'id'    => 'mylist'
    +                    );
    +
    +echo ul($list, $attributes);
    +
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>red</li>
    +  <li>blue</li>
    +  <li>green</li>
    +  <li>yellow</li>
    +</ul> +
    + +

    Here is a more complex example, using a multi-dimensional array:

    + + +$this->load->helper('html');
    +
    +$list = array(
    +            'colors' => array(
    +                                'red',
    +                                'blue',
    +                                'green'
    +                            ),
    +            'shapes' => array(
    +                                'round',
    +                                'square',
    +                                'circles' => array(
    +                                                    'ellipse',
    +                                                    'oval',
    +                                                    'sphere'
    +                                                    )
    +                            ),
    +            'moods'    => array(
    +                                'happy',
    +                                'upset' => array(
    +                                                    'defeated' => array(
    +                                                                        'dejected',
    +                                                                        'disheartened',
    +                                                                        'depressed'
    +                                                                        ),
    +                                                    'annoyed',
    +                                                    'cross',
    +                                                    'angry'
    +                                                )
    +                            )
    +            );
    +
    +
    +echo ul($list);
    + +

    The above code will produce this:

    + + +<ul class="boldlist" id="mylist">
    +  <li>colors
    +    <ul>
    +      <li>red</li>
    +      <li>blue</li>
    +      <li>green</li>
    +    </ul>
    +  </li>
    +  <li>shapes
    +    <ul>
    +      <li>round</li>
    +      <li>suare</li>
    +      <li>circles
    +        <ul>
    +          <li>elipse</li>
    +          <li>oval</li>
    +          <li>sphere</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +  <li>moods
    +    <ul>
    +      <li>happy</li>
    +      <li>upset
    +        <ul>
    +          <li>defeated
    +            <ul>
    +              <li>dejected</li>
    +              <li>disheartened</li>
    +              <li>depressed</li>
    +            </ul>
    +          </li>
    +          <li>annoyed</li>
    +          <li>cross</li>
    +          <li>angry</li>
    +        </ul>
    +      </li>
    +    </ul>
    +  </li>
    +</ul> +
    + + + +

    meta()

    + +

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    + + +echo meta('description', 'My Great site');
    +// Generates: <meta name="description" content="My Great Site" />
    +

    + +echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); // Note the third parameter. Can be "equiv" or "name"
    +// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    + +

    + +echo meta(array('name' => 'robots', 'content' => 'no-cache'));
    +// Generates: <meta name="robots" content="no-cache" />
    + +

    + +$meta = array(
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'description', 'content' => 'My Great Site'),
    +        array('name' => 'keywords', 'content' => 'love, passion, intrigue, deception'),
    +        array('name' => 'robots', 'content' => 'no-cache'),
    +        array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
    +    );
    +
    +echo meta($meta); +
    +// Generates:
    +// <meta name="robots" content="no-cache" />
    +// <meta name="description" content="My Great Site" />
    +// <meta name="keywords" content="love, passion, intrigue, deception" />
    +// <meta name="robots" content="no-cache" />
    +// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +
    + + +

    doctype()

    + +

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    + + +echo docytype();
    +// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    +
    +echo doctype('html4-trans');
    +// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +
    + +

    The following is a list of doctype choices. These are configurable, and pulled from application/config/doctypes.php

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DoctypeOptionResult
    XHTML 1.1doctype('xhtml11')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    XHTML 1.0 Strictdoctype('xhtml1-strict')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    XHTML 1.0 Transitionaldoctype('xhtml1-trans')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML 1.0 Framesetdoctype('xhtml1-frame')<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    HTML 5doctype('html5')<!DOCTYPE html>
    HTML 4 Strictdoctype('html4-strict')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    HTML 4 Transitionaldoctype('html4-trans')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    HTML 4 Framesetdoctype('html4-frame')<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index b93a9c01..323caf5c 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -1,151 +1,151 @@ - - - - - -Inflector Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Inflector Helper

    - -

    The Inflector Helper file contains functions that permits you to change words to plural, singular, camel case, etc.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('inflector'); - -

    The following functions are available:

    - - -

    singular()

    - -

    Changes a plural word to singular. Example:

    - - -$word = "dogs";
    -echo singular($word); // Returns "dog" -
    - - -

    plural()

    - -

    Changes a singular word to plural. Example:

    - - -$word = "dog";
    -echo plural($word); // Returns "dogs" -
    - - -

    To force a word to end with "es" use a second "true" argument.

    - $word = "pass";
    -echo plural($word, TRUE); // Returns "passes"
    - -

    camelize()

    -

    Changes a string of words separated by spaces or underscores to camel case. Example:

    - - -$word = "my_dog_spot";
    -echo camelize($word); // Returns "myDogSpot" -
    - - -

    underscore()

    - -

    Takes multiple words separated by spaces and underscores them. Example:

    - - -$word = "my dog spot";
    -echo underscore($word); // Returns "my_dog_spot" -
    - - -

    humanize()

    - -

    Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:

    - - -$word = "my_dog_spot";
    -echo humanize($word); // Returns "My Dog Spot" -
    - - - - - - - - - - - - -
    - - - - - - + + + + + +Inflector Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Inflector Helper

    + +

    The Inflector Helper file contains functions that permits you to change words to plural, singular, camel case, etc.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('inflector'); + +

    The following functions are available:

    + + +

    singular()

    + +

    Changes a plural word to singular. Example:

    + + +$word = "dogs";
    +echo singular($word); // Returns "dog" +
    + + +

    plural()

    + +

    Changes a singular word to plural. Example:

    + + +$word = "dog";
    +echo plural($word); // Returns "dogs" +
    + + +

    To force a word to end with "es" use a second "true" argument.

    + $word = "pass";
    +echo plural($word, TRUE); // Returns "passes"
    + +

    camelize()

    +

    Changes a string of words separated by spaces or underscores to camel case. Example:

    + + +$word = "my_dog_spot";
    +echo camelize($word); // Returns "myDogSpot" +
    + + +

    underscore()

    + +

    Takes multiple words separated by spaces and underscores them. Example:

    + + +$word = "my dog spot";
    +echo underscore($word); // Returns "my_dog_spot" +
    + + +

    humanize()

    + +

    Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:

    + + +$word = "my_dog_spot";
    +echo humanize($word); // Returns "My Dog Spot" +
    + + + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index cad1ef49..9c60759d 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -1,98 +1,98 @@ - - - - - -Language Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - - -
    - - -

    Language Helper

    - -

    The Language Helper file contains functions that assist in working with language files.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('language'); - -

    The following functions are available:

    - -

    lang('language line', 'element id')

    - -

    This function returns a line of text from a loaded language file with simplified syntax - that may be more desirable for view files than calling $this->lang->line(). - The optional second parameter will also output a form label for you. Example:

    - -echo lang('language_key', 'form_item_id');
    -// becomes <label for="form_item_id">language_key</label>
    - - -
    - - - - - - + + + + + +Language Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + + +
    + + +

    Language Helper

    + +

    The Language Helper file contains functions that assist in working with language files.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('language'); + +

    The following functions are available:

    + +

    lang('language line', 'element id')

    + +

    This function returns a line of text from a loaded language file with simplified syntax + that may be more desirable for view files than calling $this->lang->line(). + The optional second parameter will also output a form label for you. Example:

    + +echo lang('language_key', 'form_item_id');
    +// becomes <label for="form_item_id">language_key</label>
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index fea4cbf6..6ce6d76b 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -1,107 +1,107 @@ - - - - - -Number Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Number Helper

    - -

    The Number Helper file contains functions that help you work with numeric data.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('number'); - -

    The following functions are available:

    - - -

    byte_format()

    - -

    Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:

    - - -echo byte_format(456); // Returns 456 Bytes
    -echo byte_format(4567); // Returns 4.5 KB
    -echo byte_format(45678); // Returns 44.8 KB
    -echo byte_format(456789); // Returns 447.8 KB
    -echo byte_format(3456789); // Returns 3.3 MB
    -echo byte_format(12345678912345); // Returns 1.8 GB
    -echo byte_format(123456789123456789); // Returns 11,228.3 TB -
    - -

    -Note: -The text generated by this function is found in the following language file: language//number_lang.php -

    - -
    - - - - - - + + + + + +Number Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Number Helper

    + +

    The Number Helper file contains functions that help you work with numeric data.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('number'); + +

    The following functions are available:

    + + +

    byte_format()

    + +

    Formats a numbers as bytes, based on size, and adds the appropriate suffix. Examples:

    + + +echo byte_format(456); // Returns 456 Bytes
    +echo byte_format(4567); // Returns 4.5 KB
    +echo byte_format(45678); // Returns 44.8 KB
    +echo byte_format(456789); // Returns 447.8 KB
    +echo byte_format(3456789); // Returns 3.3 MB
    +echo byte_format(12345678912345); // Returns 1.8 GB
    +echo byte_format(123456789123456789); // Returns 11,228.3 TB +
    + +

    +Note: +The text generated by this function is found in the following language file: language//number_lang.php +

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index ca3fb646..6c0d7602 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -1,106 +1,106 @@ - - - - - -Path Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Path Helper

    - -

    The Path Helper file contains functions that permits you to work with file paths on the server.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('path'); - -

    The following functions are available:

    - - -

    set_realpath()

    - -

    Checks to see if the path exists. This function will return a server path without symbolic links or relative directory structures. An optional second argument will cause an error to be triggered if the path cannot be resolved.

    - -$directory = '/etc/passwd';
    -echo set_realpath($directory);
    -// returns "/etc/passwd"
    -
    -$non_existent_directory = '/path/to/nowhere';
    -echo set_realpath($non_existent_directory, TRUE);
    -// returns an error, as the path could not be resolved -

    -echo set_realpath($non_existent_directory, FALSE);
    -// returns "/path/to/nowhere" - - - -
    -

     

    -
    - - - - - - + + + + + +Path Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Path Helper

    + +

    The Path Helper file contains functions that permits you to work with file paths on the server.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('path'); + +

    The following functions are available:

    + + +

    set_realpath()

    + +

    Checks to see if the path exists. This function will return a server path without symbolic links or relative directory structures. An optional second argument will cause an error to be triggered if the path cannot be resolved.

    + +$directory = '/etc/passwd';
    +echo set_realpath($directory);
    +// returns "/etc/passwd"
    +
    +$non_existent_directory = '/path/to/nowhere';
    +echo set_realpath($non_existent_directory, TRUE);
    +// returns an error, as the path could not be resolved +

    +echo set_realpath($non_existent_directory, FALSE);
    +// returns "/path/to/nowhere" + + + +
    +

     

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 588cafef..57b4c1d4 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -1,125 +1,125 @@ - - - - - -Security Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Security Helper

    - -

    The Security Helper file contains security related functions.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('security'); - -

    The following functions are available:

    - - -

    xss_clean()

    - -

    Provides Cross Site Script Hack filtering. This function is an alias to the one in the -Input class. More info can be found there.

    - - -

    dohash()

    - -

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    - - -$str = dohash($str); // SHA1
    -
    -$str = dohash($str, 'md5'); // MD5 -
    - - - - -

    strip_image_tags()

    - -

    This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

    - -$string = strip_image_tags($string); - - -

    encode_php_tags()

    - -

    This is a security function that converts PHP tags to entities. Note: If you use the XSS filtering function it does this automatically.

    - -$string = encode_php_tags($string); - - - - - - - -
    - - - - - - + + + + + +Security Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Security Helper

    + +

    The Security Helper file contains security related functions.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('security'); + +

    The following functions are available:

    + + +

    xss_clean()

    + +

    Provides Cross Site Script Hack filtering. This function is an alias to the one in the +Input class. More info can be found there.

    + + +

    dohash()

    + +

    Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

    + + +$str = dohash($str); // SHA1
    +
    +$str = dohash($str, 'md5'); // MD5 +
    + + + + +

    strip_image_tags()

    + +

    This is a security function that will strip image tags from a string. It leaves the image URL as plain text.

    + +$string = strip_image_tags($string); + + +

    encode_php_tags()

    + +

    This is a security function that converts PHP tags to entities. Note: If you use the XSS filtering function it does this automatically.

    + +$string = encode_php_tags($string); + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 05f536e9..e81fceb8 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -1,204 +1,204 @@ - - - - - -Smiley Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Smiley Helper

    - -

    The Smiley Helper file contains functions that let you manage smileys (emoticons).

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('smiley'); - -

    Overview

    - -

    The Smiley helper has a renderer that takes plain text simileys, like :-) and turns -them into a image representation, like smile!

    - -

    It also lets you display a set of smiley images that when clicked will be inserted into a form field. -For example, if you have a blog that allows user commenting you can show the smileys next to the comment form. -Your users can click a desired smiley and with the help of some JavaScript it will be placed into the form field.

    - - - -

    Clickable Smileys Tutorial

    - -

    Here is an example demonstrating how you might create a set of clickable smileys next to a form field. This example -requires that you first download and install the smiley images, then create a controller and the View as described.

    - -

    Important: Before you begin, please download the smiley images and put them in -a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at -application/config/smileys.php

    - - -

    The Controller

    - -

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    - -

    Important: Change the URL in the get_clickable_smileys() function below so that it points to -your smiley folder.

    - -

    You'll notice that in addition to the smiley helper we are using the Table Class.

    - - - -

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    - - - - - -

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    - -

    Function Reference

    - - -

    get_clickable_smileys()

    - -

    Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder -via the first parameter:

    - -$image_array = get_clickable_smileys("http://example.com/images/smileys/"); - - -

    js_insert_smiley()

    - -

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. -The first parameter must contain the name of your form, the second parameter must contain the name of the -form field. This function is designed to be placed into the <head> area of your web page.

    - -<?php echo js_insert_smiley('blog', 'comments'); ?> - - -

    parse_smileys()

    - -

    Takes a string of text as input and replaces any contained plain text smileys into the image -equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:

    - - - -$str = 'Here are some simileys: :-) ;-)'; - -$str = parse_smileys($str, "http://example.com/images/smileys/"); - -echo $str; - -
    - - - - - - + + + + + +Smiley Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Smiley Helper

    + +

    The Smiley Helper file contains functions that let you manage smileys (emoticons).

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('smiley'); + +

    Overview

    + +

    The Smiley helper has a renderer that takes plain text simileys, like :-) and turns +them into a image representation, like smile!

    + +

    It also lets you display a set of smiley images that when clicked will be inserted into a form field. +For example, if you have a blog that allows user commenting you can show the smileys next to the comment form. +Your users can click a desired smiley and with the help of some JavaScript it will be placed into the form field.

    + + + +

    Clickable Smileys Tutorial

    + +

    Here is an example demonstrating how you might create a set of clickable smileys next to a form field. This example +requires that you first download and install the smiley images, then create a controller and the View as described.

    + +

    Important: Before you begin, please download the smiley images and put them in +a publicly accessible place on your server. This helper also assumes you have the smiley replacement array located at +application/config/smileys.php

    + + +

    The Controller

    + +

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    + +

    Important: Change the URL in the get_clickable_smileys() function below so that it points to +your smiley folder.

    + +

    You'll notice that in addition to the smiley helper we are using the Table Class.

    + + + +

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    + + + + + +

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    + +

    Function Reference

    + + +

    get_clickable_smileys()

    + +

    Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder +via the first parameter:

    + +$image_array = get_clickable_smileys("http://example.com/images/smileys/"); + + +

    js_insert_smiley()

    + +

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. +The first parameter must contain the name of your form, the second parameter must contain the name of the +form field. This function is designed to be placed into the <head> area of your web page.

    + +<?php echo js_insert_smiley('blog', 'comments'); ?> + + +

    parse_smileys()

    + +

    Takes a string of text as input and replaces any contained plain text smileys into the image +equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:

    + + + +$str = 'Here are some simileys: :-) ;-)'; + +$str = parse_smileys($str, "http://example.com/images/smileys/"); + +echo $str; + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 67318e8c..06d13c3b 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -1,176 +1,176 @@ - - - - - -String Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    String Helper

    - -

    The String Helper file contains functions that assist in working with strings.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('string'); - -

    The following functions are available:

    - -

    random_string()

    - -

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    - -

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    - - -
      -
    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • -
    • numeric:  Numeric string.
    • -
    • nozero:  Numeric string with no zeros.
    • -
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. -Returns a fixed length 32 character string.
    • -
    - -

    Usage example:

    - -echo random_string('alnum', 16); - - -

    alternator()

    - -

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    - -for ($i = 0; $i < 10; $i++)
    -{
    -    echo alternator('string one', 'string two');
    -}
    -
    - -

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    - -for ($i = 0; $i < 10; $i++)
    -{
    -    echo alternator('one', 'two', 'three', 'four', 'five');
    -}
    -
    - -

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    - - - -

    repeater()

    -

    Generates repeating copies of the data you submit. Example:

    -$string = "\n";
    -echo repeater($string, 30);
    - -

    The above would generate 30 newlines.

    -

    reduce_double_slashes()

    -

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    -$string = "http://example.com//index.php";
    -echo reduce_double_slashes($string); // results in "http://example.com/index.php"
    -

    trim_slashes()

    -

    Removes any leading/trailing slashes from a string. Example:
    -
    - $string = "/this/that/theother/";
    -echo trim_slashes($string); // results in this/that/theother

    - - -

    reduce_multiples()

    -

    Reduces multiple instances of a particular character occuring directly after each other. Example:

    - -$string="Fred, Bill,, Joe, Jimmy";
    -$string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy" -
    -

    The function accepts the following parameters: -reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string) - -The first parameter contains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced. -The third parameter is FALSE by default; if set to TRUE it will remove occurences of the character at the beginning and the end of the string. Example: - - -$string=",Fred, Bill,, Joe, Jimmy,";
    -$string=reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy" -
    -

    - -

    quotes_to_entities()

    -

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    -$string="Joe's \"dinner\"";
    -$string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;" -
    - -

    strip_quotes()

    -

    Removes single and double quotes from a string. Example:

    -$string="Joe's \"dinner\"";
    -$string=strip_quotes($string); //results in "Joes dinner" -
    - -
    - - - - - - + + + + + +String Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    String Helper

    + +

    The String Helper file contains functions that assist in working with strings.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('string'); + +

    The following functions are available:

    + +

    random_string()

    + +

    Generates a random string based on the type and length you specify. Useful for creating passwords or generating random hashes.

    + +

    The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available:

    + + +
      +
    • alnum:  Alpha-numeric string with lower and uppercase characters.
    • +
    • numeric:  Numeric string.
    • +
    • nozero:  Numeric string with no zeros.
    • +
    • unique:  Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. +Returns a fixed length 32 character string.
    • +
    + +

    Usage example:

    + +echo random_string('alnum', 16); + + +

    alternator()

    + +

    Allows two or more items to be alternated between, when cycling through a loop. Example:

    + +for ($i = 0; $i < 10; $i++)
    +{
    +    echo alternator('string one', 'string two');
    +}
    +
    + +

    You can add as many parameters as you want, and with each iteration of your loop the next item will be returned.

    + +for ($i = 0; $i < 10; $i++)
    +{
    +    echo alternator('one', 'two', 'three', 'four', 'five');
    +}
    +
    + +

    Note: To use multiple separate calls to this function simply call the function with no arguments to re-initialize.

    + + + +

    repeater()

    +

    Generates repeating copies of the data you submit. Example:

    +$string = "\n";
    +echo repeater($string, 30);
    + +

    The above would generate 30 newlines.

    +

    reduce_double_slashes()

    +

    Converts double slashes in a string to a single slash, except those found in http://. Example:

    +$string = "http://example.com//index.php";
    +echo reduce_double_slashes($string); // results in "http://example.com/index.php"
    +

    trim_slashes()

    +

    Removes any leading/trailing slashes from a string. Example:
    +
    + $string = "/this/that/theother/";
    +echo trim_slashes($string); // results in this/that/theother

    + + +

    reduce_multiples()

    +

    Reduces multiple instances of a particular character occuring directly after each other. Example:

    + +$string="Fred, Bill,, Joe, Jimmy";
    +$string=reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy" +
    +

    The function accepts the following parameters: +reduce_multiples(string: text to search in, string: character to reduce, boolean: whether to remove the character from the front and end of the string) + +The first parameter contains the string in which you want to reduce the multiplies. The second parameter contains the character you want to have reduced. +The third parameter is FALSE by default; if set to TRUE it will remove occurences of the character at the beginning and the end of the string. Example: + + +$string=",Fred, Bill,, Joe, Jimmy,";
    +$string=reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy" +
    +

    + +

    quotes_to_entities()

    +

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    +$string="Joe's \"dinner\"";
    +$string=quotes_to_entities($string); //results in "Joe&#39;s &quot;dinner&quot;" +
    + +

    strip_quotes()

    +

    Removes single and double quotes from a string. Example:

    +$string="Joe's \"dinner\"";
    +$string=strip_quotes($string); //results in "Joes dinner" +
    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 71047981..16d16fc9 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -1,192 +1,192 @@ - - - - - -Text Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Text Helper

    - -

    The Text Helper file contains functions that assist in working with text.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('text'); - -

    The following functions are available:

    - - -

    word_limiter()

    - -

    Truncates a string to the number of words specified. Example:

    - - -$string = "Here is a nice text string consisting of eleven words.";
    -
    -$string = word_limiter($string, 4);

    - -// Returns: Here is a nice… -
    - -

    The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

    - - -

    character_limiter()

    - -

    Truncates a string to the number of characters specified. It maintains the integrity -of words so the character count may be slightly more or less then what you specify. Example:

    - - -$string = "Here is a nice text string consisting of eleven words.";
    -
    -$string = character_limiter($string, 20);

    - -// Returns: Here is a nice text string… -
    - -

    The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.

    - - - -

    ascii_to_entities()

    - -

    Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, -so that they can be shown consistently regardless of browser settings or stored reliably in a database. -There is some dependence on your server's supported character sets, so it may not be 100% reliable in all cases, but for the most -part it should correctly identify characters outside the normal range (like accented characters). Example:

    - -$string = ascii_to_entities($string); - - -

    entities_to_ascii()

    - -

    This function does the opposite of the previous one; it turns character entities back into ASCII.

    - - -

    word_censor()

    - -

    Enables you to censor words within a text string. The first parameter will contain the original string. The -second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value -for the words. If not specified they are replaced with pound signs: ####. Example:

    - - -$disallowed = array('darn', 'shucks', 'golly', 'phooey');
    -
    -$string = word_censor($string, $disallowed, 'Beep!');
    - - -

    highlight_code()

    - -

    Colorizes a string of code (PHP, HTML, etc.). Example:

    - -$string = highlight_code($string); - -

    The function uses PHP's highlight_string() function, so the colors used are the ones specified in your php.ini file.

    - - -

    highlight_phrase()

    - -

    Will highlight a phrase within a text string. The first parameter will contain the original string, the second will -contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags -you would like the phrase wrapped in. Example:

    - - -$string = "Here is a nice text string about nothing in particular.";
    -
    -$string = highlight_phrase($string, "nice text", '<span style="color:#990000">', '</span>'); -
    - -

    The above text returns:

    - -

    Here is a nice text string about nothing in particular.

    - - - -

    word_wrap()

    - -

    Wraps text at the specified character count while maintaining complete words. Example:

    - -$string = "Here is a simple string of text that will help us demonstrate this function.";
    -
    -echo word_wrap($string, 25);
    -
    -// Would produce:
    -
    -Here is a simple string
    -of text that will help
    -us demonstrate this
    -function
    - - - - -
    - - - - - - + + + + + +Text Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Text Helper

    + +

    The Text Helper file contains functions that assist in working with text.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('text'); + +

    The following functions are available:

    + + +

    word_limiter()

    + +

    Truncates a string to the number of words specified. Example:

    + + +$string = "Here is a nice text string consisting of eleven words.";
    +
    +$string = word_limiter($string, 4);

    + +// Returns: Here is a nice… +
    + +

    The third parameter is an optional suffix added to the string. By default it adds an ellipsis.

    + + +

    character_limiter()

    + +

    Truncates a string to the number of characters specified. It maintains the integrity +of words so the character count may be slightly more or less then what you specify. Example:

    + + +$string = "Here is a nice text string consisting of eleven words.";
    +
    +$string = character_limiter($string, 20);

    + +// Returns: Here is a nice text string… +
    + +

    The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis.

    + + + +

    ascii_to_entities()

    + +

    Converts ASCII values to character entities, including high ASCII and MS Word characters that can cause problems when used in a web page, +so that they can be shown consistently regardless of browser settings or stored reliably in a database. +There is some dependence on your server's supported character sets, so it may not be 100% reliable in all cases, but for the most +part it should correctly identify characters outside the normal range (like accented characters). Example:

    + +$string = ascii_to_entities($string); + + +

    entities_to_ascii()

    + +

    This function does the opposite of the previous one; it turns character entities back into ASCII.

    + + +

    word_censor()

    + +

    Enables you to censor words within a text string. The first parameter will contain the original string. The +second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value +for the words. If not specified they are replaced with pound signs: ####. Example:

    + + +$disallowed = array('darn', 'shucks', 'golly', 'phooey');
    +
    +$string = word_censor($string, $disallowed, 'Beep!');
    + + +

    highlight_code()

    + +

    Colorizes a string of code (PHP, HTML, etc.). Example:

    + +$string = highlight_code($string); + +

    The function uses PHP's highlight_string() function, so the colors used are the ones specified in your php.ini file.

    + + +

    highlight_phrase()

    + +

    Will highlight a phrase within a text string. The first parameter will contain the original string, the second will +contain the phrase you wish to highlight. The third and fourth parameters will contain the opening/closing HTML tags +you would like the phrase wrapped in. Example:

    + + +$string = "Here is a nice text string about nothing in particular.";
    +
    +$string = highlight_phrase($string, "nice text", '<span style="color:#990000">', '</span>'); +
    + +

    The above text returns:

    + +

    Here is a nice text string about nothing in particular.

    + + + +

    word_wrap()

    + +

    Wraps text at the specified character count while maintaining complete words. Example:

    + +$string = "Here is a simple string of text that will help us demonstrate this function.";
    +
    +echo word_wrap($string, 25);
    +
    +// Would produce:
    +
    +Here is a simple string
    +of text that will help
    +us demonstrate this
    +function
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index d72cdd90..b64f5436 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -1,112 +1,112 @@ - - - - - -Typography Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Typography Helper

    - -

    The Typography Helper file contains functions that help your format text in semantically relevant ways.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('typography'); - -

    The following functions are available:

    - - -

    auto_typography()

    - -

    Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.

    - -

    Usage example:

    - -$string = auto_typography($string); - -

    Note: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. -If you choose to use this function you may want to consider -caching your pages.

    - - -

    nl2br_except_pre()

    - -

    Converts newlines to <br /> tags unless they appear within <pre> tags. -This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

    - -

    Usage example:

    - -$string = nl2br_except_pre($string); - - - -
    - - - - - - + + + + + +Typography Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Typography Helper

    + +

    The Typography Helper file contains functions that help your format text in semantically relevant ways.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('typography'); + +

    The following functions are available:

    + + +

    auto_typography()

    + +

    Formats text so that it is semantically and typographically correct HTML. Please see the Typography Class for more info.

    + +

    Usage example:

    + +$string = auto_typography($string); + +

    Note: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. +If you choose to use this function you may want to consider +caching your pages.

    + + +

    nl2br_except_pre()

    + +

    Converts newlines to <br /> tags unless they appear within <pre> tags. +This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

    + +

    Usage example:

    + +$string = nl2br_except_pre($string); + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index dcf02082..53fde2c3 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -1,281 +1,281 @@ - - - - - -URL Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    URL Helper

    - -

    The URL Helper file contains functions that assist in working with URLs.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('url'); - -

    The following functions are available:

    - -

    site_url()

    - -

    Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your -site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

    - -

    You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable -in the event your URL changes.

    - -

    Segments can be optionally passed to the function as a string or an array. Here is a string example:

    - -echo site_url("news/local/123"); - -

    The above example would return something like: http://example.com/index.php/news/local/123

    - -

    Here is an example of segments passed as an array:

    - - -$segments = array('news', 'local', '123');
    -
    -echo site_url($segments);
    - - -

    base_url()

    -

    Returns your site base URL, as specified in your config file. Example:

    -echo base_url(); - - -

    current_url()

    -

    Returns the full URL (including segments) of the page being currently viewed.

    - - -

    uri_string()

    -

    Returns the URI segments of any page that contains this function. For example, if your URL was this:

    -http://some-site.com/blog/comments/123 - -

    The function would return:

    -blog/comments/123 - - -

    index_page()

    -

    Returns your site "index" page, as specified in your config file. Example:

    -echo index_page(); - - - -

    anchor()

    - -

    Creates a standard HTML anchor link based on your local site URL:

    - -<a href="http://example.com">Click Here</a> - -

    The tag has three optional parameters:

    - -anchor(uri segments, text, attributes) - -

    The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, -segments can be a string or an array.

    - -

    Note:  If you are building links that are internal to your application do not include the base URL (http://...). This -will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.

    - -

    The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

    - -

    The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

    - -

    Here are some examples:

    - -echo anchor('news/local/123', 'My News'); - -

    Would produce: <a href="http://example.com/index.php/news/local/123" title="My News">My News</a>

    - -echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); - -

    Would produce: <a href="http://example.com/index.php/news/local/123" title="The best news!">My News</a>

    - - -

    anchor_popup()

    - -

    Nearly identical to the anchor() function except that it opens the URL in a new window. - -You can specify JavaScript window attributes in the third parameter to control how the window is opened. If -the third parameter is not set it will simply open a new window with your own browser settings. Here is an example -with attributes:

    - - - -$atts = array(
    -              'width'      => '800',
    -              'height'     => '600',
    -              'scrollbars' => 'yes',
    -              'status'     => 'yes',
    -              'resizable'  => 'yes',
    -              'screenx'    => '0',
    -              'screeny'    => '0'
    -            );
    -
    -echo anchor_popup('news/local/123', 'Click Me!', $atts);
    - -

    Note: The above attributes are the function defaults so you only need to set the ones that are different from what you need. -If you want the function to use all of its defaults simply pass an empty array in the third parameter:

    - -echo anchor_popup('news/local/123', 'Click Me!', array()); - - -

    mailto()

    - -

    Creates a standard HTML email link. Usage example:

    - -echo mailto('me@my-site.com', 'Click Here to Contact Me'); - -

    As with the anchor() tab above, you can set attributes using the third parameter.

    - - -

    safe_mailto()

    - -

    Identical to the above function except it writes an obfuscated version of the mailto tag using ordinal numbers -written with JavaScript to help prevent the email address from being harvested by spam bots.

    - - -

    auto_link()

    - -

    Automatically turns URLs and email addresses contained in a string into links. Example:

    - -$string = auto_link($string); - -

    The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both -if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

    - -

    Converts only URLs:

    -$string = auto_link($string, 'url'); - -

    Converts only Email addresses:

    -$string = auto_link($string, 'email'); - -

    The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

    -$string = auto_link($string, 'both', TRUE); - - -

    url_title()

    -

    Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog -in which you'd like to use the title of your entries in the URL. Example:

    - -$title = "What's wrong with CSS?";
    -
    -$url_title = url_title($title);
    -
    -// Produces: whats-wrong-with-css -
    - - -

    The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

    - -$title = "What's wrong with CSS?";
    -
    -$url_title = url_title($title, 'underscore');
    -
    -// Produces: whats_wrong_with_css -
    - - -

    prep_url()

    -

    This function will add http:// in the event it is missing from a URL. Pass the URL string to the function like this:

    - -$url = "example.com";

    -$url = prep_url($url);
    - - - - -

    redirect()

    - -

    Does a "header redirect" to the local URI specified. Just like other functions in this helper, this one is designed -to redirect to a local URL within your site. You will not specify the full site URL, but rather simply the URI segments -to the controller you want to direct to. 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:

    - -if ($logged_in == FALSE)
    -{
    -     redirect('/login/form/', 'refresh');
    -}
    -
    -// with 301 redirect
    -redirect('/article/13', 'location', 301);
    - -

    Note: In order for this function to work it must be used before anything is outputted -to the browser since it utilizes server headers.
    -Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

    - - - - - - -
    - - - - - - + + + + + +URL Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    URL Helper

    + +

    The URL Helper file contains functions that assist in working with URLs.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('url'); + +

    The following functions are available:

    + +

    site_url()

    + +

    Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your +site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function.

    + +

    You are encouraged to use this function any time you need to generate a local URL so that your pages become more portable +in the event your URL changes.

    + +

    Segments can be optionally passed to the function as a string or an array. Here is a string example:

    + +echo site_url("news/local/123"); + +

    The above example would return something like: http://example.com/index.php/news/local/123

    + +

    Here is an example of segments passed as an array:

    + + +$segments = array('news', 'local', '123');
    +
    +echo site_url($segments);
    + + +

    base_url()

    +

    Returns your site base URL, as specified in your config file. Example:

    +echo base_url(); + + +

    current_url()

    +

    Returns the full URL (including segments) of the page being currently viewed.

    + + +

    uri_string()

    +

    Returns the URI segments of any page that contains this function. For example, if your URL was this:

    +http://some-site.com/blog/comments/123 + +

    The function would return:

    +blog/comments/123 + + +

    index_page()

    +

    Returns your site "index" page, as specified in your config file. Example:

    +echo index_page(); + + + +

    anchor()

    + +

    Creates a standard HTML anchor link based on your local site URL:

    + +<a href="http://example.com">Click Here</a> + +

    The tag has three optional parameters:

    + +anchor(uri segments, text, attributes) + +

    The first parameter can contain any segments you wish appended to the URL. As with the site_url() function above, +segments can be a string or an array.

    + +

    Note:  If you are building links that are internal to your application do not include the base URL (http://...). This +will be added automatically from the information specified in your config file. Include only the URI segments you wish appended to the URL.

    + +

    The second segment is the text you would like the link to say. If you leave it blank, the URL will be used.

    + +

    The third parameter can contain a list of attributes you would like added to the link. The attributes can be a simple string or an associative array.

    + +

    Here are some examples:

    + +echo anchor('news/local/123', 'My News'); + +

    Would produce: <a href="http://example.com/index.php/news/local/123" title="My News">My News</a>

    + +echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); + +

    Would produce: <a href="http://example.com/index.php/news/local/123" title="The best news!">My News</a>

    + + +

    anchor_popup()

    + +

    Nearly identical to the anchor() function except that it opens the URL in a new window. + +You can specify JavaScript window attributes in the third parameter to control how the window is opened. If +the third parameter is not set it will simply open a new window with your own browser settings. Here is an example +with attributes:

    + + + +$atts = array(
    +              'width'      => '800',
    +              'height'     => '600',
    +              'scrollbars' => 'yes',
    +              'status'     => 'yes',
    +              'resizable'  => 'yes',
    +              'screenx'    => '0',
    +              'screeny'    => '0'
    +            );
    +
    +echo anchor_popup('news/local/123', 'Click Me!', $atts);
    + +

    Note: The above attributes are the function defaults so you only need to set the ones that are different from what you need. +If you want the function to use all of its defaults simply pass an empty array in the third parameter:

    + +echo anchor_popup('news/local/123', 'Click Me!', array()); + + +

    mailto()

    + +

    Creates a standard HTML email link. Usage example:

    + +echo mailto('me@my-site.com', 'Click Here to Contact Me'); + +

    As with the anchor() tab above, you can set attributes using the third parameter.

    + + +

    safe_mailto()

    + +

    Identical to the above function except it writes an obfuscated version of the mailto tag using ordinal numbers +written with JavaScript to help prevent the email address from being harvested by spam bots.

    + + +

    auto_link()

    + +

    Automatically turns URLs and email addresses contained in a string into links. Example:

    + +$string = auto_link($string); + +

    The second parameter determines whether URLs and emails are converted or just one or the other. Default behavior is both +if the parameter is not specified. Email links are encoded as safe_mailto() as shown above.

    + +

    Converts only URLs:

    +$string = auto_link($string, 'url'); + +

    Converts only Email addresses:

    +$string = auto_link($string, 'email'); + +

    The third parameter determines whether links are shown in a new window. The value can be TRUE or FALSE (boolean):

    +$string = auto_link($string, 'both', TRUE); + + +

    url_title()

    +

    Takes a string as input and creates a human-friendly URL string. This is useful if, for example, you have a blog +in which you'd like to use the title of your entries in the URL. Example:

    + +$title = "What's wrong with CSS?";
    +
    +$url_title = url_title($title);
    +
    +// Produces: whats-wrong-with-css +
    + + +

    The second parameter determines the word delimiter. By default dashes are used. Options are: dash, or underscore:

    + +$title = "What's wrong with CSS?";
    +
    +$url_title = url_title($title, 'underscore');
    +
    +// Produces: whats_wrong_with_css +
    + + +

    prep_url()

    +

    This function will add http:// in the event it is missing from a URL. Pass the URL string to the function like this:

    + +$url = "example.com";

    +$url = prep_url($url);
    + + + + +

    redirect()

    + +

    Does a "header redirect" to the local URI specified. Just like other functions in this helper, this one is designed +to redirect to a local URL within your site. You will not specify the full site URL, but rather simply the URI segments +to the controller you want to direct to. 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:

    + +if ($logged_in == FALSE)
    +{
    +     redirect('/login/form/', 'refresh');
    +}
    +
    +// with 301 redirect
    +redirect('/article/13', 'location', 301);
    + +

    Note: In order for this function to work it must be used before anything is outputted +to the browser since it utilizes server headers.
    +Note: For very fine grained control over headers, you should use the Output Library's set_header() function.

    + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 6971115e..17cdd247 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -1,105 +1,105 @@ - - - - - -XML Helper : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    XML Helper

    - -

    The XML Helper file contains functions that assist in working with XML data.

    - - -

    Loading this Helper

    - -

    This helper is loaded using the following code:

    -$this->load->helper('xml'); - -

    The following functions are available:

    - -

    xml_convert('string')

    - -

    Takes a string as input and converts the following reserved XML characters to entities:

    - -

    -Ampersands: &
    -Less then and greater than characters: < >
    -Single and double quotes: '  "
    -Dashes: -

    - -

    This function ignores ampersands if they are part of existing character entities. Example:

    - -$string = xml_convert($string); - - - - - - -
    - - - - - - + + + + + +XML Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    XML Helper

    + +

    The XML Helper file contains functions that assist in working with XML data.

    + + +

    Loading this Helper

    + +

    This helper is loaded using the following code:

    +$this->load->helper('xml'); + +

    The following functions are available:

    + +

    xml_convert('string')

    + +

    Takes a string as input and converts the following reserved XML characters to entities:

    + +

    +Ampersands: &
    +Less then and greater than characters: < >
    +Single and double quotes: '  "
    +Dashes: -

    + +

    This function ignores ampersands if they are part of existing character entities. Example:

    + +$string = xml_convert($string); + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/index.html b/user_guide/index.html index fc1f7204..c64981c3 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -1,99 +1,99 @@ - - - - - -Welcome to CodeIgniter : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - -
    - - - -
    - -
    CodeIgniter
    - - - -
    - - - -

    Welcome to 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.

    - - -

    Who is CodeIgniter For?

    - -

    CodeIgniter is right for you if:

    - -
      -
    • You want a framework with a small footprint.
    • -
    • You need exceptional performance.
    • -
    • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
    • -
    • You want a framework that requires nearly zero configuration.
    • -
    • You want a framework that does not require you to use the command line.
    • -
    • You want a framework that does not require you to adhere to restrictive coding rules.
    • -
    • You are not interested in large-scale monolithic libraries like PEAR.
    • -
    • You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
    • -
    • You eschew complexity, favoring simple solutions.
    • -
    • You need clear, thorough documentation.
    • -
    - - -
    - - - - - - - - + + + + + +Welcome to CodeIgniter : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + +
    + + + +
    + +
    CodeIgniter
    + + + +
    + + + +

    Welcome to 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.

    + + +

    Who is CodeIgniter For?

    + +

    CodeIgniter is right for you if:

    + +
      +
    • You want a framework with a small footprint.
    • +
    • You need exceptional performance.
    • +
    • You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
    • +
    • You want a framework that requires nearly zero configuration.
    • +
    • You want a framework that does not require you to use the command line.
    • +
    • You want a framework that does not require you to adhere to restrictive coding rules.
    • +
    • You are not interested in large-scale monolithic libraries like PEAR.
    • +
    • You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
    • +
    • You eschew complexity, favoring simple solutions.
    • +
    • You need clear, thorough documentation.
    • +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 3d4e7248..559cabd8 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -1,103 +1,103 @@ - - - - - -Downloading CodeIgniter : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Downloading CodeIgniter

    - - - - - - -

    Subversion Server

    -

    Subversion is a version control system.

    -

    Public subversion access is now available via http://dev.ellislab.com/svn/CodeIgniter/trunk please note that while every effort is made to keep this codebase functional, we cannot guarantee the functionality of code taken from the repository.

    -

    Beginning with version 1.6.1, version snapshots (tags) are also available via the Subversion server via http://dev.ellislab.com/svn/CodeIgniter/tags.

    -
    - - - - - - + + + + + +Downloading CodeIgniter : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Downloading CodeIgniter

    + + + + + + +

    Subversion Server

    +

    Subversion is a version control system.

    +

    Public subversion access is now available via http://dev.ellislab.com/svn/CodeIgniter/trunk please note that while every effort is made to keep this codebase functional, we cannot guarantee the functionality of code taken from the repository.

    +

    Beginning with version 1.6.1, version snapshots (tags) are also available via the Subversion server via http://dev.ellislab.com/svn/CodeIgniter/tags.

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 701cdac7..01d4db7c 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -1,97 +1,97 @@ - - - - - -Installation Instructions : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Installation Instructions

    - -

    CodeIgniter is installed in four steps:

    - -
      -
    1. Unzip the package.
    2. -
    3. Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
    4. -
    5. Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
    6. -
    7. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
    8. -
    - -

    If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system folder -to something more private. If you do rename it, you must open your main index.php file and set the $system_folder -variable at the top of the page with the new name you've chosen.

    - -

    That's it!

    - -

    If you're new to CodeIgniter, please read the Getting Started section of the User Guide to begin learning how -to build dynamic PHP applications. Enjoy!

    - - - -
    - - - - - - + + + + + +Installation Instructions : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Installation Instructions

    + +

    CodeIgniter is installed in four steps:

    + +
      +
    1. Unzip the package.
    2. +
    3. Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.
    4. +
    5. Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key.
    6. +
    7. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
    8. +
    + +

    If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system folder +to something more private. If you do rename it, you must open your main index.php file and set the $system_folder +variable at the top of the page with the new name you've chosen.

    + +

    That's it!

    + +

    If you're new to CodeIgniter, please read the Getting Started section of the User Guide to begin learning how +to build dynamic PHP applications. Enjoy!

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index abdf5194..3383662d 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -1,90 +1,90 @@ - - - - - -Troubleshooting : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Troubleshooting

    - -

    If you find that no matter what you put in your URL only your default page is loading, it might be that your server -does not support the PATH_INFO variable needed to serve search-engine friendly URLs. - -As a first step, open your application/config/config.php file and look for the URI Protocol -information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need -to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:

    - -$config['index_page'] = "index.php"; - -

    To this:

    - -$config['index_page'] = "index.php?"; - - -
    - - - - - - + + + + + +Troubleshooting : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Troubleshooting

    + +

    If you find that no matter what you put in your URL only your default page is loading, it might be that your server +does not support the PATH_INFO variable needed to serve search-engine friendly URLs. + +As a first step, open your application/config/config.php file and look for the URI Protocol +information. It will recommend that you try a couple alternate settings. If it still doesn't work after you've tried this you'll need +to force CodeIgniter to add a question mark to your URLs. To do this open your application/config/config.php file and change this:

    + +$config['index_page'] = "index.php"; + +

    To this:

    + +$config['index_page'] = "index.php?"; + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index e77d325e..69349ec4 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -1,92 +1,92 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading From Beta 1.0 to Final 1.2

    - -

    To upgrade to Version 1.2 please replace the following directories with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • drivers
    • -
    • helpers
    • -
    • init
    • -
    • language
    • -
    • libraries
    • -
    • plugins
    • -
    • scaffolding
    • -
    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading From Beta 1.0 to Final 1.2

    + +

    To upgrade to Version 1.2 please replace the following directories with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • drivers
    • +
    • helpers
    • +
    • init
    • +
    • language
    • +
    • libraries
    • +
    • plugins
    • +
    • scaffolding
    • +
    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index c2739777..9c83c185 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -1,203 +1,203 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.2 to 1.3

    - -

    Note: The instructions on this page assume you are running version 1.2. If you -have not upgraded to that version please do so first.

    - - -

    Before performing an update you should take your site offline by replacing the index.php file -with a static one.

    - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • application/models/   (new for 1.3)
    • -
    • codeigniter   (new for 1.3)
    • -
    • drivers
    • -
    • helpers
    • -
    • init
    • -
    • language
    • -
    • libraries
    • -
    • plugins
    • -
    • scaffolding
    • -
    - - -

    Step 2: Update your error files

    - -

    Version 1.3 contains two new error templates located in application/errors, and for naming consistency the other error templates have -been renamed.

    - -

    If you have not customized any of the error templates simply -replace this folder:

    - -
      -
    • application/errors/
    • -
    - -

    If you have customized your error templates, rename them as follows:

    - - -
      -
    • 404.php   =  error_404.php
    • -
    • error.php   =  error_general.php
    • -
    • error_db.php   (new)
    • -
    • error_php.php   (new)
    • -
    - - -

    Step 3: Update your index.php file

    - -

    Please open your main index.php file (located at your root). At the very bottom of the file, change this:

    - -require_once BASEPATH.'libraries/Front_controller'.EXT; - -

    To this:

    - -require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; - - -

    Step 4: Update your config.php file

    - -

    Open your application/config/config.php file and add these new items:

    - -
    -/*
    -|------------------------------------------------
    -| URL suffix
    -|------------------------------------------------
    -|
    -| This option allows you to add a suffix to all URLs.
    -| For example, if a URL is this:
    -|
    -| example.com/index.php/products/view/shoes
    -|
    -| You can optionally add a suffix, like ".html",
    -| making the page appear to be of a certain type:
    -|
    -| example.com/index.php/products/view/shoes.html
    -|
    -*/
    -$config['url_suffix'] = "";
    -
    -
    -/*
    -|------------------------------------------------
    -| Enable Query Strings
    -|------------------------------------------------
    -|
    -| By default CodeIgniter uses search-engine and
    -| human-friendly segment based URLs:
    -|
    -| example.com/who/what/where/
    -|
    -| You can optionally enable standard query string
    -| based URLs:
    -|
    -| example.com?who=me&what=something&where=here
    -|
    -| Options are: TRUE or FALSE (boolean)
    -|
    -| The two other items let you set the query string "words"
    -| that will invoke your controllers and functions:
    -| example.com/index.php?c=controller&m=function
    -|
    -*/
    -$config['enable_query_strings'] = FALSE;
    -$config['controller_trigger'] = 'c';
    -$config['function_trigger'] = 'm';
    -
    - - -

    Step 5: Update your database.php file

    - -

    Open your application/config/database.php file and add these new items:

    - -
    -$db['default']['dbprefix'] = "";
    -$db['default']['active_r'] = TRUE;
    -
    - - -

    Step 6: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.2 to 1.3

    + +

    Note: The instructions on this page assume you are running version 1.2. If you +have not upgraded to that version please do so first.

    + + +

    Before performing an update you should take your site offline by replacing the index.php file +with a static one.

    + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • application/models/   (new for 1.3)
    • +
    • codeigniter   (new for 1.3)
    • +
    • drivers
    • +
    • helpers
    • +
    • init
    • +
    • language
    • +
    • libraries
    • +
    • plugins
    • +
    • scaffolding
    • +
    + + +

    Step 2: Update your error files

    + +

    Version 1.3 contains two new error templates located in application/errors, and for naming consistency the other error templates have +been renamed.

    + +

    If you have not customized any of the error templates simply +replace this folder:

    + +
      +
    • application/errors/
    • +
    + +

    If you have customized your error templates, rename them as follows:

    + + +
      +
    • 404.php   =  error_404.php
    • +
    • error.php   =  error_general.php
    • +
    • error_db.php   (new)
    • +
    • error_php.php   (new)
    • +
    + + +

    Step 3: Update your index.php file

    + +

    Please open your main index.php file (located at your root). At the very bottom of the file, change this:

    + +require_once BASEPATH.'libraries/Front_controller'.EXT; + +

    To this:

    + +require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; + + +

    Step 4: Update your config.php file

    + +

    Open your application/config/config.php file and add these new items:

    + +
    +/*
    +|------------------------------------------------
    +| URL suffix
    +|------------------------------------------------
    +|
    +| This option allows you to add a suffix to all URLs.
    +| For example, if a URL is this:
    +|
    +| example.com/index.php/products/view/shoes
    +|
    +| You can optionally add a suffix, like ".html",
    +| making the page appear to be of a certain type:
    +|
    +| example.com/index.php/products/view/shoes.html
    +|
    +*/
    +$config['url_suffix'] = "";
    +
    +
    +/*
    +|------------------------------------------------
    +| Enable Query Strings
    +|------------------------------------------------
    +|
    +| By default CodeIgniter uses search-engine and
    +| human-friendly segment based URLs:
    +|
    +| example.com/who/what/where/
    +|
    +| You can optionally enable standard query string
    +| based URLs:
    +|
    +| example.com?who=me&what=something&where=here
    +|
    +| Options are: TRUE or FALSE (boolean)
    +|
    +| The two other items let you set the query string "words"
    +| that will invoke your controllers and functions:
    +| example.com/index.php?c=controller&m=function
    +|
    +*/
    +$config['enable_query_strings'] = FALSE;
    +$config['controller_trigger'] = 'c';
    +$config['function_trigger'] = 'm';
    +
    + + +

    Step 5: Update your database.php file

    + +

    Open your application/config/database.php file and add these new items:

    + +
    +$db['default']['dbprefix'] = "";
    +$db['default']['active_r'] = TRUE;
    +
    + + +

    Step 6: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 890e37dd..028faf2d 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -1,102 +1,102 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.3 to 1.3.1

    - -

    Note: The instructions on this page assume you are running version 1.3. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • drivers
    • -
    • init/init_unit_test.php (new for 1.3.1)
    • -
    • language/
    • -
    • libraries
    • -
    • scaffolding
    • -
    - - -

    Step 2: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.3 to 1.3.1

    + +

    Note: The instructions on this page assume you are running version 1.3. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • drivers
    • +
    • init/init_unit_test.php (new for 1.3.1)
    • +
    • language/
    • +
    • libraries
    • +
    • scaffolding
    • +
    + + +

    Step 2: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 333d8ca9..1344a333 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -1,100 +1,100 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.3.1 to 1.3.2

    - -

    Note: The instructions on this page assume you are running version 1.3.1. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • drivers
    • -
    • init
    • -
    • libraries
    • -
    - - -

    Step 2: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.3.1 to 1.3.2

    + +

    Note: The instructions on this page assume you are running version 1.3.1. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • drivers
    • +
    • init
    • +
    • libraries
    • +
    + + +

    Step 2: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 41c131bc..3944dd3e 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -1,112 +1,112 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.3.2 to 1.3.3

    - -

    Note: The instructions on this page assume you are running version 1.3.2. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • codeigniter
    • -
    • drivers
    • -
    • helpers
    • -
    • init
    • -
    • libraries
    • -
    - - -

    Step 2: Update your Models

    - -

    If you are NOT using CodeIgniter's Models feature disregard this step.

    - -

    As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This -allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting -to your database prior to a model being loaded you will have to update your code. There are several options for connecting, -as described here.

    - - -

    Step 3: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.3.2 to 1.3.3

    + +

    Note: The instructions on this page assume you are running version 1.3.2. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • codeigniter
    • +
    • drivers
    • +
    • helpers
    • +
    • init
    • +
    • libraries
    • +
    + + +

    Step 2: Update your Models

    + +

    If you are NOT using CodeIgniter's Models feature disregard this step.

    + +

    As of version 1.3.3, CodeIgniter does not connect automatically to your database when a model is loaded. This +allows you greater flexibility in determining which databases you would like used with your models. If your application is not connecting +to your database prior to a model being loaded you will have to update your code. There are several options for connecting, +as described here.

    + + +

    Step 3: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 1e593739..3d6d29ca 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -1,145 +1,145 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.3.3 to 1.4.0

    - -

    Note: The instructions on this page assume you are running version 1.3.3. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • application/config/hooks.php
    • -
    • application/config/mimes.php
    • -
    • codeigniter
    • -
    • drivers
    • -
    • helpers
    • -
    • init
    • -
    • language
    • -
    • libraries
    • -
    • scaffolding
    • -
    - - -

    Step 2: Update your config.php file

    - -

    Open your application/config/config.php file and add these new items:

    - -
    -
    -/*
    -|--------------------------------------------------------------------------
    -| Enable/Disable System Hooks
    -|--------------------------------------------------------------------------
    -|
    -| If you would like to use the "hooks" feature you must enable it by
    -| setting this variable to TRUE (boolean).  See the user guide for details.
    -|
    -*/
    -$config['enable_hooks'] = FALSE;
    -
    -
    -/*
    -|--------------------------------------------------------------------------
    -| Allowed URL Characters
    -|--------------------------------------------------------------------------
    -|
    -| This lets you specify which characters are permitted within your URLs.
    -| When someone tries to submit a URL with disallowed characters they will
    -| get a warning message.
    -|
    -| As a security measure you are STRONGLY encouraged to restrict URLs to
    -| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
    -|
    -| Leave blank to allow all characters -- but only if you are insane.
    -|
    -| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
    -|
    -*/
    -$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
    -
    - - -

    Step 3: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.3.3 to 1.4.0

    + +

    Note: The instructions on this page assume you are running version 1.3.3. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • application/config/hooks.php
    • +
    • application/config/mimes.php
    • +
    • codeigniter
    • +
    • drivers
    • +
    • helpers
    • +
    • init
    • +
    • language
    • +
    • libraries
    • +
    • scaffolding
    • +
    + + +

    Step 2: Update your config.php file

    + +

    Open your application/config/config.php file and add these new items:

    + +
    +
    +/*
    +|--------------------------------------------------------------------------
    +| Enable/Disable System Hooks
    +|--------------------------------------------------------------------------
    +|
    +| If you would like to use the "hooks" feature you must enable it by
    +| setting this variable to TRUE (boolean).  See the user guide for details.
    +|
    +*/
    +$config['enable_hooks'] = FALSE;
    +
    +
    +/*
    +|--------------------------------------------------------------------------
    +| Allowed URL Characters
    +|--------------------------------------------------------------------------
    +|
    +| This lets you specify which characters are permitted within your URLs.
    +| When someone tries to submit a URL with disallowed characters they will
    +| get a warning message.
    +|
    +| As a security measure you are STRONGLY encouraged to restrict URLs to
    +| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
    +|
    +| Leave blank to allow all characters -- but only if you are insane.
    +|
    +| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
    +|
    +*/
    +$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';
    +
    + + +

    Step 3: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index c1b667a8..182abbde 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -1,148 +1,148 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.4.0 to 1.4.1

    - -

    Note: The instructions on this page assume you are running version 1.4.0. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace the following directories in your "system" folder with the new versions:

    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -
      -
    • codeigniter
    • -
    • drivers
    • -
    • helpers
    • -
    • libraries
    • -
    - - -

    Step 2: Update your config.php file

    - -

    Open your application/config/config.php file and add this new item:

    - -
    -
    -/*
    -|--------------------------------------------------------------------------
    -| Output Compression
    -|--------------------------------------------------------------------------
    -|
    -| Enables Gzip output compression for faster page loads.  When enabled,
    -| the output class will test whether your server supports Gzip.
    -| Even if it does, however, not all browsers support compression
    -| so enable only if you are reasonably sure your visitors can handle it.
    -|
    -| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
    -| means you are prematurely outputting something to your browser. It could
    -| even be a line of whitespace at the end of one of your scripts.  For
    -| compression to work, nothing can be sent before the output buffer is called
    -| by the output class.  Do not "echo" any values with compression enabled.
    -|
    -*/
    -$config['compress_output'] = FALSE;
    -
    -
    - - - -

    Step 3: Rename an Autoload Item

    - -

    Open the following file: application/config/autoload.php

    - -

    Find this array item:

    - -$autoload['core'] = array(); - -

    And rename it to this:

    - -$autoload['libraries'] = array(); - -

    This change was made to improve clarity since some users were not sure that their own libraries could be auto-loaded.

    - - - - - - -

    Step 4: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.4.0 to 1.4.1

    + +

    Note: The instructions on this page assume you are running version 1.4.0. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace the following directories in your "system" folder with the new versions:

    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +
      +
    • codeigniter
    • +
    • drivers
    • +
    • helpers
    • +
    • libraries
    • +
    + + +

    Step 2: Update your config.php file

    + +

    Open your application/config/config.php file and add this new item:

    + +
    +
    +/*
    +|--------------------------------------------------------------------------
    +| Output Compression
    +|--------------------------------------------------------------------------
    +|
    +| Enables Gzip output compression for faster page loads.  When enabled,
    +| the output class will test whether your server supports Gzip.
    +| Even if it does, however, not all browsers support compression
    +| so enable only if you are reasonably sure your visitors can handle it.
    +|
    +| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
    +| means you are prematurely outputting something to your browser. It could
    +| even be a line of whitespace at the end of one of your scripts.  For
    +| compression to work, nothing can be sent before the output buffer is called
    +| by the output class.  Do not "echo" any values with compression enabled.
    +|
    +*/
    +$config['compress_output'] = FALSE;
    +
    +
    + + + +

    Step 3: Rename an Autoload Item

    + +

    Open the following file: application/config/autoload.php

    + +

    Find this array item:

    + +$autoload['core'] = array(); + +

    And rename it to this:

    + +$autoload['libraries'] = array(); + +

    This change was made to improve clarity since some users were not sure that their own libraries could be auto-loaded.

    + + + + + + +

    Step 4: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 2a418087..afb1d49f 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -1,178 +1,178 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.4.1 to 1.5.0

    - -

    Note: The instructions on this page assume you are running version 1.4.1. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • application/config/user_agents.php (new file for 1.5)
    • -
    • application/config/smileys.php (new file for 1.5)
    • -
    • codeigniter/
    • -
    • database/ (new folder for 1.5. Replaces the "drivers" folder)
    • -
    • helpers/
    • -
    • language/
    • -
    • libraries/
    • -
    • scaffolding/
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Update your database.php file

    - -

    Open your application/config/database.php file and add these new items:

    - -
    -$db['default']['cache_on'] = FALSE;
    -$db['default']['cachedir'] = '';
    -
    - - - -

    Step 3: Update your config.php file

    - -

    Open your application/config/config.php file and ADD these new items:

    - -
    -/*
    -|--------------------------------------------------------------------------
    -| Class Extension Prefix
    -|--------------------------------------------------------------------------
    -|
    -| This item allows you to set the filename/classname prefix when extending
    -| native libraries.  For more information please see the user guide:
    -|
    -| http://codeigniter.com/user_guide/general/core_classes.html
    -| http://codeigniter.com/user_guide/general/creating_libraries.html
    -|
    -*/
    -$config['subclass_prefix'] = 'MY_';
    -
    -/*
    -|--------------------------------------------------------------------------
    -| Rewrite PHP Short Tags
    -|--------------------------------------------------------------------------
    -|
    -| If your PHP installation does not have short tag support enabled CI
    -| can rewrite the tags on-the-fly, enabling you to utilize that syntax
    -| in your view files.  Options are TRUE or FALSE (boolean)
    -|
    -*/
    -$config['rewrite_short_tags'] = FALSE;
    -
    - -

    In that same file REMOVE this item:

    - - -
    -/*
    -|--------------------------------------------------------------------------
    -| Enable/Disable Error Logging
    -|--------------------------------------------------------------------------
    -|
    -| If you would like errors or debug messages logged set this variable to
    -| TRUE (boolean).  Note: You must set the file permissions on the "logs" folder
    -| such that it is writable.
    -|
    -*/
    -$config['log_errors'] = FALSE;
    -
    - -

    Error logging is now disabled simply by setting the threshold to zero.

    - - - -

    Step 4: Update your main index.php file

    - -

    If you are running a stock index.php file simply replace your version with the new one.

    - -

    If your index.php file has internal modifications, please add your modifications to the new file and use it.

    - - - -

    Step 5: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.4.1 to 1.5.0

    + +

    Note: The instructions on this page assume you are running version 1.4.1. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • application/config/user_agents.php (new file for 1.5)
    • +
    • application/config/smileys.php (new file for 1.5)
    • +
    • codeigniter/
    • +
    • database/ (new folder for 1.5. Replaces the "drivers" folder)
    • +
    • helpers/
    • +
    • language/
    • +
    • libraries/
    • +
    • scaffolding/
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Update your database.php file

    + +

    Open your application/config/database.php file and add these new items:

    + +
    +$db['default']['cache_on'] = FALSE;
    +$db['default']['cachedir'] = '';
    +
    + + + +

    Step 3: Update your config.php file

    + +

    Open your application/config/config.php file and ADD these new items:

    + +
    +/*
    +|--------------------------------------------------------------------------
    +| Class Extension Prefix
    +|--------------------------------------------------------------------------
    +|
    +| This item allows you to set the filename/classname prefix when extending
    +| native libraries.  For more information please see the user guide:
    +|
    +| http://codeigniter.com/user_guide/general/core_classes.html
    +| http://codeigniter.com/user_guide/general/creating_libraries.html
    +|
    +*/
    +$config['subclass_prefix'] = 'MY_';
    +
    +/*
    +|--------------------------------------------------------------------------
    +| Rewrite PHP Short Tags
    +|--------------------------------------------------------------------------
    +|
    +| If your PHP installation does not have short tag support enabled CI
    +| can rewrite the tags on-the-fly, enabling you to utilize that syntax
    +| in your view files.  Options are TRUE or FALSE (boolean)
    +|
    +*/
    +$config['rewrite_short_tags'] = FALSE;
    +
    + +

    In that same file REMOVE this item:

    + + +
    +/*
    +|--------------------------------------------------------------------------
    +| Enable/Disable Error Logging
    +|--------------------------------------------------------------------------
    +|
    +| If you would like errors or debug messages logged set this variable to
    +| TRUE (boolean).  Note: You must set the file permissions on the "logs" folder
    +| such that it is writable.
    +|
    +*/
    +$config['log_errors'] = FALSE;
    +
    + +

    Error logging is now disabled simply by setting the threshold to zero.

    + + + +

    Step 4: Update your main index.php file

    + +

    If you are running a stock index.php file simply replace your version with the new one.

    + +

    If your index.php file has internal modifications, please add your modifications to the new file and use it.

    + + + +

    Step 5: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 789f21bf..223eef6b 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -1,111 +1,111 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.5.0 to 1.5.2

    - -

    Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you -have not upgraded to that version please do so first.

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/helpers/download_helper.php
    • -
    • system/helpers/form_helper.php
    • -
    • system/libraries/Table.php
    • -
    • system/libraries/User_agent.php
    • -
    • system/libraries/Exceptions.php
    • -
    • system/libraries/Input.php
    • -
    • system/libraries/Router.php
    • -
    • system/libraries/Loader.php
    • -
    • system/libraries/Image_lib.php
    • -
    • system/language/english/unit_test_lang.php
    • -
    • system/database/DB_active_rec.php
    • -
    • system/database/drivers/mysqli/mysqli_driver.php
    • -
    • codeigniter/
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.5.0 to 1.5.2

    + +

    Note: The instructions on this page assume you are running version 1.5.0 or 1.5.1. If you +have not upgraded to that version please do so first.

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/helpers/download_helper.php
    • +
    • system/helpers/form_helper.php
    • +
    • system/libraries/Table.php
    • +
    • system/libraries/User_agent.php
    • +
    • system/libraries/Exceptions.php
    • +
    • system/libraries/Input.php
    • +
    • system/libraries/Router.php
    • +
    • system/libraries/Loader.php
    • +
    • system/libraries/Image_lib.php
    • +
    • system/language/english/unit_test_lang.php
    • +
    • system/database/DB_active_rec.php
    • +
    • system/database/drivers/mysqli/mysqli_driver.php
    • +
    • codeigniter/
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 66ca76e4..c15579b6 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -1,100 +1,100 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.5.2 to 1.5.3

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/database/drivers
    • -
    • system/helpers
    • -
    • system/libraries/Input.php
    • -
    • system/libraries/Loader.php
    • -
    • system/libraries/Profiler.php
    • -
    • system/libraries/Table.php
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Update your user guide

    - -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.5.2 to 1.5.3

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/database/drivers
    • +
    • system/helpers
    • +
    • system/libraries/Input.php
    • +
    • system/libraries/Loader.php
    • +
    • system/libraries/Profiler.php
    • +
    • system/libraries/Table.php
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Update your user guide

    + +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 5e6dfb9c..7750a35e 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -1,116 +1,116 @@ - - - - - -Upgrading from 1.5.3 to 1.5.4 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.5.3 to 1.5.4

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/application/config/mimes.php
    • -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/libraries
    • -
    • system/plugins
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -

    Step 2: Add charset to your config.php

    -

    Add the following to system/application/config/config.php

    -/*
    - |--------------------------------------------------------------------------
    - | Default Character Set
    - |--------------------------------------------------------------------------
    - |
    - | This determines which character set is used by default in various methods
    - | that require a character set to be provided.
    - |
    - */
    - $config['charset'] = "UTF-8";
    - -

    Step 3: Autoloading language files

    -

    If you want to autoload any language files, add this line to system/application/config/autoload.php

    -$autoload['language'] = array(); - -

    Step 4: Update your user guide

    -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +Upgrading from 1.5.3 to 1.5.4 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.5.3 to 1.5.4

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/application/config/mimes.php
    • +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/libraries
    • +
    • system/plugins
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +

    Step 2: Add charset to your config.php

    +

    Add the following to system/application/config/config.php

    +/*
    + |--------------------------------------------------------------------------
    + | Default Character Set
    + |--------------------------------------------------------------------------
    + |
    + | This determines which character set is used by default in various methods
    + | that require a character set to be provided.
    + |
    + */
    + $config['charset'] = "UTF-8";
    + +

    Step 3: Autoloading language files

    +

    If you want to autoload any language files, add this line to system/application/config/autoload.php

    +$autoload['language'] = array(); + +

    Step 4: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index f9b4c3b9..3ca7372b 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -1,125 +1,125 @@ - - - - - -Upgrading from 1.5.4 to 1.6.0 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.5.4 to 1.6.0

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/libraries
    • -
    • system/plugins
    • -
    • system/language
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -

    Step 2: Add time_to_update to your config.php

    -

    Add the following to system/application/config/config.php with the other session configuration options

    -

    $config['sess_time_to_update'] = 300;

    -

    Step 3: Add $autoload['model']

    -

    Add the following to system/application/autoload.php

    -

    /*
    - | -------------------------------------------------------------------
    - | Auto-load Model files
    - | -------------------------------------------------------------------
    - | Prototype:
    - |
    - | $autoload['model'] = array('my_model');
    - |
    - */
    -
    - $autoload['model'] = array();

    -

    Step 4: Add to your database.php

    -

    Make the following changes to your system/application/config/database.php file:

    -

    Add the following variable above the database configuration options, with $active_group

    -

    $active_record = TRUE;

    -

    Remove the following from your database configuration options

    -

    $db['default']['active_r'] = TRUE;

    -

    Add the following to your database configuration options

    -

    $db['default']['char_set'] = "utf8";
    -$db['default']['dbcollat'] = "utf8_general_ci";

    - -

    Step 5: Update your user guide

    -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +Upgrading from 1.5.4 to 1.6.0 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.5.4 to 1.6.0

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/libraries
    • +
    • system/plugins
    • +
    • system/language
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +

    Step 2: Add time_to_update to your config.php

    +

    Add the following to system/application/config/config.php with the other session configuration options

    +

    $config['sess_time_to_update'] = 300;

    +

    Step 3: Add $autoload['model']

    +

    Add the following to system/application/autoload.php

    +

    /*
    + | -------------------------------------------------------------------
    + | Auto-load Model files
    + | -------------------------------------------------------------------
    + | Prototype:
    + |
    + | $autoload['model'] = array('my_model');
    + |
    + */
    +
    + $autoload['model'] = array();

    +

    Step 4: Add to your database.php

    +

    Make the following changes to your system/application/config/database.php file:

    +

    Add the following variable above the database configuration options, with $active_group

    +

    $active_record = TRUE;

    +

    Remove the following from your database configuration options

    +

    $db['default']['active_r'] = TRUE;

    +

    Add the following to your database configuration options

    +

    $db['default']['char_set'] = "utf8";
    +$db['default']['dbcollat'] = "utf8_general_ci";

    + +

    Step 5: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 24d34fd7..49715eec 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -1,98 +1,98 @@ - - - - - -Upgrading from 1.6.0 to 1.6.1 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.6.0 to 1.6.1

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/language
    • -
    • system/libraries
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - -

    Step 2: Update your user guide

    -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +Upgrading from 1.6.0 to 1.6.1 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.6.0 to 1.6.1

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/language
    • +
    • system/libraries
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +

    Step 2: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 258df2a5..942be9f0 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -1,106 +1,106 @@ - - - - - -Upgrading from 1.6.1 to 1.6.2 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.6.1 to 1.6.2

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/language
    • -
    • system/libraries
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Encryption Key

    -

    If you are using sessions, open up system/application/config/config.php and verify you've set an encryption key.

    - -

    Step 3: Constants File

    -

    Copy /system/application/config/constants.php to your installation, and modify if necessary.

    -

    Step 4: Mimes File

    -

    Replace /system/application/config/mimes.php with the dowloaded version. If you've added custom mime types, you'll need to re-add them.

    -

    Step 5: Update your user guide

    -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +Upgrading from 1.6.1 to 1.6.2 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.6.1 to 1.6.2

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/language
    • +
    • system/libraries
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Encryption Key

    +

    If you are using sessions, open up system/application/config/config.php and verify you've set an encryption key.

    + +

    Step 3: Constants File

    +

    Copy /system/application/config/constants.php to your installation, and modify if necessary.

    +

    Step 4: Mimes File

    +

    Replace /system/application/config/mimes.php with the dowloaded version. If you've added custom mime types, you'll need to re-add them.

    +

    Step 5: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 784ada8b..f9056b6a 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -1,99 +1,99 @@ - - - - - -Upgrading from 1.6.2 to 1.6.3 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.6.2 to 1.6.3

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/language
    • -
    • system/libraries
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Update your user guide

    -

    Please also replace your local copy of the user guide with the new version.

    - -
    - - - - - - + + + + + +Upgrading from 1.6.2 to 1.6.3 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.6.2 to 1.6.3

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/language
    • +
    • system/libraries
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Update your user guide

    +

    Please also replace your local copy of the user guide with the new version.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 1e69b3f2..006172d4 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -1,121 +1,121 @@ - - - - - -Upgrading from 1.6.3 to 1.7.0 : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading from 1.6.3 to 1.7.0

    - -

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    - - - -

    Step 1: Update your CodeIgniter files

    - -

    Replace these files and directories in your "system" folder with the new versions:

    - -
      - -
    • system/codeigniter
    • -
    • system/database
    • -
    • system/helpers
    • -
    • system/language
    • -
    • system/libraries
    • -
    - -

    Note: If you have any custom developed files in these folders please make copies of them first.

    - - -

    Step 2: Update your Session Table

    - -

    If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. -Here is an example of what this column might look like for MySQL: - -user_data text NOT NULL - -

    To add this column you will run a query similar to this:

    - -ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL - -

    You'll find more information regarding the new Session functionality in the Session class page.

    - - -

    Step 3: Update your Validation Syntax

    - -

    This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which -deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to -migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

    - - - -

    Step 4: Update your user guide

    -

    Please replace your local copy of the user guide with the new version, including the image files.

    - -
    - - - - - - + + + + + +Upgrading from 1.6.3 to 1.7.0 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.6.3 to 1.7.0

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/language
    • +
    • system/libraries
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + + +

    Step 2: Update your Session Table

    + +

    If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. +Here is an example of what this column might look like for MySQL: + +user_data text NOT NULL + +

    To add this column you will run a query similar to this:

    + +ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL + +

    You'll find more information regarding the new Session functionality in the Session class page.

    + + +

    Step 3: Update your Validation Syntax

    + +

    This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which +deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to +migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

    + + + +

    Step 4: Update your user guide

    +

    Please replace your local copy of the user guide with the new version, including the image files.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 8360a2b3..58ade4fe 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -1,144 +1,144 @@ - - - - - -CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Upgrading From Beta 1.0 to Beta 1.1

    - -

    To upgrade to Beta 1.1 please perform the following steps:

    - -

    Step 1: Replace your index file

    - -

    Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.

    - -

    Step 2: Relocate your config folder

    - -

    This version of CodeIgniter now permits multiple sets of "applications" to all share a common set of backend files. In order to enable -each application to have its own configuration values, the config directory must now reside -inside of your application folder, so please move it there.

    - - -

    Step 3: Replace directories

    - -

    Replace the following directories with the new versions:

    - -
      -
    • drivers
    • -
    • helpers
    • -
    • init
    • -
    • libraries
    • -
    • scaffolding
    • -
    - - -

    Step 4: Add the calendar language file

    - -

    There is a new language file corresponding to the new calendaring class which must be added to your language folder. Add -the following item to your version: language/english/calendar_lang.php

    - - -

    Step 5: Edit your config file

    - -

    The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:

    - -$conf['cookie_prefix'] = "";
    -$conf['cookie_domain'] = "";
    -$conf['cookie_path'] = "/";
    - -

    Change the array name from $conf to $config, like this:

    - -$config['cookie_prefix'] = "";
    -$config['cookie_domain'] = "";
    -$config['cookie_path'] = "/";
    - -

    Lastly, add the following new item to the config file (and edit the option if needed):

    - -
    -/*
    -|------------------------------------------------
    -| URI PROTOCOL
    -|------------------------------------------------
    -|
    -| This item determines which server global
    -| should be used to retrieve the URI string. The
    -| default setting of "auto" works for most servers.
    -| If your links do not seem to work, try one of
    -| the other delicious flavors:
    -|
    -| 'auto' Default - auto detects
    -| 'path_info' Uses the PATH_INFO
    -| 'query_string' Uses the QUERY_STRING
    -*/
    -
    -$config['uri_protocol'] = "auto";
    - - -
    - - - - - - + + + + + +CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading From Beta 1.0 to Beta 1.1

    + +

    To upgrade to Beta 1.1 please perform the following steps:

    + +

    Step 1: Replace your index file

    + +

    Replace your main index.php file with the new index.php file. Note: If you have renamed your "system" folder you will need to edit this info in the new file.

    + +

    Step 2: Relocate your config folder

    + +

    This version of CodeIgniter now permits multiple sets of "applications" to all share a common set of backend files. In order to enable +each application to have its own configuration values, the config directory must now reside +inside of your application folder, so please move it there.

    + + +

    Step 3: Replace directories

    + +

    Replace the following directories with the new versions:

    + +
      +
    • drivers
    • +
    • helpers
    • +
    • init
    • +
    • libraries
    • +
    • scaffolding
    • +
    + + +

    Step 4: Add the calendar language file

    + +

    There is a new language file corresponding to the new calendaring class which must be added to your language folder. Add +the following item to your version: language/english/calendar_lang.php

    + + +

    Step 5: Edit your config file

    + +

    The original application/config/config.php file has a typo in it Open the file and look for the items related to cookies:

    + +$conf['cookie_prefix'] = "";
    +$conf['cookie_domain'] = "";
    +$conf['cookie_path'] = "/";
    + +

    Change the array name from $conf to $config, like this:

    + +$config['cookie_prefix'] = "";
    +$config['cookie_domain'] = "";
    +$config['cookie_path'] = "/";
    + +

    Lastly, add the following new item to the config file (and edit the option if needed):

    + +
    +/*
    +|------------------------------------------------
    +| URI PROTOCOL
    +|------------------------------------------------
    +|
    +| This item determines which server global
    +| should be used to retrieve the URI string. The
    +| default setting of "auto" works for most servers.
    +| If your links do not seem to work, try one of
    +| the other delicious flavors:
    +|
    +| 'auto' Default - auto detects
    +| 'path_info' Uses the PATH_INFO
    +| 'query_string' Uses the QUERY_STRING
    +*/
    +
    +$config['uri_protocol'] = "auto";
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 78b5433c..78dd0f29 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -1,99 +1,99 @@ - - - - - -Upgrading From a Previous Version : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - - - - - - - - + + + + + +Upgrading From a Previous Version : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 67c36135..9f83a8de 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -1,197 +1,197 @@ - - - - - -Benchmarking Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Benchmarking Class

    - -

    CodeIgniter has a Benchmarking class that is always active, enabling the time difference between any -two marked points to be calculated.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - - -

    In addition, the benchmark is always started the moment the framework is -invoked, and ended by the output class right before sending the final view to the browser, enabling a very accurate -timing of the entire system execution to be shown.

    - - -

    Table of Contents

    - - - - - - -

    Using the Benchmark Class

    - -

    The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this:

    - -
      -
    1. Mark a start point
    2. -
    3. Mark an end point
    4. -
    5. Run the "elapsed time" function to view the results
    6. -
    - -

    Here's an example using real code:

    - -$this->benchmark->mark('code_start');
    -
    -// Some code happens here
    -
    -$this->benchmark->mark('code_end');
    -
    -echo $this->benchmark->elapsed_time('code_start', 'code_end');
    - -

    Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can -use any words you want, and you can set multiple sets of markers. Consider this example:

    - -$this->benchmark->mark('dog');
    -
    -// Some code happens here
    -
    -$this->benchmark->mark('cat');
    -
    -// More code happens here
    -
    -$this->benchmark->mark('bird');
    -
    -echo $this->benchmark->elapsed_time('dog', 'cat');
    -echo $this->benchmark->elapsed_time('cat', 'bird');
    -echo $this->benchmark->elapsed_time('dog', 'bird');
    - - - -

    Profiling Your Benchmark Points

    - -

    If you want your benchmark data to be available to the -Profiler all of your marked points must be set up in pairs, and -each mark point name must end with _start and _end. -Each pair of points must otherwise be named identically. Example:

    - - -$this->benchmark->mark('my_mark_start');
    -
    -// Some code happens here...
    -
    -$this->benchmark->mark('my_mark_end'); -

    - -$this->benchmark->mark('another_mark_start');
    -
    -// Some more code happens here...
    -
    -$this->benchmark->mark('another_mark_end'); -
    - -

    Please read the Profiler page for more information.

    - - - -

    Displaying Total Execution Time

    - -

    If you would like to display the total elapsed time from the moment CodeIgniter starts to the moment the final output -is sent to the browser, simply place this in one of your view templates:

    - -<?php echo $this->benchmark->elapsed_time();?> - -

    You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are -not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final -output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

    - -

    An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

    -{elapsed_time} - -

    Note: If you want to benchmark anything within your controller -functions you must set your own start/end points.

    - - -

    Displaying Memory Consumption

    - -

    If your PHP installation is configured with --enable-memory-limit, you can display the amount of memory consumed by the entire -system using the following code in one of your view file:

    - -<?php echo $this->benchmark->memory_usage();?> -

    Note: This function can only be used in your view files. The consumption will reflect the total memory used by the entire app.

    - -

    An alternate way to show your memory usage in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

    -{memory_usage} - - - - -
    - - - - - - + + + + + +Benchmarking Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Benchmarking Class

    + +

    CodeIgniter has a Benchmarking class that is always active, enabling the time difference between any +two marked points to be calculated.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + + +

    In addition, the benchmark is always started the moment the framework is +invoked, and ended by the output class right before sending the final view to the browser, enabling a very accurate +timing of the entire system execution to be shown.

    + + +

    Table of Contents

    + + + + + + +

    Using the Benchmark Class

    + +

    The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this:

    + +
      +
    1. Mark a start point
    2. +
    3. Mark an end point
    4. +
    5. Run the "elapsed time" function to view the results
    6. +
    + +

    Here's an example using real code:

    + +$this->benchmark->mark('code_start');
    +
    +// Some code happens here
    +
    +$this->benchmark->mark('code_end');
    +
    +echo $this->benchmark->elapsed_time('code_start', 'code_end');
    + +

    Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can +use any words you want, and you can set multiple sets of markers. Consider this example:

    + +$this->benchmark->mark('dog');
    +
    +// Some code happens here
    +
    +$this->benchmark->mark('cat');
    +
    +// More code happens here
    +
    +$this->benchmark->mark('bird');
    +
    +echo $this->benchmark->elapsed_time('dog', 'cat');
    +echo $this->benchmark->elapsed_time('cat', 'bird');
    +echo $this->benchmark->elapsed_time('dog', 'bird');
    + + + +

    Profiling Your Benchmark Points

    + +

    If you want your benchmark data to be available to the +Profiler all of your marked points must be set up in pairs, and +each mark point name must end with _start and _end. +Each pair of points must otherwise be named identically. Example:

    + + +$this->benchmark->mark('my_mark_start');
    +
    +// Some code happens here...
    +
    +$this->benchmark->mark('my_mark_end'); +

    + +$this->benchmark->mark('another_mark_start');
    +
    +// Some more code happens here...
    +
    +$this->benchmark->mark('another_mark_end'); +
    + +

    Please read the Profiler page for more information.

    + + + +

    Displaying Total Execution Time

    + +

    If you would like to display the total elapsed time from the moment CodeIgniter starts to the moment the final output +is sent to the browser, simply place this in one of your view templates:

    + +<?php echo $this->benchmark->elapsed_time();?> + +

    You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are +not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final +output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

    + +

    An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

    +{elapsed_time} + +

    Note: If you want to benchmark anything within your controller +functions you must set your own start/end points.

    + + +

    Displaying Memory Consumption

    + +

    If your PHP installation is configured with --enable-memory-limit, you can display the amount of memory consumed by the entire +system using the following code in one of your view file:

    + +<?php echo $this->benchmark->memory_usage();?> +

    Note: This function can only be used in your view files. The consumption will reflect the total memory used by the entire app.

    + +

    An alternate way to show your memory usage in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

    +{memory_usage} + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 1c849939..9daf2651 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -1,249 +1,249 @@ - - - - - -Calendaring Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - - - -

    Calendaring Class

    - -

    The Calendar class enables you to dynamically create calendars. Your calendars can be formatted through the use of a calendar -template, allowing 100% control over every aspect of its design. In addition, you can pass data to your calendar cells.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Calendar class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('calendar'); -

    Once loaded, the Calendar object will be available using: $this->calendar

    - - -

    Displaying a Calendar

    - -

    Here is a very simple example showing how you can display a calendar:

    - -$this->load->library('calendar');
    -
    -echo $this->calendar->generate();
    - -

    The above code will generate a calendar for the current month/year based on your server time. -To show a calendar for a specific month and year you will pass this information to the calendar generating function:

    - -$this->load->library('calendar');
    -
    -echo $this->calendar->generate(2006, 6);
    - -

    The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

    - -

    Passing Data to your Calendar Cells

    - -

    To add data to your calendar cells involves creating an associative array in which the keys correspond to the days -you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar -generating function. Consider this example:

    - -$this->load->library('calendar');
    -
    -$data = array(
    -               3  => 'http://example.com/news/article/2006/03/',
    -               7  => 'http://example.com/news/article/2006/07/',
    -               13 => 'http://example.com/news/article/2006/13/',
    -               26 => 'http://example.com/news/article/2006/26/'
    -             );
    -
    -echo $this->calendar->generate(2006, 6, $data);
    - -

    Using the above example, day numbers 3, 7, 13, and 26 will become links pointing to the URLs you've provided.

    - -

    Note: By default it is assumed that your array will contain links. -In the section that explains the calendar template below you'll see how you can customize -how data passed to your cells is handled so you can pass different types of information.

    - - -

    Setting Display Preferences

    - -

    There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an -array of preferences in the second parameter of the loading function. Here is an example:

    - - - -$prefs = array (
    -               'start_day'    => 'saturday',
    -               'month_type'   => 'long',
    -               'day_type'     => 'short'
    -             );
    -
    -$this->load->library('calendar', $prefs);
    -
    -echo $this->calendar->generate();
    - -

    The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information -regarding preferences below.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    templateNoneNoneA string containing your calendar template. See the template section below.
    local_timetime()NoneA Unix timestamp corresponding to the current time.
    start_daysundayAny week day (sunday, monday, tuesday, etc.)Sets the day of the week the calendar should start on.
    month_typelonglong, shortDetermines what version of the month name to use in the header. long = January, short = Jan.
    day_typeabrlong, short, abrDetermines what version of the weekday names to use in the column headers. long = Sunday, short = Sun, abr = Su.
    show_next_prevFALSETRUE/FALSE (boolean)Determines whether to display links allowing you to toggle to next/previous months. See information on this feature below.
    next_prev_urlNoneA URLSets the basepath used in the next/previous calendar links.
    - - - -

    Showing Next/Previous Month Links

    - -

    To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar -code similar to this example:

    - - -$prefs = array (
    -               'show_next_prev'  => TRUE,
    -               'next_prev_url'   => 'http://example.com/index.php/calendar/show/'
    -             );
    -
    -$this->load->library('calendar', $prefs);
    -
    -echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
    - -

    You'll notice a few things about the above example:

    - -
      -
    • You must set the "show_next_prev" to TRUE.
    • -
    • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
    • -
    • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
    • -
    - - - -

    Creating a Calendar Template

    - -

    By creating a calendar template you have 100% control over the design of your calendar. Each component of your -calendar will be placed within a pair of pseudo-variables as shown here:

    - - - -$prefs['template'] = '

    -   {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}
    -
    -   {heading_row_start}<tr>{/heading_row_start}
    -
    -   {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
    -   {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
    -   {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}
    -
    -   {heading_row_end}</tr>{/heading_row_end}
    -
    -   {week_row_start}<tr>{/week_row_start}
    -   {week_day_cell}<td>{week_day}</td>{/week_day_cell}
    -   {week_row_end}</tr>{/week_row_end}
    -
    -   {cal_row_start}<tr>{/cal_row_start}
    -   {cal_cell_start}<td>{/cal_cell_start}
    -
    -   {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
    -   {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}
    -
    -   {cal_cell_no_content}{day}{/cal_cell_no_content}
    -   {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
    -
    -   {cal_cell_blank}&nbsp;{/cal_cell_blank}
    -
    -   {cal_cell_end}</td>{/cal_cell_end}
    -   {cal_row_end}</tr>{/cal_row_end}
    -
    -   {table_close}</table>{/table_close}
    -';
    -
    -$this->load->library('calendar', $prefs);
    -
    -echo $this->calendar->generate();
    - - - -
    - - - - - - + + + + + +Calendaring Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + + + +

    Calendaring Class

    + +

    The Calendar class enables you to dynamically create calendars. Your calendars can be formatted through the use of a calendar +template, allowing 100% control over every aspect of its design. In addition, you can pass data to your calendar cells.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Calendar class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('calendar'); +

    Once loaded, the Calendar object will be available using: $this->calendar

    + + +

    Displaying a Calendar

    + +

    Here is a very simple example showing how you can display a calendar:

    + +$this->load->library('calendar');
    +
    +echo $this->calendar->generate();
    + +

    The above code will generate a calendar for the current month/year based on your server time. +To show a calendar for a specific month and year you will pass this information to the calendar generating function:

    + +$this->load->library('calendar');
    +
    +echo $this->calendar->generate(2006, 6);
    + +

    The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

    + +

    Passing Data to your Calendar Cells

    + +

    To add data to your calendar cells involves creating an associative array in which the keys correspond to the days +you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar +generating function. Consider this example:

    + +$this->load->library('calendar');
    +
    +$data = array(
    +               3  => 'http://example.com/news/article/2006/03/',
    +               7  => 'http://example.com/news/article/2006/07/',
    +               13 => 'http://example.com/news/article/2006/13/',
    +               26 => 'http://example.com/news/article/2006/26/'
    +             );
    +
    +echo $this->calendar->generate(2006, 6, $data);
    + +

    Using the above example, day numbers 3, 7, 13, and 26 will become links pointing to the URLs you've provided.

    + +

    Note: By default it is assumed that your array will contain links. +In the section that explains the calendar template below you'll see how you can customize +how data passed to your cells is handled so you can pass different types of information.

    + + +

    Setting Display Preferences

    + +

    There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an +array of preferences in the second parameter of the loading function. Here is an example:

    + + + +$prefs = array (
    +               'start_day'    => 'saturday',
    +               'month_type'   => 'long',
    +               'day_type'     => 'short'
    +             );
    +
    +$this->load->library('calendar', $prefs);
    +
    +echo $this->calendar->generate();
    + +

    The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information +regarding preferences below.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    templateNoneNoneA string containing your calendar template. See the template section below.
    local_timetime()NoneA Unix timestamp corresponding to the current time.
    start_daysundayAny week day (sunday, monday, tuesday, etc.)Sets the day of the week the calendar should start on.
    month_typelonglong, shortDetermines what version of the month name to use in the header. long = January, short = Jan.
    day_typeabrlong, short, abrDetermines what version of the weekday names to use in the column headers. long = Sunday, short = Sun, abr = Su.
    show_next_prevFALSETRUE/FALSE (boolean)Determines whether to display links allowing you to toggle to next/previous months. See information on this feature below.
    next_prev_urlNoneA URLSets the basepath used in the next/previous calendar links.
    + + + +

    Showing Next/Previous Month Links

    + +

    To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar +code similar to this example:

    + + +$prefs = array (
    +               'show_next_prev'  => TRUE,
    +               'next_prev_url'   => 'http://example.com/index.php/calendar/show/'
    +             );
    +
    +$this->load->library('calendar', $prefs);
    +
    +echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
    + +

    You'll notice a few things about the above example:

    + +
      +
    • You must set the "show_next_prev" to TRUE.
    • +
    • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
    • +
    • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
    • +
    + + + +

    Creating a Calendar Template

    + +

    By creating a calendar template you have 100% control over the design of your calendar. Each component of your +calendar will be placed within a pair of pseudo-variables as shown here:

    + + + +$prefs['template'] = '

    +   {table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}
    +
    +   {heading_row_start}<tr>{/heading_row_start}
    +
    +   {heading_previous_cell}<th><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell}
    +   {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}
    +   {heading_next_cell}<th><a href="{next_url}">&gt;&gt;</a></th>{/heading_next_cell}
    +
    +   {heading_row_end}</tr>{/heading_row_end}
    +
    +   {week_row_start}<tr>{/week_row_start}
    +   {week_day_cell}<td>{week_day}</td>{/week_day_cell}
    +   {week_row_end}</tr>{/week_row_end}
    +
    +   {cal_row_start}<tr>{/cal_row_start}
    +   {cal_cell_start}<td>{/cal_cell_start}
    +
    +   {cal_cell_content}<a href="{content}">{day}</a>{/cal_cell_content}
    +   {cal_cell_content_today}<div class="highlight"><a href="{content}">{day}</a></div>{/cal_cell_content_today}
    +
    +   {cal_cell_no_content}{day}{/cal_cell_no_content}
    +   {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
    +
    +   {cal_cell_blank}&nbsp;{/cal_cell_blank}
    +
    +   {cal_cell_end}</td>{/cal_cell_end}
    +   {cal_row_end}</tr>{/cal_row_end}
    +
    +   {table_close}</table>{/table_close}
    +';
    +
    +$this->load->library('calendar', $prefs);
    +
    +echo $this->calendar->generate();
    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 41a89566..8bc0a905 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -1,181 +1,181 @@ - - - - - -Config Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Config Class

    - -

    The Config class provides a means to retrieve configuration preferences. These preferences can -come from the default config file (application/config/config.php) or from your own custom config files.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - - -

    Anatomy of a Config File

    - -

    By default, CodeIgniter has a one primary config file, located at application/config/config.php. If you open the file using -your text editor you'll see that config items are stored in an array called $config.

    - -

    You can add your own config items to -this file, or if you prefer to keep your configuration items separate (assuming you even need config items), -simply create your own file and save it in config folder.

    - -

    Note: If you do create your own config files use the same format as the primary one, storing your items in -an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though -the array has the same name (assuming an array index is not named the same as another).

    - -

    Loading a Config File

    - -

    Note: CodeIgniter automatically loads the primary config file (application/config/config.php), -so you will only need to load a config file if you have created your own.

    - -

    There are two ways to load a config file:

    - -
    1. Manual Loading - -

      To load one of your custom config files you will use the following function within the controller that needs it:

      - -$this->config->load('filename'); - -

      Where filename is the name of your config file, without the .php file extension.

      - -

      If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if -you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE -and each config file will be stored in an array index corresponding to the name of the config file. Example:

      - - -// Stored in an array with this prototype: $this->config['blog_settings'] = $config
      -$this->config->load('blog_settings', TRUE);
      - -

      Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

      - -

      The third parameter allows you to suppress errors in the event that a config file does not exist:

      - -$this->config->load('blog_settings', FALSE, TRUE); - -
    2. -
    3. Auto-loading - -

      If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, -open the autoload.php file, located at application/config/autoload.php, and add your config file as -indicated in the file.

      -
    4. -
    - - -

    Fetching Config Items

    - -

    To retrieve an item from your config file, use the following function:

    - -$this->config->item('item name'); - -

    Where item name is the $config array index you want to retrieve. For example, to fetch your language choice you'll do this:

    - -$lang = $this->config->item('language'); - -

    The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

    - -

    If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index -you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    - - -// Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
    -$this->config->load('blog_settings', TRUE);

    - -// Retrieve a config item named site_name contained within the blog_settings array
    -$site_name = $this->config->item('site_name', 'blog_settings');

    - -// An alternate way to specify the same item:
    -$blog_config = $this->config->item('blog_settings');
    -$site_name = $blog_config['site_name'];
    - -

    Setting a Config Item

    - -

    If you would like to dynamically set a config item or change an existing one, you can so using:

    - -$this->config->set_item('item_name', 'item_value'); - -

    Where item_name is the $config array index you want to change, and item_value is its value.

    - - -

    Helper Functions

    - -

    The config class has the following helper functions:

    - -

    $this->config->site_url();

    -

    This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

    - -

    $this->config->system_url();

    -

    This function retrieves the URL to your system folder.

    - - -
    - - - - - - + + + + + +Config Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Config Class

    + +

    The Config class provides a means to retrieve configuration preferences. These preferences can +come from the default config file (application/config/config.php) or from your own custom config files.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + + +

    Anatomy of a Config File

    + +

    By default, CodeIgniter has a one primary config file, located at application/config/config.php. If you open the file using +your text editor you'll see that config items are stored in an array called $config.

    + +

    You can add your own config items to +this file, or if you prefer to keep your configuration items separate (assuming you even need config items), +simply create your own file and save it in config folder.

    + +

    Note: If you do create your own config files use the same format as the primary one, storing your items in +an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though +the array has the same name (assuming an array index is not named the same as another).

    + +

    Loading a Config File

    + +

    Note: CodeIgniter automatically loads the primary config file (application/config/config.php), +so you will only need to load a config file if you have created your own.

    + +

    There are two ways to load a config file:

    + +
    1. Manual Loading + +

      To load one of your custom config files you will use the following function within the controller that needs it:

      + +$this->config->load('filename'); + +

      Where filename is the name of your config file, without the .php file extension.

      + +

      If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if +you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE +and each config file will be stored in an array index corresponding to the name of the config file. Example:

      + + +// Stored in an array with this prototype: $this->config['blog_settings'] = $config
      +$this->config->load('blog_settings', TRUE);
      + +

      Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

      + +

      The third parameter allows you to suppress errors in the event that a config file does not exist:

      + +$this->config->load('blog_settings', FALSE, TRUE); + +
    2. +
    3. Auto-loading + +

      If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, +open the autoload.php file, located at application/config/autoload.php, and add your config file as +indicated in the file.

      +
    4. +
    + + +

    Fetching Config Items

    + +

    To retrieve an item from your config file, use the following function:

    + +$this->config->item('item name'); + +

    Where item name is the $config array index you want to retrieve. For example, to fetch your language choice you'll do this:

    + +$lang = $this->config->item('language'); + +

    The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

    + +

    If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    + + +// Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
    +$this->config->load('blog_settings', TRUE);

    + +// Retrieve a config item named site_name contained within the blog_settings array
    +$site_name = $this->config->item('site_name', 'blog_settings');

    + +// An alternate way to specify the same item:
    +$blog_config = $this->config->item('blog_settings');
    +$site_name = $blog_config['site_name'];
    + +

    Setting a Config Item

    + +

    If you would like to dynamically set a config item or change an existing one, you can so using:

    + +$this->config->set_item('item_name', 'item_value'); + +

    Where item_name is the $config array index you want to change, and item_value is its value.

    + + +

    Helper Functions

    + +

    The config class has the following helper functions:

    + +

    $this->config->site_url();

    +

    This function retrieves the URL to your site, along with the "index" value you've specified in the config file.

    + +

    $this->config->system_url();

    +

    This function retrieves the URL to your system folder.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 64f56aca..22643ef1 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -1,307 +1,307 @@ - - - - - -Email Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Email Class

    - -

    CodeIgniter's robust Email Class supports the following features:

    - - -
      -
    • Multiple Protocols: Mail, Sendmail, and SMTP
    • -
    • Multiple recipients
    • -
    • CC and BCCs
    • -
    • HTML or Plaintext email
    • -
    • Attachments
    • -
    • Word wrapping
    • -
    • Priorities
    • -
    • BCC Batch Mode, enabling large email lists to be broken into small BCC batches.
    • -
    • Email Debugging tools
    • -
    - - -

    Sending Email

    - -

    Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

    - -

    Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your -controllers.

    - -$this->load->library('email');
    -
    -$this->email->from('your@example.com', 'Your Name');
    -$this->email->to('someone@example.com');
    -$this->email->cc('another@another-example.com');
    -$this->email->bcc('them@their-example.com');
    -
    -$this->email->subject('Email Test');
    -$this->email->message('Testing the email class.');
    -
    -$this->email->send();
    -
    -echo $this->email->print_debugger();
    - - - - -

    Setting Email Preferences

    - -

    There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually -as described here, or automatically via preferences stored in your config file, described below:

    - -

    Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

    - -$config['protocol'] = 'sendmail';
    -$config['mailpath'] = '/usr/sbin/sendmail';
    -$config['charset'] = 'iso-8859-1';
    -$config['wordwrap'] = TRUE;
    -
    -$this->email->initialize($config);
    - -

    Note: Most of the preferences have default values that will be used if you do not set them.

    Setting Email Preferences in a Config File

    - -

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the email.php, add the $config -array in that file. Then save the file at config/email.php and it will be used automatically. You -will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

    - - - - -

    Email Preferences

    - -

    The following is a list of all the preferences that can be set when sending email.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    useragentCodeIgniterNoneThe "user agent".
    protocolmailmail, sendmail, or smtpThe mail sending protocol.
    mailpath/usr/sbin/sendmailNoneThe server path to Sendmail.
    smtp_hostNo DefaultNoneSMTP Server Address.
    smtp_userNo DefaultNoneSMTP Username.
    smtp_passNo DefaultNoneSMTP Password.
    smtp_port25NoneSMTP Port.
    smtp_timeout5NoneSMTP Timeout (in seconds).
    wordwrapTRUETRUE or FALSE (boolean)Enable word-wrap.
    wrapchars76 Character count to wrap at.
    mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
    charsetutf-8Character set (utf-8, iso-8859-1, etc.).
    validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
    priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
    crlf\n"\r\n" or "\n" or "\r"Newline character. (Use "\r\n" to comply with RFC 822).
    newline\n"\r\n" or "\n" or "\r"Newline character. (Use "\r\n" to comply with RFC 822).
    bcc_batch_modeFALSETRUE or FALSE (boolean)Enable BCC Batch Mode.
    bcc_batch_size200NoneNumber of emails in each BCC batch.
    - - -

    Email Function Reference

    - -

    $this->email->from()

    -

    Sets the email address and name of the person sending the email:

    -$this->email->from('you@example.com', 'Your Name'); - -

    $this->email->reply_to()

    -

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    -$this->email->reply_to('you@example.com', 'Your Name'); - - -

    $this->email->to()

    -

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    - -$this->email->to('someone@example.com'); -$this->email->to('one@example.com, two@example.com, three@example.com'); - -$list = array('one@example.com', 'two@example.com', 'three@example.com');
    -
    -$this->email->to($list);
    - -

    $this->email->cc()

    -

    Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    - -

    $this->email->bcc()

    -

    Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    - - -

    $this->email->subject()

    -

    Sets the email subject:

    -$this->email->subject('This is my subject'); - -

    $this->email->message()

    -

    Sets the email message body:

    -$this->email->message('This is my message'); - -

    $this->email->set_alt_message()

    -

    Sets the alternative email message body:

    -$this->email->set_alt_message('This is the alternative message'); - -

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative -message with no HTML formatting which is added to the header string for people who do not accept HTML email. -If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

    - - - -

    $this->email->clear()

    -

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function -in a loop, permitting the data to be reset between cycles.

    -foreach ($list as $name => $address)
    -{
    -    $this->email->clear();

    - -    $this->email->to($address);
    -    $this->email->from('your@example.com');
    -    $this->email->subject('Here is your info '.$name);
    -    $this->email->message('Hi '.$name.' Here is the info you requested.');
    -    $this->email->send();
    -}
    - -

    If you set the parameter to TRUE any attachments will be cleared as well:

    - -$this->email->clear(TRUE); - - -

    $this->email->send()

    -

    The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used -conditionally:

    - -if ( ! $this->email->send())
    -{
    -    // Generate error
    -}
    - - -

    $this->email->attach()

    -

    Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. -For multiple attachments use the function multiple times. For example:

    - -$this->email->attach('/path/to/photo1.jpg');
    -$this->email->attach('/path/to/photo2.jpg');
    -$this->email->attach('/path/to/photo3.jpg');
    -
    -$this->email->send();
    - - -

    $this->email->print_debugger()

    -

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    - - -

    Overriding Word Wrapping

    - -

    If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can -get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override -word wrapping within part of your message like this:

    - -The text of your email that
    -gets wrapped normally.
    -
    -{unwrap}http://example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
    -
    -More text that will be
    -wrapped normally.
    - -

    Place the item you do not want word-wrapped between: {unwrap} {/unwrap}

    - - -
    - - - - - - + + + + + +Email Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Email Class

    + +

    CodeIgniter's robust Email Class supports the following features:

    + + +
      +
    • Multiple Protocols: Mail, Sendmail, and SMTP
    • +
    • Multiple recipients
    • +
    • CC and BCCs
    • +
    • HTML or Plaintext email
    • +
    • Attachments
    • +
    • Word wrapping
    • +
    • Priorities
    • +
    • BCC Batch Mode, enabling large email lists to be broken into small BCC batches.
    • +
    • Email Debugging tools
    • +
    + + +

    Sending Email

    + +

    Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

    + +

    Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your +controllers.

    + +$this->load->library('email');
    +
    +$this->email->from('your@example.com', 'Your Name');
    +$this->email->to('someone@example.com');
    +$this->email->cc('another@another-example.com');
    +$this->email->bcc('them@their-example.com');
    +
    +$this->email->subject('Email Test');
    +$this->email->message('Testing the email class.');
    +
    +$this->email->send();
    +
    +echo $this->email->print_debugger();
    + + + + +

    Setting Email Preferences

    + +

    There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually +as described here, or automatically via preferences stored in your config file, described below:

    + +

    Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

    + +$config['protocol'] = 'sendmail';
    +$config['mailpath'] = '/usr/sbin/sendmail';
    +$config['charset'] = 'iso-8859-1';
    +$config['wordwrap'] = TRUE;
    +
    +$this->email->initialize($config);
    + +

    Note: Most of the preferences have default values that will be used if you do not set them.

    Setting Email Preferences in a Config File

    + +

    If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the email.php, add the $config +array in that file. Then save the file at config/email.php and it will be used automatically. You +will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

    + + + + +

    Email Preferences

    + +

    The following is a list of all the preferences that can be set when sending email.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    useragentCodeIgniterNoneThe "user agent".
    protocolmailmail, sendmail, or smtpThe mail sending protocol.
    mailpath/usr/sbin/sendmailNoneThe server path to Sendmail.
    smtp_hostNo DefaultNoneSMTP Server Address.
    smtp_userNo DefaultNoneSMTP Username.
    smtp_passNo DefaultNoneSMTP Password.
    smtp_port25NoneSMTP Port.
    smtp_timeout5NoneSMTP Timeout (in seconds).
    wordwrapTRUETRUE or FALSE (boolean)Enable word-wrap.
    wrapchars76 Character count to wrap at.
    mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
    charsetutf-8Character set (utf-8, iso-8859-1, etc.).
    validateFALSETRUE or FALSE (boolean)Whether to validate the email address.
    priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal.
    crlf\n"\r\n" or "\n" or "\r"Newline character. (Use "\r\n" to comply with RFC 822).
    newline\n"\r\n" or "\n" or "\r"Newline character. (Use "\r\n" to comply with RFC 822).
    bcc_batch_modeFALSETRUE or FALSE (boolean)Enable BCC Batch Mode.
    bcc_batch_size200NoneNumber of emails in each BCC batch.
    + + +

    Email Function Reference

    + +

    $this->email->from()

    +

    Sets the email address and name of the person sending the email:

    +$this->email->from('you@example.com', 'Your Name'); + +

    $this->email->reply_to()

    +

    Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

    +$this->email->reply_to('you@example.com', 'Your Name'); + + +

    $this->email->to()

    +

    Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

    + +$this->email->to('someone@example.com'); +$this->email->to('one@example.com, two@example.com, three@example.com'); + +$list = array('one@example.com', 'two@example.com', 'three@example.com');
    +
    +$this->email->to($list);
    + +

    $this->email->cc()

    +

    Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    + +

    $this->email->bcc()

    +

    Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.

    + + +

    $this->email->subject()

    +

    Sets the email subject:

    +$this->email->subject('This is my subject'); + +

    $this->email->message()

    +

    Sets the email message body:

    +$this->email->message('This is my message'); + +

    $this->email->set_alt_message()

    +

    Sets the alternative email message body:

    +$this->email->set_alt_message('This is the alternative message'); + +

    This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative +message with no HTML formatting which is added to the header string for people who do not accept HTML email. +If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

    + + + +

    $this->email->clear()

    +

    Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function +in a loop, permitting the data to be reset between cycles.

    +foreach ($list as $name => $address)
    +{
    +    $this->email->clear();

    + +    $this->email->to($address);
    +    $this->email->from('your@example.com');
    +    $this->email->subject('Here is your info '.$name);
    +    $this->email->message('Hi '.$name.' Here is the info you requested.');
    +    $this->email->send();
    +}
    + +

    If you set the parameter to TRUE any attachments will be cleared as well:

    + +$this->email->clear(TRUE); + + +

    $this->email->send()

    +

    The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used +conditionally:

    + +if ( ! $this->email->send())
    +{
    +    // Generate error
    +}
    + + +

    $this->email->attach()

    +

    Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. +For multiple attachments use the function multiple times. For example:

    + +$this->email->attach('/path/to/photo1.jpg');
    +$this->email->attach('/path/to/photo2.jpg');
    +$this->email->attach('/path/to/photo3.jpg');
    +
    +$this->email->send();
    + + +

    $this->email->print_debugger()

    +

    Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

    + + +

    Overriding Word Wrapping

    + +

    If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can +get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override +word wrapping within part of your message like this:

    + +The text of your email that
    +gets wrapped normally.
    +
    +{unwrap}http://example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
    +
    +More text that will be
    +wrapped normally.
    + +

    Place the item you do not want word-wrapped between: {unwrap} {/unwrap}

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 092dad2a..a0733ab1 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -1,182 +1,182 @@ - - - - - -Encryption Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Encryption Class

    - -

    The Encryption Class provides two-way data encryption. It uses a scheme that pre-compiles -the message using a randomly hashed bitwise XOR encoding scheme, which is then encrypted using -the Mcrypt library. If Mcrypt is not available on your server the encoded message will -still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. -If Mcrypt is available, you'll effectively end up with a double-encrypted message string, which should -provide a very high degree of security.

    - - -

    Setting your Key

    - -

    A key is a piece of information that controls the cryptographic process and permits an encrypted string to be decoded. -In fact, the key you chose will provide the only means to decode data that was encrypted with that key, -so not only must you choose the key carefully, you must never change it if you intend use it for persistent data.

    - -

    It goes without saying that you should guard your key carefully. -Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control -it's impossible to ensure key security so you may want to think carefully before using it for anything -that requires high security, like storing credit card numbers.

    - -

    To take maximum advantage of the encryption algorithm, your key should be 32 characters in length (128 bits). -The key should be as random a string as you can concoct, with numbers and uppercase and lowercase letters. -Your key should not be a simple text string. In order to be cryptographically secure it -needs to be as random as possible.

    - -

    Your key can be either stored in your application/config/config.php, or you can design your own -storage mechanism and pass the key dynamically when encoding/decoding.

    - -

    To save your key to your application/config/config.php, open the file and set:

    -$config['encryption_key'] = "YOUR KEY"; - - -

    Message Length

    - -

    It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original -message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up -with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in -64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, -for example, can only hold 4K of information.

    - - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Encryption class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('encrypt'); -

    Once loaded, the Encrypt library object will be available using: $this->encrypt

    - - -

    $this->encrypt->encode()

    - -

    Performs the data encryption and returns it as a string. Example:

    - -$msg = 'My secret message';
    -
    -$encrypted_string = $this->encrypt->encode($msg);
    - -

    You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file:

    - - -$msg = 'My secret message';
    -$key = 'super-secret-key';
    -
    -$encrypted_string = $this->encrypt->encode($msg, $key);
    - - -

    $this->encrypt->decode()

    - -

    Decrypts an encoded string. Example:

    - - -$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
    -
    -$plaintext_string = $this->encrypt->decode($encrypted_string);
    - - -

    $this->encrypt->set_cipher();

    - -

    Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

    -$this->encrypt->set_cipher(MCRYPT_BLOWFISH); -

    Please visit php.net for a list of available ciphers.

    - -

    If you'd like to manually test whether your server supports Mcrypt you can use:

    -echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; - - -

    $this->encrypt->set_mode();

    - -

    Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example:

    -$this->encrypt->set_mode(MCRYPT_MODE_CFB); -

    Please visit php.net for a list of available modes.

    - - -

    $this->encrypt->sha1();

    -

    SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

    -$hash = $this->encrypt->sha1('Some string'); - -

    Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native -function:

    - -$hash = sha1('Some string'); - -

    If your server does not support SHA1 you can use the provided function.

    - - - -
    - - - - - - + + + + + +Encryption Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Encryption Class

    + +

    The Encryption Class provides two-way data encryption. It uses a scheme that pre-compiles +the message using a randomly hashed bitwise XOR encoding scheme, which is then encrypted using +the Mcrypt library. If Mcrypt is not available on your server the encoded message will +still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. +If Mcrypt is available, you'll effectively end up with a double-encrypted message string, which should +provide a very high degree of security.

    + + +

    Setting your Key

    + +

    A key is a piece of information that controls the cryptographic process and permits an encrypted string to be decoded. +In fact, the key you chose will provide the only means to decode data that was encrypted with that key, +so not only must you choose the key carefully, you must never change it if you intend use it for persistent data.

    + +

    It goes without saying that you should guard your key carefully. +Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control +it's impossible to ensure key security so you may want to think carefully before using it for anything +that requires high security, like storing credit card numbers.

    + +

    To take maximum advantage of the encryption algorithm, your key should be 32 characters in length (128 bits). +The key should be as random a string as you can concoct, with numbers and uppercase and lowercase letters. +Your key should not be a simple text string. In order to be cryptographically secure it +needs to be as random as possible.

    + +

    Your key can be either stored in your application/config/config.php, or you can design your own +storage mechanism and pass the key dynamically when encoding/decoding.

    + +

    To save your key to your application/config/config.php, open the file and set:

    +$config['encryption_key'] = "YOUR KEY"; + + +

    Message Length

    + +

    It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original +message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up +with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in +64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, +for example, can only hold 4K of information.

    + + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Encryption class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('encrypt'); +

    Once loaded, the Encrypt library object will be available using: $this->encrypt

    + + +

    $this->encrypt->encode()

    + +

    Performs the data encryption and returns it as a string. Example:

    + +$msg = 'My secret message';
    +
    +$encrypted_string = $this->encrypt->encode($msg);
    + +

    You can optionally pass your encryption key via the second parameter if you don't want to use the one in your config file:

    + + +$msg = 'My secret message';
    +$key = 'super-secret-key';
    +
    +$encrypted_string = $this->encrypt->encode($msg, $key);
    + + +

    $this->encrypt->decode()

    + +

    Decrypts an encoded string. Example:

    + + +$encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
    +
    +$plaintext_string = $this->encrypt->decode($encrypted_string);
    + + +

    $this->encrypt->set_cipher();

    + +

    Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

    +$this->encrypt->set_cipher(MCRYPT_BLOWFISH); +

    Please visit php.net for a list of available ciphers.

    + +

    If you'd like to manually test whether your server supports Mcrypt you can use:

    +echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; + + +

    $this->encrypt->set_mode();

    + +

    Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example:

    +$this->encrypt->set_mode(MCRYPT_MODE_CFB); +

    Please visit php.net for a list of available modes.

    + + +

    $this->encrypt->sha1();

    +

    SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

    +$hash = $this->encrypt->sha1('Some string'); + +

    Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native +function:

    + +$hash = sha1('Some string'); + +

    If your server does not support SHA1 you can use the provided function.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index fb976975..a840c1ec 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -1,438 +1,438 @@ - - - - - -File Uploading Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    File Uploading Class

    - -

    CodeIgniter's File Uploading Class permits files to be uploaded. You can set various -preferences, restricting the type and size of the files.

    - - -

    The Process

    - -

    Uploading a file involves the following general process:

    - - -
      -
    • An upload form is displayed, allowing a user to select a file and upload it.
    • -
    • When the form is submitted, the file is uploaded to the destination you specify.
    • -
    • Along the way, the file is validated to make sure it is allowed to be uploaded based on the preferences you set.
    • -
    • Once uploaded, the user will be shown a success message.
    • -
    - -

    To demonstrate this process here is brief tutorial. Afterward you'll find reference information.

    - -

    Creating the Upload Form

    - - - -

    Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - -

    You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper -creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event -the user does something wrong.

    - - -

    The Success Page

    - -

    Using a text editor, create a form called upload_success.php. -In it, place this code and save it to your applications/views/ folder:

    - - - - -

    The Controller

    - -

    Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ -folder:

    - - - - - -

    The Upload Folder

    - -

    You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called -uploads and set its file permissions to 777.

    - - -

    Try it!

    - -

    To try your form, visit your site using a URL similar to this one:

    - -example.com/index.php/upload/ - -

    You should see an upload form. Try uploading an image file (either a jpg, gif, or png). If the path in your -controller is correct it should work.

    - - -

     

    - -

    Reference Guide

    - - -

    Initializing the Upload Class

    - -

    Like most other classes in CodeIgniter, the Upload class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('upload'); -

    Once the Upload class is loaded, the object will be available using: $this->upload

    - - -

    Setting Preferences

    - -

    Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you -built above you set the following preferences:

    - -$config['upload_path'] = './uploads/';
    -$config['allowed_types'] = 'gif|jpg|png';
    -$config['max_size'] = '100';
    -$config['max_width'] = '1024';
    -$config['max_height'] = '768';
    -
    -$this->load->library('upload', $config);

    - -// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
    -$this->upload->initialize($config);
    - -

    The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

    - - -

    Preferences

    - -

    The following preferences are available. The default value indicates what will be used if you do not specify that preference.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    upload_pathNoneNoneThe path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.
    allowed_typesNoneNoneThe mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.
    overwriteFALSETRUE/FALSE (boolean)If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten. If set to false, a number will be appended to the filename if another with the same name exists.
    max_size0NoneThe maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.
    max_width0NoneThe maximum width (in pixels) that the file can be. Set to zero for no limit.
    max_height0NoneThe maximum height (in pixels) that the file can be. Set to zero for no limit.
    max_filename0NoneThe maximum length that a file name can be. Set to zero for no limit.
    encrypt_nameFALSETRUE/FALSE (boolean)If set to TRUE the file name will be converted to a random encrypted string. This can be useful if you would like the file saved with a name that can not be discerned by the person uploading it.
    remove_spacesTRUETRUE/FALSE (boolean)If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended.
    - - -

    Setting preferences in a config file

    - -

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the upload.php, add the $config -array in that file. Then save the file in: config/upload.php and it will be used automatically. You -will NOT need to use the $this->upload->initialize function if you save your preferences in a config file.

    - - -

    Function Reference

    - -

    The following functions are available

    - - -

    $this->upload->do_upload()

    - -

    Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field -called userfile, and the form must be a "multipart type:

    - -<form method="post" action="some_action" enctype="multipart/form-data" /> - -

    If you would like to set your own field name simply pass its value to the do_upload function:

    - - -$field_name = "some_field_name";
    -$this->upload->do_upload($field_name)
    - - -

    $this->upload->display_errors()

    - -

    Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it -returns the data so you can assign it however you need.

    - -

    Formatting Errors

    -

    By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

    - -$this->upload->display_errors('<p>', '</p>'); - -

    $this->upload->data()

    - -

    This is a helper function that returns an array containing all of the data related to the file you uploaded. -Here is the array prototype:

    - -Array
    -(
    -    [file_name]    => mypic.jpg
    -    [file_type]    => image/jpeg
    -    [file_path]    => /path/to/your/upload/
    -    [full_path]    => /path/to/your/upload/jpg.jpg
    -    [raw_name]     => mypic
    -    [orig_name]    => mypic.jpg
    -    [file_ext]     => .jpg
    -    [file_size]    => 22.2
    -    [is_image]     => 1
    -    [image_width]  => 800
    -    [image_height] => 600
    -    [image_type]   => jpeg
    -    [image_size_str] => width="800" height="200"
    -)
    - -

    Explanation

    - -

    Here is an explanation of the above array items.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ItemDescription
    file_nameThe name of the file that was uploaded including the file extension.
    file_typeThe file's Mime type
    file_pathThe absolute server path to the file
    full_pathThe absolute server path including the file name
    raw_nameThe file name without the extension
    orig_nameThe original file name. This is only useful if you use the encrypted name option.
    file_extThe file extension with period
    file_sizeThe file size in kilobytes
    is_imageWhether the file is an image or not. 1 = image. 0 = not.
    image_widthImage width.
    image_heigthImage height
    image_typeImage type. Typically the file extension without the period.
    image_size_strA string containing the width and height. Useful to put into an image tag.
    - -
    - - - - - - + + + + + +File Uploading Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    File Uploading Class

    + +

    CodeIgniter's File Uploading Class permits files to be uploaded. You can set various +preferences, restricting the type and size of the files.

    + + +

    The Process

    + +

    Uploading a file involves the following general process:

    + + +
      +
    • An upload form is displayed, allowing a user to select a file and upload it.
    • +
    • When the form is submitted, the file is uploaded to the destination you specify.
    • +
    • Along the way, the file is validated to make sure it is allowed to be uploaded based on the preferences you set.
    • +
    • Once uploaded, the user will be shown a success message.
    • +
    + +

    To demonstrate this process here is brief tutorial. Afterward you'll find reference information.

    + +

    Creating the Upload Form

    + + + +

    Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ +folder:

    + + + + +

    You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper +creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event +the user does something wrong.

    + + +

    The Success Page

    + +

    Using a text editor, create a form called upload_success.php. +In it, place this code and save it to your applications/views/ folder:

    + + + + +

    The Controller

    + +

    Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ +folder:

    + + + + + +

    The Upload Folder

    + +

    You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called +uploads and set its file permissions to 777.

    + + +

    Try it!

    + +

    To try your form, visit your site using a URL similar to this one:

    + +example.com/index.php/upload/ + +

    You should see an upload form. Try uploading an image file (either a jpg, gif, or png). If the path in your +controller is correct it should work.

    + + +

     

    + +

    Reference Guide

    + + +

    Initializing the Upload Class

    + +

    Like most other classes in CodeIgniter, the Upload class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('upload'); +

    Once the Upload class is loaded, the object will be available using: $this->upload

    + + +

    Setting Preferences

    + +

    Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you +built above you set the following preferences:

    + +$config['upload_path'] = './uploads/';
    +$config['allowed_types'] = 'gif|jpg|png';
    +$config['max_size'] = '100';
    +$config['max_width'] = '1024';
    +$config['max_height'] = '768';
    +
    +$this->load->library('upload', $config);

    + +// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
    +$this->upload->initialize($config);
    + +

    The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

    + + +

    Preferences

    + +

    The following preferences are available. The default value indicates what will be used if you do not specify that preference.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    upload_pathNoneNoneThe path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.
    allowed_typesNoneNoneThe mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.
    overwriteFALSETRUE/FALSE (boolean)If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten. If set to false, a number will be appended to the filename if another with the same name exists.
    max_size0NoneThe maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.
    max_width0NoneThe maximum width (in pixels) that the file can be. Set to zero for no limit.
    max_height0NoneThe maximum height (in pixels) that the file can be. Set to zero for no limit.
    max_filename0NoneThe maximum length that a file name can be. Set to zero for no limit.
    encrypt_nameFALSETRUE/FALSE (boolean)If set to TRUE the file name will be converted to a random encrypted string. This can be useful if you would like the file saved with a name that can not be discerned by the person uploading it.
    remove_spacesTRUETRUE/FALSE (boolean)If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended.
    + + +

    Setting preferences in a config file

    + +

    If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called the upload.php, add the $config +array in that file. Then save the file in: config/upload.php and it will be used automatically. You +will NOT need to use the $this->upload->initialize function if you save your preferences in a config file.

    + + +

    Function Reference

    + +

    The following functions are available

    + + +

    $this->upload->do_upload()

    + +

    Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field +called userfile, and the form must be a "multipart type:

    + +<form method="post" action="some_action" enctype="multipart/form-data" /> + +

    If you would like to set your own field name simply pass its value to the do_upload function:

    + + +$field_name = "some_field_name";
    +$this->upload->do_upload($field_name)
    + + +

    $this->upload->display_errors()

    + +

    Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it +returns the data so you can assign it however you need.

    + +

    Formatting Errors

    +

    By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

    + +$this->upload->display_errors('<p>', '</p>'); + +

    $this->upload->data()

    + +

    This is a helper function that returns an array containing all of the data related to the file you uploaded. +Here is the array prototype:

    + +Array
    +(
    +    [file_name]    => mypic.jpg
    +    [file_type]    => image/jpeg
    +    [file_path]    => /path/to/your/upload/
    +    [full_path]    => /path/to/your/upload/jpg.jpg
    +    [raw_name]     => mypic
    +    [orig_name]    => mypic.jpg
    +    [file_ext]     => .jpg
    +    [file_size]    => 22.2
    +    [is_image]     => 1
    +    [image_width]  => 800
    +    [image_height] => 600
    +    [image_type]   => jpeg
    +    [image_size_str] => width="800" height="200"
    +)
    + +

    Explanation

    + +

    Here is an explanation of the above array items.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ItemDescription
    file_nameThe name of the file that was uploaded including the file extension.
    file_typeThe file's Mime type
    file_pathThe absolute server path to the file
    full_pathThe absolute server path including the file name
    raw_nameThe file name without the extension
    orig_nameThe original file name. This is only useful if you use the encrypted name option.
    file_extThe file extension with period
    file_sizeThe file size in kilobytes
    is_imageWhether the file is an image or not. 1 = image. 0 = not.
    image_widthImage width.
    image_heigthImage height
    image_typeImage type. Typically the file extension without the period.
    image_size_strA string containing the width and height. Useful to put into an image tag.
    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 63111919..684fe9b5 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1,1221 +1,1221 @@ - - - - - -Form Validation : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Form Validation

    - -

    CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you'll write.

    - -

    Note:  As of CodeIgniter 1.7.0, this Form Validation class supercedes the old Validation class, which is now deprecated. We -have left the old class in the library so applications currently using it will not break, but you are encouraged to migrate to this new version.

    - - - - - - - - -

     

    - - -

    Overview

    - - -

    Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

    - -
      -
    1. A form is displayed.
    2. -
    3. You fill it in and submit it.
    4. -
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data -along with an error message describing the problem.
    6. -
    7. This process continues until you have submitted a valid form.
    8. -
    - -

    On the receiving end, the script must:

    - -
      -
    1. Check for required data.
    2. -
    3. Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted -it must be validated to contain only permitted characters. It must be of a minimum length, -and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
    4. -
    5. Sanitize the data for security.
    6. -
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. -
    9. Prep the data for insertion in the database.
    10. -
    - - -

    Although there is nothing terribly complex about the above process, it usually requires a significant -amount of code, and to display error messages, various control structures are usually placed within the form HTML. -Form validation, while simple to create, is generally very messy and tedious to implement.

    - -

     

    - - - -

    Form Validation Tutorial

    - -

    What follows is a "hands on" tutorial for implementing CodeIgniters Form Validation.

    - - -

    In order to implement form validation you'll need three things:

    - -
      -
    1. A View file containing a form.
    2. -
    3. A View file containing a "success" message to be displayed upon successful submission.
    4. -
    5. A controller function to receive and process the submitted data.
    6. -
    - -

    Let's create those three things, using a member sign-up form as the example.

    - - - - - -

    The Form

    - -

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - - - - -

    The Success Page

    - - -

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - - - -

    The Controller

    - -

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ -folder:

    - - - - - -

    Try it!

    - -

    To try your form, visit your site using a URL similar to this one:

    - -example.com/index.php/form/ - -

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation -rules yet.

    - -

    Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() -function only returns TRUE if it has successfully applied your rules without any of them failing.

    - - -

    Explanation

    - -

    You'll notice several things about the above pages:

    - -

    The form (myform.php) is a standard web form with a couple exceptions:

    - -
      -
    1. It uses a form helper to create the form opening. -Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper -is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
    2. - -
    3. At the top of the form you'll notice the following function call: -<?php echo validation_errors(); ?> - -

      This function will return any error messages sent back by the validator. If there are no messages it returns an empty string.

      -
    4. -
    - -

    The controller (form.php) has one function: index(). This function initializes the validation class and -loads the form helper and URL helper used by your view files. It also runs -the validation routine. Based on -whether the validation was successful it either presents the form or the success page.

    - - - - - - -

    Setting Validation Rules

    - -

    CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data -at the same time. To set validation rules you will use the set_rules() function:

    - -$this->form_validation->set_rules(); - -

    The above function takes three parameters as input:

    - -
      -
    1. The field name - the exact name you've given the form field.
    2. -
    3. A "human" name for this field, which will be inserted into the error message. For example, if your field is named "user" you might give it a human name of "Username". Note: If you would like the field name to be stored in a language file, please see Translating Field Names.
    4. -
    5. The validation rules for this form field.
    6. -
    - - -


    Here is an example. In your controller (form.php), add this code just below the validation initialization function:

    - - -$this->form_validation->set_rules('username', 'Username', 'required');
    -$this->form_validation->set_rules('password', 'Password', 'required');
    -$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
    -$this->form_validation->set_rules('email', 'Email', 'required');
    -
    - -

    Your controller should now look like this:

    - - - -

    Now submit the form with the fields blank and you should see the error messages. -If you submit the form with all the fields populated you'll see your success page.

    - -

    Note: The form fields are not yet being re-populated with the data when -there is an error. We'll get to that shortly.

    - - - - - -

    Setting Rules Using an Array

    - -

    Before moving on it should be noted that the rule setting function can be passed an array if you prefer to set all your rules in one action. -If you use this approach you must name your array keys as indicated:

    - - -$config = array(
    -               array(
    -                     'field'   => 'username',
    -                     'label'   => 'Username',
    -                     'rules'   => 'required'
    -                  ),
    -               array(
    -                     'field'   => 'password',
    -                     'label'   => 'Password',
    -                     'rules'   => 'required'
    -                  ),
    -               array(
    -                     'field'   => 'passconf',
    -                     'label'   => 'Password Confirmation',
    -                     'rules'   => 'required'
    -                  ),   
    -               array(
    -                     'field'   => 'email',
    -                     'label'   => 'Email',
    -                     'rules'   => 'required'
    -                  )
    -            );
    -
    -$this->form_validation->set_rules($config); -
    - - - - - - - -

    Cascading Rules

    - -

    CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

    - - -$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
    -$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
    -$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
    -$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
    -
    - -

    The above code sets the following rules:

    - -
      -
    1. The username field be no shorter than 5 characters and no longer than 12.
    2. -
    3. The password field must match the password confirmation field.
    4. -
    5. The email field must contain a valid email address.
    6. -
    - -

    Give it a try! Submit your form without the proper data and you'll see new error messages that correspond to your new rules. -There are numerous rules available which you can read about in the validation reference.

    - - - - -

    Prepping Data

    - -

    In addition to the validation functions like the ones we used above, you can also prep your data in various ways. -For example, you can set up rules like this:

    - - -$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean');
    -$this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5');
    -$this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
    -$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
    -
    - - -

    In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through -the "xss_clean" function, which removes malicious data.

    - -

    Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, -trim, MD5, etc.

    - -

    Note: You will generally want to use the prepping functions after -the validation rules so if there is an error, the original data will be shown in the form.

    - - - - - -

    Re-populating the form

    - -

    Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions -that permit you to do this. The one you will use most commonly is:

    - -set_value('field name') - - -

    Open your myform.php view file and update the value in each field using the set_value() function:

    - -

    Don't forget to include each. field name in the set_value() functions!

    - - - - - -

    Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

    - -

    Note: The Function Reference section below contains functions that -permit you to re-populate <select> menus, radio buttons, and checkboxes.

    - - -

    Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

    - -<input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> - -

    For more info please see the Using Arrays as Field Names section below.

    - - - - - - -

    Callbacks: Your own Validation Functions

    - -

    The validation system supports callbacks to your own validation functions. This permits you to extend the validation class -to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can -create a callback function that does that. Let's create a example of this.

    - -

    In your controller, change the "username" rule to this:

    - -$this->form_validation->set_rules('username', 'Username', 'callback_username_check'); - - -

    Then add a new function called username_check to your controller. Here's how your controller should now look:

    - - - - -

    Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your -callback function for you to process.

    - -

    To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

    - -

    You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE -it is assumed that the data is your newly processed form data.

    - - - - - -

    Setting Error Messages

    - - -

    All of the native error messages are located in the following language file: language/english/form_validation_lang.php

    - -

    To set your own custom message you can either edit that file, or use the following function:

    - -$this->form_validation->set_message('rule', 'Error Message'); - -

    Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

    - -

    If you include %s in your error string, it will be replaced with the "human" name you used for your field when you set your rules.

    - -

    In the "callback" example above, the error message was set by passing the name of the function:

    - -$this->form_validation->set_message('username_check') - -

    You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

    - -$this->form_validation->set_message('required', 'Your custom message here'); - - - - -

    Translating Field Names

    - -

    If you would like to store the "human" name you passed to the set_rules() function in a language file, and therefore make the name able to be translated, here's how:

    - -

    First, prefix your "human" name with lang:, as in this example:

    - - -$this->form_validation->set_rules('first_name', 'lang:first_name', 'required');
    -
    - -

    Then, store the name in one of your language file arrays (without the prefix):

    - -$lang['first_name'] = 'First Name'; - -

    Note: If you store your array item in a language file that is not loaded automatically by CI, you'll need to remember to load it in your controller using:

    - -$this->lang->load('file_name'); - -

    See the Language Class page for more info regarding language files.

    - - - -

    Changing the Error Delimiters

    - -

    By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or -individually.

    - -
      - -
    1. Changing delimiters Globally - -

      To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:

      - -$this->form_validation->set_error_delimiters('<div class="error">', '</div>'); - -

      In this example, we've switched to using div tags.

      - -
    2. - -
    3. Changing delimiters Individually - -

      Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:

      - -<?php echo form_error('field name', '<div class="error">', '</div>'); ?> - -

      Or:

      - -<?php echo validation_errors('<div class="error">', '</div>'); ?> - -
    4. -
    - - - - - -

    Showing Errors Individually

    - -

    If you prefer to show an error message next to each form field, rather than as a list, you can use the form_error() function.

    - -

    Try it! Change your form so that it looks like this:

    - - - -

    If there are no errors, nothing will be shown. If there is an error, the message will appear.

    - -

    Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

    - -<?php echo form_error('options[size]'); ?>
    -<input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> -
    - -

    For more info please see the Using Arrays as Field Names section below.

    - - - - -

     

    - - - -

    Saving Sets of Validation Rules to a Config File

    - -

    A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You -can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or -you can manually call each set as needed.

    - -

    How to save your rules

    - -

    To store your validation rules, simply create a file named form_validation.php in your application/config/ folder. -In that file you will place an array named $config with your rules. As shown earlier, the validation array will have this prototype:

    - - -$config = array(
    -               array(
    -                     'field'   => 'username',
    -                     'label'   => 'Username',
    -                     'rules'   => 'required'
    -                  ),
    -               array(
    -                     'field'   => 'password',
    -                     'label'   => 'Password',
    -                     'rules'   => 'required'
    -                  ),
    -               array(
    -                     'field'   => 'passconf',
    -                     'label'   => 'Password Confirmation',
    -                     'rules'   => 'required'
    -                  ),   
    -               array(
    -                     'field'   => 'email',
    -                     'label'   => 'Email',
    -                     'rules'   => 'required'
    -                  )
    -            );
    -
    - -

    Your validation rule file will be loaded automatically and used when you call the run() function.

    - -

    Please note that you MUST name your array $config.

    - -

    Creating Sets of Rules

    - -

    In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. -We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

    - - -$config = array(
    -                 'signup' => array(
    -                                    array(
    -                                            'field' => 'username',
    -                                            'label' => 'Username',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'password',
    -                                            'label' => 'Password',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'passconf',
    -                                            'label' => 'PasswordConfirmation',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'email',
    -                                            'label' => 'Email',
    -                                            'rules' => 'required'
    -                                         )
    -                                    ),
    -                 'email' => array(
    -                                    array(
    -                                            'field' => 'emailaddress',
    -                                            'label' => 'EmailAddress',
    -                                            'rules' => 'required|valid_email'
    -                                         ),
    -                                    array(
    -                                            'field' => 'name',
    -                                            'label' => 'Name',
    -                                            'rules' => 'required|alpha'
    -                                         ),
    -                                    array(
    -                                            'field' => 'title',
    -                                            'label' => 'Title',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'message',
    -                                            'label' => 'MessageBody',
    -                                            'rules' => 'required'
    -                                         )
    -                                    )                          
    -               );
    -
    - - -

    Calling a Specific Rule Group

    - -

    In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

    - - -if ($this->form_validation->run('signup') == FALSE)
    -{
    -   $this->load->view('myform');
    -}
    -else
    -{
    -   $this->load->view('formsuccess');
    -}
    -
    - - - -

    Associating a Controller Function with a Rule Group

    - -

    An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you -have a controller named Member and a function named signup. Here's what your class might look like:

    - - -<?php

    -class Member extends Controller {
    -
    -   function signup()
    -   {      
    -      $this->load->library('form_validation');
    -            
    -      if ($this->form_validation->run() == FALSE)
    -      {
    -         $this->load->view('myform');
    -      }
    -      else
    -      {
    -         $this->load->view('formsuccess');
    -      }
    -   }
    -}
    -?>
    - -

    In your validation config file, you will name your rule group member/signup:

    - - -$config = array(
    -           'member/signup' = array(
    -                                    array(
    -                                            'field' => 'username',
    -                                            'label' => 'Username',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'password',
    -                                            'label' => 'Password',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'passconf',
    -                                            'label' => 'PasswordConfirmation',
    -                                            'rules' => 'required'
    -                                         ),
    -                                    array(
    -                                            'field' => 'email',
    -                                            'label' => 'Email',
    -                                            'rules' => 'required'
    -                                         )
    -                                    )
    -               );
    -
    - -

    When a rule group is named identically to a controller class/function it will be used automatically when the run() function is invoked from that class/function.

    - -

     

    - - - -

    Using Arrays as Field Names

    - -

    The Form Validation class supports the use of arrays as field names. Consider this example:

    - -<input type="text" name="options[]" value="" size="50" /> - -

    If you do use an array as a field name, you must use the EXACT array name in the Helper Functions that require the field name, -and as your Validation Rule field name.

    - -

    For example, to set a rule for the above field you would use:

    - -$this->form_validation->set_rules('options[]', 'Options', 'required'); - -

    Or, to show an error for the above field you would use:

    - -<?php echo form_error('options[]'); ?> - -

    Or to re-populate the field you would use:

    - -<input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> - -

    You can use multidimensional arrays as field names as well. For example:

    - -<input type="text" name="options[size]" value="" size="50" /> - -

    Or even:

    - -<input type="text" name="sports[nba][basketball]" value="" size="50" /> - -

    As with our first example, you must use the exact array name in the helper functions:

    - -<?php echo form_error('sports[nba][basketball]'); ?> - -

    If you are using checkboxes (or other fields) that have multiple options, don't forget to leave an empty bracket after each option, so that all selections will be added to the -POST array:

    - - -<input type="checkbox" name="options[]" value="red" />
    -<input type="checkbox" name="options[]" value="blue" />
    -<input type="checkbox" name="options[]" value="green" /> -
    - -

    Or if you use a multidimensional array:

    - - -<input type="checkbox" name="options[color][]" value="red" />
    -<input type="checkbox" name="options[color][]" value="blue" />
    -<input type="checkbox" name="options[color][]" value="green" /> -
    - -

    When you use a helper function you'll include the bracket as well:

    - -<?php echo form_error('options[color][]'); ?> - - - - -

     

    - - - -

    Rule Reference

    - -

    The following is a list of all the native rules that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    RuleParameterDescriptionExample
    requiredNoReturns FALSE if the form element is empty. 
    matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
    min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
    max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
    exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
    alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
    alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
    alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
    numericNoReturns FALSE if the form element contains anything other than numeric characters. 
    integerNoReturns FALSE if the form element contains anything other than an integer. 
    is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
    is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
    valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
    valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
    valid_ipNoReturns FALSE if the supplied IP is not valid. 
    valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
    - -

    Note: These rules can also be called as discrete functions. For example:

    - -$this->form_validation->required($string); - -

    Note: You can also use any native PHP functions that permit one parameter.

    - - - -

     

    - - -

    Prepping Reference

    - -

    The following is a list of all the prepping functions that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameParameterDescription
    xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
    prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
    prep_urlNoAdds "http://" to URLs if missing.
    strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
    encode_php_tagsNoConverts PHP tags to entities.
    - -

    Note: You can also use any native PHP functions that permit one parameter, -like trim, htmlspecialchars, urldecode, etc.

    - - - - - - - -

     

    - - -

    Function Reference

    - -

    The following functions are intended for use in your controller functions.

    - -

    $this->form_validation->set_rule();

    - -

    Permits you to set validation rules, as described in the tutorial sections above:

    - - - - -

    $this->form_validation->run();

    - -

    Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation -group via the function, as described in: Saving Groups of Validation Rules to a Config File.

    - - -

    $this->form_validation->set_message();

    - -

    Permits you to set custom error messages. See Setting Error Messages above.

    - - -

     

    - - -

    Helper Reference

    - -

    The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they -do not require you to prepend them with $this->form_validation.

    - -

    form_error()

    - -

    Shows an individual error message associated with the field name supplied to the function. Example:

    - -<?php echo form_error('username'); ?> - -

    The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

    - - - -

    validation_errors()

    -

    Shows all error messages as a string: Example:

    - -<?php echo validation_errors(); ?> - -

    The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

    - - - -

    set_value()

    - -

    Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. -The second (optional) parameter allows you to set a default value for the form. Example:

    - -<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> - -

    The above form will show "0" when loaded for the first time.

    - -

    set_select()

    - -

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter -must contain the name of the select menu, the second parameter must contain the value of -each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

    - -

    Example:

    - - -<select name="myselect">
    -<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    -<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    -<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    -</select> -
    - - -

    set_checkbox()

    - -

    Permits you to display a checkbox in the state it was submitted. The first parameter -must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

    - -<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
    -<input type="checkbox" name="mycheck[]" value="2" <?php echo set_checkbox('mycheck[]', '2'); ?> />
    - - -

    set_radio()

    - -

    Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

    - -<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    -<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    - - - -
    - - - - - - + + + + + +Form Validation : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Form Validation

    + +

    CodeIgniter provides a comprehensive form validation and data prepping class that helps minimize the amount of code you'll write.

    + +

    Note:  As of CodeIgniter 1.7.0, this Form Validation class supercedes the old Validation class, which is now deprecated. We +have left the old class in the library so applications currently using it will not break, but you are encouraged to migrate to this new version.

    + + + + + + + + +

     

    + + +

    Overview

    + + +

    Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

    + +
      +
    1. A form is displayed.
    2. +
    3. You fill it in and submit it.
    4. +
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data +along with an error message describing the problem.
    6. +
    7. This process continues until you have submitted a valid form.
    8. +
    + +

    On the receiving end, the script must:

    + +
      +
    1. Check for required data.
    2. +
    3. Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted +it must be validated to contain only permitted characters. It must be of a minimum length, +and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
    4. +
    5. Sanitize the data for security.
    6. +
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. +
    9. Prep the data for insertion in the database.
    10. +
    + + +

    Although there is nothing terribly complex about the above process, it usually requires a significant +amount of code, and to display error messages, various control structures are usually placed within the form HTML. +Form validation, while simple to create, is generally very messy and tedious to implement.

    + +

     

    + + + +

    Form Validation Tutorial

    + +

    What follows is a "hands on" tutorial for implementing CodeIgniters Form Validation.

    + + +

    In order to implement form validation you'll need three things:

    + +
      +
    1. A View file containing a form.
    2. +
    3. A View file containing a "success" message to be displayed upon successful submission.
    4. +
    5. A controller function to receive and process the submitted data.
    6. +
    + +

    Let's create those three things, using a member sign-up form as the example.

    + + + + + +

    The Form

    + +

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +folder:

    + + + + + + + + +

    The Success Page

    + + +

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +folder:

    + + + + + + + +

    The Controller

    + +

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +folder:

    + + + + + +

    Try it!

    + +

    To try your form, visit your site using a URL similar to this one:

    + +example.com/index.php/form/ + +

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation +rules yet.

    + +

    Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() +function only returns TRUE if it has successfully applied your rules without any of them failing.

    + + +

    Explanation

    + +

    You'll notice several things about the above pages:

    + +

    The form (myform.php) is a standard web form with a couple exceptions:

    + +
      +
    1. It uses a form helper to create the form opening. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
    2. + +
    3. At the top of the form you'll notice the following function call: +<?php echo validation_errors(); ?> + +

      This function will return any error messages sent back by the validator. If there are no messages it returns an empty string.

      +
    4. +
    + +

    The controller (form.php) has one function: index(). This function initializes the validation class and +loads the form helper and URL helper used by your view files. It also runs +the validation routine. Based on +whether the validation was successful it either presents the form or the success page.

    + + + + + + +

    Setting Validation Rules

    + +

    CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data +at the same time. To set validation rules you will use the set_rules() function:

    + +$this->form_validation->set_rules(); + +

    The above function takes three parameters as input:

    + +
      +
    1. The field name - the exact name you've given the form field.
    2. +
    3. A "human" name for this field, which will be inserted into the error message. For example, if your field is named "user" you might give it a human name of "Username". Note: If you would like the field name to be stored in a language file, please see Translating Field Names.
    4. +
    5. The validation rules for this form field.
    6. +
    + + +


    Here is an example. In your controller (form.php), add this code just below the validation initialization function:

    + + +$this->form_validation->set_rules('username', 'Username', 'required');
    +$this->form_validation->set_rules('password', 'Password', 'required');
    +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
    +$this->form_validation->set_rules('email', 'Email', 'required');
    +
    + +

    Your controller should now look like this:

    + + + +

    Now submit the form with the fields blank and you should see the error messages. +If you submit the form with all the fields populated you'll see your success page.

    + +

    Note: The form fields are not yet being re-populated with the data when +there is an error. We'll get to that shortly.

    + + + + + +

    Setting Rules Using an Array

    + +

    Before moving on it should be noted that the rule setting function can be passed an array if you prefer to set all your rules in one action. +If you use this approach you must name your array keys as indicated:

    + + +$config = array(
    +               array(
    +                     'field'   => 'username',
    +                     'label'   => 'Username',
    +                     'rules'   => 'required'
    +                  ),
    +               array(
    +                     'field'   => 'password',
    +                     'label'   => 'Password',
    +                     'rules'   => 'required'
    +                  ),
    +               array(
    +                     'field'   => 'passconf',
    +                     'label'   => 'Password Confirmation',
    +                     'rules'   => 'required'
    +                  ),   
    +               array(
    +                     'field'   => 'email',
    +                     'label'   => 'Email',
    +                     'rules'   => 'required'
    +                  )
    +            );
    +
    +$this->form_validation->set_rules($config); +
    + + + + + + + +

    Cascading Rules

    + +

    CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

    + + +$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
    +$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
    +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
    +$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
    +
    + +

    The above code sets the following rules:

    + +
      +
    1. The username field be no shorter than 5 characters and no longer than 12.
    2. +
    3. The password field must match the password confirmation field.
    4. +
    5. The email field must contain a valid email address.
    6. +
    + +

    Give it a try! Submit your form without the proper data and you'll see new error messages that correspond to your new rules. +There are numerous rules available which you can read about in the validation reference.

    + + + + +

    Prepping Data

    + +

    In addition to the validation functions like the ones we used above, you can also prep your data in various ways. +For example, you can set up rules like this:

    + + +$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|xss_clean');
    +$this->form_validation->set_rules('password', 'Password', 'trim|required|matches[passconf]|md5');
    +$this->form_validation->set_rules('passconf', 'Password Confirmation', 'trim|required');
    +$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
    +
    + + +

    In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through +the "xss_clean" function, which removes malicious data.

    + +

    Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, +trim, MD5, etc.

    + +

    Note: You will generally want to use the prepping functions after +the validation rules so if there is an error, the original data will be shown in the form.

    + + + + + +

    Re-populating the form

    + +

    Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions +that permit you to do this. The one you will use most commonly is:

    + +set_value('field name') + + +

    Open your myform.php view file and update the value in each field using the set_value() function:

    + +

    Don't forget to include each. field name in the set_value() functions!

    + + + + + +

    Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

    + +

    Note: The Function Reference section below contains functions that +permit you to re-populate <select> menus, radio buttons, and checkboxes.

    + + +

    Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

    + +<input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> + +

    For more info please see the Using Arrays as Field Names section below.

    + + + + + + +

    Callbacks: Your own Validation Functions

    + +

    The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a example of this.

    + +

    In your controller, change the "username" rule to this:

    + +$this->form_validation->set_rules('username', 'Username', 'callback_username_check'); + + +

    Then add a new function called username_check to your controller. Here's how your controller should now look:

    + + + + +

    Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +callback function for you to process.

    + +

    To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

    + +

    You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE +it is assumed that the data is your newly processed form data.

    + + + + + +

    Setting Error Messages

    + + +

    All of the native error messages are located in the following language file: language/english/form_validation_lang.php

    + +

    To set your own custom message you can either edit that file, or use the following function:

    + +$this->form_validation->set_message('rule', 'Error Message'); + +

    Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

    + +

    If you include %s in your error string, it will be replaced with the "human" name you used for your field when you set your rules.

    + +

    In the "callback" example above, the error message was set by passing the name of the function:

    + +$this->form_validation->set_message('username_check') + +

    You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

    + +$this->form_validation->set_message('required', 'Your custom message here'); + + + + +

    Translating Field Names

    + +

    If you would like to store the "human" name you passed to the set_rules() function in a language file, and therefore make the name able to be translated, here's how:

    + +

    First, prefix your "human" name with lang:, as in this example:

    + + +$this->form_validation->set_rules('first_name', 'lang:first_name', 'required');
    +
    + +

    Then, store the name in one of your language file arrays (without the prefix):

    + +$lang['first_name'] = 'First Name'; + +

    Note: If you store your array item in a language file that is not loaded automatically by CI, you'll need to remember to load it in your controller using:

    + +$this->lang->load('file_name'); + +

    See the Language Class page for more info regarding language files.

    + + + +

    Changing the Error Delimiters

    + +

    By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or +individually.

    + +
      + +
    1. Changing delimiters Globally + +

      To globally change the error delimiters, in your controller function, just after loading the Form Validation class, add this:

      + +$this->form_validation->set_error_delimiters('<div class="error">', '</div>'); + +

      In this example, we've switched to using div tags.

      + +
    2. + +
    3. Changing delimiters Individually + +

      Each of the two error generating functions shown in this tutorial can be supplied their own delimiters as follows:

      + +<?php echo form_error('field name', '<div class="error">', '</div>'); ?> + +

      Or:

      + +<?php echo validation_errors('<div class="error">', '</div>'); ?> + +
    4. +
    + + + + + +

    Showing Errors Individually

    + +

    If you prefer to show an error message next to each form field, rather than as a list, you can use the form_error() function.

    + +

    Try it! Change your form so that it looks like this:

    + + + +

    If there are no errors, nothing will be shown. If there is an error, the message will appear.

    + +

    Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

    + +<?php echo form_error('options[size]'); ?>
    +<input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> +
    + +

    For more info please see the Using Arrays as Field Names section below.

    + + + + +

     

    + + + +

    Saving Sets of Validation Rules to a Config File

    + +

    A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You +can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or +you can manually call each set as needed.

    + +

    How to save your rules

    + +

    To store your validation rules, simply create a file named form_validation.php in your application/config/ folder. +In that file you will place an array named $config with your rules. As shown earlier, the validation array will have this prototype:

    + + +$config = array(
    +               array(
    +                     'field'   => 'username',
    +                     'label'   => 'Username',
    +                     'rules'   => 'required'
    +                  ),
    +               array(
    +                     'field'   => 'password',
    +                     'label'   => 'Password',
    +                     'rules'   => 'required'
    +                  ),
    +               array(
    +                     'field'   => 'passconf',
    +                     'label'   => 'Password Confirmation',
    +                     'rules'   => 'required'
    +                  ),   
    +               array(
    +                     'field'   => 'email',
    +                     'label'   => 'Email',
    +                     'rules'   => 'required'
    +                  )
    +            );
    +
    + +

    Your validation rule file will be loaded automatically and used when you call the run() function.

    + +

    Please note that you MUST name your array $config.

    + +

    Creating Sets of Rules

    + +

    In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. +We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

    + + +$config = array(
    +                 'signup' => array(
    +                                    array(
    +                                            'field' => 'username',
    +                                            'label' => 'Username',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'password',
    +                                            'label' => 'Password',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'passconf',
    +                                            'label' => 'PasswordConfirmation',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'email',
    +                                            'label' => 'Email',
    +                                            'rules' => 'required'
    +                                         )
    +                                    ),
    +                 'email' => array(
    +                                    array(
    +                                            'field' => 'emailaddress',
    +                                            'label' => 'EmailAddress',
    +                                            'rules' => 'required|valid_email'
    +                                         ),
    +                                    array(
    +                                            'field' => 'name',
    +                                            'label' => 'Name',
    +                                            'rules' => 'required|alpha'
    +                                         ),
    +                                    array(
    +                                            'field' => 'title',
    +                                            'label' => 'Title',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'message',
    +                                            'label' => 'MessageBody',
    +                                            'rules' => 'required'
    +                                         )
    +                                    )                          
    +               );
    +
    + + +

    Calling a Specific Rule Group

    + +

    In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

    + + +if ($this->form_validation->run('signup') == FALSE)
    +{
    +   $this->load->view('myform');
    +}
    +else
    +{
    +   $this->load->view('formsuccess');
    +}
    +
    + + + +

    Associating a Controller Function with a Rule Group

    + +

    An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you +have a controller named Member and a function named signup. Here's what your class might look like:

    + + +<?php

    +class Member extends Controller {
    +
    +   function signup()
    +   {      
    +      $this->load->library('form_validation');
    +            
    +      if ($this->form_validation->run() == FALSE)
    +      {
    +         $this->load->view('myform');
    +      }
    +      else
    +      {
    +         $this->load->view('formsuccess');
    +      }
    +   }
    +}
    +?>
    + +

    In your validation config file, you will name your rule group member/signup:

    + + +$config = array(
    +           'member/signup' = array(
    +                                    array(
    +                                            'field' => 'username',
    +                                            'label' => 'Username',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'password',
    +                                            'label' => 'Password',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'passconf',
    +                                            'label' => 'PasswordConfirmation',
    +                                            'rules' => 'required'
    +                                         ),
    +                                    array(
    +                                            'field' => 'email',
    +                                            'label' => 'Email',
    +                                            'rules' => 'required'
    +                                         )
    +                                    )
    +               );
    +
    + +

    When a rule group is named identically to a controller class/function it will be used automatically when the run() function is invoked from that class/function.

    + +

     

    + + + +

    Using Arrays as Field Names

    + +

    The Form Validation class supports the use of arrays as field names. Consider this example:

    + +<input type="text" name="options[]" value="" size="50" /> + +

    If you do use an array as a field name, you must use the EXACT array name in the Helper Functions that require the field name, +and as your Validation Rule field name.

    + +

    For example, to set a rule for the above field you would use:

    + +$this->form_validation->set_rules('options[]', 'Options', 'required'); + +

    Or, to show an error for the above field you would use:

    + +<?php echo form_error('options[]'); ?> + +

    Or to re-populate the field you would use:

    + +<input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> + +

    You can use multidimensional arrays as field names as well. For example:

    + +<input type="text" name="options[size]" value="" size="50" /> + +

    Or even:

    + +<input type="text" name="sports[nba][basketball]" value="" size="50" /> + +

    As with our first example, you must use the exact array name in the helper functions:

    + +<?php echo form_error('sports[nba][basketball]'); ?> + +

    If you are using checkboxes (or other fields) that have multiple options, don't forget to leave an empty bracket after each option, so that all selections will be added to the +POST array:

    + + +<input type="checkbox" name="options[]" value="red" />
    +<input type="checkbox" name="options[]" value="blue" />
    +<input type="checkbox" name="options[]" value="green" /> +
    + +

    Or if you use a multidimensional array:

    + + +<input type="checkbox" name="options[color][]" value="red" />
    +<input type="checkbox" name="options[color][]" value="blue" />
    +<input type="checkbox" name="options[color][]" value="green" /> +
    + +

    When you use a helper function you'll include the bracket as well:

    + +<?php echo form_error('options[color][]'); ?> + + + + +

     

    + + + +

    Rule Reference

    + +

    The following is a list of all the native rules that are available to use:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    RuleParameterDescriptionExample
    requiredNoReturns FALSE if the form element is empty. 
    matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
    min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
    max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
    exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
    alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
    alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
    alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
    numericNoReturns FALSE if the form element contains anything other than numeric characters. 
    integerNoReturns FALSE if the form element contains anything other than an integer. 
    is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
    is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
    valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
    valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
    valid_ipNoReturns FALSE if the supplied IP is not valid. 
    valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
    + +

    Note: These rules can also be called as discrete functions. For example:

    + +$this->form_validation->required($string); + +

    Note: You can also use any native PHP functions that permit one parameter.

    + + + +

     

    + + +

    Prepping Reference

    + +

    The following is a list of all the prepping functions that are available to use:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameParameterDescription
    xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
    prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
    prep_urlNoAdds "http://" to URLs if missing.
    strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
    encode_php_tagsNoConverts PHP tags to entities.
    + +

    Note: You can also use any native PHP functions that permit one parameter, +like trim, htmlspecialchars, urldecode, etc.

    + + + + + + + +

     

    + + +

    Function Reference

    + +

    The following functions are intended for use in your controller functions.

    + +

    $this->form_validation->set_rule();

    + +

    Permits you to set validation rules, as described in the tutorial sections above:

    + + + + +

    $this->form_validation->run();

    + +

    Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation +group via the function, as described in: Saving Groups of Validation Rules to a Config File.

    + + +

    $this->form_validation->set_message();

    + +

    Permits you to set custom error messages. See Setting Error Messages above.

    + + +

     

    + + +

    Helper Reference

    + +

    The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they +do not require you to prepend them with $this->form_validation.

    + +

    form_error()

    + +

    Shows an individual error message associated with the field name supplied to the function. Example:

    + +<?php echo form_error('username'); ?> + +

    The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

    + + + +

    validation_errors()

    +

    Shows all error messages as a string: Example:

    + +<?php echo validation_errors(); ?> + +

    The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

    + + + +

    set_value()

    + +

    Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. +The second (optional) parameter allows you to set a default value for the form. Example:

    + +<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" /> + +

    The above form will show "0" when loaded for the first time.

    + +

    set_select()

    + +

    If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

    + +

    Example:

    + + +<select name="myselect">
    +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
    +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
    +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
    +</select> +
    + + +

    set_checkbox()

    + +

    Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

    + +<input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
    +<input type="checkbox" name="mycheck[]" value="2" <?php echo set_checkbox('mycheck[]', '2'); ?> />
    + + +

    set_radio()

    + +

    Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

    + +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
    +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 1d52a290..08a0df41 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -1,303 +1,303 @@ - - - - - -FTP Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    FTP Class

    - -

    CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, -and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

    - -

    Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the FTP class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('ftp'); -

    Once loaded, the FTP object will be available using: $this->ftp

    - - -

    Usage Examples

    - -

    In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The -file permissions are set to 755. Note: Setting permissions requires PHP 5.

    - - -$this->load->library('ftp');
    -
    -$config['hostname'] = 'ftp.example.com';
    -$config['username'] = 'your-username';
    -$config['password'] = 'your-password';
    -$config['debug'] = TRUE;
    -
    -$this->ftp->connect($config);
    -
    -$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
    -
    -$this->ftp->close(); - -
    - - -

    In this example a list of files is retrieved from the server.

    - - -$this->load->library('ftp');
    -
    -$config['hostname'] = 'ftp.example.com';
    -$config['username'] = 'your-username';
    -$config['password'] = 'your-password';
    -$config['debug'] = TRUE;
    -
    -$this->ftp->connect($config);
    -
    -$list = $this->ftp->list_files('/public_html/');
    -
    -print_r($list);
    -
    -$this->ftp->close(); -
    - -

    In this example a local directory is mirrored on the server.

    - - - -$this->load->library('ftp');
    -
    -$config['hostname'] = 'ftp.example.com';
    -$config['username'] = 'your-username';
    -$config['password'] = 'your-password';
    -$config['debug'] = TRUE;
    -
    -$this->ftp->connect($config);
    -
    -$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
    -
    -$this->ftp->close(); -
    - - -

    Function Reference

    - -

    $this->ftp->connect()

    - -

    Connects and logs into to the FTP server. Connection preferences are set by passing an array -to the function, or you can store them in a config file.

    - - -

    Here is an example showing how you set preferences manually:

    - - -$this->load->library('ftp');
    -
    -$config['hostname'] = 'ftp.example.com';
    -$config['username'] = 'your-username';
    -$config['password'] = 'your-password';
    -$config['port']     = 21;
    -$config['passive']  = FALSE;
    -$config['debug']    = TRUE;
    -
    -$this->ftp->connect($config);
    -
    - -

    Setting FTP Preferences in a Config File

    - -

    If you prefer you can store your FTP preferences in a config file. -Simply create a new file called the ftp.php, add the $config -array in that file. Then save the file at config/ftp.php and it will be used automatically.

    - -

    Available connection options:

    - - -
      -
    • hostname - the FTP hostname. Usually something like:  ftp.example.com
    • -
    • username - the FTP username.
    • -
    • password - the FTP password.
    • -
    • port - The port number. Set to 21 by default.
    • -
    • debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
    • -
    • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
    • -
    - - - -

    $this->ftp->upload()

    - -

    Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. -Example:

    - - -$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775); - -

    Mode options are:  ascii, binary, and auto (the default). If -auto is used it will base the mode on the file extension of the source file.

    - -

    Permissions are available if you are running PHP 5 and can be passed as an octal value in the fourth parameter.

    - - -

    $this->ftp->rename()

    -

    Permits you to rename a file. Supply the source file name/path and the new file name/path.

    - - -// Renames green.html to blue.html
    -$this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html'); -
    - -

    $this->ftp->move()

    -

    Lets you move a file. Supply the source and destination paths:

    - - -// Moves blog.html from "joe" to "fred"
    -$this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html'); -
    - -

    Note: if the destination file name is different the file will be renamed.

    - - -

    $this->ftp->delete_file()

    -

    Lets you delete a file. Supply the source path with the file name.

    - - -$this->ftp->delete_file('/public_html/joe/blog.html'); - - - -

    $this->ftp->delete_dir()

    -

    Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

    - -

    Important  Be VERY careful with this function. It will recursively delete -everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. -Try using the list_files() function first to verify that your path is correct.

    - - -$this->ftp->delete_dir('/public_html/path/to/folder/'); - - - - -

    $this->ftp->list_files()

    -

    Permits you to retrieve a list of files on your server returned as an array. You must supply -the path to the desired directory.

    - - -$list = $this->ftp->list_files('/public_html/');
    -
    -print_r($list); -
    - - -

    $this->ftp->mirror()

    - -

    Recursively reads a local folder and everything it contains (including sub-folders) and creates a -mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. -You must supply a source path and a destination path:

    - - -$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/'); - - - - -

    $this->ftp->mkdir()

    - -

    Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. -Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).

    - - -// Creates a folder named "bar"
    -$this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE); -
    - - -

    $this->ftp->chmod()

    - -

    Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

    - - -// Chmod "bar" to 777
    -$this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE); -
    - - - - -

    $this->ftp->close();

    -

    Closes the connection to your server. It's recommended that you use this when you are finished uploading.

    - - - - - - - - -
    - - - - - - + + + + + +FTP Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    FTP Class

    + +

    CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, +and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

    + +

    Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the FTP class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('ftp'); +

    Once loaded, the FTP object will be available using: $this->ftp

    + + +

    Usage Examples

    + +

    In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The +file permissions are set to 755. Note: Setting permissions requires PHP 5.

    + + +$this->load->library('ftp');
    +
    +$config['hostname'] = 'ftp.example.com';
    +$config['username'] = 'your-username';
    +$config['password'] = 'your-password';
    +$config['debug'] = TRUE;
    +
    +$this->ftp->connect($config);
    +
    +$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);
    +
    +$this->ftp->close(); + +
    + + +

    In this example a list of files is retrieved from the server.

    + + +$this->load->library('ftp');
    +
    +$config['hostname'] = 'ftp.example.com';
    +$config['username'] = 'your-username';
    +$config['password'] = 'your-password';
    +$config['debug'] = TRUE;
    +
    +$this->ftp->connect($config);
    +
    +$list = $this->ftp->list_files('/public_html/');
    +
    +print_r($list);
    +
    +$this->ftp->close(); +
    + +

    In this example a local directory is mirrored on the server.

    + + + +$this->load->library('ftp');
    +
    +$config['hostname'] = 'ftp.example.com';
    +$config['username'] = 'your-username';
    +$config['password'] = 'your-password';
    +$config['debug'] = TRUE;
    +
    +$this->ftp->connect($config);
    +
    +$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');
    +
    +$this->ftp->close(); +
    + + +

    Function Reference

    + +

    $this->ftp->connect()

    + +

    Connects and logs into to the FTP server. Connection preferences are set by passing an array +to the function, or you can store them in a config file.

    + + +

    Here is an example showing how you set preferences manually:

    + + +$this->load->library('ftp');
    +
    +$config['hostname'] = 'ftp.example.com';
    +$config['username'] = 'your-username';
    +$config['password'] = 'your-password';
    +$config['port']     = 21;
    +$config['passive']  = FALSE;
    +$config['debug']    = TRUE;
    +
    +$this->ftp->connect($config);
    +
    + +

    Setting FTP Preferences in a Config File

    + +

    If you prefer you can store your FTP preferences in a config file. +Simply create a new file called the ftp.php, add the $config +array in that file. Then save the file at config/ftp.php and it will be used automatically.

    + +

    Available connection options:

    + + +
      +
    • hostname - the FTP hostname. Usually something like:  ftp.example.com
    • +
    • username - the FTP username.
    • +
    • password - the FTP password.
    • +
    • port - The port number. Set to 21 by default.
    • +
    • debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
    • +
    • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
    • +
    + + + +

    $this->ftp->upload()

    + +

    Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. +Example:

    + + +$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775); + +

    Mode options are:  ascii, binary, and auto (the default). If +auto is used it will base the mode on the file extension of the source file.

    + +

    Permissions are available if you are running PHP 5 and can be passed as an octal value in the fourth parameter.

    + + +

    $this->ftp->rename()

    +

    Permits you to rename a file. Supply the source file name/path and the new file name/path.

    + + +// Renames green.html to blue.html
    +$this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html'); +
    + +

    $this->ftp->move()

    +

    Lets you move a file. Supply the source and destination paths:

    + + +// Moves blog.html from "joe" to "fred"
    +$this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html'); +
    + +

    Note: if the destination file name is different the file will be renamed.

    + + +

    $this->ftp->delete_file()

    +

    Lets you delete a file. Supply the source path with the file name.

    + + +$this->ftp->delete_file('/public_html/joe/blog.html'); + + + +

    $this->ftp->delete_dir()

    +

    Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

    + +

    Important  Be VERY careful with this function. It will recursively delete +everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. +Try using the list_files() function first to verify that your path is correct.

    + + +$this->ftp->delete_dir('/public_html/path/to/folder/'); + + + + +

    $this->ftp->list_files()

    +

    Permits you to retrieve a list of files on your server returned as an array. You must supply +the path to the desired directory.

    + + +$list = $this->ftp->list_files('/public_html/');
    +
    +print_r($list); +
    + + +

    $this->ftp->mirror()

    + +

    Recursively reads a local folder and everything it contains (including sub-folders) and creates a +mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. +You must supply a source path and a destination path:

    + + +$this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/'); + + + + +

    $this->ftp->mkdir()

    + +

    Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. +Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).

    + + +// Creates a folder named "bar"
    +$this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE); +
    + + +

    $this->ftp->chmod()

    + +

    Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

    + + +// Chmod "bar" to 777
    +$this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE); +
    + + + + +

    $this->ftp->close();

    +

    Closes the connection to your server. It's recommended that you use this when you are finished uploading.

    + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 1bbb842c..3d427891 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -1,666 +1,666 @@ - - - - - -Image Manipulation Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Image Manipulation Class

    - -

    CodeIgniter's Image Manipulation class lets you perform the following actions:

    - -
      -
    • Image Resizing
    • -
    • Thumbnail Creation
    • -
    • Image Cropping
    • -
    • Image Rotating
    • -
    • Image Watermarking
    • -
    - -

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    - -

    Note: Watermarking is only available using the GD/GD2 library. -In addition, even though other libraries are supported, GD is required in -order for the script to calculate the image properties. The image processing, however, will be performed with the -library you specify.

    - - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the image class is initialized in your controller -using the $this->load->library function:

    -$this->load->library('image_lib'); - -

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    - - -

    Processing an Image

    - -

    Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is -identical. You will set some preferences corresponding to the action you intend to perform, then -call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    - -$config['image_library'] = 'gd2';
    -$config['source_image'] = '/path/to/image/mypic.jpg';
    -$config['create_thumb'] = TRUE;
    -$config['maintain_ratio'] = TRUE;
    -$config['width'] = 75;
    -$config['height'] = 50;
    -
    -$this->load->library('image_lib', $config); -
    -
    -$this->image_lib->resize();
    - -

    The above code tells the image_resize function to look for an image called mypic.jpg -located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. -Since the maintain_ratio option is enabled, the thumb will be as close to the target width and -height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg -

    - -

    Note: In order for the image class to be allowed to do any processing, the -folder containing the image files must have write permissions.

    - - -

    Processing Functions

    - -

    There are four available processing functions:

    - -
      -
    • $this->image_lib->resize()
    • -
    • $this->image_lib->crop()
    • -
    • $this->image_lib->rotate()
    • -
    • $this->image_lib->watermark()
    • -
    • $this->image_lib->clear()
    • -
    - -

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the -error message using this function:

    - -echo $this->image_lib->display_errors(); - -

    A good practice is use the processing function conditionally, showing an error upon failure, like this:

    - -if ( ! $this->image_lib->resize())
    -{
    -    echo $this->image_lib->display_errors();
    -}
    - -

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing -tags in the function, like this:

    - -$this->image_lib->display_errors('<p>', '</p>'); - - -

    Preferences

    - -

    The preferences described below allow you to tailor the image processing to suit your needs.

    - -

    Note that not all preferences are available for every -function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height -preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    - -

    Availability Legend:

    - -
      -
    • R - Image Resizing
    • -
    • C - Image Cropping
    • -
    • X - Image Rotation
    • -
    • W - Image Watermarking
    • - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescriptionAvailability
    image_libraryGD2GD, GD2, ImageMagick, NetPBMSets the image library to be used.R, C, X, W
    library_pathNoneNoneSets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path.R, C, X
    source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.R, C, S, W
    dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.R, C, X, W
    quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.R, C, X, W
    new_imageNoneNoneSets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL.R, C, X, W
    widthNoneNoneSets the width you would like the image set to.R, C
    heightNoneNoneSets the height you would like the image set to.R, C
    create_thumbFALSETRUE/FALSE (boolean)Tells the image processing function to create a thumb.R
    thumb_marker_thumbNoneSpecifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpgR
    maintain_ratioTRUETRUE/FALSE (boolean)Specifies whether to maintain the original aspect ratio when resizing or use hard values.R, C
    master_dimautoauto, width, heightSpecifies what to use as the master axis when resizing or creating thumbs. For example, let's say you want to resize an image to 100 X 75 pixels. If the source image size does not allow perfect resizing to those dimensions, this setting determines which axis should be used as the hard value. "auto" sets the axis automatically based on whether the image is taller then wider, or vice versa.R
    rotation_angleNone90, 180, 270, vrt, horSpecifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270.X
    x_axisNoneNoneSets the X coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the left.C
    y_axisNoneNoneSets the Y coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the top.C
    - - -

    Setting preferences in a config file

    - -

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called image_lib.php, add the $config -array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You -will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

    - - -

    $this->image_lib->resize()

    - -

    The image resizing function lets you resize the original image, create a copy (with or without resizing), -or create a thumbnail image.

    - -

    For practical purposes there is no difference between creating a copy and creating -a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

    - -

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    - -

    Creating a Thumbnail

    - -

    The resizing function will create a thumbnail file (and preserve the original) if you set this preference to TRUE:

    - -$config['create_thumb'] = TRUE; - -

    This single preference determines whether a thumbnail is created or not.

    - -

    Creating a Copy

    - -

    The resizing function will create a copy of the image file (and preserve the original) if you set -a path and/or a new filename using this preference:

    - -$config['new_image'] = '/path/to/new_image.jpg'; - -

    Notes regarding this preference:

    -
      -
    • If only the new image name is specified it will be placed in the same folder as the original
    • -
    • If only the path is specified, the new image will be placed in the destination with the same name as the original.
    • -
    • If both the path and image name are specified it will placed in its own destination and given the new name.
    • -
    - - -

    Resizing the Original Image

    - -

    If neither of the two preferences listed above (create_thumb, and new_image) are used, the resizing function will instead -target the original image for processing.

    - - -

    $this->image_lib->crop()

    - -

    The cropping function works nearly identically to the resizing function except it requires that you set -preferences for the X and Y axis (in pixels) specifying where to crop, like this:

    - -$config['x_axis'] = '100';
    -$config['y_axis'] = '40';
    - -

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    - -

    Here's an example showing how you might crop an image:

    - -$config['image_library'] = 'imagemagick';
    -$config['library_path'] = '/usr/X11R6/bin/';
    -$config['source_image'] = '/path/to/image/mypic.jpg';
    -$config['x_axis'] = '100';
    -$config['y_axis'] = '60';
    -
    -$this->image_lib->initialize($config); -
    -
    -if ( ! $this->image_lib->crop())
    -{
    -    echo $this->image_lib->display_errors();
    -}
    - - -

    Note: Without a visual interface it is difficult to crop images, so this function is not very useful -unless you intend to build such an interface. That's exactly what we did using for the photo -gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping -area be selected.

    - -

    $this->image_lib->rotate()

    - -

    The image rotation function requires that the angle of rotation be set via its preference:

    - -$config['rotation_angle'] = '90'; - -

    There are 5 rotation options:

    - -
      -
    1. 90 - rotates counter-clockwise by 90 degrees.
    2. -
    3. 180 - rotates counter-clockwise by 180 degrees.
    4. -
    5. 270 - rotates counter-clockwise by 270 degrees.
    6. -
    7. hor - flips the image horizontally.
    8. -
    9. vrt - flips the image vertically.
    10. -
    - -

    Here's an example showing how you might rotate an image:

    - -$config['image_library'] = 'netpbm';
    -$config['library_path'] = '/usr/bin/';
    -$config['source_image'] = '/path/to/image/mypic.jpg';
    -$config['rotation_angle'] = 'hor';
    -
    -$this->image_lib->initialize($config); -
    -
    -if ( ! $this->image_lib->rotate())
    -{
    -    echo $this->image_lib->display_errors();
    -}
    - - - -

    $this->image_lib->clear()

    -

    The clear function resets all of the values used when processing an image. You will want to call this if you are processing images in a loop.

    -

    $this->image_lib->clear();

    -

     

    -

    Image Watermarking

    - -

    The Watermarking feature requires the GD/GD2 library.

    - - -

    Two Types of Watermarking

    - -

    There are two types of watermarking that you can use:

    - -
      -
    • Text: The watermark message will be generating using text, either with a True Type font that you specify, or -using the native text output that the GD library supports. If you use the True Type version your GD installation -must be compiled with True Type support (most are, but not all).
    • - -
    • Overlay: The watermark message will be generated by overlaying an image (usually a transparent PNG or GIF) -containing your watermark over the source image.
    • - -
    - - -

    Watermarking an Image

    - -

    Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking -involves setting the preferences corresponding to the action you intend to perform, then -calling the watermark function. Here is an example:

    - - -$config['source_image'] = '/path/to/image/mypic.jpg';
    -$config['wm_text'] = 'Copyright 2006 - John Doe';
    -$config['wm_type'] = 'text';
    -$config['wm_font_path'] = './system/fonts/texb.ttf';
    -$config['wm_font_size'] = '16';
    -$config['wm_font_color'] = 'ffffff';
    -$config['wm_vrt_alignment'] = 'bottom';
    -$config['wm_hor_alignment'] = 'center';
    -$config['wm_padding'] = '20';
    -
    -$this->image_lib->initialize($config); -
    -
    -$this->image_lib->watermark();
    - - -

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark -will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

    - -

    Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

    - - -

    Watermarking Preferences

    - -

    This table shown the preferences that are available for both types of watermarking (text or overlay)

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    wm_typetexttext, overlaySets the type of watermarking that should be used.
    source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.
    dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.
    quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.
    paddingNoneA numberThe 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_alignmentbottomtop, middle, bottomSets the vertical alignment for the watermark image.
    wm_hor_alignmentcenterleft, center, rightSets the horizontal alignment for the watermark image.
    wm_hor_offsetNoneNoneYou may specify a horizontal offset (in pixels) to apply to the watermark position. The offset normally moves the watermark to the right, except if you have your alignment set to "right" then your offset value will move the watermark toward the left of the image.
    wm_vrt_offsetNoneNoneYou may specify a vertical offset (in pixels) to apply to the watermark position. The offset normally moves the watermark down, except if you have your alignment set to "bottom" then your offset value will move the watermark toward the top of the image.
    - - - -

    Text Preferences

    -

    This table shown the preferences that are available for the text type of watermarking.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    wm_textNoneNoneThe text you would like shown as the watermark. Typically this will be a copyright notice.
    wm_font_pathNoneNoneThe server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used.
    wm_font_size16NoneThe size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using.
    wm_font_colorffffffNoneThe font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
    wm_shadow_colorNoneNoneThe color of the drop shadow, specified in hex. If you leave this blank a drop shadow will not be used. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
    wm_shadow_distance3NoneThe distance (in pixels) from the font that the drop shadow should appear.
    - - - - -

    Overlay Preferences

    -

    This table shown the preferences that are available for the overlay type of watermarking.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefault ValueOptionsDescription
    wm_overlay_pathNoneNoneThe server path to the image you wish to use as your watermark. Required only if you are using the overlay method.
    wm_opacity501 - 100Image opacity. You may specify the opacity (i.e. transparency) of your watermark image. This allows the watermark to be faint and not completely obscure the details from the original image behind it. A 50% opacity is typical.
    wm_x_transp4A numberIf your watermark image is a PNG or GIF image, you may specify a color on the image to be "transparent". This setting (along with the next) will allow you to specify that color. This works by specifying the "X" and "Y" coordinate pixel (measured from the upper left) within the image that corresponds to a pixel representative of the color you want to be transparent.
    wm_y_transp4A numberAlong with the previous setting, this allows you to specify the coordinate to a pixel representative of the color you want to be transparent.
    - -
    - - - - - - + + + + + +Image Manipulation Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Image Manipulation Class

    + +

    CodeIgniter's Image Manipulation class lets you perform the following actions:

    + +
      +
    • Image Resizing
    • +
    • Thumbnail Creation
    • +
    • Image Cropping
    • +
    • Image Rotating
    • +
    • Image Watermarking
    • +
    + +

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    + +

    Note: Watermarking is only available using the GD/GD2 library. +In addition, even though other libraries are supported, GD is required in +order for the script to calculate the image properties. The image processing, however, will be performed with the +library you specify.

    + + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the image class is initialized in your controller +using the $this->load->library function:

    +$this->load->library('image_lib'); + +

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    + + +

    Processing an Image

    + +

    Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is +identical. You will set some preferences corresponding to the action you intend to perform, then +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    + +$config['image_library'] = 'gd2';
    +$config['source_image'] = '/path/to/image/mypic.jpg';
    +$config['create_thumb'] = TRUE;
    +$config['maintain_ratio'] = TRUE;
    +$config['width'] = 75;
    +$config['height'] = 50;
    +
    +$this->load->library('image_lib', $config); +
    +
    +$this->image_lib->resize();
    + +

    The above code tells the image_resize function to look for an image called mypic.jpg +located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. +Since the maintain_ratio option is enabled, the thumb will be as close to the target width and +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +

    + +

    Note: In order for the image class to be allowed to do any processing, the +folder containing the image files must have write permissions.

    + + +

    Processing Functions

    + +

    There are four available processing functions:

    + +
      +
    • $this->image_lib->resize()
    • +
    • $this->image_lib->crop()
    • +
    • $this->image_lib->rotate()
    • +
    • $this->image_lib->watermark()
    • +
    • $this->image_lib->clear()
    • +
    + +

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +error message using this function:

    + +echo $this->image_lib->display_errors(); + +

    A good practice is use the processing function conditionally, showing an error upon failure, like this:

    + +if ( ! $this->image_lib->resize())
    +{
    +    echo $this->image_lib->display_errors();
    +}
    + +

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +tags in the function, like this:

    + +$this->image_lib->display_errors('<p>', '</p>'); + + +

    Preferences

    + +

    The preferences described below allow you to tailor the image processing to suit your needs.

    + +

    Note that not all preferences are available for every +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    + +

    Availability Legend:

    + +
      +
    • R - Image Resizing
    • +
    • C - Image Cropping
    • +
    • X - Image Rotation
    • +
    • W - Image Watermarking
    • + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescriptionAvailability
    image_libraryGD2GD, GD2, ImageMagick, NetPBMSets the image library to be used.R, C, X, W
    library_pathNoneNoneSets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path.R, C, X
    source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.R, C, S, W
    dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.R, C, X, W
    quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.R, C, X, W
    new_imageNoneNoneSets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL.R, C, X, W
    widthNoneNoneSets the width you would like the image set to.R, C
    heightNoneNoneSets the height you would like the image set to.R, C
    create_thumbFALSETRUE/FALSE (boolean)Tells the image processing function to create a thumb.R
    thumb_marker_thumbNoneSpecifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpgR
    maintain_ratioTRUETRUE/FALSE (boolean)Specifies whether to maintain the original aspect ratio when resizing or use hard values.R, C
    master_dimautoauto, width, heightSpecifies what to use as the master axis when resizing or creating thumbs. For example, let's say you want to resize an image to 100 X 75 pixels. If the source image size does not allow perfect resizing to those dimensions, this setting determines which axis should be used as the hard value. "auto" sets the axis automatically based on whether the image is taller then wider, or vice versa.R
    rotation_angleNone90, 180, 270, vrt, horSpecifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270.X
    x_axisNoneNoneSets the X coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the left.C
    y_axisNoneNoneSets the Y coordinate in pixels for image cropping. For example, a setting of 30 will crop an image 30 pixels from the top.C
    + + +

    Setting preferences in a config file

    + +

    If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called image_lib.php, add the $config +array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You +will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

    + + +

    $this->image_lib->resize()

    + +

    The image resizing function lets you resize the original image, create a copy (with or without resizing), +or create a thumbnail image.

    + +

    For practical purposes there is no difference between creating a copy and creating +a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

    + +

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    + +

    Creating a Thumbnail

    + +

    The resizing function will create a thumbnail file (and preserve the original) if you set this preference to TRUE:

    + +$config['create_thumb'] = TRUE; + +

    This single preference determines whether a thumbnail is created or not.

    + +

    Creating a Copy

    + +

    The resizing function will create a copy of the image file (and preserve the original) if you set +a path and/or a new filename using this preference:

    + +$config['new_image'] = '/path/to/new_image.jpg'; + +

    Notes regarding this preference:

    +
      +
    • If only the new image name is specified it will be placed in the same folder as the original
    • +
    • If only the path is specified, the new image will be placed in the destination with the same name as the original.
    • +
    • If both the path and image name are specified it will placed in its own destination and given the new name.
    • +
    + + +

    Resizing the Original Image

    + +

    If neither of the two preferences listed above (create_thumb, and new_image) are used, the resizing function will instead +target the original image for processing.

    + + +

    $this->image_lib->crop()

    + +

    The cropping function works nearly identically to the resizing function except it requires that you set +preferences for the X and Y axis (in pixels) specifying where to crop, like this:

    + +$config['x_axis'] = '100';
    +$config['y_axis'] = '40';
    + +

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    + +

    Here's an example showing how you might crop an image:

    + +$config['image_library'] = 'imagemagick';
    +$config['library_path'] = '/usr/X11R6/bin/';
    +$config['source_image'] = '/path/to/image/mypic.jpg';
    +$config['x_axis'] = '100';
    +$config['y_axis'] = '60';
    +
    +$this->image_lib->initialize($config); +
    +
    +if ( ! $this->image_lib->crop())
    +{
    +    echo $this->image_lib->display_errors();
    +}
    + + +

    Note: Without a visual interface it is difficult to crop images, so this function is not very useful +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +area be selected.

    + +

    $this->image_lib->rotate()

    + +

    The image rotation function requires that the angle of rotation be set via its preference:

    + +$config['rotation_angle'] = '90'; + +

    There are 5 rotation options:

    + +
      +
    1. 90 - rotates counter-clockwise by 90 degrees.
    2. +
    3. 180 - rotates counter-clockwise by 180 degrees.
    4. +
    5. 270 - rotates counter-clockwise by 270 degrees.
    6. +
    7. hor - flips the image horizontally.
    8. +
    9. vrt - flips the image vertically.
    10. +
    + +

    Here's an example showing how you might rotate an image:

    + +$config['image_library'] = 'netpbm';
    +$config['library_path'] = '/usr/bin/';
    +$config['source_image'] = '/path/to/image/mypic.jpg';
    +$config['rotation_angle'] = 'hor';
    +
    +$this->image_lib->initialize($config); +
    +
    +if ( ! $this->image_lib->rotate())
    +{
    +    echo $this->image_lib->display_errors();
    +}
    + + + +

    $this->image_lib->clear()

    +

    The clear function resets all of the values used when processing an image. You will want to call this if you are processing images in a loop.

    +

    $this->image_lib->clear();

    +

     

    +

    Image Watermarking

    + +

    The Watermarking feature requires the GD/GD2 library.

    + + +

    Two Types of Watermarking

    + +

    There are two types of watermarking that you can use:

    + +
      +
    • Text: The watermark message will be generating using text, either with a True Type font that you specify, or +using the native text output that the GD library supports. If you use the True Type version your GD installation +must be compiled with True Type support (most are, but not all).
    • + +
    • Overlay: The watermark message will be generated by overlaying an image (usually a transparent PNG or GIF) +containing your watermark over the source image.
    • + +
    + + +

    Watermarking an Image

    + +

    Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking +involves setting the preferences corresponding to the action you intend to perform, then +calling the watermark function. Here is an example:

    + + +$config['source_image'] = '/path/to/image/mypic.jpg';
    +$config['wm_text'] = 'Copyright 2006 - John Doe';
    +$config['wm_type'] = 'text';
    +$config['wm_font_path'] = './system/fonts/texb.ttf';
    +$config['wm_font_size'] = '16';
    +$config['wm_font_color'] = 'ffffff';
    +$config['wm_vrt_alignment'] = 'bottom';
    +$config['wm_hor_alignment'] = 'center';
    +$config['wm_padding'] = '20';
    +
    +$this->image_lib->initialize($config); +
    +
    +$this->image_lib->watermark();
    + + +

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

    + +

    Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

    + + +

    Watermarking Preferences

    + +

    This table shown the preferences that are available for both types of watermarking (text or overlay)

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    wm_typetexttext, overlaySets the type of watermarking that should be used.
    source_imageNoneNoneSets the source image name/path. The path must be a relative or absolute server path, not a URL.
    dynamic_outputFALSETRUE/FALSE (boolean)Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers.
    quality90%1 - 100%Sets the quality of the image. The higher the quality the larger the file size.
    paddingNoneA numberThe 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_alignmentbottomtop, middle, bottomSets the vertical alignment for the watermark image.
    wm_hor_alignmentcenterleft, center, rightSets the horizontal alignment for the watermark image.
    wm_hor_offsetNoneNoneYou may specify a horizontal offset (in pixels) to apply to the watermark position. The offset normally moves the watermark to the right, except if you have your alignment set to "right" then your offset value will move the watermark toward the left of the image.
    wm_vrt_offsetNoneNoneYou may specify a vertical offset (in pixels) to apply to the watermark position. The offset normally moves the watermark down, except if you have your alignment set to "bottom" then your offset value will move the watermark toward the top of the image.
    + + + +

    Text Preferences

    +

    This table shown the preferences that are available for the text type of watermarking.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    wm_textNoneNoneThe text you would like shown as the watermark. Typically this will be a copyright notice.
    wm_font_pathNoneNoneThe server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used.
    wm_font_size16NoneThe size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using.
    wm_font_colorffffffNoneThe font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
    wm_shadow_colorNoneNoneThe color of the drop shadow, specified in hex. If you leave this blank a drop shadow will not be used. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff).
    wm_shadow_distance3NoneThe distance (in pixels) from the font that the drop shadow should appear.
    + + + + +

    Overlay Preferences

    +

    This table shown the preferences that are available for the overlay type of watermarking.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefault ValueOptionsDescription
    wm_overlay_pathNoneNoneThe server path to the image you wish to use as your watermark. Required only if you are using the overlay method.
    wm_opacity501 - 100Image opacity. You may specify the opacity (i.e. transparency) of your watermark image. This allows the watermark to be faint and not completely obscure the details from the original image behind it. A 50% opacity is typical.
    wm_x_transp4A numberIf your watermark image is a PNG or GIF image, you may specify a color on the image to be "transparent". This setting (along with the next) will allow you to specify that color. This works by specifying the "X" and "Y" coordinate pixel (measured from the upper left) within the image that corresponds to a pixel representative of the color you want to be transparent.
    wm_y_transp4A numberAlong with the previous setting, this allows you to specify the coordinate to a pixel representative of the color you want to be transparent.
    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index ad73dffb..f210c18f 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -1,231 +1,231 @@ - - - - - -Input Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Input Class

    - -

    The Input Class serves two purposes:

    - -
      -
    1. It pre-processes global input data for security.
    2. -
    3. It provides some helper functions for fetching input data and pre-processing it.
    4. -
    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - - -

    Security Filtering

    - -

    The security filtering function is called automatically when a new controller is invoked. It does the following:

    - -
      -
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • -
    • Destroys all global variables in the event register_globals is turned on.
    • -
    • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
    • -
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • -
    • Standardizes newline characters to \n
    • -
    - - -

    XSS Filtering

    - -

    CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not -run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

    - -

    The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

    - -

    -Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

    - - -

    To filter data through the XSS filter use this function:

    - -

    $this->input->xss_clean()

    - -

    Here is an usage example:

    - -$data = $this->input->xss_clean($data); - -

    If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your -application/config/config.php file and setting this:

    - -$config['global_xss_filtering'] = TRUE; - -

    Note: If you use the form validation class, it gives you the option of XSS filtering as well.

    - -

    An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

    - -if ($this->input->xss_clean($file, TRUE) === FALSE)
    -{
    -    // file failed the XSS test
    -}
    - - -

    Using POST, COOKIE, or SERVER Data

    - -

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided -functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and -return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. -In other words, normally you might do something like this:

    - - -if ( ! isset($_POST['something']))
    -{
    -    $something = FALSE;
    -}
    -else
    -{
    -    $something = $_POST['something'];
    -}
    - -

    With CodeIgniter's built in functions you can simply do this:

    - -$something = $this->input->post('something'); - -

    The three functions are:

    - -
      -
    • $this->input->post()
    • -
    • $this->input->cookie()
    • -
    • $this->input->server()
    • -
    - -

    $this->input->post()

    - -

    The first parameter will contain the name of the POST item you are looking for:

    - -$this->input->post('some_data'); - -

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    - -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    - -$this->input->post('some_data', TRUE); - -

    $this->input->get()

    - -

    This function is identical to the post function, only it fetches get data:

    - -$this->input->get('some_data', TRUE); - -

    $this->input->get_post()

    - -

    This function will search through both the post and get streams for data, looking first in post, and then in get:

    - -$this->input->get_post('some_data', TRUE); - -

    $this->input->cookie()

    - -

    This function is identical to the post function, only it fetches cookie data:

    - -$this->input->cookie('some_data', TRUE); - -

    $this->input->server()

    - -

    This function is identical to the above functions, only it fetches server data:

    - -$this->input->server('some_data'); - - - - -

    $this->input->ip_address()

    -

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    -echo $this->input->ip_address(); - - -

    $this->input->valid_ip($ip)

    - -

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above -validates the IP automatically.

    - -if ( ! $this->input->valid_ip($ip))
    -{
    -     echo 'Not Valid';
    -}
    -else
    -{
    -     echo 'Valid';
    -}
    - - -

    $this->input->user_agent()

    -

    Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.

    -echo $this->input->user_agent(); - - - - -
    - - - - - - + + + + + +Input Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Input Class

    + +

    The Input Class serves two purposes:

    + +
      +
    1. It pre-processes global input data for security.
    2. +
    3. It provides some helper functions for fetching input data and pre-processing it.
    4. +
    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + + +

    Security Filtering

    + +

    The security filtering function is called automatically when a new controller is invoked. It does the following:

    + +
      +
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • +
    • Destroys all global variables in the event register_globals is turned on.
    • +
    • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
    • +
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • +
    • Standardizes newline characters to \n
    • +
    + + +

    XSS Filtering

    + +

    CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

    + +

    The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

    + +

    +Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

    + + +

    To filter data through the XSS filter use this function:

    + +

    $this->input->xss_clean()

    + +

    Here is an usage example:

    + +$data = $this->input->xss_clean($data); + +

    If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +application/config/config.php file and setting this:

    + +$config['global_xss_filtering'] = TRUE; + +

    Note: If you use the form validation class, it gives you the option of XSS filtering as well.

    + +

    An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

    + +if ($this->input->xss_clean($file, TRUE) === FALSE)
    +{
    +    // file failed the XSS test
    +}
    + + +

    Using POST, COOKIE, or SERVER Data

    + +

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided +functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +In other words, normally you might do something like this:

    + + +if ( ! isset($_POST['something']))
    +{
    +    $something = FALSE;
    +}
    +else
    +{
    +    $something = $_POST['something'];
    +}
    + +

    With CodeIgniter's built in functions you can simply do this:

    + +$something = $this->input->post('something'); + +

    The three functions are:

    + +
      +
    • $this->input->post()
    • +
    • $this->input->cookie()
    • +
    • $this->input->server()
    • +
    + +

    $this->input->post()

    + +

    The first parameter will contain the name of the POST item you are looking for:

    + +$this->input->post('some_data'); + +

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    + +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    + +$this->input->post('some_data', TRUE); + +

    $this->input->get()

    + +

    This function is identical to the post function, only it fetches get data:

    + +$this->input->get('some_data', TRUE); + +

    $this->input->get_post()

    + +

    This function will search through both the post and get streams for data, looking first in post, and then in get:

    + +$this->input->get_post('some_data', TRUE); + +

    $this->input->cookie()

    + +

    This function is identical to the post function, only it fetches cookie data:

    + +$this->input->cookie('some_data', TRUE); + +

    $this->input->server()

    + +

    This function is identical to the above functions, only it fetches server data:

    + +$this->input->server('some_data'); + + + + +

    $this->input->ip_address()

    +

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    +echo $this->input->ip_address(); + + +

    $this->input->valid_ip($ip)

    + +

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +validates the IP automatically.

    + +if ( ! $this->input->valid_ip($ip))
    +{
    +     echo 'Not Valid';
    +}
    +else
    +{
    +     echo 'Valid';
    +}
    + + +

    $this->input->user_agent()

    +

    Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.

    +echo $this->input->user_agent(); + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 0b5e8a21..4967fe0f 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -1,137 +1,137 @@ - - - - - -Language Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Language Class

    - -

    The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

    - -

    In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create -your own language files as needed in order to display error and other messages in other languages.

    - -

    Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your system/application/language -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global -system/language folder.

    - -

    Note:  Each language should be stored in its own folder. For example, the English files are located at: -system/language/english

    - - - -

    Creating Language Files

    - -

    Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: error_lang.php

    - -

    Within the file you will assign each line of text to an array called $lang with this prototype:

    - -$lang['language_key'] = "The actual message to be shown"; - -

    Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

    - -$lang['error_email_missing'] = "You must submit an email address";
    -$lang['error_url_missing'] = "You must submit a URL";
    -$lang['error_username_missing'] = "You must submit a username";
    - - -

    Loading A Language File

    - -

    In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

    - -$this->lang->load('filename', 'language'); - -

    Where filename is the name of the file you wish to load (without the file extension), and language -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your -application/config/config.php file will be used.

    - - -

    Fetching a Line of Text

    - -

    Once your desired language file is loaded you can access any line of text using this function:

    - -$this->lang->line('language_key'); - -

    Where language_key is the array key corresponding to the line you wish to show.

    - -

    Note: This function simply returns the line. It does not echo it for you.

    - -

    Using language lines as form labels

    - -

    This feature has been deprecated from the language library and moved to the lang() function of the Language helper.

    - -

    Auto-loading Languages

    -

    If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

    -

     

    -
    - - - - - - + + + + + +Language Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Language Class

    + +

    The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

    + +

    In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create +your own language files as needed in order to display error and other messages in other languages.

    + +

    Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside +your application folder and store them there. CodeIgniter will look first in your system/application/language +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +system/language folder.

    + +

    Note:  Each language should be stored in its own folder. For example, the English files are located at: +system/language/english

    + + + +

    Creating Language Files

    + +

    Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

    + +

    Within the file you will assign each line of text to an array called $lang with this prototype:

    + +$lang['language_key'] = "The actual message to be shown"; + +

    Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with +similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

    + +$lang['error_email_missing'] = "You must submit an email address";
    +$lang['error_url_missing'] = "You must submit a URL";
    +$lang['error_username_missing'] = "You must submit a username";
    + + +

    Loading A Language File

    + +

    In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

    + +$this->lang->load('filename', 'language'); + +

    Where filename is the name of the file you wish to load (without the file extension), and language +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +application/config/config.php file will be used.

    + + +

    Fetching a Line of Text

    + +

    Once your desired language file is loaded you can access any line of text using this function:

    + +$this->lang->line('language_key'); + +

    Where language_key is the array key corresponding to the line you wish to show.

    + +

    Note: This function simply returns the line. It does not echo it for you.

    + +

    Using language lines as form labels

    + +

    This feature has been deprecated from the language library and moved to the lang() function of the Language helper.

    + +

    Auto-loading Languages

    +

    If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

    +

     

    +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 0e13d86b..2680dfab 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -1,214 +1,214 @@ - - - - - -Loader Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Loader Class

    - -

    Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, -Helpers, Plugins, or your own files.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - -

    The following functions are available in this class:

    - - -

    $this->load->library('class_name', $config, 'object name')

    - - -

    This function is used to load core classes. Where class_name is the name of the class you want to load. -Note: We use the terms "class" and "library" interchangeably.

    - -

    For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

    - -$this->load->library('email'); - -

    Once loaded, the library will be ready for use, using $this->email->some_function(). - -

    Library files can be stored in subdirectories within the main "libraries" folder, or within your personal application/libraries folder. -To load a file located in a subdirectory, simply include the path, relative to the "libraries" folder. -For example, if you have file located at:

    - -libraries/flavors/chocolate.php - -

    You will load it using:

    - -$this->load->library('flavors/chocolate'); - -

    You may nest the file in as many subdirectories as you want.

    - -

    Setting options

    - -

    The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

    - - -$config = array (
    -                  'mailtype' => 'html',
    -                  'charset'  => 'utf-8,
    -                  'priority' => '1'
    -               );
    -
    -$this->load->library('email', $config);
    - -

    Config options can usually also be set via a config file. Each library is explained in detail in its own page, so please read the information regarding each one you would like to use.

    - -

    Assigning a Library to a different object name

    - -

    If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it -will be assigned to a variable named $this->session.

    - -

    If you prefer to set your own class names you can pass its value to the third parameter:

    - -$this->load->library('session', '', 'my_session');

    - -// Session class is now accessed using:

    - -$this->my_session - -
    - - - -

    $this->load->view('file_name', $data, true/false)

    - -

    This function is used to load your View files. If you haven't read the Views section of the -user guide it is recommended that you do since it shows you how this function is typically used.

    - -

    The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

    - -

    The second optional parameter can take -an associative array or an object as input, which it runs through the PHP extract function to -convert to variables that can be used in your view files. Again, read the Views page to learn -how this might be useful.

    - -

    The third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

    - -$string = $this->load->view('myfile', '', true); - - -

    $this->load->model('Model_name');

    -

    $this->load->model('Model_name');

    -

    If your model is located in a sub-folder, include the relative path from your models folder. For example, if you have a model located at application/models/blog/queries.php you'll load it using:

    -

    $this->load->model('blog/queries');

    -

    If you would like your model assigned to a different object name you can specify it via the second parameter of the loading - function:

    - $this->load->model('Model_name', 'fubar');
    -
    -$this->fubar->function();
    -

    $this->load->database('options', true/false)

    -

    This function lets you load the database class. The two parameters are optional. Please see the -database section for more info.

    - - -

    $this->load->scaffolding('table_name')

    - -

    This function lets you enable scaffolding. Please see the -scaffolding section for more info.

    - - - -

    $this->load->vars($array)

    - -

    This function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might -want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached -and merged into one array for conversion to variables. -

    - - -

    $this->load->helper('file_name')

    -

    This function loads helper files, where file_name is the name of the file, without the _helper.php extension.

    - - -

    $this->load->plugin('file_name')

    -

    This function loads plugins files, where file_name is the name of the file, without the _plugin.php extension.

    - -

    $this->load->file('filepath/filename', true/false)

    -

    This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. -By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) -it will instead return the data as a string.

    - - -

    $this->load->lang('file_name')

    -

    This function is an alias of the language loading function: $this->lang->load()

    - -

    $this->load->config('file_name')

    -

    This function is an alias of the config file loading function: $this->config->load()

    - - - - -
    - - - - - - + + + + + +Loader Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Loader Class

    + +

    Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +Helpers, Plugins, or your own files.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + +

    The following functions are available in this class:

    + + +

    $this->load->library('class_name', $config, 'object name')

    + + +

    This function is used to load core classes. Where class_name is the name of the class you want to load. +Note: We use the terms "class" and "library" interchangeably.

    + +

    For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

    + +$this->load->library('email'); + +

    Once loaded, the library will be ready for use, using $this->email->some_function(). + +

    Library files can be stored in subdirectories within the main "libraries" folder, or within your personal application/libraries folder. +To load a file located in a subdirectory, simply include the path, relative to the "libraries" folder. +For example, if you have file located at:

    + +libraries/flavors/chocolate.php + +

    You will load it using:

    + +$this->load->library('flavors/chocolate'); + +

    You may nest the file in as many subdirectories as you want.

    + +

    Setting options

    + +

    The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

    + + +$config = array (
    +                  'mailtype' => 'html',
    +                  'charset'  => 'utf-8,
    +                  'priority' => '1'
    +               );
    +
    +$this->load->library('email', $config);
    + +

    Config options can usually also be set via a config file. Each library is explained in detail in its own page, so please read the information regarding each one you would like to use.

    + +

    Assigning a Library to a different object name

    + +

    If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it +will be assigned to a variable named $this->session.

    + +

    If you prefer to set your own class names you can pass its value to the third parameter:

    + +$this->load->library('session', '', 'my_session');

    + +// Session class is now accessed using:

    + +$this->my_session + +
    + + + +

    $this->load->view('file_name', $data, true/false)

    + +

    This function is used to load your View files. If you haven't read the Views section of the +user guide it is recommended that you do since it shows you how this function is typically used.

    + +

    The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

    + +

    The second optional parameter can take +an associative array or an object as input, which it runs through the PHP extract function to +convert to variables that can be used in your view files. Again, read the Views page to learn +how this might be useful.

    + +

    The third optional parameter lets you change the behavior of the function so that it returns data as a string +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

    + +$string = $this->load->view('myfile', '', true); + + +

    $this->load->model('Model_name');

    +

    $this->load->model('Model_name');

    +

    If your model is located in a sub-folder, include the relative path from your models folder. For example, if you have a model located at application/models/blog/queries.php you'll load it using:

    +

    $this->load->model('blog/queries');

    +

    If you would like your model assigned to a different object name you can specify it via the second parameter of the loading + function:

    + $this->load->model('Model_name', 'fubar');
    +
    +$this->fubar->function();
    +

    $this->load->database('options', true/false)

    +

    This function lets you load the database class. The two parameters are optional. Please see the +database section for more info.

    + + +

    $this->load->scaffolding('table_name')

    + +

    This function lets you enable scaffolding. Please see the +scaffolding section for more info.

    + + + +

    $this->load->vars($array)

    + +

    This function takes an associative array as input and generates variables using the PHP extract function. +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +want to use this function independently is if you would like to set some global variables in the constructor of your controller +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and merged into one array for conversion to variables. +

    + + +

    $this->load->helper('file_name')

    +

    This function loads helper files, where file_name is the name of the file, without the _helper.php extension.

    + + +

    $this->load->plugin('file_name')

    +

    This function loads plugins files, where file_name is the name of the file, without the _plugin.php extension.

    + +

    $this->load->file('filepath/filename', true/false)

    +

    This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) +it will instead return the data as a string.

    + + +

    $this->load->lang('file_name')

    +

    This function is an alias of the language loading function: $this->lang->load()

    + +

    $this->load->config('file_name')

    +

    This function is an alias of the config file loading function: $this->config->load()

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 7af2b358..004e0420 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -1,145 +1,145 @@ - - - - - -Output Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Output Class

    - -

    The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is -also responsible for caching your web pages, if you use that feature.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - -

    Under normal circumstances you won't even notice the Output class since it works transparently without your intervention. -For example, when you use the Loader class to load a view file, it's automatically -passed to the Output class, which will be called automatically by CodeIgniter at the end of system execution. -It is possible, however, for you to manually intervene with the output if you need to, using either of the two following functions:

    - -

    $this->output->set_output();

    - -

    Permits you to manually set the final output string. Usage example:

    - -$this->output->set_output($data); - -

    Important: If you do set your output manually, it must be the last thing done in the function you call it from. -For example, if you build a page in one of your controller functions, don't set the output until the end.

    - - -

    $this->output->get_output();

    - -

    Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

    -$string = $this->output->get_output(); - -

    Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the -CodeIgniter functions like $this->load->view().

    - - -

    $this->output->set_header();

    - -

    Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

    - - -$this->output->set_header("HTTP/1.0 200 OK");
    -$this->output->set_header("HTTP/1.1 200 OK");
    -$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
    -$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
    -$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
    -$this->output->set_header("Pragma: no-cache");
    - - -

    $this->output->set_status_header();

    - -

    Permits you to manually set a server status header. Example:

    - -$this->output->set_status_header('401');
    -// Sets the header as: Unauthorized
    - -

    See here for a full list of headers.

    - -

    $this->output->enable_profiler();

    - -

    Permits you to enable/disable the Profiler, which will display benchmark and other data -at the bottom of your pages for debugging and optimization purposes.

    - -

    To enable the profiler place the following function anywhere within your Controller functions:

    -$this->output->enable_profiler(TRUE); - -

    When enabled a report will be generated and inserted at the bottom of your pages.

    - -

    To disable the profiler you will use:

    -$this->output->enable_profiler(FALSE); - - -

    $this->output->cache();

    -

    The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

    - -
    - - - - - - + + + + + +Output Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Output Class

    + +

    The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +also responsible for caching your web pages, if you use that feature.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + +

    Under normal circumstances you won't even notice the Output class since it works transparently without your intervention. +For example, when you use the Loader class to load a view file, it's automatically +passed to the Output class, which will be called automatically by CodeIgniter at the end of system execution. +It is possible, however, for you to manually intervene with the output if you need to, using either of the two following functions:

    + +

    $this->output->set_output();

    + +

    Permits you to manually set the final output string. Usage example:

    + +$this->output->set_output($data); + +

    Important: If you do set your output manually, it must be the last thing done in the function you call it from. +For example, if you build a page in one of your controller functions, don't set the output until the end.

    + + +

    $this->output->get_output();

    + +

    Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

    +$string = $this->output->get_output(); + +

    Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the +CodeIgniter functions like $this->load->view().

    + + +

    $this->output->set_header();

    + +

    Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

    + + +$this->output->set_header("HTTP/1.0 200 OK");
    +$this->output->set_header("HTTP/1.1 200 OK");
    +$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
    +$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
    +$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
    +$this->output->set_header("Pragma: no-cache");
    + + +

    $this->output->set_status_header();

    + +

    Permits you to manually set a server status header. Example:

    + +$this->output->set_status_header('401');
    +// Sets the header as: Unauthorized
    + +

    See here for a full list of headers.

    + +

    $this->output->enable_profiler();

    + +

    Permits you to enable/disable the Profiler, which will display benchmark and other data +at the bottom of your pages for debugging and optimization purposes.

    + +

    To enable the profiler place the following function anywhere within your Controller functions:

    +$this->output->enable_profiler(TRUE); + +

    When enabled a report will be generated and inserted at the bottom of your pages.

    + +

    To disable the profiler you will use:

    +$this->output->enable_profiler(FALSE); + + +

    $this->output->cache();

    +

    The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 452a4d21..79e5a5bd 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -1,218 +1,218 @@ - - - - - -Pagination Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Pagination Class

    - -

    CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.

    - -

    If you are not familiar with the term "pagination", it refers to links that allows you to navigate from page to page, like this:

    - -« First  < 1 2 3 4 5 >  Last » - -

    Example

    - -

    Here is a simple example showing how to create pagination in one of your controller functions:

    - - -$this->load->library('pagination');

    -$config['base_url'] = 'http://example.com/index.php/test/page/';
    -$config['total_rows'] = '200';
    -$config['per_page'] = '20'; -

    -$this->pagination->initialize($config); - -

    -echo $this->pagination->create_links();
    - -

    Notes:

    - -

    The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

    - -
      -
    • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can - re-route your URI if you need a different structure.
    • -
    • total_rows This number represents the total rows in the result set you are creating pagination for. - Typically this number will be the total rows that your database query returned. -
    • -
    • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
    • -
    - -

    The create_links() function returns an empty string when there is no pagination to show.

    - - -

    Setting preferences in a config file

    - -

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called pagination.php, add the $config -array in that file. Then save the file in: config/pagination.php and it will be used automatically. You -will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

    - - -

    Customizing the Pagination

    - -

    The following is a list of all the preferences you can pass to the initialization function to tailor the display.

    - - -

    $config['uri_segment'] = 3;

    - -

    The pagination function automatically determines which segment of your URI contains the page number. If you need -something different you can specify it.

    - -

    $config['num_links'] = 2;

    - -

    The number of "digit" links you would like before and after the selected page number. For example, the number 2 - will place two digits on either side, as in the example links at the very top of this page.

    -

    $config['page_query_string'] = TRUE

    -

    By default, the pagination library assume you are using URI Segments, and constructs your links something like

    -

    http://example.com/index.php/test/page/20

    -

    If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

    -

    http://example.com/index.php?c=test&m=page&per_page=20

    -

    Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

    -

    Adding Enclosing Markup

    - -

    If you would like to surround the entire pagination with some markup you can do it with these two prefs:

    - -

    $config['full_tag_open'] = '<p>';

    -

    The opening tag placed on the left side of the entire result.

    - -

    $config['full_tag_close'] = '</p>';

    -

    The closing tag placed on the right side of the entire result.

    - - -

    Customizing the First Link

    - -

    $config['first_link'] = 'First';

    -

    The text you would like shown in the "first" link on the left.

    - -

    $config['first_tag_open'] = '<div>';

    -

    The opening tag for the "first" link.

    - -

    $config['first_tag_close'] = '</div>';

    -

    The closing tag for the "first" link.

    - -

    Customizing the Last Link

    - -

    $config['last_link'] = 'Last';

    -

    The text you would like shown in the "last" link on the right.

    - -

    $config['last_tag_open'] = '<div>';

    -

    The opening tag for the "last" link.

    - -

    $config['last_tag_close'] = '</div>';

    -

    The closing tag for the "last" link.

    - -

    Customizing the "Next" Link

    - -

    $config['next_link'] = '&gt;';

    -

    The text you would like shown in the "next" page link.

    - -

    $config['next_tag_open'] = '<div>';

    -

    The opening tag for the "next" link.

    - -

    $config['next_tag_close'] = '</div>';

    -

    The closing tag for the "next" link.

    - -

    Customizing the "Previous" Link

    - -

    $config['prev_link'] = '&lt;';

    -

    The text you would like shown in the "previous" page link.

    - -

    $config['prev_tag_open'] = '<div>';

    -

    The opening tag for the "previous" link.

    - -

    $config['prev_tag_close'] = '</div>';

    -

    The closing tag for the "previous" link.

    - -

    Customizing the "Current Page" Link

    - -

    $config['cur_tag_open'] = '<b>';

    -

    The opening tag for the "current" link.

    - -

    $config['cur_tag_close'] = '</b>';

    -

    The closing tag for the "current" link.

    - - -

    Customizing the "Digit" Link

    - -

    $config['num_tag_open'] = '<div>';

    -

    The opening tag for the "digit" link.

    - -

    $config['num_tag_close'] = '</div>';

    -

    The closing tag for the "digit" link.

    - - - -
    - - - - - - + + + + + +Pagination Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Pagination Class

    + +

    CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.

    + +

    If you are not familiar with the term "pagination", it refers to links that allows you to navigate from page to page, like this:

    + +« First  < 1 2 3 4 5 >  Last » + +

    Example

    + +

    Here is a simple example showing how to create pagination in one of your controller functions:

    + + +$this->load->library('pagination');

    +$config['base_url'] = 'http://example.com/index.php/test/page/';
    +$config['total_rows'] = '200';
    +$config['per_page'] = '20'; +

    +$this->pagination->initialize($config); + +

    +echo $this->pagination->create_links();
    + +

    Notes:

    + +

    The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

    + +
      +
    • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can + re-route your URI if you need a different structure.
    • +
    • total_rows This number represents the total rows in the result set you are creating pagination for. + Typically this number will be the total rows that your database query returned. +
    • +
    • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
    • +
    + +

    The create_links() function returns an empty string when there is no pagination to show.

    + + +

    Setting preferences in a config file

    + +

    If you prefer not to set preferences using the above method, you can instead put them into a config file. +Simply create a new file called pagination.php, add the $config +array in that file. Then save the file in: config/pagination.php and it will be used automatically. You +will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

    + + +

    Customizing the Pagination

    + +

    The following is a list of all the preferences you can pass to the initialization function to tailor the display.

    + + +

    $config['uri_segment'] = 3;

    + +

    The pagination function automatically determines which segment of your URI contains the page number. If you need +something different you can specify it.

    + +

    $config['num_links'] = 2;

    + +

    The number of "digit" links you would like before and after the selected page number. For example, the number 2 + will place two digits on either side, as in the example links at the very top of this page.

    +

    $config['page_query_string'] = TRUE

    +

    By default, the pagination library assume you are using URI Segments, and constructs your links something like

    +

    http://example.com/index.php/test/page/20

    +

    If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

    +

    http://example.com/index.php?c=test&m=page&per_page=20

    +

    Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

    +

    Adding Enclosing Markup

    + +

    If you would like to surround the entire pagination with some markup you can do it with these two prefs:

    + +

    $config['full_tag_open'] = '<p>';

    +

    The opening tag placed on the left side of the entire result.

    + +

    $config['full_tag_close'] = '</p>';

    +

    The closing tag placed on the right side of the entire result.

    + + +

    Customizing the First Link

    + +

    $config['first_link'] = 'First';

    +

    The text you would like shown in the "first" link on the left.

    + +

    $config['first_tag_open'] = '<div>';

    +

    The opening tag for the "first" link.

    + +

    $config['first_tag_close'] = '</div>';

    +

    The closing tag for the "first" link.

    + +

    Customizing the Last Link

    + +

    $config['last_link'] = 'Last';

    +

    The text you would like shown in the "last" link on the right.

    + +

    $config['last_tag_open'] = '<div>';

    +

    The opening tag for the "last" link.

    + +

    $config['last_tag_close'] = '</div>';

    +

    The closing tag for the "last" link.

    + +

    Customizing the "Next" Link

    + +

    $config['next_link'] = '&gt;';

    +

    The text you would like shown in the "next" page link.

    + +

    $config['next_tag_open'] = '<div>';

    +

    The opening tag for the "next" link.

    + +

    $config['next_tag_close'] = '</div>';

    +

    The closing tag for the "next" link.

    + +

    Customizing the "Previous" Link

    + +

    $config['prev_link'] = '&lt;';

    +

    The text you would like shown in the "previous" page link.

    + +

    $config['prev_tag_open'] = '<div>';

    +

    The opening tag for the "previous" link.

    + +

    $config['prev_tag_close'] = '</div>';

    +

    The closing tag for the "previous" link.

    + +

    Customizing the "Current Page" Link

    + +

    $config['cur_tag_open'] = '<b>';

    +

    The opening tag for the "current" link.

    + +

    $config['cur_tag_close'] = '</b>';

    +

    The closing tag for the "current" link.

    + + +

    Customizing the "Digit" Link

    + +

    $config['num_tag_open'] = '<div>';

    +

    The opening tag for the "digit" link.

    + +

    $config['num_tag_close'] = '</div>';

    +

    The closing tag for the "digit" link.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 7d6b2afa..8151eb12 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -1,208 +1,208 @@ - - - - - -Template Parser Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - - - -

    Template Parser Class

    - -

    The Template Parser Class enables you to parse pseudo-variables contained within your view files. It can parse simple -variables or variable tag pairs. If you've never used a template engine, pseudo-variables look like this:

    - -<html>
    -<head>
    -<title>{blog_title}</title>
    -</head>
    -<body>
    -
    -<h3>{blog_heading}</h3>
    -
    -{blog_entries}
    -<h5>{title}</h5>
    -<p>{body}</p>
    -{/blog_entries}
    - -</body>
    -</html>
    - -

    These variables are not actual PHP variables, but rather plain text representations that allow you to eliminate -PHP from your templates (view files).

    - -

    Note: CodeIgniter does not require you to use this class -since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if -they work with designers who they feel would find some confusion working with PHP.

    - -

    Also Note: The Template Parser Class is not a -full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

    - - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Parser class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('parser'); -

    Once loaded, the Parser library object will be available using: $this->parser

    - - -

    The following functions are available in this library:

    - -

    $this->parser->parse()

    - -

    This method accepts a template name and data array as input, and it generates a parsed version. Example:

    - -$this->load->library('parser');
    -
    -$data = array(
    -            'blog_title' => 'My Blog Title',
    -            'blog_heading' => 'My Blog Heading'
    -            );
    -
    -$this->parser->parse('blog_template', $data);
    - -

    The first parameter contains the name of the view file (in this example the file would be called blog_template.php), -and the second parameter contains an associative array of data to be replaced in the template. In the above example, the -template would contain two variables: {blog_title} and {blog_heading}

    - -

    There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically -passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can -pass TRUE (boolean) to the third parameter:

    - -$string = $this->parser->parse('blog_template', $data, TRUE); - - -

    Variable Pairs

    - -

    The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be -repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

    - -<html>
    -<head>
    -<title>{blog_title}</title>
    -</head>
    -<body>
    -
    -<h3>{blog_heading}</h3>
    -
    -{blog_entries}
    -<h5>{title}</h5>
    -<p>{body}</p>
    -{/blog_entries}
    - -</body>
    -</html>
    - -

    In the above code you'll notice a pair of variables: {blog_entries} data... {/blog_entries}. -In a case like this, the entire chunk of data between these pairs would be repeated multiple times, corresponding -to the number of rows in a result.

    - -

    Parsing variable pairs is done using the identical code shown above to parse single variables, -except, you will add a multi-dimensional array corresponding to your variable pair data. -Consider this example:

    - - -$this->load->library('parser');
    -
    -$data = array(
    -              'blog_title'   => 'My Blog Title',
    -              'blog_heading' => 'My Blog Heading',
    -              'blog_entries' => array(
    -                                      array('title' => 'Title 1', 'body' => 'Body 1'),
    -                                      array('title' => 'Title 2', 'body' => 'Body 2'),
    -                                      array('title' => 'Title 3', 'body' => 'Body 3'),
    -                                      array('title' => 'Title 4', 'body' => 'Body 4'),
    -                                      array('title' => 'Title 5', 'body' => 'Body 5')
    -                                      )
    -            );
    -
    -$this->parser->parse('blog_template', $data);
    - -

    If your "pair" data is coming from a database result, which is already a multi-dimensional array, you can simply -use the database result_array() function:

    - - -$query = $this->db->query("SELECT * FROM blog");
    -
    -$this->load->library('parser');
    -
    -$data = array(
    -              'blog_title'   => 'My Blog Title',
    -              'blog_heading' => 'My Blog Heading',
    -              'blog_entries' => $query->result_array()
    -            );
    -
    -$this->parser->parse('blog_template', $data);
    - - - - -
    - - - - - - + + + + + +Template Parser Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + + + +

    Template Parser Class

    + +

    The Template Parser Class enables you to parse pseudo-variables contained within your view files. It can parse simple +variables or variable tag pairs. If you've never used a template engine, pseudo-variables look like this:

    + +<html>
    +<head>
    +<title>{blog_title}</title>
    +</head>
    +<body>
    +
    +<h3>{blog_heading}</h3>
    +
    +{blog_entries}
    +<h5>{title}</h5>
    +<p>{body}</p>
    +{/blog_entries}
    + +</body>
    +</html>
    + +

    These variables are not actual PHP variables, but rather plain text representations that allow you to eliminate +PHP from your templates (view files).

    + +

    Note: CodeIgniter does not require you to use this class +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +they work with designers who they feel would find some confusion working with PHP.

    + +

    Also Note: The Template Parser Class is not a +full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

    + + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Parser class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('parser'); +

    Once loaded, the Parser library object will be available using: $this->parser

    + + +

    The following functions are available in this library:

    + +

    $this->parser->parse()

    + +

    This method accepts a template name and data array as input, and it generates a parsed version. Example:

    + +$this->load->library('parser');
    +
    +$data = array(
    +            'blog_title' => 'My Blog Title',
    +            'blog_heading' => 'My Blog Heading'
    +            );
    +
    +$this->parser->parse('blog_template', $data);
    + +

    The first parameter contains the name of the view file (in this example the file would be called blog_template.php), +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +template would contain two variables: {blog_title} and {blog_heading}

    + +

    There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +pass TRUE (boolean) to the third parameter:

    + +$string = $this->parser->parse('blog_template', $data, TRUE); + + +

    Variable Pairs

    + +

    The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

    + +<html>
    +<head>
    +<title>{blog_title}</title>
    +</head>
    +<body>
    +
    +<h3>{blog_heading}</h3>
    +
    +{blog_entries}
    +<h5>{title}</h5>
    +<p>{body}</p>
    +{/blog_entries}
    + +</body>
    +</html>
    + +

    In the above code you'll notice a pair of variables: {blog_entries} data... {/blog_entries}. +In a case like this, the entire chunk of data between these pairs would be repeated multiple times, corresponding +to the number of rows in a result.

    + +

    Parsing variable pairs is done using the identical code shown above to parse single variables, +except, you will add a multi-dimensional array corresponding to your variable pair data. +Consider this example:

    + + +$this->load->library('parser');
    +
    +$data = array(
    +              'blog_title'   => 'My Blog Title',
    +              'blog_heading' => 'My Blog Heading',
    +              'blog_entries' => array(
    +                                      array('title' => 'Title 1', 'body' => 'Body 1'),
    +                                      array('title' => 'Title 2', 'body' => 'Body 2'),
    +                                      array('title' => 'Title 3', 'body' => 'Body 3'),
    +                                      array('title' => 'Title 4', 'body' => 'Body 4'),
    +                                      array('title' => 'Title 5', 'body' => 'Body 5')
    +                                      )
    +            );
    +
    +$this->parser->parse('blog_template', $data);
    + +

    If your "pair" data is coming from a database result, which is already a multi-dimensional array, you can simply +use the database result_array() function:

    + + +$query = $this->db->query("SELECT * FROM blog");
    +
    +$this->load->library('parser');
    +
    +$data = array(
    +              'blog_title'   => 'My Blog Title',
    +              'blog_heading' => 'My Blog Heading',
    +              'blog_entries' => $query->result_array()
    +            );
    +
    +$this->parser->parse('blog_template', $data);
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 8ceadf24..fbbaa64e 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -1,311 +1,311 @@ - - - - - -Session Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Session Class

    - -

    The Session class permits you maintain a user's "state" and track their activity while they browse your site. -The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. -It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to -use the database option you'll need to create the session table as indicated below. -

    - -

    Note: The Session class does not utilize native PHP sessions. It -generates its own session data, offering more flexibility for developers.

    - -

    Initializing a Session

    - -

    Sessions will typically run globally with each page load, so the session class must either be -initialized in your -controller constructors, or it can be -auto-loaded by the system. -For the most part the session class will run unattended in the background, so simply initializing the class -will cause it to read, create, and update sessions.

    - - -

    To initialize the Session class manually in your controller constructor, use the $this->load->library function:

    - -$this->load->library('session'); -

    Once loaded, the Sessions library object will be available using: $this->session

    - - -

    How do Sessions work?

    - -

    When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. -If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. -If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

    - -

    It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or -even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

    - - -

    What is Session Data?

    - -

    A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

    - -
      -
    • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
    • -
    • The user's IP Address
    • -
    • The user's User Agent data (the first 50 characters of the browser data string)
    • -
    • The "last activity" time stamp.
    • -
    - -

    The above data is stored in a cookie as a serialized array with this prototype:

    - -[array]
    -(
    -     'session_id'    => random hash,
    -     'ip_address'    => 'string - user IP address',
    -     'user_agent'    => 'string - user agent data',
    -     'last_activity' => timestamp
    -)
    - -

    If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, -making the data highly secure and impervious to being read or altered by someone. More info regarding encryption -can be found here, although the Session class will take care of initializing -and encrypting the data automatically.

    - -

    Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page -you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time -the cookie was written. This time is configurable by changing the $config['time_to_update'] line in your system/config/config.php file.

    - -

    Retrieving Session Data

    - -

    Any piece of information from the session array is available using the following function:

    - -$this->session->userdata('item'); - -

    Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you -will do this:

    - -$session_id = $this->session->userdata('session_id'); - -

    Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

    - - -

    Adding Custom Session Data

    - -

    A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

    - -

    Let's say a particular user logs into your site. Once authenticated, -you could add their username and email address to the session cookie, making that data globally available to you without -having to run a database query when you need it.

    - -

    To add your data to the session array involves passing an array containing your new data to this function:

    - -$this->session->set_userdata($array); - -

    Where $array is an associative array containing your new data. Here's an example:

    - - -

    $newdata = array(
    -                    'username'  => 'johndoe',
    -                    'email'     => 'johndoe@some-site.com',
    -                    'logged_in' => TRUE
    -                );
    -
    - $this->session->set_userdata($newdata);

    -

    If you want to add userdata one value at a time, set_userdata() also supports this syntax.

    -

    $this->session->set_userdata('some_name', 'some_value');

    -

    Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The -encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

    - -

    Removing Session Data

    -

    Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

    -

    $this->session->unset_userdata('some_name');

    -

    This function can also be passed an associative array of items to unset.

    -

    $array_items = array('username' => '', 'email' => '');
    -
    -$this->session->unset_userdata($array_items);

    -

    Flashdata

    -

    CodeIgniter supports "flashdata", or session data that will only be available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

    -

    Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

    -

    To add flashdata:

    -

    $this->session->set_flashdata('item', 'value');

    -

    You can also pass an array to set_flashdata(), in the same manner as set_userdata().

    -

    To read a flashdata variable:

    -

    $this->session->flashdata('item');

    -

    If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.

    -

    $this->session->keep_flashdata('item');

    -

    Saving Session Data to a Database

    -

    While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

    - -

    When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never -be updated, they can only be generated when a new session is created.

    - -

    In order to store sessions, you must first create a database table for this purpose. Here is the basic -prototype (for MySQL) required by the session class:

    - - - -

    Note: By default the table is called ci_sessions, but you can name it anything you want -as long as you update the application/config/config.php file so that it contains the name you have chosen. -Once you have created your database table you can enable the database option in your config.php file as follows:

    - -$config['sess_use_database'] = TRUE; - -

    Once enabled, the Session class will store session data in the DB.

    - -

    Make sure you've specified the table name in your config file as well:

    - -$config['sess_table_name'] = 'ci_sessions"; - -

    Note: The Session class has built-in garbage collection which clears out expired sessions so you -do not need to write your own routine to do it.

    - - -

    Destroying a Session

    -

    To clear the current session:

    -$this->session->sess_destroy(); -

    Note: This function should be the last one called, and even flash variables will no longer be available. If you only want some items destroyed and not all, use unset_userdata().

    - - - -

    Session Preferences

    -

    You'll find the following Session related preferences in your application/config/config.php file:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PreferenceDefaultOptionsDescription
    sess_cookie_nameci_sessionNoneThe name you want the session cookie saved as.
    sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0
    sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
    sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
    sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
    sess_time_to_update300Time in secondsThis options controls how often the session class will regenerate itself and create a new session id.
    sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically - changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
    sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
    - - -
    - - - - - - + + + + + +Session Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Session Class

    + +

    The Session class permits you maintain a user's "state" and track their activity while they browse your site. +The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. +It can also store the session data in a database table for added security, as this permits the session ID in the +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +use the database option you'll need to create the session table as indicated below. +

    + +

    Note: The Session class does not utilize native PHP sessions. It +generates its own session data, offering more flexibility for developers.

    + +

    Initializing a Session

    + +

    Sessions will typically run globally with each page load, so the session class must either be +initialized in your +controller constructors, or it can be +auto-loaded by the system. +For the most part the session class will run unattended in the background, so simply initializing the class +will cause it to read, create, and update sessions.

    + + +

    To initialize the Session class manually in your controller constructor, use the $this->load->library function:

    + +$this->load->library('session'); +

    Once loaded, the Sessions library object will be available using: $this->session

    + + +

    How do Sessions work?

    + +

    When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie. +If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. +If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

    + +

    It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

    + + +

    What is Session Data?

    + +

    A session, as far as CodeIgniter is concerned, is simply an array containing the following information:

    + +
      +
    • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
    • +
    • The user's IP Address
    • +
    • The user's User Agent data (the first 50 characters of the browser data string)
    • +
    • The "last activity" time stamp.
    • +
    + +

    The above data is stored in a cookie as a serialized array with this prototype:

    + +[array]
    +(
    +     'session_id'    => random hash,
    +     'ip_address'    => 'string - user IP address',
    +     'user_agent'    => 'string - user agent data',
    +     'last_activity' => timestamp
    +)
    + +

    If you have the encryption option enabled, the serialized array will be encrypted before being stored in the cookie, +making the data highly secure and impervious to being read or altered by someone. More info regarding encryption +can be found here, although the Session class will take care of initializing +and encrypting the data automatically.

    + +

    Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time +the cookie was written. This time is configurable by changing the $config['time_to_update'] line in your system/config/config.php file.

    + +

    Retrieving Session Data

    + +

    Any piece of information from the session array is available using the following function:

    + +$this->session->userdata('item'); + +

    Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +will do this:

    + +$session_id = $this->session->userdata('session_id'); + +

    Note: The function returns FALSE (boolean) if the item you are trying to access does not exist.

    + + +

    Adding Custom Session Data

    + +

    A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. +Why would you want to do this? Here's one example:

    + +

    Let's say a particular user logs into your site. Once authenticated, +you could add their username and email address to the session cookie, making that data globally available to you without +having to run a database query when you need it.

    + +

    To add your data to the session array involves passing an array containing your new data to this function:

    + +$this->session->set_userdata($array); + +

    Where $array is an associative array containing your new data. Here's an example:

    + + +

    $newdata = array(
    +                    'username'  => 'johndoe',
    +                    'email'     => 'johndoe@some-site.com',
    +                    'logged_in' => TRUE
    +                );
    +
    + $this->session->set_userdata($newdata);

    +

    If you want to add userdata one value at a time, set_userdata() also supports this syntax.

    +

    $this->session->set_userdata('some_name', 'some_value');

    +

    Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

    + +

    Removing Session Data

    +

    Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

    +

    $this->session->unset_userdata('some_name');

    +

    This function can also be passed an associative array of items to unset.

    +

    $array_items = array('username' => '', 'email' => '');
    +
    +$this->session->unset_userdata($array_items);

    +

    Flashdata

    +

    CodeIgniter supports "flashdata", or session data that will only be available for the next server request, and are then automatically cleared. These can be very useful, and are typically used for informational or status messages (for example: "record 2 deleted").

    +

    Note: Flash variables are prefaced with "flash_" so avoid this prefix in your own session names.

    +

    To add flashdata:

    +

    $this->session->set_flashdata('item', 'value');

    +

    You can also pass an array to set_flashdata(), in the same manner as set_userdata().

    +

    To read a flashdata variable:

    +

    $this->session->flashdata('item');

    +

    If you find that you need to preserve a flashdata variable through an additional request, you can do so using the keep_flashdata() function.

    +

    $this->session->keep_flashdata('item');

    +

    Saving Session Data to a Database

    +

    While the session data array stored in the user's cookie contains a Session ID, +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

    + +

    When session data is available in a database, every time a valid session is found in the user's cookie, a database +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +be updated, they can only be generated when a new session is created.

    + +

    In order to store sessions, you must first create a database table for this purpose. Here is the basic +prototype (for MySQL) required by the session class:

    + + + +

    Note: By default the table is called ci_sessions, but you can name it anything you want +as long as you update the application/config/config.php file so that it contains the name you have chosen. +Once you have created your database table you can enable the database option in your config.php file as follows:

    + +$config['sess_use_database'] = TRUE; + +

    Once enabled, the Session class will store session data in the DB.

    + +

    Make sure you've specified the table name in your config file as well:

    + +$config['sess_table_name'] = 'ci_sessions"; + +

    Note: The Session class has built-in garbage collection which clears out expired sessions so you +do not need to write your own routine to do it.

    + + +

    Destroying a Session

    +

    To clear the current session:

    +$this->session->sess_destroy(); +

    Note: This function should be the last one called, and even flash variables will no longer be available. If you only want some items destroyed and not all, use unset_userdata().

    + + + +

    Session Preferences

    +

    You'll find the following Session related preferences in your application/config/config.php file:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PreferenceDefaultOptionsDescription
    sess_cookie_nameci_sessionNoneThe name you want the session cookie saved as.
    sess_expiration7200NoneThe number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0
    sess_encrypt_cookieFALSETRUE/FALSE (boolean)Whether to encrypt the session data.
    sess_use_databaseFALSETRUE/FALSE (boolean)Whether to save the session data to a database. You must create the table before enabling this option.
    sess_table_nameci_sessionsAny valid SQL table nameThe name of the session database table.
    sess_time_to_update300Time in secondsThis options controls how often the session class will regenerate itself and create a new session id.
    sess_match_ipFALSETRUE/FALSE (boolean)Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically + changes the IP, so if you want a non-expiring session you will likely set this to FALSE.
    sess_match_useragentTRUETRUE/FALSE (boolean)Whether to match the User Agent when reading the session data.
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 7671d2aa..92fcc9c7 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -1,292 +1,292 @@ - - - - - -HTML Table Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    HTML Table Class

    - -

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('table'); -

    Once loaded, the Table library object will be available using: $this->table

    - - -

    Examples

    - -

    Here is an example showing how you can create a table from a multi-dimensional array. -Note that the first array index will become the table heading (or you can set your own headings using the -set_heading() function described in the function reference below).

    - - -$this->load->library('table');
    -
    -$data = array(
    -             array('Name', 'Color', 'Size'),
    -             array('Fred', 'Blue', 'Small'),
    -             array('Mary', 'Red', 'Large'),
    -             array('John', 'Green', 'Medium')
    -             );
    -
    -echo $this->table->generate($data); -
    - -

    Here is an example of a table created from a database query result. The table class will automatically generate the -headings based on the table names (or you can set your own headings using the set_heading() function described -in the function reference below).

    - - -$this->load->library('table');
    -
    -$query = $this->db->query("SELECT * FROM my_table");
    -
    -echo $this->table->generate($query); -
    - - -

    Here is an example showing how you might create a table using discrete parameters:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading('Name', 'Color', 'Size');
    -
    -$this->table->add_row('Fred', 'Blue', 'Small');
    -$this->table->add_row('Mary', 'Red', 'Large');
    -$this->table->add_row('John', 'Green', 'Medium');
    -
    -echo $this->table->generate(); -
    - -

    Here is the same example, except instead of individual parameters, arrays are used:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading(array('Name', 'Color', 'Size'));
    -
    -$this->table->add_row(array('Fred', 'Blue', 'Small'));
    -$this->table->add_row(array('Mary', 'Red', 'Large'));
    -$this->table->add_row(array('John', 'Green', 'Medium'));
    -
    -echo $this->table->generate(); -
    - - -

    Changing the Look of Your Table

    - -

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template -prototype:

    - - -$tmpl = array (
    -                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',
    -
    -                    'heading_row_start'   => '<tr>',
    -                    'heading_row_end'     => '</tr>',
    -                    'heading_cell_start'  => '<th>',
    -                    'heading_cell_end'    => '</th>',
    -
    -                    'row_start'           => '<tr>',
    -                    'row_end'             => '</tr>',
    -                    'cell_start'          => '<td>',
    -                    'cell_end'            => '</td>',
    -
    -                    'row_alt_start'       => '<tr>',
    -                    'row_alt_end'         => '</tr>',
    -                    'cell_alt_start'      => '<td>',
    -                    'cell_alt_end'        => '</td>',
    -
    -                    'table_close'         => '</table>'
    -              );
    - -
    -$this->table->set_template($tmpl); -
    - -

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each -iteration of the row data.

    - -

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. -In this example, only the table opening tag is being changed:

    - - -$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    - -
    -$this->table->set_template($tmpl); -
    - -
    -

    Function Reference

    - -

    $this->table->generate()

    -

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    - -

    $this->table->set_caption()

    - -

    Permits you to add a caption to the table.

    - -$this->table->set_caption('Colors'); - -

    $this->table->set_heading()

    - -

    Permits you to set the table heading. You can submit an array or discrete params:

    - -$this->table->set_heading('Name', 'Color', 'Size'); -$this->table->set_heading(array('Name', 'Color', 'Size')); - -

    $this->table->add_row()

    - -

    Permits you to add a row to your table. You can submit an array or discrete params:

    - -$this->table->add_row('Blue', 'Red', 'Green'); -$this->table->add_row(array('Blue', 'Red', 'Green')); - - -

    $this->table->make_columns()

    - -

    This function takes a one-dimensional array as input and creates -a multi-dimensional array with a depth equal to the number of -columns desired. This allows a single array with many elements to be -displayed in a table that has a fixed column count. Consider this example:

    - - -$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
    -
    -$new_list = $this->table->make_columns($list, 3);
    -
    -$this->table->generate($new_list);
    -
    -// Generates a table with this prototype
    -
    -<table border="0" cellpadding="4" cellspacing="0">
    -<tr>
    -<td>one</td><td>two</td><td>three</td>
    -</tr><tr>
    -<td>four</td><td>five</td><td>six</td>
    -</tr><tr>
    -<td>seven</td><td>eight</td><td>nine</td>
    -</tr><tr>
    -<td>ten</td><td>eleven</td><td>twelve</td></tr>
    -</table>
    - - - -

    $this->table->set_template()

    - -

    Permits you to set your template. You can submit a full or partial template.

    - - -$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    - -
    -$this->table->set_template($tmpl); -
    - - -

    $this->table->set_empty()

    - -

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    - - -$this->table->set_empty("&nbsp;"); - - -

    $this->table->clear()

    - -

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should -to call this function after each table has been generated to empty the previous table information. Example:

    - - -$this->load->library('table');
    -
    -$this->table->set_heading('Name', 'Color', 'Size');
    -$this->table->add_row('Fred', 'Blue', 'Small');
    -$this->table->add_row('Mary', 'Red', 'Large');
    -$this->table->add_row('John', 'Green', 'Medium');
    -
    -echo $this->table->generate();
    -
    -$this->table->clear();
    -
    -$this->table->set_heading('Name', 'Day', 'Delivery');
    -$this->table->add_row('Fred', 'Wednesday', 'Express');
    -$this->table->add_row('Mary', 'Monday', 'Air');
    -$this->table->add_row('John', 'Saturday', 'Overnight');
    -
    -echo $this->table->generate(); -
    - -
    - - - - - - + + + + + +HTML Table Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    HTML Table Class

    + +

    The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Table class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('table'); +

    Once loaded, the Table library object will be available using: $this->table

    + + +

    Examples

    + +

    Here is an example showing how you can create a table from a multi-dimensional array. +Note that the first array index will become the table heading (or you can set your own headings using the +set_heading() function described in the function reference below).

    + + +$this->load->library('table');
    +
    +$data = array(
    +             array('Name', 'Color', 'Size'),
    +             array('Fred', 'Blue', 'Small'),
    +             array('Mary', 'Red', 'Large'),
    +             array('John', 'Green', 'Medium')
    +             );
    +
    +echo $this->table->generate($data); +
    + +

    Here is an example of a table created from a database query result. The table class will automatically generate the +headings based on the table names (or you can set your own headings using the set_heading() function described +in the function reference below).

    + + +$this->load->library('table');
    +
    +$query = $this->db->query("SELECT * FROM my_table");
    +
    +echo $this->table->generate($query); +
    + + +

    Here is an example showing how you might create a table using discrete parameters:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading('Name', 'Color', 'Size');
    +
    +$this->table->add_row('Fred', 'Blue', 'Small');
    +$this->table->add_row('Mary', 'Red', 'Large');
    +$this->table->add_row('John', 'Green', 'Medium');
    +
    +echo $this->table->generate(); +
    + +

    Here is the same example, except instead of individual parameters, arrays are used:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading(array('Name', 'Color', 'Size'));
    +
    +$this->table->add_row(array('Fred', 'Blue', 'Small'));
    +$this->table->add_row(array('Mary', 'Red', 'Large'));
    +$this->table->add_row(array('John', 'Green', 'Medium'));
    +
    +echo $this->table->generate(); +
    + + +

    Changing the Look of Your Table

    + +

    The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template +prototype:

    + + +$tmpl = array (
    +                    'table_open'          => '<table border="0" cellpadding="4" cellspacing="0">',
    +
    +                    'heading_row_start'   => '<tr>',
    +                    'heading_row_end'     => '</tr>',
    +                    'heading_cell_start'  => '<th>',
    +                    'heading_cell_end'    => '</th>',
    +
    +                    'row_start'           => '<tr>',
    +                    'row_end'             => '</tr>',
    +                    'cell_start'          => '<td>',
    +                    'cell_end'            => '</td>',
    +
    +                    'row_alt_start'       => '<tr>',
    +                    'row_alt_end'         => '</tr>',
    +                    'cell_alt_start'      => '<td>',
    +                    'cell_alt_end'        => '</td>',
    +
    +                    'table_close'         => '</table>'
    +              );
    + +
    +$this->table->set_template($tmpl); +
    + +

    Note:  You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each +iteration of the row data.

    + +

    You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. +In this example, only the table opening tag is being changed:

    + + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    + +
    +

    Function Reference

    + +

    $this->table->generate()

    +

    Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.

    + +

    $this->table->set_caption()

    + +

    Permits you to add a caption to the table.

    + +$this->table->set_caption('Colors'); + +

    $this->table->set_heading()

    + +

    Permits you to set the table heading. You can submit an array or discrete params:

    + +$this->table->set_heading('Name', 'Color', 'Size'); +$this->table->set_heading(array('Name', 'Color', 'Size')); + +

    $this->table->add_row()

    + +

    Permits you to add a row to your table. You can submit an array or discrete params:

    + +$this->table->add_row('Blue', 'Red', 'Green'); +$this->table->add_row(array('Blue', 'Red', 'Green')); + + +

    $this->table->make_columns()

    + +

    This function takes a one-dimensional array as input and creates +a multi-dimensional array with a depth equal to the number of +columns desired. This allows a single array with many elements to be +displayed in a table that has a fixed column count. Consider this example:

    + + +$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');
    +
    +$new_list = $this->table->make_columns($list, 3);
    +
    +$this->table->generate($new_list);
    +
    +// Generates a table with this prototype
    +
    +<table border="0" cellpadding="4" cellspacing="0">
    +<tr>
    +<td>one</td><td>two</td><td>three</td>
    +</tr><tr>
    +<td>four</td><td>five</td><td>six</td>
    +</tr><tr>
    +<td>seven</td><td>eight</td><td>nine</td>
    +</tr><tr>
    +<td>ten</td><td>eleven</td><td>twelve</td></tr>
    +</table>
    + + + +

    $this->table->set_template()

    + +

    Permits you to set your template. You can submit a full or partial template.

    + + +$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="mytable">' );
    + +
    +$this->table->set_template($tmpl); +
    + + +

    $this->table->set_empty()

    + +

    Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:

    + + +$this->table->set_empty("&nbsp;"); + + +

    $this->table->clear()

    + +

    Lets you clear the table heading and row data. If you need to show multiple tables with different data you should +to call this function after each table has been generated to empty the previous table information. Example:

    + + +$this->load->library('table');
    +
    +$this->table->set_heading('Name', 'Color', 'Size');
    +$this->table->add_row('Fred', 'Blue', 'Small');
    +$this->table->add_row('Mary', 'Red', 'Large');
    +$this->table->add_row('John', 'Green', 'Medium');
    +
    +echo $this->table->generate();
    +
    +$this->table->clear();
    +
    +$this->table->set_heading('Name', 'Day', 'Delivery');
    +$this->table->add_row('Fred', 'Wednesday', 'Express');
    +$this->table->add_row('Mary', 'Monday', 'Air');
    +$this->table->add_row('John', 'Saturday', 'Overnight');
    +
    +echo $this->table->generate(); +
    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 177ccb06..1c40a454 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -1,246 +1,246 @@ - - - - - -Trackback Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Trackback Class

    - -

    The Trackback Class provides functions that enable you to send and receive Trackback data.

    - - -

    If you are not familiar with Trackbacks you'll find more information here.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Trackback class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('trackback'); -

    Once loaded, the Trackback library object will be available using: $this->trackback

    - - -

    Sending Trackbacks

    - -

    A Trackback can be sent from any of your controller functions using code similar to this example:

    - -$this->load->library('trackback');
    -
    -$tb_data = array(
    -                'ping_url'  => 'http://example.com/trackback/456',
    -                'url'       => 'http://www.my-example.com/blog/entry/123',
    -                'title'     => 'The Title of My Entry',
    -                'excerpt'   => 'The entry content.',
    -                'blog_name' => 'My Blog Name',
    -                'charset'   => 'utf-8'
    -                );
    -
    -if ( ! $this->trackback->send($tb_data))
    -{
    -     echo $this->trackback->display_errors();
    -}
    -else
    -{
    -     echo 'Trackback was sent!';
    -}
    - -

    Description of array data:

    - -
      -
    • ping_url - The URL of the site you are sending the Trackback to. You can send Trackbacks to multiple URLs by separating each URL with a comma.
    • -
    • url - The URL to YOUR site where the weblog entry can be seen.
    • -
    • title - The title of your weblog entry.
    • -
    • excerpt - The content of your weblog entry. Note: the Trackback class will automatically send only the first 500 characters of your entry. It will also strip all HTML.
    • -
    • blog_name - The name of your weblog.
    • -
    • charset - The character encoding your weblog is written in. If omitted, UTF-8 will be used.
    • -
    - -

    The Trackback sending function returns TRUE/FALSE (boolean) on success or failure. If it fails, you can retrieve the error message using:

    - -$this->trackback->display_errors(); - - -

    Receiving Trackbacks

    - -

    Before you can receive Trackbacks you must create a weblog. If you don't have a blog yet there's no point in continuing.

    - -

    Receiving Trackbacks is a little more complex than sending them, only because you will need a database table in which to store them, -and you will need to validate the incoming trackback data. You are encouraged to implement a thorough validation process to -guard against spam and duplicate data. You may also want to limit the number of Trackbacks you allow from a particular IP within -a given span of time to further curtail spam. The process of receiving a Trackback is quite simple; -the validation is what takes most of the effort.

    - -

    Your Ping URL

    - -

    In order to accept Trackbacks you must display a Trackback URL next to each one of your weblog entries. This will be the URL -that people will use to send you Trackbacks (we will refer to this as your "Ping URL").

    - -

    Your Ping URL must point to a controller function where your Trackback receiving code is located, and the URL -must contain the ID number for each particular entry, so that when the Trackback is received you'll be -able to associate it with a particular entry.

    - -

    For example, if your controller class is called Trackback, and the receiving function is called receive, your -Ping URLs will look something like this:

    - -http://example.com/index.php/trackback/receive/entry_id - -

    Where entry_id represents the individual ID number for each of your entries.

    - - -

    Creating a Trackback Table

    - -

    Before you can receive Trackbacks you must create a table in which to store them. Here is a basic prototype for such a table:

    - - - - -

    The Trackback specification only requires four pieces of information to be sent in a Trackback (url, title, excerpt, blog_name), -but to make the data more useful we've added a few more fields in the above table schema (date, IP address, etc.).

    - -

    Processing a Trackback

    - -

    Here is an example showing how you will receive and process a Trackback. The following -code is intended for use within the controller function where you expect to receive Trackbacks.

    - -$this->load->library('trackback');
    -$this->load->database();
    -
    -if ($this->uri->segment(3) == FALSE)
    -{
    -    $this->trackback->send_error("Unable to determine the entry ID");
    -}
    -
    -if ( ! $this->trackback->receive())
    -{
    -    $this->trackback->send_error("The Trackback did not contain valid data");
    -}
    -
    -$data = array(
    -                'tb_id'      => '',
    -                'entry_id'   => $this->uri->segment(3),
    -                'url'        => $this->trackback->data('url'),
    -                'title'      => $this->trackback->data('title'),
    -                'excerpt'    => $this->trackback->data('excerpt'),
    -                'blog_name'  => $this->trackback->data('blog_name'),
    -                'tb_date'    => time(),
    -                'ip_address' => $this->input->ip_address()
    -                );
    -
    -$sql = $this->db->insert_string('trackbacks', $data);
    -$this->db->query($sql);
    -
    -$this->trackback->send_success();
    - -

    Notes:

    - -

    The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:

    - -http://example.com/index.php/trackback/receive/entry_id - -

    Notice the entry_id is in the third URI segment, which you can retrieve using:

    - -$this->uri->segment(3); - -

    In our Trackback receiving code above, if the third segment is missing, we will issue an error. Without a valid entry ID, there's no -reason to continue.

    - -

    The $this->trackback->receive() function is simply a validation function that looks at the incoming data -and makes sure it contains the four pieces of data that are required (url, title, excerpt, blog_name). -It returns TRUE on success and FALSE on failure. If it fails you will issue an error message.

    - -

    The incoming Trackback data can be retrieved using this function:

    - -$this->trackback->data('item') - -

    Where item represents one of these four pieces of info: url, title, excerpt, or blog_name

    - -

    If the Trackback data is successfully received, you will issue a success message using:

    - -$this->trackback->send_success(); - -

    Note: The above code contains no data validation, which you are encouraged to add.

    - - - - - -
    - - - - - - + + + + + +Trackback Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Trackback Class

    + +

    The Trackback Class provides functions that enable you to send and receive Trackback data.

    + + +

    If you are not familiar with Trackbacks you'll find more information here.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Trackback class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('trackback'); +

    Once loaded, the Trackback library object will be available using: $this->trackback

    + + +

    Sending Trackbacks

    + +

    A Trackback can be sent from any of your controller functions using code similar to this example:

    + +$this->load->library('trackback');
    +
    +$tb_data = array(
    +                'ping_url'  => 'http://example.com/trackback/456',
    +                'url'       => 'http://www.my-example.com/blog/entry/123',
    +                'title'     => 'The Title of My Entry',
    +                'excerpt'   => 'The entry content.',
    +                'blog_name' => 'My Blog Name',
    +                'charset'   => 'utf-8'
    +                );
    +
    +if ( ! $this->trackback->send($tb_data))
    +{
    +     echo $this->trackback->display_errors();
    +}
    +else
    +{
    +     echo 'Trackback was sent!';
    +}
    + +

    Description of array data:

    + +
      +
    • ping_url - The URL of the site you are sending the Trackback to. You can send Trackbacks to multiple URLs by separating each URL with a comma.
    • +
    • url - The URL to YOUR site where the weblog entry can be seen.
    • +
    • title - The title of your weblog entry.
    • +
    • excerpt - The content of your weblog entry. Note: the Trackback class will automatically send only the first 500 characters of your entry. It will also strip all HTML.
    • +
    • blog_name - The name of your weblog.
    • +
    • charset - The character encoding your weblog is written in. If omitted, UTF-8 will be used.
    • +
    + +

    The Trackback sending function returns TRUE/FALSE (boolean) on success or failure. If it fails, you can retrieve the error message using:

    + +$this->trackback->display_errors(); + + +

    Receiving Trackbacks

    + +

    Before you can receive Trackbacks you must create a weblog. If you don't have a blog yet there's no point in continuing.

    + +

    Receiving Trackbacks is a little more complex than sending them, only because you will need a database table in which to store them, +and you will need to validate the incoming trackback data. You are encouraged to implement a thorough validation process to +guard against spam and duplicate data. You may also want to limit the number of Trackbacks you allow from a particular IP within +a given span of time to further curtail spam. The process of receiving a Trackback is quite simple; +the validation is what takes most of the effort.

    + +

    Your Ping URL

    + +

    In order to accept Trackbacks you must display a Trackback URL next to each one of your weblog entries. This will be the URL +that people will use to send you Trackbacks (we will refer to this as your "Ping URL").

    + +

    Your Ping URL must point to a controller function where your Trackback receiving code is located, and the URL +must contain the ID number for each particular entry, so that when the Trackback is received you'll be +able to associate it with a particular entry.

    + +

    For example, if your controller class is called Trackback, and the receiving function is called receive, your +Ping URLs will look something like this:

    + +http://example.com/index.php/trackback/receive/entry_id + +

    Where entry_id represents the individual ID number for each of your entries.

    + + +

    Creating a Trackback Table

    + +

    Before you can receive Trackbacks you must create a table in which to store them. Here is a basic prototype for such a table:

    + + + + +

    The Trackback specification only requires four pieces of information to be sent in a Trackback (url, title, excerpt, blog_name), +but to make the data more useful we've added a few more fields in the above table schema (date, IP address, etc.).

    + +

    Processing a Trackback

    + +

    Here is an example showing how you will receive and process a Trackback. The following +code is intended for use within the controller function where you expect to receive Trackbacks.

    + +$this->load->library('trackback');
    +$this->load->database();
    +
    +if ($this->uri->segment(3) == FALSE)
    +{
    +    $this->trackback->send_error("Unable to determine the entry ID");
    +}
    +
    +if ( ! $this->trackback->receive())
    +{
    +    $this->trackback->send_error("The Trackback did not contain valid data");
    +}
    +
    +$data = array(
    +                'tb_id'      => '',
    +                'entry_id'   => $this->uri->segment(3),
    +                'url'        => $this->trackback->data('url'),
    +                'title'      => $this->trackback->data('title'),
    +                'excerpt'    => $this->trackback->data('excerpt'),
    +                'blog_name'  => $this->trackback->data('blog_name'),
    +                'tb_date'    => time(),
    +                'ip_address' => $this->input->ip_address()
    +                );
    +
    +$sql = $this->db->insert_string('trackbacks', $data);
    +$this->db->query($sql);
    +
    +$this->trackback->send_success();
    + +

    Notes:

    + +

    The entry ID number is expected in the third segment of your URL. This is based on the URI example we gave earlier:

    + +http://example.com/index.php/trackback/receive/entry_id + +

    Notice the entry_id is in the third URI segment, which you can retrieve using:

    + +$this->uri->segment(3); + +

    In our Trackback receiving code above, if the third segment is missing, we will issue an error. Without a valid entry ID, there's no +reason to continue.

    + +

    The $this->trackback->receive() function is simply a validation function that looks at the incoming data +and makes sure it contains the four pieces of data that are required (url, title, excerpt, blog_name). +It returns TRUE on success and FALSE on failure. If it fails you will issue an error message.

    + +

    The incoming Trackback data can be retrieved using this function:

    + +$this->trackback->data('item') + +

    Where item represents one of these four pieces of info: url, title, excerpt, or blog_name

    + +

    If the Trackback data is successfully received, you will issue a success message using:

    + +$this->trackback->send_success(); + +

    Note: The above code contains no data validation, which you are encouraged to add.

    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index cd161016..2c7e06c9 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -1,160 +1,160 @@ - - - - - -Typography Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Typography Class

    - -

    The Typography Class provides functions that help you format text.

    - - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Typography class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('typography'); -

    Once loaded, the Typography library object will be available using: $this->typography

    - - -

    auto_typography()

    - -

    Formats text so that it is semantically and typographically correct HTML. Takes a string as input and returns it with -the following formatting:

    - -
      -
    • Surrounds paragraphs within <p></p> (looks for double line breaks to identify paragraphs).
    • -
    • Single line breaks are converted to <br />, except those that appear within <pre> tags.
    • -
    • Block level elements, like <div> tags, are not wrapped within paragraphs, but their contained text is if it contains paragraphs.
    • -
    • Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
    • -
    • Apostrophes are converted to curly apostrophy entities.
    • -
    • Double dashes (either like -- this or like--this) are converted to em—dashes.
    • -
    • Three consecutive periods either preceding or following a word are converted to ellipsis…
    • -
    • Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
    • -
    - -

    Usage example:

    - -$string = $this->typography->auto_typography($string); - -

    Parameters

    - -

    There is one optional parameters that determines whether the parser should reduce more then two consecutive linebreaks down to two. Use bolean TRUE or FALSE. - -

    By default the parser does not reduce line breaks. In other words, if no parameters are submitted, it is the same as doing this:

    - -$string = $this->typography->auto_typography($string, FALSE); - - -

    Note: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. -If you choose to use this function you may want to consider -caching your pages.

    - - - -

    convert_characters()

    - -

    This function is similiar to the auto_typography function above, except that it only does character conversion:

    - -
      -
    • Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
    • -
    • Apostrophes are converted to curly apostrophy entities.
    • -
    • Double dashes (either like -- this or like--this) are converted to em—dashes.
    • -
    • Three consecutive periods either preceding or following a word are converted to ellipsis…
    • -
    • Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
    • -
    - -

    Usage example:

    - -$string = $this->typography->convert_characters($string); - - -

    nl2br_except_pre()

    - -

    Converts newlines to <br /> tags unless they appear within <pre> tags. -This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

    - -

    Usage example:

    - -$string = $this->typography->nl2br_except_pre($string); - -

    protect_braced_quotes

    - -

    When using the Typography library in conjunction with the Template Parser library it can often be desirable to protect single - and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE. - -

    Usage example:

    - -$this->load->library('typography');
    -$this->typography->protect_braced_quotes = TRUE; -
    - -
    - - - - - - + + + + + +Typography Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Typography Class

    + +

    The Typography Class provides functions that help you format text.

    + + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Typography class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('typography'); +

    Once loaded, the Typography library object will be available using: $this->typography

    + + +

    auto_typography()

    + +

    Formats text so that it is semantically and typographically correct HTML. Takes a string as input and returns it with +the following formatting:

    + +
      +
    • Surrounds paragraphs within <p></p> (looks for double line breaks to identify paragraphs).
    • +
    • Single line breaks are converted to <br />, except those that appear within <pre> tags.
    • +
    • Block level elements, like <div> tags, are not wrapped within paragraphs, but their contained text is if it contains paragraphs.
    • +
    • Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
    • +
    • Apostrophes are converted to curly apostrophy entities.
    • +
    • Double dashes (either like -- this or like--this) are converted to em—dashes.
    • +
    • Three consecutive periods either preceding or following a word are converted to ellipsis…
    • +
    • Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
    • +
    + +

    Usage example:

    + +$string = $this->typography->auto_typography($string); + +

    Parameters

    + +

    There is one optional parameters that determines whether the parser should reduce more then two consecutive linebreaks down to two. Use bolean TRUE or FALSE. + +

    By default the parser does not reduce line breaks. In other words, if no parameters are submitted, it is the same as doing this:

    + +$string = $this->typography->auto_typography($string, FALSE); + + +

    Note: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. +If you choose to use this function you may want to consider +caching your pages.

    + + + +

    convert_characters()

    + +

    This function is similiar to the auto_typography function above, except that it only does character conversion:

    + +
      +
    • Quotes are converted to correctly facing curly quote entities, except those that appear within tags.
    • +
    • Apostrophes are converted to curly apostrophy entities.
    • +
    • Double dashes (either like -- this or like--this) are converted to em—dashes.
    • +
    • Three consecutive periods either preceding or following a word are converted to ellipsis…
    • +
    • Double spaces following sentences are converted to non-breaking spaces to mimic double spacing.
    • +
    + +

    Usage example:

    + +$string = $this->typography->convert_characters($string); + + +

    nl2br_except_pre()

    + +

    Converts newlines to <br /> tags unless they appear within <pre> tags. +This function is identical to the native PHP nl2br() function, except that it ignores <pre> tags.

    + +

    Usage example:

    + +$string = $this->typography->nl2br_except_pre($string); + +

    protect_braced_quotes

    + +

    When using the Typography library in conjunction with the Template Parser library it can often be desirable to protect single + and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE. + +

    Usage example:

    + +$this->load->library('typography');
    +$this->typography->protect_braced_quotes = TRUE; +
    + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 37632327..35bd347f 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -1,205 +1,205 @@ - - - - - -Unit Testing Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Unit Testing Class

    - -

    Unit testing is an approach to software development in which tests are written for each function in your application. -If you are not familiar with the concept you might do a little googling on the subject.

    - -

    CodeIgniter's Unit Test class is quite simple, consisting of an evaluation function and two result functions. -It's not intended to be a full-blown test suite but rather a simple mechanism to evaluate your code -to determine if it is producing the correct data type and result. -

    - - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the Unit Test class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('unit_test'); -

    Once loaded, the Unit Test object will be available using: $this->unit

    - - -

    Running Tests

    - -

    Running a test involves supplying a test and an expected result to the following function:

    - -

    $this->unit->run( test, expected result, 'test name' );

    - -

    Where test is the result of the code you wish to test, -expected result is the data type you expect, and test name is an optional name you can give your test. Example:

    - -$test = 1 + 1;
    -
    -$expected_result = 2;
    -
    -$test_name = 'Adds one plus one';
    -
    -$this->unit->run($test, $expected_result, $test_name);
    - -

    The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:

    - -$this->unit->run('Foo', 'Foo'); - -

    Here is an example of a data type match:

    - -$this->unit->run('Foo', 'is_string'); - -

    Notice the use of "is_string" in the second parameter? This tells the function to evaluate whether your test is producing a string -as the result. Here is a list of allowed comparison types:

    - -
      -
    • is_string
    • -
    • is_bool
    • -
    • is_true
    • -
    • is_false
    • -
    • is_int
    • -
    • is_numeric
    • -
    • is_float
    • -
    • is_double
    • -
    • is_array
    • -
    • is_null
    • -
    - - -

    Generating Reports

    - -

    You can either display results after each test, or your can run several tests and generate a report at the end. -To show a report directly simply echo or return the run function:

    - -echo $this->unit->run($test, $expected_result); - -

    To run a full report of all tests, use this:

    - -echo $this->unit->report(); - -

    The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:

    - -echo $this->unit->result(); - - -

    Strict Mode

    - -

    By default the unit test class evaluates literal matches loosely. Consider this example:

    - -$this->unit->run(1, TRUE); - -

    The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing -will evaluate the above code as TRUE using a normal equality test:

    - -if (1 == TRUE) echo 'This evaluates as true'; - -

    If you prefer, you can put the unit test class in to strict mode, which will compare the data type as well as the value:

    - -if (1 === TRUE) echo 'This evaluates as FALSE'; - -

    To enable strict mode use this:

    - -$this->unit->use_strict(TRUE); - -

    Enabling/Disabling Unit Testing

    - -

    If you would like to leave some testing in place in your scripts, but not have it run unless you need it, you can disable -unit testing using:

    - -$this->unit->active(FALSE) - - - -

    Creating a Template

    - -

    If you would like your test results formatted differently then the default you can set your own template. Here is an -example of a simple template. Note the required pseudo-variables:

    - - -$str = '
    -<table border="0" cellpadding="4" cellspacing="1">
    -    {rows}
    -        <tr>
    -        <td>{item}</td>
    -        <td>{result}</td>
    -        </tr>
    -    {/rows}
    -</table>';
    -
    -$this->unit->set_template($str); -
    - -

    Note: Your template must be declared before running the unit test process.

    - - - - - -
    - - - - - - + + + + + +Unit Testing Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Unit Testing Class

    + +

    Unit testing is an approach to software development in which tests are written for each function in your application. +If you are not familiar with the concept you might do a little googling on the subject.

    + +

    CodeIgniter's Unit Test class is quite simple, consisting of an evaluation function and two result functions. +It's not intended to be a full-blown test suite but rather a simple mechanism to evaluate your code +to determine if it is producing the correct data type and result. +

    + + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the Unit Test class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('unit_test'); +

    Once loaded, the Unit Test object will be available using: $this->unit

    + + +

    Running Tests

    + +

    Running a test involves supplying a test and an expected result to the following function:

    + +

    $this->unit->run( test, expected result, 'test name' );

    + +

    Where test is the result of the code you wish to test, +expected result is the data type you expect, and test name is an optional name you can give your test. Example:

    + +$test = 1 + 1;
    +
    +$expected_result = 2;
    +
    +$test_name = 'Adds one plus one';
    +
    +$this->unit->run($test, $expected_result, $test_name);
    + +

    The expected result you supply can either be a literal match, or a data type match. Here's an example of a literal:

    + +$this->unit->run('Foo', 'Foo'); + +

    Here is an example of a data type match:

    + +$this->unit->run('Foo', 'is_string'); + +

    Notice the use of "is_string" in the second parameter? This tells the function to evaluate whether your test is producing a string +as the result. Here is a list of allowed comparison types:

    + +
      +
    • is_string
    • +
    • is_bool
    • +
    • is_true
    • +
    • is_false
    • +
    • is_int
    • +
    • is_numeric
    • +
    • is_float
    • +
    • is_double
    • +
    • is_array
    • +
    • is_null
    • +
    + + +

    Generating Reports

    + +

    You can either display results after each test, or your can run several tests and generate a report at the end. +To show a report directly simply echo or return the run function:

    + +echo $this->unit->run($test, $expected_result); + +

    To run a full report of all tests, use this:

    + +echo $this->unit->report(); + +

    The report will be formatted in an HTML table for viewing. If you prefer the raw data you can retrieve an array using:

    + +echo $this->unit->result(); + + +

    Strict Mode

    + +

    By default the unit test class evaluates literal matches loosely. Consider this example:

    + +$this->unit->run(1, TRUE); + +

    The test is evaluating an integer, but the expected result is a boolean. PHP, however, due to it's loose data-typing +will evaluate the above code as TRUE using a normal equality test:

    + +if (1 == TRUE) echo 'This evaluates as true'; + +

    If you prefer, you can put the unit test class in to strict mode, which will compare the data type as well as the value:

    + +if (1 === TRUE) echo 'This evaluates as FALSE'; + +

    To enable strict mode use this:

    + +$this->unit->use_strict(TRUE); + +

    Enabling/Disabling Unit Testing

    + +

    If you would like to leave some testing in place in your scripts, but not have it run unless you need it, you can disable +unit testing using:

    + +$this->unit->active(FALSE) + + + +

    Creating a Template

    + +

    If you would like your test results formatted differently then the default you can set your own template. Here is an +example of a simple template. Note the required pseudo-variables:

    + + +$str = '
    +<table border="0" cellpadding="4" cellspacing="1">
    +    {rows}
    +        <tr>
    +        <td>{item}</td>
    +        <td>{result}</td>
    +        </tr>
    +    {/rows}
    +</table>';
    +
    +$this->unit->set_template($str); +
    + +

    Note: Your template must be declared before running the unit test process.

    + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7bebbf38..fb8deb25 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -1,252 +1,252 @@ - - - - - -URI Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    URI Class

    - -

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can -also retrieve information about the re-routed segments.

    - -

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    - -

    $this->uri->segment(n)

    - -

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. -Segments are numbered from left to right. For example, if your full URL is this:

    - -http://example.com/index.php/news/local/metro/crime_is_up - -

    The segment numbers would be this:

    - -
      -
    1. news
    2. -
    3. local
    4. -
    5. metro
    6. -
    7. crime_is_up
    8. -
    - -

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that -permits you to set your own default value if the segment is missing. -For example, this would tell the function to return the number zero in the event of failure:

    - -$product_id = $this->uri->segment(3, 0); - -

    It helps avoid having to write code like this:

    - -if ($this->uri->segment(3) === FALSE)
    -{
    -    $product_id = 0;
    -}
    -else
    -{
    -    $product_id = $this->uri->segment(3);
    -}
    -
    - -

    $this->uri->rsegment(n)

    - -

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - -

    $this->uri->slash_segment(n)

    - -

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second -parameter. If the parameter is not used, a trailing slash added. Examples:

    - -$this->uri->slash_segment(3);
    -$this->uri->slash_segment(3, 'leading');
    -$this->uri->slash_segment(3, 'both');
    - -

    Returns:

    - -
      -
    1. segment/
    2. -
    3. /segment
    4. -
    5. /segment/
    6. -
    - - -

    $this->uri->slash_rsegment(n)

    - -

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->uri_to_assoc(n)

    - -

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    - -index.php/user/search/name/joe/location/UK/gender/male - -

    Using this function you can turn the URI into an associative array with this prototype:

    - -[array]
    -(
    -    'name' => 'joe'
    -    'location' => 'UK'
    -    'gender' => 'male'
    -)
    - -

    The first parameter of the function lets you set an offset. By default it is set to 3 since your -URI will normally contain a controller/function in the first and second segments. Example:

    - - -$array = $this->uri->uri_to_assoc(3);
    -
    -echo $array['name']; -
    - - -

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    - - -$default = array('name', 'gender', 'location', 'type', 'sort');
    -
    -$array = $this->uri->uri_to_assoc(3, $default);
    - -

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    - -

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    - - -

    $this->uri->ruri_to_assoc(n)

    - -

    This function is identical to the previous one, except that it creates an associative array using the -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - -

    $this->uri->assoc_to_uri()

    - -

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    - -$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
    -
    -$str = $this->uri->assoc_to_uri($array);
    -
    -// Produces: product/shoes/size/large/color/red -
    - - -

    $this->uri->uri_string()

    - -

    Returns a string with the complete URI. For example, if this is your full URL:

    - -http://example.com/index.php/news/local/345 - -

    The function would return this:

    - -/news/local/345 - - -

    $this->uri->ruri_string(n)

    - -

    This function is identical to the previous one, except that it returns the -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->total_segments()

    - -

    Returns the total number of segments.

    - - -

    $this->uri->total_rsegments()

    - -

    This function is identical to the previous one, except that it returns the total number of segments in your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -

    $this->uri->segment_array()

    - -

    Returns an array containing the URI segments. For example:

    - - -$segs = $this->uri->segment_array();
    -
    -foreach ($segs as $segment)
    -{
    -    echo $segment;
    -    echo '<br />';
    -}
    - -

    $this->uri->rsegment_array()

    - -

    This function is identical to the previous one, except that it returns the array of segments in your -re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    - - - -
    - - - - - - + + + + + +URI Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    URI Class

    + +

    The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can +also retrieve information about the re-routed segments.

    + +

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    + +

    $this->uri->segment(n)

    + +

    Permits you to retrieve a specific segment. Where n is the segment number you wish to retrieve. +Segments are numbered from left to right. For example, if your full URL is this:

    + +http://example.com/index.php/news/local/metro/crime_is_up + +

    The segment numbers would be this:

    + +
      +
    1. news
    2. +
    3. local
    4. +
    5. metro
    6. +
    7. crime_is_up
    8. +
    + +

    By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that +permits you to set your own default value if the segment is missing. +For example, this would tell the function to return the number zero in the event of failure:

    + +$product_id = $this->uri->segment(3, 0); + +

    It helps avoid having to write code like this:

    + +if ($this->uri->segment(3) === FALSE)
    +{
    +    $product_id = 0;
    +}
    +else
    +{
    +    $product_id = $this->uri->segment(3);
    +}
    +
    + +

    $this->uri->rsegment(n)

    + +

    This function is identical to the previous one, except that it lets you retrieve a specific segment from your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + +

    $this->uri->slash_segment(n)

    + +

    This function is almost identical to $this->uri->segment(), except it adds a trailing and/or leading slash based on the second +parameter. If the parameter is not used, a trailing slash added. Examples:

    + +$this->uri->slash_segment(3);
    +$this->uri->slash_segment(3, 'leading');
    +$this->uri->slash_segment(3, 'both');
    + +

    Returns:

    + +
      +
    1. segment/
    2. +
    3. /segment
    4. +
    5. /segment/
    6. +
    + + +

    $this->uri->slash_rsegment(n)

    + +

    This function is identical to the previous one, except that it lets you add slashes a specific segment from your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->uri_to_assoc(n)

    + +

    This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:

    + +index.php/user/search/name/joe/location/UK/gender/male + +

    Using this function you can turn the URI into an associative array with this prototype:

    + +[array]
    +(
    +    'name' => 'joe'
    +    'location' => 'UK'
    +    'gender' => 'male'
    +)
    + +

    The first parameter of the function lets you set an offset. By default it is set to 3 since your +URI will normally contain a controller/function in the first and second segments. Example:

    + + +$array = $this->uri->uri_to_assoc(3);
    +
    +echo $array['name']; +
    + + +

    The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:

    + + +$default = array('name', 'gender', 'location', 'type', 'sort');
    +
    +$array = $this->uri->uri_to_assoc(3, $default);
    + +

    If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.

    + +

    Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).

    + + +

    $this->uri->ruri_to_assoc(n)

    + +

    This function is identical to the previous one, except that it creates an associative array using the +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + +

    $this->uri->assoc_to_uri()

    + +

    Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:

    + +$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');
    +
    +$str = $this->uri->assoc_to_uri($array);
    +
    +// Produces: product/shoes/size/large/color/red +
    + + +

    $this->uri->uri_string()

    + +

    Returns a string with the complete URI. For example, if this is your full URL:

    + +http://example.com/index.php/news/local/345 + +

    The function would return this:

    + +/news/local/345 + + +

    $this->uri->ruri_string(n)

    + +

    This function is identical to the previous one, except that it returns the +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->total_segments()

    + +

    Returns the total number of segments.

    + + +

    $this->uri->total_rsegments()

    + +

    This function is identical to the previous one, except that it returns the total number of segments in your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +

    $this->uri->segment_array()

    + +

    Returns an array containing the URI segments. For example:

    + + +$segs = $this->uri->segment_array();
    +
    +foreach ($segs as $segment)
    +{
    +    echo $segment;
    +    echo '<br />';
    +}
    + +

    $this->uri->rsegment_array()

    + +

    This function is identical to the previous one, except that it returns the array of segments in your +re-routed URI in the event you are using CodeIgniter's URI Routing feature.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 0a012608..39337dbd 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -1,201 +1,201 @@ - - - - - -User Agent Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    User Agent Class

    - -

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. -In addition you can get referrer information as well as language and supported character-set information.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('user_agent'); -

    Once loaded, the object will be available using: $this->agent

    - -

    User Agent Definitions

    - -

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the -various user agent arrays if needed.

    - -

    Example

    - -

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is -a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    - - - -$this->load->library('user_agent');
    -
    -if ($this->agent->is_browser())
    -{
    -    $agent = $this->agent->browser().' '.$this->agent->version();
    -}
    -elseif ($this->agent->is_robot())
    -{
    -    $agent = $this->agent->robot();
    -}
    -elseif ($this->agent->is_mobile())
    -{
    -    $agent = $this->agent->mobile();
    -}
    -else
    -{
    -    $agent = 'Unidentified User Agent';
    -}
    -
    -echo $agent;
    -
    -echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) -
    - - -

    Function Reference

    - - -

    $this->agent->is_browser()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    - -

    $this->agent->is_mobile()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    - -

    $this->agent->is_robot()

    -

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    - -

    Note:  The user agent library only contains the most common robot -definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be -very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your -application/config/user_agents.php file.

    - -

    $this->agent->is_referral()

    -

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    - - -

    $this->agent->browser()

    -

    Returns a string containing the name of the web browser viewing your site.

    - -

    $this->agent->version()

    -

    Returns a string containing the version number of the web browser viewing your site.

    - -

    $this->agent->mobile()

    -

    Returns a string containing the name of the mobile device viewing your site.

    - -

    $this->agent->robot()

    -

    Returns a string containing the name of the robot viewing your site.

    - -

    $this->agent->platform()

    -

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    - -

    $this->agent->referrer()

    -

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    - - if ($this->agent->is_referral())
    -{
    -    echo $this->agent->referrer();
    -}
    - - -

    $this->agent->agent_string()

    -

    Returns a string containing the full user agent string. Typically it will be something like this:

    - -Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2 - - -

    $this->agent->accept_lang()

    -

    Lets you determine if the user agent accepts a particular language. Example:

    - -if ($this->agent->accept_lang('en'))
    -{
    -    echo 'You accept English!';
    -}
    - -

    Note: This function is not typically very reliable -since some browsers do not provide language info, and even among those that do, it is not always accurate.

    - - - -

    $this->agent->accept_charset()

    -

    Lets you determine if the user agent accepts a particular character set. Example:

    - -if ($this->agent->accept_charset('utf-8'))
    -{
    -    echo 'You browser supports UTF-8!';
    -}
    - -

    Note: This function is not typically very reliable -since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    - - - -
    - - - - - - + + + + + +User Agent Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    User Agent Class

    + +

    The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. +In addition you can get referrer information as well as language and supported character-set information.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('user_agent'); +

    Once loaded, the object will be available using: $this->agent

    + +

    User Agent Definitions

    + +

    The user agent name definitions are located in a config file located at: application/config/user_agents.php. You may add items to the +various user agent arrays if needed.

    + +

    Example

    + +

    When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is +a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

    + + + +$this->load->library('user_agent');
    +
    +if ($this->agent->is_browser())
    +{
    +    $agent = $this->agent->browser().' '.$this->agent->version();
    +}
    +elseif ($this->agent->is_robot())
    +{
    +    $agent = $this->agent->robot();
    +}
    +elseif ($this->agent->is_mobile())
    +{
    +    $agent = $this->agent->mobile();
    +}
    +else
    +{
    +    $agent = 'Unidentified User Agent';
    +}
    +
    +echo $agent;
    +
    +echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) +
    + + +

    Function Reference

    + + +

    $this->agent->is_browser()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known web browser.

    + +

    $this->agent->is_mobile()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.

    + +

    $this->agent->is_robot()

    +

    Returns TRUE/FALSE (boolean) if the user agent is a known robot.

    + +

    Note:  The user agent library only contains the most common robot +definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be +very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your +application/config/user_agents.php file.

    + +

    $this->agent->is_referral()

    +

    Returns TRUE/FALSE (boolean) if the user agent was referred from another site.

    + + +

    $this->agent->browser()

    +

    Returns a string containing the name of the web browser viewing your site.

    + +

    $this->agent->version()

    +

    Returns a string containing the version number of the web browser viewing your site.

    + +

    $this->agent->mobile()

    +

    Returns a string containing the name of the mobile device viewing your site.

    + +

    $this->agent->robot()

    +

    Returns a string containing the name of the robot viewing your site.

    + +

    $this->agent->platform()

    +

    Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).

    + +

    $this->agent->referrer()

    +

    The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:

    + + if ($this->agent->is_referral())
    +{
    +    echo $this->agent->referrer();
    +}
    + + +

    $this->agent->agent_string()

    +

    Returns a string containing the full user agent string. Typically it will be something like this:

    + +Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2 + + +

    $this->agent->accept_lang()

    +

    Lets you determine if the user agent accepts a particular language. Example:

    + +if ($this->agent->accept_lang('en'))
    +{
    +    echo 'You accept English!';
    +}
    + +

    Note: This function is not typically very reliable +since some browsers do not provide language info, and even among those that do, it is not always accurate.

    + + + +

    $this->agent->accept_charset()

    +

    Lets you determine if the user agent accepts a particular character set. Example:

    + +if ($this->agent->accept_charset('utf-8'))
    +{
    +    echo 'You browser supports UTF-8!';
    +}
    + +

    Note: This function is not typically very reliable +since some browsers do not provide character-set info, and even among those that do, it is not always accurate.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 6037a24e..394be190 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -1,736 +1,736 @@ - - - - - -Form Validation : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Form Validation

    - -

    Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

    - -
      -
    1. A form is displayed.
    2. -
    3. You fill it in and submit it.
    4. -
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data along with an error message describing the problem.
    6. -
    7. This process continues until you have submitted a valid form.
    8. -
    - -

    On the receiving end, the script must:

    - -
      -
    1. Check for required data.
    2. -
    3. Verify that the data is of the correct type, and meets the correct criteria. (For example, if a username is submitted -it must be validated to contain only permitted characters. It must be of a minimum length, -and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.)
    4. -
    5. Sanitize the data for security.
    6. -
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. -
    9. Prep the data for insertion in the database.
    10. -
    - - -

    Although there is nothing complex about the above process, it usually requires a significant -amount of code, and to display error messages, various control structures are usually placed within the form HTML. -Form validation, while simple to create, is generally very messy and tedious to implement.

    - -CodeIgniter provides a comprehensive validation framework that truly minimizes the amount of code you'll write. -It also removes all control structures from your form HTML, permitting it to be clean and free of code. - -

    Overview

    - -

    In order to implement CodeIgniter's form validation you'll need three things:

    - -
      -
    1. A View file containing the form.
    2. -
    3. A View file containing a "success" message to be displayed upon successful submission.
    4. -
    5. A controller function to receive and process the submitted data.
    6. -
    - -

    Let's create those three things, using a member sign-up form as the example.

    - -

    The Form

    - -

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - -

    The Success Page

    - - -

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - -

    The Controller

    - -

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ -folder:

    - - - - - -

    Try it!

    - -

    To try your form, visit your site using a URL similar to this one:

    - -example.com/index.php/form/ - -

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation -rules yet, which we'll get to in a moment.

    - - -

    Explanation

    - -

    You'll notice several things about the above pages:

    - -

    The form (myform.php) is a standard web form with a couple exceptions:

    - -
      -
    1. It uses a form helper to create the form opening. -Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper -is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable -and flexible in the event your URLs change.
    2. - -
    3. At the top of the form you'll notice the following variable: -<?php echo $this->validation->error_string; ?> - -

      This variable will display any error messages sent back by the validator. If there are no messages it returns nothing.

      -
    4. -
    - -

    The controller (form.php) has one function: index(). This function initializes the validation class and -loads the form helper and URL helper used by your view files. It also runs -the validation routine. Based on -whether the validation was successful it either presents the form or the success page.

    - -

    Since you haven't told the validation class to validate anything yet, it returns "false" (boolean false) by default. The run() -function only returns "true" if it has successfully applied your rules without any of them failing.

    - - -

    Setting Validation Rules

    - -

    CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data -at the same time. Let's see it in action, we'll explain it afterwards.

    - -

    In your controller (form.php), add this code just below the validation initialization function:

    - -$rules['username'] = "required";
    -$rules['password'] = "required";
    -$rules['passconf'] = "required";
    -$rules['email'] = "required";
    -
    -$this->validation->set_rules($rules);
    - -

    Your controller should now look like this:

    - - - -

    Now submit the form with the fields blank and you should see the error message. -If you submit the form with all the fields populated you'll see your success page.

    - -

    Note: The form fields are not yet being re-populated with the data when -there is an error. We'll get to that shortly, once we're through explaining the validation rules.

    - - -

    Changing the Error Delimiters

    - -

    By default, the system adds a paragraph tag (<p>) around each error message shown. You can easily change these delimiters with -this code, placed in your controller:

    - -$this->validation->set_error_delimiters('<div class="error">', '</div>'); - -

    In this example, we've switched to using div tags.

    - -

    Cascading Rules

    - -

    CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules array like this:

    - - -$rules['username'] = "required|min_length[5]|max_length[12]";
    -$rules['password'] = "required|matches[passconf]";
    -$rules['passconf'] = "required";
    -$rules['email'] = "required|valid_email";
    - -

    The above code requires that:

    - -
      -
    1. The username field be no shorter than 5 characters and no longer than 12.
    2. -
    3. The password field must match the password confirmation field.
    4. -
    5. The email field must contain a valid email address.
    6. -
    - -

    Give it a try!

    - -

    Note: There are numerous rules available which you can read about in the validation reference.

    - - -

    Prepping Data

    - -

    In addition to the validation functions like the ones we used above, you can also prep your data in various ways. -For example, you can set up rules like this:

    - -$rules['username'] = "trim|required|min_length[5]|max_length[12]|xss_clean";
    -$rules['password'] = "trim|required|matches[passconf]|md5";
    -$rules['passconf'] = "trim|required";
    -$rules['email'] = "trim|required|valid_email";
    - -

    In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through -the "xss_clean" function, which removes malicious data.

    - -

    Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, -trim, MD5, etc.

    - -

    Note: You will generally want to use the prepping functions after -the validation rules so if there is an error, the original data will be shown in the form.

    - -

    Callbacks: Your own Validation Functions

    - -

    The validation system supports callbacks to your own validation functions. This permits you to extend the validation class -to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can -create a callback function that does that. Let's create a simple example.

    - -

    In your controller, change the "username" rule to this:

    - -$rules['username'] = "callback_username_check"; - -

    Then add a new function called username_check to your controller. Here's how your controller should look:

    - - - - -

    Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your -callback function for you to process.

    - -

    To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

    - -

    The error message was set using the $this->validation->set_message function. -Just remember that the message key (the first parameter) must match your function name.

    - -

    Note: You can apply your own custom error messages to any rule, just by setting the -message similarly. For example, to change the message for the "required" rule you will do this:

    - -$this->validation->set_message('required', 'Your custom message here'); - -

    Re-populating the form

    - -

    Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. -This is done similarly to your rules. Add the following code to your controller, just below your rules:

    - -$fields['username'] = 'Username';
    -$fields['password'] = 'Password';
    -$fields['passconf'] = 'Password Confirmation';
    -$fields['email'] = 'Email Address';
    -
    -$this->validation->set_fields($fields);
    - -

    The array keys are the actual names of the form fields, the value represents the full name that you want shown in the -error message.

    - -

    The index function of your controller should now look like this:

    - - - - - -

    Now open your myform.php view file and update the value in each field so that it has an attribute corresponding to its name:

    - - - - - -

    Now reload your page and submit the form so that it triggers an error. Your form fields should be populated -and the error messages will contain a more relevant field name.

    - - - -

    Showing Errors Individually

    - -

    If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

    - - - - -

    If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you -have set (<p> tags by default).

    - -

    Note: To display errors this way you must remember to set your fields using the $this->validation->set_fields -function described earlier. The errors will be turned into variables that have "_error" after your field name. -For example, your "username" error will be available at:
    $this->validation->username_error.

    - - -

    Rule Reference

    - -

    The following is a list of all the native rules that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    RuleParameterDescriptionExample
    requiredNoReturns FALSE if the form element is empty. 
    matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
    min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
    max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
    exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
    alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
    alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
    alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
    numericNoReturns FALSE if the form element contains anything other than numeric characters. 
    integerNoReturns FALSE if the form element contains anything other than an integer. 
    valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
    valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
    valid_ipNoReturns FALSE if the supplied IP is not valid. 
    valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
    - -

    Note: These rules can also be called as discrete functions. For example:

    - -$this->validation->required($string); - -

    Note: You can also use any native PHP functions that permit one parameter.

    - - - -

    Prepping Reference

    - -

    The following is a list of all the prepping functions that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameParameterDescription
    xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
    prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
    prep_urlNoAdds "http://" to URLs if missing.
    strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
    encode_php_tagsNoConverts PHP tags to entities.
    - -

    Note: You can also use any native PHP functions that permit one parameter, -like trim, htmlspecialchars, urldecode, etc.

    - - -

    Setting Custom Error Messages

    - -

    All of the native error messages are located in the following language file: language/english/validation_lang.php

    - -

    To set your own custom message you can either edit that file, or use the following function:

    - -$this->validation->set_message('rule', 'Error Message'); - -

    Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

    - - -

    Dealing with Select Menus, Radio Buttons, and Checkboxes

    - -

    If you use select menus, radio buttons or checkboxes, you will want the state of -these items to be retained in the event of an error. The Validation class has three functions that help you do this:

    - -

    set_select()

    - -

    Permits you to display the menu item that was selected. The first parameter -must contain the name of the select menu, the second parameter must contain the value of -each item. Example:

    - - -<select name="myselect">
    -<option value="one" <?php echo $this->validation->set_select('myselect', 'one'); ?> >One</option>
    -<option value="two" <?php echo $this->validation->set_select('myselect', 'two'); ?> >Two</option>
    -<option value="three" <?php echo $this->validation->set_select('myselect', 'three'); ?> >Three</option>
    -</select> -
    - - -

    set_checkbox()

    - -

    Permits you to display a checkbox in the state it was submitted. The first parameter -must contain the name of the checkbox, the second parameter must contain its value. Example:

    - -<input type="checkbox" name="mycheck" value="1" <?php echo $this->validation->set_checkbox('mycheck', '1'); ?> /> - - -

    set_radio()

    - -

    Permits you to display radio buttons in the state they were submitted. The first parameter -must contain the name of the radio button, the second parameter must contain its value. Example:

    - -<input type="radio" name="myradio" value="1" <?php echo $this->validation->set_radio('myradio', '1'); ?> /> - - - - - -
    - - - - - - + + + + + +Form Validation : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Form Validation

    + +

    Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

    + +
      +
    1. A form is displayed.
    2. +
    3. You fill it in and submit it.
    4. +
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data along with an error message describing the problem.
    6. +
    7. This process continues until you have submitted a valid form.
    8. +
    + +

    On the receiving end, the script must:

    + +
      +
    1. Check for required data.
    2. +
    3. Verify that the data is of the correct type, and meets the correct criteria. (For example, if a username is submitted +it must be validated to contain only permitted characters. It must be of a minimum length, +and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.)
    4. +
    5. Sanitize the data for security.
    6. +
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. +
    9. Prep the data for insertion in the database.
    10. +
    + + +

    Although there is nothing complex about the above process, it usually requires a significant +amount of code, and to display error messages, various control structures are usually placed within the form HTML. +Form validation, while simple to create, is generally very messy and tedious to implement.

    + +CodeIgniter provides a comprehensive validation framework that truly minimizes the amount of code you'll write. +It also removes all control structures from your form HTML, permitting it to be clean and free of code. + +

    Overview

    + +

    In order to implement CodeIgniter's form validation you'll need three things:

    + +
      +
    1. A View file containing the form.
    2. +
    3. A View file containing a "success" message to be displayed upon successful submission.
    4. +
    5. A controller function to receive and process the submitted data.
    6. +
    + +

    Let's create those three things, using a member sign-up form as the example.

    + +

    The Form

    + +

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +folder:

    + + + + + +

    The Success Page

    + + +

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +folder:

    + + + + + +

    The Controller

    + +

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +folder:

    + + + + + +

    Try it!

    + +

    To try your form, visit your site using a URL similar to this one:

    + +example.com/index.php/form/ + +

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation +rules yet, which we'll get to in a moment.

    + + +

    Explanation

    + +

    You'll notice several things about the above pages:

    + +

    The form (myform.php) is a standard web form with a couple exceptions:

    + +
      +
    1. It uses a form helper to create the form opening. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable +and flexible in the event your URLs change.
    2. + +
    3. At the top of the form you'll notice the following variable: +<?php echo $this->validation->error_string; ?> + +

      This variable will display any error messages sent back by the validator. If there are no messages it returns nothing.

      +
    4. +
    + +

    The controller (form.php) has one function: index(). This function initializes the validation class and +loads the form helper and URL helper used by your view files. It also runs +the validation routine. Based on +whether the validation was successful it either presents the form or the success page.

    + +

    Since you haven't told the validation class to validate anything yet, it returns "false" (boolean false) by default. The run() +function only returns "true" if it has successfully applied your rules without any of them failing.

    + + +

    Setting Validation Rules

    + +

    CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data +at the same time. Let's see it in action, we'll explain it afterwards.

    + +

    In your controller (form.php), add this code just below the validation initialization function:

    + +$rules['username'] = "required";
    +$rules['password'] = "required";
    +$rules['passconf'] = "required";
    +$rules['email'] = "required";
    +
    +$this->validation->set_rules($rules);
    + +

    Your controller should now look like this:

    + + + +

    Now submit the form with the fields blank and you should see the error message. +If you submit the form with all the fields populated you'll see your success page.

    + +

    Note: The form fields are not yet being re-populated with the data when +there is an error. We'll get to that shortly, once we're through explaining the validation rules.

    + + +

    Changing the Error Delimiters

    + +

    By default, the system adds a paragraph tag (<p>) around each error message shown. You can easily change these delimiters with +this code, placed in your controller:

    + +$this->validation->set_error_delimiters('<div class="error">', '</div>'); + +

    In this example, we've switched to using div tags.

    + +

    Cascading Rules

    + +

    CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules array like this:

    + + +$rules['username'] = "required|min_length[5]|max_length[12]";
    +$rules['password'] = "required|matches[passconf]";
    +$rules['passconf'] = "required";
    +$rules['email'] = "required|valid_email";
    + +

    The above code requires that:

    + +
      +
    1. The username field be no shorter than 5 characters and no longer than 12.
    2. +
    3. The password field must match the password confirmation field.
    4. +
    5. The email field must contain a valid email address.
    6. +
    + +

    Give it a try!

    + +

    Note: There are numerous rules available which you can read about in the validation reference.

    + + +

    Prepping Data

    + +

    In addition to the validation functions like the ones we used above, you can also prep your data in various ways. +For example, you can set up rules like this:

    + +$rules['username'] = "trim|required|min_length[5]|max_length[12]|xss_clean";
    +$rules['password'] = "trim|required|matches[passconf]|md5";
    +$rules['passconf'] = "trim|required";
    +$rules['email'] = "trim|required|valid_email";
    + +

    In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through +the "xss_clean" function, which removes malicious data.

    + +

    Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, +trim, MD5, etc.

    + +

    Note: You will generally want to use the prepping functions after +the validation rules so if there is an error, the original data will be shown in the form.

    + +

    Callbacks: Your own Validation Functions

    + +

    The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a simple example.

    + +

    In your controller, change the "username" rule to this:

    + +$rules['username'] = "callback_username_check"; + +

    Then add a new function called username_check to your controller. Here's how your controller should look:

    + + + + +

    Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +callback function for you to process.

    + +

    To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

    + +

    The error message was set using the $this->validation->set_message function. +Just remember that the message key (the first parameter) must match your function name.

    + +

    Note: You can apply your own custom error messages to any rule, just by setting the +message similarly. For example, to change the message for the "required" rule you will do this:

    + +$this->validation->set_message('required', 'Your custom message here'); + +

    Re-populating the form

    + +

    Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. +This is done similarly to your rules. Add the following code to your controller, just below your rules:

    + +$fields['username'] = 'Username';
    +$fields['password'] = 'Password';
    +$fields['passconf'] = 'Password Confirmation';
    +$fields['email'] = 'Email Address';
    +
    +$this->validation->set_fields($fields);
    + +

    The array keys are the actual names of the form fields, the value represents the full name that you want shown in the +error message.

    + +

    The index function of your controller should now look like this:

    + + + + + +

    Now open your myform.php view file and update the value in each field so that it has an attribute corresponding to its name:

    + + + + + +

    Now reload your page and submit the form so that it triggers an error. Your form fields should be populated +and the error messages will contain a more relevant field name.

    + + + +

    Showing Errors Individually

    + +

    If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

    + + + + +

    If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you +have set (<p> tags by default).

    + +

    Note: To display errors this way you must remember to set your fields using the $this->validation->set_fields +function described earlier. The errors will be turned into variables that have "_error" after your field name. +For example, your "username" error will be available at:
    $this->validation->username_error.

    + + +

    Rule Reference

    + +

    The following is a list of all the native rules that are available to use:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    RuleParameterDescriptionExample
    requiredNoReturns FALSE if the form element is empty. 
    matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
    min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
    max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
    exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
    alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
    alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
    alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
    numericNoReturns FALSE if the form element contains anything other than numeric characters. 
    integerNoReturns FALSE if the form element contains anything other than an integer. 
    valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
    valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
    valid_ipNoReturns FALSE if the supplied IP is not valid. 
    valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
    + +

    Note: These rules can also be called as discrete functions. For example:

    + +$this->validation->required($string); + +

    Note: You can also use any native PHP functions that permit one parameter.

    + + + +

    Prepping Reference

    + +

    The following is a list of all the prepping functions that are available to use:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameParameterDescription
    xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
    prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
    prep_urlNoAdds "http://" to URLs if missing.
    strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
    encode_php_tagsNoConverts PHP tags to entities.
    + +

    Note: You can also use any native PHP functions that permit one parameter, +like trim, htmlspecialchars, urldecode, etc.

    + + +

    Setting Custom Error Messages

    + +

    All of the native error messages are located in the following language file: language/english/validation_lang.php

    + +

    To set your own custom message you can either edit that file, or use the following function:

    + +$this->validation->set_message('rule', 'Error Message'); + +

    Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

    + + +

    Dealing with Select Menus, Radio Buttons, and Checkboxes

    + +

    If you use select menus, radio buttons or checkboxes, you will want the state of +these items to be retained in the event of an error. The Validation class has three functions that help you do this:

    + +

    set_select()

    + +

    Permits you to display the menu item that was selected. The first parameter +must contain the name of the select menu, the second parameter must contain the value of +each item. Example:

    + + +<select name="myselect">
    +<option value="one" <?php echo $this->validation->set_select('myselect', 'one'); ?> >One</option>
    +<option value="two" <?php echo $this->validation->set_select('myselect', 'two'); ?> >Two</option>
    +<option value="three" <?php echo $this->validation->set_select('myselect', 'three'); ?> >Three</option>
    +</select> +
    + + +

    set_checkbox()

    + +

    Permits you to display a checkbox in the state it was submitted. The first parameter +must contain the name of the checkbox, the second parameter must contain its value. Example:

    + +<input type="checkbox" name="mycheck" value="1" <?php echo $this->validation->set_checkbox('mycheck', '1'); ?> /> + + +

    set_radio()

    + +

    Permits you to display radio buttons in the state they were submitted. The first parameter +must contain the name of the radio button, the second parameter must contain its value. Example:

    + +<input type="radio" name="myradio" value="1" <?php echo $this->validation->set_radio('myradio', '1'); ?> /> + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 9c1b7145..e329e4a9 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -1,517 +1,517 @@ - - - - - -XML-RPC and XML-RPC Server Classes : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    XML-RPC and XML-RPC Server Classes

    - - -

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up -your own XML-RPC server to receive requests.

    - - -

    What is XML-RPC?

    - -

    Quite simply it is a way for two computers to communicate over the internet using XML. -One computer, which we will call the client, sends an XML-RPC request to -another computer, which we will call the server. Once the server receives and processes the request it -will send back a response to the client.

    - -

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will -send a request to an XML-RPC Server running on your site. This request might be a new weblog entry -being sent for publication, or it could be a request for an existing entry for editing. - -When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. -Once processed, the server will then send back a response message.

    - -

    For detailed specifications, you can visit the XML-RPC site.

    - -

    Initializing the Class

    - -

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    - -

    To load the XML-RPC class you will use:

    -$this->load->library('xmlrpc'); -

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    - -

    To load the XML-RPC Server class you will use:

    - -$this->load->library('xmlrpc');
    -$this->load->library('xmlrpcs'); -
    -

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    - -

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    - - - -

    Sending XML-RPC Requests

    - -

    To send a request to an XML-RPC server you must specify the following information:

    - -
      -
    • The URL of the server
    • -
    • The method on the server you wish to call
    • -
    • The request data (explained below).
    • -
    - -

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    - - -$this->load->library('xmlrpc');
    -
    -$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    -$this->xmlrpc->method('weblogUpdates.ping');
    - -
    -$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    -$this->xmlrpc->request($request);
    -
    -if ( ! $this->xmlrpc->send_request())
    -{
    -    echo $this->xmlrpc->display_error();
    -}
    - -

    Explanation

    - -

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The -request (in this case, the title and URL of your site) is placed into an array for transportation, and -compiled using the request() function. -Lastly, the full request is sent. If the send_request() method returns false we will display the error message -sent back from the XML-RPC Server.

    - -

    Anatomy of a Request

    - -

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request -is referred to as a request parameter. The above example has two parameters: -The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    - -

    Request parameters must be placed into an array for transportation, and each parameter can be one -of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings -you will have to include the data type in the request array.

    - -

    Here is an example of a simple array with three parameters:

    - -$request = array('John', 'Doe', 'www.some-site.com');
    -$this->xmlrpc->request($request);
    - -

    If you use data types other than strings, or if you have several different data types, you will place -each parameter into its own array, with the data type in the second position:

    - - -$request = array (
    -                   array('John', 'string'),
    -                   array('Doe', 'string'),
    -                   array(FALSE, 'boolean'),
    -                   array(12345, 'int')
    -                 ); -
    -$this->xmlrpc->request($request);
    - -The Data Types section below has a full list of data types. - - - -

    Creating an XML-RPC Server

    - -

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the -appropriate functions for processing.

    - -

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming -request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate -class and method for processing.

    - -

    Here is an example to illustrate:

    - - -$this->load->library('xmlrpc');
    -$this->load->library('xmlrpcs');
    -
    -$config['functions']['new_post'] = array('function' => 'My_blog.new_entry'),
    -$config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
    -$config['object'] = $this;
    -
    -$this->xmlrpcs->initialize($config);
    -$this->xmlrpcs->serve();
    - -

    The above example contains an array specifying two method requests that the Server allows. -The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    - -

    The 'object' key is a special key that you pass an instantiated class object with, which is necessary when the method you are mapping to is not - part of the CodeIgniter super object.

    - -

    In other words, if an XML-RPC Client sends a request for the new_post method, your -server will load the My_blog class and call the new_entry function. -If the request is for the update_post method, your -server will load the My_blog class and call the update_entry function.

    - -

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, -or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    - -

    Processing Server Requests

    - -

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass -an object to that method containing the data sent by the client.

    - -

    Using the above example, if the new_post method is requested, the server will expect a class -to exist with this prototype:

    - -class My_blog extends Controller {
    -
    -    function new_post($request)
    -    {
    -
    -    }
    -} -
    - -

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. -Using this object you will have access to the request parameters enabling you to process the request. When -you are done you will send a Response back to the Client.

    - -

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). -Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends -back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing -function might look:

    - - -class My_blog extends Controller {
    -
    -    function getUserInfo($request)
    -    {
    - -        $username = 'smitty';
    -        $password = 'secretsmittypass';

    - -        $this->load->library('xmlrpc');
    -    
    -        $parameters = $request->output_parameters();
    -    
    -        if ($parameters['1'] != $username AND $parameters['2'] != $password)
    -        {
    -            return $this->xmlrpc->send_error_message('100', 'Invalid Access');
    -        }
    -    
    -        $response = array(array('nickname'  => array('Smitty','string'),
    -                                'userid'    => array('99','string'),
    -                                'url'       => array('http://yoursite.com','string'),
    -                                'email'     => array('jsmith@yoursite.com','string'),
    -                                'lastname'  => array('Smith','string'),
    -                                'firstname' => array('John','string')
    -                                ),
    -                         'struct');
    -
    -        return $this->xmlrpc->send_response($response);
    -    }
    -} -
    - -

    Notes:

    -

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. -In the above example, the output parameters will be the username and password.

    - -

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    - -

    If the operation was successful, the client will be sent back a response array containing the user's info.

    - - -

    Formatting a Response

    - -

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array -that contains a single item. This item can be an array with several additional arrays, but there -can be only one primary array index. In other words, the basic prototype is this:

    - -$response = array('Response data', 'array'); - -

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own -array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    - - -$response = array (
    -                   array(
    -                         'first_name' => array('John', 'string'),
    -                         'last_name' => array('Doe', 'string'),
    -                         'member_id' => array(123435, 'int'),
    -                         'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
    -                        ),
    -                 'struct'
    -                 ); -
    - -

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    - -

    As with Requests, a response can be one of the seven data types listed in the Data Types section.

    - - -

    Sending an Error Response

    - -

    If you need to send the client an error response you will use the following:

    - -return $this->xmlrpc->send_error_message('123', 'Requested data not available'); - -

    The first parameter is the error number while the second parameter is the error message.

    - - - - - - -

    Creating Your Own Client and Server

    - -

    To help you understand everything we've covered thus far, let's create a couple controllers that act as -XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    - -

    The Client

    - -

    Using a text editor, create a controller called xmlrpc_client.php. -In it, place this code and save it to your applications/controllers/ folder:

    - - - -

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    - -

    The Server

    - -

    Using a text editor, create a controller called xmlrpc_server.php. -In it, place this code and save it to your applications/controllers/ folder:

    - - - -

    Try it!

    - -

    Now visit the your site using a URL similar to this:

    -example.com/index.php/xmlrpc_client/ - -

    You should now see the message you sent to the server, and its response back to you.

    - -

    The client you created sends a message ("How's is going?") to the server, along with a request for the "Greetings" method. -The Server receives the request and maps it to the "process" function, where a response is sent back.

    - -

    Using Associative Arrays In a Request Parameter

    - -

    If you wish to use an associative array in your method parameters you will need to use a struct datatype:

    - -$request = array(
    -                  array(
    -                        // Param 0
    -                        array(
    -                              'name'=>'John'
    -                              ),
    -                              'struct'
    -                        ),
    -                        array(
    -                              // Param 1
    -                              array(
    -                                    'size'=>'large',
    -                                    'shape'=>'round'
    -                                    ),
    -                              'struct'
    -                        )
    -                  );
    - $this->xmlrpc->request($request);
    - -

    You can retrieve the associative array when processing the request in the Server.

    - -$parameters = $request->output_parameters();
    - $name = $parameters['0']['name'];
    - $size = $parameters['1']['size'];
    - $size = $parameters['1']['shape'];
    - -

    XML-RPC Function Reference

    - -

    $this->xmlrpc->server()

    -

    Sets the URL and port number of the server to which a request is to be sent:

    -$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80); - -

    $this->xmlrpc->timeout()

    -

    Set a time out period (in seconds) after which the request will be canceled:

    -$this->xmlrpc->timeout(6); - -

    $this->xmlrpc->method()

    -

    Sets the method that will be requested from the XML-RPC server:

    -$this->xmlrpc->method('method'); - -

    Where method is the name of the method.

    - -

    $this->xmlrpc->request()

    -

    Takes an array of data and builds request to be sent to XML-RPC server:

    -$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    -$this->xmlrpc->request($request);
    - -

    $this->xmlrpc->send_request()

    -

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    - -

    $this->xmlrpc->set_debug(TRUE);

    -

    Enables debugging, which will display a variety of information and error data helpful during development.

    - - -

    $this->xmlrpc->display_error()

    -

    Returns an error message as a string if your request failed for some reason.

    -echo $this->xmlrpc->display_error(); - -

    $this->xmlrpc->display_response()

    -

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    -$this->xmlrpc->display_response(); - -

    $this->xmlrpc->send_error_message()

    -

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter -is the error message.

    -return $this->xmlrpc->send_error_message('123', 'Requested data not available'); - -

    $this->xmlrpc->send_response()

    -

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    -$response = array(
    -                 array(
    -                        'flerror' => array(FALSE, 'boolean'),
    -                        'message' => "Thanks for the ping!")
    -                     )
    -                 'struct');
    -return $this->xmlrpc->send_response($response);
    - - - -

    Data Types

    - -

    According to the XML-RPC spec there are seven types -of values that you can send via XML-RPC:

    - -
      -
    • int or i4
    • -
    • boolean
    • -
    • string
    • -
    • double
    • -
    • dateTime.iso8601
    • -
    • base64
    • -
    • struct (contains array of values)
    • -
    • array (contains array of values)
    • -
    - - -
    - - - - - - + + + + + +XML-RPC and XML-RPC Server Classes : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    XML-RPC and XML-RPC Server Classes

    + + +

    CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up +your own XML-RPC server to receive requests.

    + + +

    What is XML-RPC?

    + +

    Quite simply it is a way for two computers to communicate over the internet using XML. +One computer, which we will call the client, sends an XML-RPC request to +another computer, which we will call the server. Once the server receives and processes the request it +will send back a response to the client.

    + +

    For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will +send a request to an XML-RPC Server running on your site. This request might be a new weblog entry +being sent for publication, or it could be a request for an existing entry for editing. + +When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. +Once processed, the server will then send back a response message.

    + +

    For detailed specifications, you can visit the XML-RPC site.

    + +

    Initializing the Class

    + +

    Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function:

    + +

    To load the XML-RPC class you will use:

    +$this->load->library('xmlrpc'); +

    Once loaded, the xml-rpc library object will be available using: $this->xmlrpc

    + +

    To load the XML-RPC Server class you will use:

    + +$this->load->library('xmlrpc');
    +$this->load->library('xmlrpcs'); +
    +

    Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs

    + +

    Note:  When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.

    + + + +

    Sending XML-RPC Requests

    + +

    To send a request to an XML-RPC server you must specify the following information:

    + +
      +
    • The URL of the server
    • +
    • The method on the server you wish to call
    • +
    • The request data (explained below).
    • +
    + +

    Here is a basic example that sends a simple Weblogs.com ping to the Ping-o-Matic

    + + +$this->load->library('xmlrpc');
    +
    +$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
    +$this->xmlrpc->method('weblogUpdates.ping');
    + +
    +$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
    +$this->xmlrpc->request($request);
    +
    +if ( ! $this->xmlrpc->send_request())
    +{
    +    echo $this->xmlrpc->display_error();
    +}
    + +

    Explanation

    + +

    The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The +request (in this case, the title and URL of your site) is placed into an array for transportation, and +compiled using the request() function. +Lastly, the full request is sent. If the send_request() method returns false we will display the error message +sent back from the XML-RPC Server.

    + +

    Anatomy of a Request

    + +

    An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request +is referred to as a request parameter. The above example has two parameters: +The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

    + +

    Request parameters must be placed into an array for transportation, and each parameter can be one +of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings +you will have to include the data type in the request array.

    + +

    Here is an example of a simple array with three parameters:

    + +$request = array('John', 'Doe', 'www.some-site.com');
    +$this->xmlrpc->request($request);
    + +

    If you use data types other than strings, or if you have several different data types, you will place +each parameter into its own array, with the data type in the second position:

    + + +$request = array (
    +                   array('John', 'string'),
    +                   array('Doe', 'string'),
    +                   array(FALSE, 'boolean'),
    +                   array(12345, 'int')
    +                 ); +
    +$this->xmlrpc->request($request);
    + +The Data Types section below has a full list of data types. + + + +

    Creating an XML-RPC Server

    + +

    An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the +appropriate functions for processing.

    + +

    To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming +request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate +class and method for processing.

    + +

    Here is an example to illustrate:

    + + +$this->load->library('xmlrpc');
    +$this->load->library('xmlrpcs');
    +
    +$config['functions']['new_post'] = array('function' => 'My_blog.new_entry'),
    +$config['functions']['update_post'] = array('function' => 'My_blog.update_entry');
    +$config['object'] = $this;
    +
    +$this->xmlrpcs->initialize($config);
    +$this->xmlrpcs->serve();
    + +

    The above example contains an array specifying two method requests that the Server allows. +The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.

    + +

    The 'object' key is a special key that you pass an instantiated class object with, which is necessary when the method you are mapping to is not + part of the CodeIgniter super object.

    + +

    In other words, if an XML-RPC Client sends a request for the new_post method, your +server will load the My_blog class and call the new_entry function. +If the request is for the update_post method, your +server will load the My_blog class and call the update_entry function.

    + +

    The function names in the above example are arbitrary. You'll decide what they should be called on your server, +or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

    + +

    Processing Server Requests

    + +

    When the XML-RPC Server receives a request and loads the class/method for processing, it will pass +an object to that method containing the data sent by the client.

    + +

    Using the above example, if the new_post method is requested, the server will expect a class +to exist with this prototype:

    + +class My_blog extends Controller {
    +
    +    function new_post($request)
    +    {
    +
    +    }
    +} +
    + +

    The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. +Using this object you will have access to the request parameters enabling you to process the request. When +you are done you will send a Response back to the Client.

    + +

    Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). +Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends +back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing +function might look:

    + + +class My_blog extends Controller {
    +
    +    function getUserInfo($request)
    +    {
    + +        $username = 'smitty';
    +        $password = 'secretsmittypass';

    + +        $this->load->library('xmlrpc');
    +    
    +        $parameters = $request->output_parameters();
    +    
    +        if ($parameters['1'] != $username AND $parameters['2'] != $password)
    +        {
    +            return $this->xmlrpc->send_error_message('100', 'Invalid Access');
    +        }
    +    
    +        $response = array(array('nickname'  => array('Smitty','string'),
    +                                'userid'    => array('99','string'),
    +                                'url'       => array('http://yoursite.com','string'),
    +                                'email'     => array('jsmith@yoursite.com','string'),
    +                                'lastname'  => array('Smith','string'),
    +                                'firstname' => array('John','string')
    +                                ),
    +                         'struct');
    +
    +        return $this->xmlrpc->send_response($response);
    +    }
    +} +
    + +

    Notes:

    +

    The output_parameters() function retrieves an indexed array corresponding to the request parameters sent by the client. +In the above example, the output parameters will be the username and password.

    + +

    If the username and password sent by the client were not valid, and error message is returned using send_error_message().

    + +

    If the operation was successful, the client will be sent back a response array containing the user's info.

    + + +

    Formatting a Response

    + +

    Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array +that contains a single item. This item can be an array with several additional arrays, but there +can be only one primary array index. In other words, the basic prototype is this:

    + +$response = array('Response data', 'array'); + +

    Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own +array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

    + + +$response = array (
    +                   array(
    +                         'first_name' => array('John', 'string'),
    +                         'last_name' => array('Doe', 'string'),
    +                         'member_id' => array(123435, 'int'),
    +                         'todo_list' => array(array('clean house', 'call mom', 'water plants'), 'array'),
    +                        ),
    +                 'struct'
    +                 ); +
    + +

    Notice that the above array is formatted as a struct. This is the most common data type for responses.

    + +

    As with Requests, a response can be one of the seven data types listed in the Data Types section.

    + + +

    Sending an Error Response

    + +

    If you need to send the client an error response you will use the following:

    + +return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

    The first parameter is the error number while the second parameter is the error message.

    + + + + + + +

    Creating Your Own Client and Server

    + +

    To help you understand everything we've covered thus far, let's create a couple controllers that act as +XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

    + +

    The Client

    + +

    Using a text editor, create a controller called xmlrpc_client.php. +In it, place this code and save it to your applications/controllers/ folder:

    + + + +

    Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

    + +

    The Server

    + +

    Using a text editor, create a controller called xmlrpc_server.php. +In it, place this code and save it to your applications/controllers/ folder:

    + + + +

    Try it!

    + +

    Now visit the your site using a URL similar to this:

    +example.com/index.php/xmlrpc_client/ + +

    You should now see the message you sent to the server, and its response back to you.

    + +

    The client you created sends a message ("How's is going?") to the server, along with a request for the "Greetings" method. +The Server receives the request and maps it to the "process" function, where a response is sent back.

    + +

    Using Associative Arrays In a Request Parameter

    + +

    If you wish to use an associative array in your method parameters you will need to use a struct datatype:

    + +$request = array(
    +                  array(
    +                        // Param 0
    +                        array(
    +                              'name'=>'John'
    +                              ),
    +                              'struct'
    +                        ),
    +                        array(
    +                              // Param 1
    +                              array(
    +                                    'size'=>'large',
    +                                    'shape'=>'round'
    +                                    ),
    +                              'struct'
    +                        )
    +                  );
    + $this->xmlrpc->request($request);
    + +

    You can retrieve the associative array when processing the request in the Server.

    + +$parameters = $request->output_parameters();
    + $name = $parameters['0']['name'];
    + $size = $parameters['1']['size'];
    + $size = $parameters['1']['shape'];
    + +

    XML-RPC Function Reference

    + +

    $this->xmlrpc->server()

    +

    Sets the URL and port number of the server to which a request is to be sent:

    +$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80); + +

    $this->xmlrpc->timeout()

    +

    Set a time out period (in seconds) after which the request will be canceled:

    +$this->xmlrpc->timeout(6); + +

    $this->xmlrpc->method()

    +

    Sets the method that will be requested from the XML-RPC server:

    +$this->xmlrpc->method('method'); + +

    Where method is the name of the method.

    + +

    $this->xmlrpc->request()

    +

    Takes an array of data and builds request to be sent to XML-RPC server:

    +$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');
    +$this->xmlrpc->request($request);
    + +

    $this->xmlrpc->send_request()

    +

    The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

    + +

    $this->xmlrpc->set_debug(TRUE);

    +

    Enables debugging, which will display a variety of information and error data helpful during development.

    + + +

    $this->xmlrpc->display_error()

    +

    Returns an error message as a string if your request failed for some reason.

    +echo $this->xmlrpc->display_error(); + +

    $this->xmlrpc->display_response()

    +

    Returns the response from the remote server once request is received. The response will typically be an associative array.

    +$this->xmlrpc->display_response(); + +

    $this->xmlrpc->send_error_message()

    +

    This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter +is the error message.

    +return $this->xmlrpc->send_error_message('123', 'Requested data not available'); + +

    $this->xmlrpc->send_response()

    +

    Lets you send the response from your server to the client. An array of valid data values must be sent with this method.

    +$response = array(
    +                 array(
    +                        'flerror' => array(FALSE, 'boolean'),
    +                        'message' => "Thanks for the ping!")
    +                     )
    +                 'struct');
    +return $this->xmlrpc->send_response($response);
    + + + +

    Data Types

    + +

    According to the XML-RPC spec there are seven types +of values that you can send via XML-RPC:

    + +
      +
    • int or i4
    • +
    • boolean
    • +
    • string
    • +
    • double
    • +
    • dateTime.iso8601
    • +
    • base64
    • +
    • struct (contains array of values)
    • +
    • array (contains array of values)
    • +
    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index c789c85f..ebd5b49a 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -1,278 +1,278 @@ - - - - - -Zip Encoding Class : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Zip Encoding Class

    -

    CodeIgniter's Zip Encoding Class classes permit you to create Zip archives. Archives can be downloaded to your -desktop or saved to a directory.

    - - -

    Initializing the Class

    -

    Like most other classes in CodeIgniter, the Zip class is initialized in your controller using the $this->load->library function:

    - -$this->load->library('zip'); -

    Once loaded, the Zip library object will be available using: $this->zip

    - - -

    Usage Example

    - -

    This example demonstrates how to compress a file, save it to a folder on your server, and download it to your desktop.

    - - -$name = 'mydata1.txt';
    -$data = 'A Data String!';
    -
    -$this->zip->add_data($name, $data);
    -
    -// Write the zip file to a folder on your server. Name it "my_backup.zip"
    -$this->zip->archive('/path/to/directory/my_backup.zip'); -

    - // Download the file to your desktop. Name it "my_backup.zip"
    -$this->zip->download('my_backup.zip'); -
    - -

    Function Reference

    - -

    $this->zip->add_data()

    - -

    Permits you to add data to the Zip archive. The first parameter must contain the name you would like -given to the file, the second parameter must contain the file data as a string:

    - - -$name = 'my_bio.txt';
    -$data = 'I was born in an elevator...';
    -
    -$this->zip->add_data($name, $data); -
    - -

    You are allowed multiple calls to this function in order to -add several files to your archive. Example:

    - - -$name = 'mydata1.txt';
    -$data = 'A Data String!';
    -$this->zip->add_data($name, $data);
    -
    -$name = 'mydata2.txt';
    -$data = 'Another Data String!';
    -$this->zip->add_data($name, $data);
    -
    - -

    Or you can pass multiple files using an array:

    - - -$data = array(
    -                'mydata1.txt' => 'A Data String!',
    -                'mydata2.txt' => 'Another Data String!'
    -            );
    -
    -$this->zip->add_data($data);
    -
    -$this->zip->download('my_backup.zip'); -
    - -

    If you would like your compressed data organized into sub-folders, include the path as part of the filename:

    - - -$name = 'personal/my_bio.txt';
    -$data = 'I was born in an elevator...';
    -
    -$this->zip->add_data($name, $data); -
    - -

    The above example will place my_bio.txt inside a folder called personal.

    - - -

    $this->zip->add_dir()

    - -

    Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when -using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

    - -$this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" - - - -

    $this->zip->read_file()

    - -

    Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will -read it and add it to the archive:

    - - -$path = '/path/to/photo.jpg';

    -$this->zip->read_file($path); -

    - // Download the file to your desktop. Name it "my_backup.zip"
    -$this->zip->download('my_backup.zip'); -
    - -

    If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the -second parameter. Example:

    - - - -$path = '/path/to/photo.jpg';

    -$this->zip->read_file($path, TRUE); -

    - // Download the file to your desktop. Name it "my_backup.zip"
    -$this->zip->download('my_backup.zip'); -
    - -

    In the above example, photo.jpg will be placed inside two folders: path/to/

    - - - -

    $this->zip->read_dir()

    - -

    Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the -directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encoded, as will any sub-folders contained within it. Example:

    - - -$path = '/path/to/your/directory/';

    -$this->zip->read_dir($path); -

    - // Download the file to your desktop. Name it "my_backup.zip"
    -$this->zip->download('my_backup.zip'); -
    - - - - -

    $this->zip->archive()

    - -

    Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the -directory is writable (666 or 777 is usually OK). Example:

    - -$this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip - - -

    $this->zip->download()

    - -

    Causes the Zip file to be downloaded from your server. The function must be passed the name you would like the zip file called. -Example:

    - -$this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip" - -

    Note:  Do not display any data in the controller in which you call this function since it sends various server headers -that cause the download to happen and the file to be treated as binary.

    - - -

    $this->zip->get_zip()

    - -

    Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. -Example:

    - - -$name = 'my_bio.txt';
    -$data = 'I was born in an elevator...';
    -
    -$this->zip->add_data($name, $data);

    - -$zip_file = $this->zip->get_zip(); -
    - - -

    $this->zip->clear_data()

    - -

    The Zip class caches your zip data so that it doesn't need to recompile the Zip archive for each function you use above. -If, however, you need to create multiple Zips, each with different data, you can clear the cache between calls. Example:

    - - -$name = 'my_bio.txt';
    -$data = 'I was born in an elevator...';
    -
    -$this->zip->add_data($name, $data);
    -$zip_file = $this->zip->get_zip();
    -
    -$this->zip->clear_data(); -

    - -$name = 'photo.jpg';
    -$this->zip->read_file("/path/to/photo.jpg"); // Read the file's contents
    -

    -$this->zip->download('myphotos.zip'); -
    - - - - - - - - - - - - - -
    - - - - - - + + + + + +Zip Encoding Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Zip Encoding Class

    +

    CodeIgniter's Zip Encoding Class classes permit you to create Zip archives. Archives can be downloaded to your +desktop or saved to a directory.

    + + +

    Initializing the Class

    +

    Like most other classes in CodeIgniter, the Zip class is initialized in your controller using the $this->load->library function:

    + +$this->load->library('zip'); +

    Once loaded, the Zip library object will be available using: $this->zip

    + + +

    Usage Example

    + +

    This example demonstrates how to compress a file, save it to a folder on your server, and download it to your desktop.

    + + +$name = 'mydata1.txt';
    +$data = 'A Data String!';
    +
    +$this->zip->add_data($name, $data);
    +
    +// Write the zip file to a folder on your server. Name it "my_backup.zip"
    +$this->zip->archive('/path/to/directory/my_backup.zip'); +

    + // Download the file to your desktop. Name it "my_backup.zip"
    +$this->zip->download('my_backup.zip'); +
    + +

    Function Reference

    + +

    $this->zip->add_data()

    + +

    Permits you to add data to the Zip archive. The first parameter must contain the name you would like +given to the file, the second parameter must contain the file data as a string:

    + + +$name = 'my_bio.txt';
    +$data = 'I was born in an elevator...';
    +
    +$this->zip->add_data($name, $data); +
    + +

    You are allowed multiple calls to this function in order to +add several files to your archive. Example:

    + + +$name = 'mydata1.txt';
    +$data = 'A Data String!';
    +$this->zip->add_data($name, $data);
    +
    +$name = 'mydata2.txt';
    +$data = 'Another Data String!';
    +$this->zip->add_data($name, $data);
    +
    + +

    Or you can pass multiple files using an array:

    + + +$data = array(
    +                'mydata1.txt' => 'A Data String!',
    +                'mydata2.txt' => 'Another Data String!'
    +            );
    +
    +$this->zip->add_data($data);
    +
    +$this->zip->download('my_backup.zip'); +
    + +

    If you would like your compressed data organized into sub-folders, include the path as part of the filename:

    + + +$name = 'personal/my_bio.txt';
    +$data = 'I was born in an elevator...';
    +
    +$this->zip->add_data($name, $data); +
    + +

    The above example will place my_bio.txt inside a folder called personal.

    + + +

    $this->zip->add_dir()

    + +

    Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when +using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

    + +$this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" + + + +

    $this->zip->read_file()

    + +

    Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will +read it and add it to the archive:

    + + +$path = '/path/to/photo.jpg';

    +$this->zip->read_file($path); +

    + // Download the file to your desktop. Name it "my_backup.zip"
    +$this->zip->download('my_backup.zip'); +
    + +

    If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the +second parameter. Example:

    + + + +$path = '/path/to/photo.jpg';

    +$this->zip->read_file($path, TRUE); +

    + // Download the file to your desktop. Name it "my_backup.zip"
    +$this->zip->download('my_backup.zip'); +
    + +

    In the above example, photo.jpg will be placed inside two folders: path/to/

    + + + +

    $this->zip->read_dir()

    + +

    Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the +supplied path will be encoded, as will any sub-folders contained within it. Example:

    + + +$path = '/path/to/your/directory/';

    +$this->zip->read_dir($path); +

    + // Download the file to your desktop. Name it "my_backup.zip"
    +$this->zip->download('my_backup.zip'); +
    + + + + +

    $this->zip->archive()

    + +

    Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the +directory is writable (666 or 777 is usually OK). Example:

    + +$this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip + + +

    $this->zip->download()

    + +

    Causes the Zip file to be downloaded from your server. The function must be passed the name you would like the zip file called. +Example:

    + +$this->zip->download('latest_stuff.zip'); // File will be named "latest_stuff.zip" + +

    Note:  Do not display any data in the controller in which you call this function since it sends various server headers +that cause the download to happen and the file to be treated as binary.

    + + +

    $this->zip->get_zip()

    + +

    Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. +Example:

    + + +$name = 'my_bio.txt';
    +$data = 'I was born in an elevator...';
    +
    +$this->zip->add_data($name, $data);

    + +$zip_file = $this->zip->get_zip(); +
    + + +

    $this->zip->clear_data()

    + +

    The Zip class caches your zip data so that it doesn't need to recompile the Zip archive for each function you use above. +If, however, you need to create multiple Zips, each with different data, you can clear the cache between calls. Example:

    + + +$name = 'my_bio.txt';
    +$data = 'I was born in an elevator...';
    +
    +$this->zip->add_data($name, $data);
    +$zip_file = $this->zip->get_zip();
    +
    +$this->zip->clear_data(); +

    + +$name = 'photo.jpg';
    +$this->zip->read_file("/path/to/photo.jpg"); // Read the file's contents
    +

    +$this->zip->download('myphotos.zip'); +
    + + + + + + + + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/license.html b/user_guide/license.html index 646389ea..c17e7bf6 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -1,107 +1,107 @@ - - - - - -CodeIgniter License Agreement : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - - - -
    - - - -
    - -

    CodeIgniter License Agreement

    - -

    Copyright (c) 2008, 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. -
    3. Redistributions of source code must retain the above copyright notice in all source code files.
    4. -
    5. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution.
    6. -
    7. Any files that have been modified must carry notices stating the nature of the change and the names of those who changed them.
    8. -
    9. 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.
    10. -
    11. Products derived from the Software may not be called "CodeIgniter", nor may "CodeIgniter" appear in their name, without prior written permission from EllisLab, Inc.
    12. -
    - -

    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.

    - - - -
    - - - - - - + + + + + +CodeIgniter License Agreement : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + + + +
    + + + +
    + +

    CodeIgniter License Agreement

    + +

    Copyright (c) 2008, 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. +
    3. Redistributions of source code must retain the above copyright notice in all source code files.
    4. +
    5. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution.
    6. +
    7. Any files that have been modified must carry notices stating the nature of the change and the names of those who changed them.
    8. +
    9. 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.
    10. +
    11. Products derived from the Software may not be called "CodeIgniter", nor may "CodeIgniter" appear in their name, without prior written permission from EllisLab, Inc.
    12. +
    + +

    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.

    + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt index 081eecef..f29e5a77 100644 --- a/user_guide/nav/hacks.txt +++ b/user_guide/nav/hacks.txt @@ -1,9 +1,9 @@ -I did the following hack in moo.fx.js: - -At line 79 in the toggle: function() function, I added: - -document.getElementById('nav').style.display = 'block'; - - - +I did the following hack in moo.fx.js: + +At line 79 in the toggle: function() function, I added: + +document.getElementById('nav').style.display = 'block'; + + + -- Rick Ellis \ No newline at end of file diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js index 953e87c6..53cfa925 100755 --- a/user_guide/nav/moo.fx.js +++ b/user_guide/nav/moo.fx.js @@ -1,119 +1,119 @@ -/* -moo.fx, simple effects library built with prototype.js (http://prototype.conio.net). -by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE. -for more info (http://moofx.mad4milk.net). -10/24/2005 -v(1.0.2) -*/ - -//base -var fx = new Object(); -fx.Base = function(){}; -fx.Base.prototype = { - setOptions: function(options) { - this.options = { - duration: 500, - onComplete: '' - } - Object.extend(this.options, options || {}); - }, - - go: function() { - this.duration = this.options.duration; - this.startTime = (new Date).getTime(); - this.timer = setInterval (this.step.bind(this), 13); - }, - - step: function() { - var time = (new Date).getTime(); - var Tpos = (time - this.startTime) / (this.duration); - if (time >= this.duration+this.startTime) { - this.now = this.to; - clearInterval (this.timer); - this.timer = null; - if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); - } - else { - this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from; - //this time-position, sinoidal transition thing is from script.aculo.us - } - this.increase(); - }, - - custom: function(from, to) { - if (this.timer != null) return; - this.from = from; - this.to = to; - this.go(); - }, - - hide: function() { - this.now = 0; - this.increase(); - }, - - clearTimer: function() { - clearInterval(this.timer); - this.timer = null; - } -} - -//stretchers -fx.Layout = Class.create(); -fx.Layout.prototype = Object.extend(new fx.Base(), { - initialize: function(el, options) { - this.el = $(el); - this.el.style.overflow = "hidden"; - this.el.iniWidth = this.el.offsetWidth; - this.el.iniHeight = this.el.offsetHeight; - this.setOptions(options); - } -}); - -fx.Height = Class.create(); -Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { - increase: function() { - this.el.style.height = this.now + "px"; - }, - - toggle: function() { - if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); - else this.custom(0, this.el.scrollHeight); - } -}); - -fx.Width = Class.create(); -Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), { - increase: function() { - this.el.style.width = this.now + "px"; - }, - - toggle: function(){ - if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0); - else this.custom(0, this.el.iniWidth); - } -}); - -//fader -fx.Opacity = Class.create(); -fx.Opacity.prototype = Object.extend(new fx.Base(), { - initialize: function(el, options) { - this.el = $(el); - this.now = 1; - this.increase(); - this.setOptions(options); - }, - - increase: function() { - if (this.now == 1) this.now = 0.9999; - if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible"; - if (this.now == 0) this.el.style.visibility = "hidden"; - if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")"; - this.el.style.opacity = this.now; - }, - - toggle: function() { - if (this.now > 0) this.custom(1, 0); - else this.custom(0, 1); - } +/* +moo.fx, simple effects library built with prototype.js (http://prototype.conio.net). +by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE. +for more info (http://moofx.mad4milk.net). +10/24/2005 +v(1.0.2) +*/ + +//base +var fx = new Object(); +fx.Base = function(){}; +fx.Base.prototype = { + setOptions: function(options) { + this.options = { + duration: 500, + onComplete: '' + } + Object.extend(this.options, options || {}); + }, + + go: function() { + this.duration = this.options.duration; + this.startTime = (new Date).getTime(); + this.timer = setInterval (this.step.bind(this), 13); + }, + + step: function() { + var time = (new Date).getTime(); + var Tpos = (time - this.startTime) / (this.duration); + if (time >= this.duration+this.startTime) { + this.now = this.to; + clearInterval (this.timer); + this.timer = null; + if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); + } + else { + this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from; + //this time-position, sinoidal transition thing is from script.aculo.us + } + this.increase(); + }, + + custom: function(from, to) { + if (this.timer != null) return; + this.from = from; + this.to = to; + this.go(); + }, + + hide: function() { + this.now = 0; + this.increase(); + }, + + clearTimer: function() { + clearInterval(this.timer); + this.timer = null; + } +} + +//stretchers +fx.Layout = Class.create(); +fx.Layout.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.el.style.overflow = "hidden"; + this.el.iniWidth = this.el.offsetWidth; + this.el.iniHeight = this.el.offsetHeight; + this.setOptions(options); + } +}); + +fx.Height = Class.create(); +Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { + increase: function() { + this.el.style.height = this.now + "px"; + }, + + toggle: function() { + if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); + else this.custom(0, this.el.scrollHeight); + } +}); + +fx.Width = Class.create(); +Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), { + increase: function() { + this.el.style.width = this.now + "px"; + }, + + toggle: function(){ + if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0); + else this.custom(0, this.el.iniWidth); + } +}); + +//fader +fx.Opacity = Class.create(); +fx.Opacity.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.now = 1; + this.increase(); + this.setOptions(options); + }, + + increase: function() { + if (this.now == 1) this.now = 0.9999; + if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible"; + if (this.now == 0) this.el.style.visibility = "hidden"; + if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")"; + this.el.style.opacity = this.now; + }, + + toggle: function() { + if (this.now > 0) this.custom(1, 0); + else this.custom(0, 1); + } }); \ No newline at end of file diff --git a/user_guide/nav/moo.fx.pack.js b/user_guide/nav/moo.fx.pack.js index b5c360c3..574f27cf 100755 --- a/user_guide/nav/moo.fx.pack.js +++ b/user_guide/nav/moo.fx.pack.js @@ -1,241 +1,241 @@ -/* -moo.fx pack, effects extensions for moo.fx. -by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE -for more info visit (http://moofx.mad4milk.net). -Wednesday, November 16, 2005 -v1.0.4 -*/ - -//text size modify, now works with pixels too. -fx.Text = Class.create(); -fx.Text.prototype = Object.extend(new fx.Base(), { - initialize: function(el, options) { - this.el = $(el); - this.setOptions(options); - if (!this.options.unit) this.options.unit = "em"; - }, - - increase: function() { - this.el.style.fontSize = this.now + this.options.unit; - } -}); - -//composition effect, calls Width and Height alltogheter -fx.Resize = Class.create(); -fx.Resize.prototype = { - initialize: function(el, options) { - this.h = new fx.Height(el, options); - if (options) options.onComplete = null; - this.w = new fx.Width(el, options); - this.el = $(el); - }, - - toggle: function(){ - this.h.toggle(); - this.w.toggle(); - }, - - modify: function(hto, wto) { - this.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto); - this.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto); - }, - - custom: function(hto, wto) { - this.h.custom(this.el.offsetHeight, hto); - this.w.custom(this.el.offsetWidth, wto); - }, - - hide: function(){ - this.h.hide(); - this.w.hide(); - } -} - -//composition effect, calls Opacity and (Width and/or Height) alltogheter -fx.FadeSize = Class.create(); -fx.FadeSize.prototype = { - initialize: function(el, options) { - this.el = $(el); - this.el.o = new fx.Opacity(el, options); - if (options) options.onComplete = null; - this.el.h = new fx.Height(el, options); - this.el.w = new fx.Width(el, options); - }, - - toggle: function() { - this.el.o.toggle(); - for (var i = 0; i < arguments.length; i++) { - if (arguments[i] == 'height') this.el.h.toggle(); - if (arguments[i] == 'width') this.el.w.toggle(); - } - }, - - hide: function(){ - this.el.o.hide(); - for (var i = 0; i < arguments.length; i++) { - if (arguments[i] == 'height') this.el.h.hide(); - if (arguments[i] == 'width') this.el.w.hide(); - } - } -} - -//intended to work with arrays. -var Multi = new Object(); -Multi = function(){}; -Multi.prototype = { - initialize: function(elements, options){ - this.options = options; - this.el = this.getElementsFromArray(elements); - for (i=0;i 0 && this.el[i] != el && this.el[i].h.timer == null && el.h.timer == null){ - this.el[i].fs.toggle(mode); - setTimeout(function(){el.fs.toggle(mode);}.bind(el), delay); - } - - } - }, - - hide: function(el, mode){ - el.fs.hide(mode); - } -}); - -var Remember = new Object(); -Remember = function(){}; -Remember.prototype = { - initialize: function(el, options){ - this.el = $(el); - this.days = 365; - this.options = options; - this.effect(); - var cookie = this.readCookie(); - if (cookie) { - this.fx.now = cookie; - this.fx.increase(); - } - }, - - //cookie functions based on code by Peter-Paul Koch - setCookie: function(value) { - var date = new Date(); - date.setTime(date.getTime()+(this.days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/"; - }, - - readCookie: function() { - var nameEQ = this.el+this.el.id+this.prefix + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return false; - }, - - custom: function(from, to){ - if (this.fx.now != to) { - this.setCookie(to); - this.fx.custom(from, to); - } - } -} - -fx.RememberHeight = Class.create(); -fx.RememberHeight.prototype = Object.extend(new Remember(), { - effect: function(){ - this.fx = new fx.Height(this.el, this.options); - this.prefix = 'height'; - }, - - toggle: function(){ - if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight); - else this.setCookie(0); - this.fx.toggle(); - }, - - resize: function(to){ - this.setCookie(this.el.offsetHeight+to); - this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to); - }, - - hide: function(){ - if (!this.readCookie()) { - this.fx.hide(); - } - } -}); - -fx.RememberText = Class.create(); -fx.RememberText.prototype = Object.extend(new Remember(), { - effect: function(){ - this.fx = new fx.Text(this.el, this.options); - this.prefix = 'text'; - } -}); - - -//use to attach effects without using js code, just classnames and rel attributes. -ParseClassNames = Class.create(); -ParseClassNames.prototype = { - initialize: function(options){ - var babies = document.getElementsByTagName('*') || document.all; - for (var i = 0; i < babies.length; i++) { - var el = babies[i]; - //attach the effect, from the classNames; - var effects = this.getEffects(el); - for (var j = 0; j < effects.length; j++) { - if (j == 1 && options) options.onComplete = null; - el[effects[j]+"fx"] = new fx[effects[j]](el, options); - } - //execute methods, from rel - if (el.rel) { - el.crel = el.rel.split(' '); - if (el.crel[0].indexOf("fx_") > -1) { - var event = el.crel[0].replace('fx_', ''); - var tocompute = this.getEffects($(el.crel[1])); - el["on"+event] = function(){ - for (var f = 0; f < tocompute.length; f++) { - $(this.crel[1])[tocompute[f]+"fx"][this.crel[2] || "toggle"](this.crel[3] || null, this.crel[4] || null); - } - } - } - } - } - }, - - getEffects: function(el){ - var effects = new Array(); - var css = el.className.split(' '); - for (var i = 0; i < css.length; i++) { - if (css[i].indexOf('fx_') > -1) { - var effect = css[i].replace('fx_', ''); - effects.push(effect); - } - } - return effects; - } +/* +moo.fx pack, effects extensions for moo.fx. +by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE +for more info visit (http://moofx.mad4milk.net). +Wednesday, November 16, 2005 +v1.0.4 +*/ + +//text size modify, now works with pixels too. +fx.Text = Class.create(); +fx.Text.prototype = Object.extend(new fx.Base(), { + initialize: function(el, options) { + this.el = $(el); + this.setOptions(options); + if (!this.options.unit) this.options.unit = "em"; + }, + + increase: function() { + this.el.style.fontSize = this.now + this.options.unit; + } +}); + +//composition effect, calls Width and Height alltogheter +fx.Resize = Class.create(); +fx.Resize.prototype = { + initialize: function(el, options) { + this.h = new fx.Height(el, options); + if (options) options.onComplete = null; + this.w = new fx.Width(el, options); + this.el = $(el); + }, + + toggle: function(){ + this.h.toggle(); + this.w.toggle(); + }, + + modify: function(hto, wto) { + this.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto); + this.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto); + }, + + custom: function(hto, wto) { + this.h.custom(this.el.offsetHeight, hto); + this.w.custom(this.el.offsetWidth, wto); + }, + + hide: function(){ + this.h.hide(); + this.w.hide(); + } +} + +//composition effect, calls Opacity and (Width and/or Height) alltogheter +fx.FadeSize = Class.create(); +fx.FadeSize.prototype = { + initialize: function(el, options) { + this.el = $(el); + this.el.o = new fx.Opacity(el, options); + if (options) options.onComplete = null; + this.el.h = new fx.Height(el, options); + this.el.w = new fx.Width(el, options); + }, + + toggle: function() { + this.el.o.toggle(); + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] == 'height') this.el.h.toggle(); + if (arguments[i] == 'width') this.el.w.toggle(); + } + }, + + hide: function(){ + this.el.o.hide(); + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] == 'height') this.el.h.hide(); + if (arguments[i] == 'width') this.el.w.hide(); + } + } +} + +//intended to work with arrays. +var Multi = new Object(); +Multi = function(){}; +Multi.prototype = { + initialize: function(elements, options){ + this.options = options; + this.el = this.getElementsFromArray(elements); + for (i=0;i 0 && this.el[i] != el && this.el[i].h.timer == null && el.h.timer == null){ + this.el[i].fs.toggle(mode); + setTimeout(function(){el.fs.toggle(mode);}.bind(el), delay); + } + + } + }, + + hide: function(el, mode){ + el.fs.hide(mode); + } +}); + +var Remember = new Object(); +Remember = function(){}; +Remember.prototype = { + initialize: function(el, options){ + this.el = $(el); + this.days = 365; + this.options = options; + this.effect(); + var cookie = this.readCookie(); + if (cookie) { + this.fx.now = cookie; + this.fx.increase(); + } + }, + + //cookie functions based on code by Peter-Paul Koch + setCookie: function(value) { + var date = new Date(); + date.setTime(date.getTime()+(this.days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/"; + }, + + readCookie: function() { + var nameEQ = this.el+this.el.id+this.prefix + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return false; + }, + + custom: function(from, to){ + if (this.fx.now != to) { + this.setCookie(to); + this.fx.custom(from, to); + } + } +} + +fx.RememberHeight = Class.create(); +fx.RememberHeight.prototype = Object.extend(new Remember(), { + effect: function(){ + this.fx = new fx.Height(this.el, this.options); + this.prefix = 'height'; + }, + + toggle: function(){ + if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight); + else this.setCookie(0); + this.fx.toggle(); + }, + + resize: function(to){ + this.setCookie(this.el.offsetHeight+to); + this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to); + }, + + hide: function(){ + if (!this.readCookie()) { + this.fx.hide(); + } + } +}); + +fx.RememberText = Class.create(); +fx.RememberText.prototype = Object.extend(new Remember(), { + effect: function(){ + this.fx = new fx.Text(this.el, this.options); + this.prefix = 'text'; + } +}); + + +//use to attach effects without using js code, just classnames and rel attributes. +ParseClassNames = Class.create(); +ParseClassNames.prototype = { + initialize: function(options){ + var babies = document.getElementsByTagName('*') || document.all; + for (var i = 0; i < babies.length; i++) { + var el = babies[i]; + //attach the effect, from the classNames; + var effects = this.getEffects(el); + for (var j = 0; j < effects.length; j++) { + if (j == 1 && options) options.onComplete = null; + el[effects[j]+"fx"] = new fx[effects[j]](el, options); + } + //execute methods, from rel + if (el.rel) { + el.crel = el.rel.split(' '); + if (el.crel[0].indexOf("fx_") > -1) { + var event = el.crel[0].replace('fx_', ''); + var tocompute = this.getEffects($(el.crel[1])); + el["on"+event] = function(){ + for (var f = 0; f < tocompute.length; f++) { + $(this.crel[1])[tocompute[f]+"fx"][this.crel[2] || "toggle"](this.crel[3] || null, this.crel[4] || null); + } + } + } + } + } + }, + + getEffects: function(el){ + var effects = new Array(); + var css = el.className.split(' '); + for (var i = 0; i < css.length; i++) { + if (css[i].indexOf('fx_') > -1) { + var effect = css[i].replace('fx_', ''); + effects.push(effect); + } + } + return effects; + } } \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index f8320ddd..d9131aab 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -1,137 +1,137 @@ -function create_menu(basepath) -{ - var base = (basepath == 'null') ? '' : basepath; - - document.write( - '' + - '
    ' + - - '' + - - '

    Basic Info

    ' + - '' + - - '

    Installation

    ' + - '' + - - '

    Introduction

    ' + - '' + - - - '
    ' + - - '

    General Topics

    ' + - '' + - - '
    ' + - - - '

    Class Reference

    ' + - '' + - - '
    ' + - - '

    Helper Reference

    ' + - '' + - - - '

    Additional Resources

    ' + - '' + - - '
    '); +function create_menu(basepath) +{ + var base = (basepath == 'null') ? '' : basepath; + + document.write( + '' + + '
    ' + + + '' + + + '

    Basic Info

    ' + + '' + + + '

    Installation

    ' + + '' + + + '

    Introduction

    ' + + '' + + + + '
    ' + + + '

    General Topics

    ' + + '' + + + '
    ' + + + + '

    Class Reference

    ' + + '' + + + '
    ' + + + '

    Helper Reference

    ' + + '' + + + + '

    Additional Resources

    ' + + '' + + + '
    '); } \ No newline at end of file diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js index d294fd7f..e6c36227 100755 --- a/user_guide/nav/prototype.lite.js +++ b/user_guide/nav/prototype.lite.js @@ -1,127 +1,127 @@ -/* Prototype JavaScript framework - * (c) 2005 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * - * For details, see the Prototype web site: http://prototype.conio.net/ - * -/*--------------------------------------------------------------------------*/ - - -//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -} - -Object.extend = function(destination, source) { - for (property in source) { - destination[property] = source[property]; - } - return destination; -} - -Function.prototype.bind = function(object) { - var __method = this; - return function() { - return __method.apply(object, arguments); - } -} - -function $() { - var elements = new Array(); - - for (var i = 0; i < arguments.length; i++) { - var element = arguments[i]; - if (typeof element == 'string') - element = document.getElementById(element); - - if (arguments.length == 1) - return element; - - elements.push(element); - } - - return elements; -} - -//------------------------- - -document.getElementsByClassName = function(className) { - var children = document.getElementsByTagName('*') || document.all; - var elements = new Array(); - - for (var i = 0; i < children.length; i++) { - var child = children[i]; - var classNames = child.className.split(' '); - for (var j = 0; j < classNames.length; j++) { - if (classNames[j] == className) { - elements.push(child); - break; - } - } - } - - return elements; -} - -//------------------------- - -if (!window.Element) { - var Element = new Object(); -} - -Object.extend(Element, { - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - }, - - hasClassName: function(element, className) { - element = $(element); - if (!element) - return; - var a = element.className.split(' '); - for (var i = 0; i < a.length; i++) { - if (a[i] == className) - return true; - } - return false; - }, - - addClassName: function(element, className) { - element = $(element); - Element.removeClassName(element, className); - element.className += ' ' + className; - }, - - removeClassName: function(element, className) { - element = $(element); - if (!element) - return; - var newClassName = ''; - var a = element.className.split(' '); - for (var i = 0; i < a.length; i++) { - if (a[i] != className) { - if (i > 0) - newClassName += ' '; - newClassName += a[i]; - } - } - element.className = newClassName; - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - Element.remove(node); - } - } +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + + +//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +} + +Function.prototype.bind = function(object) { + var __method = this; + return function() { + return __method.apply(object, arguments); + } +} + +function $() { + var elements = new Array(); + + for (var i = 0; i < arguments.length; i++) { + var element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + + if (arguments.length == 1) + return element; + + elements.push(element); + } + + return elements; +} + +//------------------------- + +document.getElementsByClassName = function(className) { + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + var classNames = child.className.split(' '); + for (var j = 0; j < classNames.length; j++) { + if (classNames[j] == className) { + elements.push(child); + break; + } + } + } + + return elements; +} + +//------------------------- + +if (!window.Element) { + var Element = new Object(); +} + +Object.extend(Element, { + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + hasClassName: function(element, className) { + element = $(element); + if (!element) + return; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] == className) + return true; + } + return false; + }, + + addClassName: function(element, className) { + element = $(element); + Element.removeClassName(element, className); + element.className += ' ' + className; + }, + + removeClassName: function(element, className) { + element = $(element); + if (!element) + return; + var newClassName = ''; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] != className) { + if (i > 0) + newClassName += ' '; + newClassName += a[i]; + } + } + element.className = newClassName; + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + } }); \ No newline at end of file diff --git a/user_guide/nav/user_guide_menu.js b/user_guide/nav/user_guide_menu.js index f24f5d4e..ce5d0776 100644 --- a/user_guide/nav/user_guide_menu.js +++ b/user_guide/nav/user_guide_menu.js @@ -1,4 +1,4 @@ -window.onload = function() { - myHeight = new fx.Height('nav', {duration: 400}); - myHeight.hide(); +window.onload = function() { + myHeight = new fx.Height('nav', {duration: 400}); + myHeight.hide(); } \ No newline at end of file diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 8850b63e..cdc6ac20 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -1,95 +1,95 @@ - - - - - -Application Flow Chart : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Application Flow Chart

    - -

    The following graphic illustrates how data flows throughout the system:

    - -
    CodeIgniter application flow
    - - -
      -
    1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
    2. -
    3. The Router examines the HTTP request to determine what should be done with it.
    4. -
    5. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
    6. -
    7. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
    8. -
    9. The Controller loads the model, core libraries, plugins, helpers, and any other resources needed to process the specific request.
    10. -
    11. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so -that on subsequent requests it can be served.
    12. -
    - - - - -
    - - - - - - + + + + + +Application Flow Chart : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Application Flow Chart

    + +

    The following graphic illustrates how data flows throughout the system:

    + +
    CodeIgniter application flow
    + + +
      +
    1. The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
    2. +
    3. The Router examines the HTTP request to determine what should be done with it.
    4. +
    5. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
    6. +
    7. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
    8. +
    9. The Controller loads the model, core libraries, plugins, helpers, and any other resources needed to process the specific request.
    10. +
    11. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so +that on subsequent requests it can be served.
    12. +
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 5688f907..a9a45833 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -1,172 +1,172 @@ - - - - - -CodeIgniter at a Glance : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    CodeIgniter at a Glance

    - - -

    CodeIgniter is an Application Framework

    - -

    CodeIgniter is a toolkit for people who build web application 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.

    - -

    CodeIgniter is Free

    -

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. -For more information please read the license agreement.

    - - -

    CodeIgniter Runs on PHP 4

    -

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling -in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), -at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our -potential audience. Major OS vendors like RedHat are moving slowly to support PHP 5, and they are unlikely to do so in the short term, so -we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    - -

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    - -

    CodeIgniter is Light Weight

    -

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. -Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system -is very lean and quite fast. -

    - -

    CodeIgniter is Fast

    -

    Really fast. We challenge you to find a framework that has better performance than CodeIgniter.

    - - -

    CodeIgniter Uses M-V-C

    -

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. -This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    - -

    CodeIgniter Generates Clean URLs

    -

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" -approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    - -example.com/news/article/345 - -

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    - -

    CodeIgniter Packs a Punch

    -

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, -like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and -much more.

    - -

    CodeIgniter is Extensible

    -

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    - - -

    CodeIgniter Does Not Require a Template Engine

    -

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. - -Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template -engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    - -<ul>
    -
    -<?php foreach ($addressbook as $name):?>
    -
    -<li><?=$name?></li>
    -
    -<?php endforeach; ?>
    -
    -</ul>
    - -

    Contrast this with the pseudo-code used by a template engine:

    - -<ul>
    -
    -{foreach from=$addressbook item="name"}
    -
    -<li>{$name}</li>
    -
    -{/foreach}
    -
    -</ul>
    - -

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted -back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    - - -

    CodeIgniter is Thoroughly Documented

    -

    Programmers love to code and hate to write documentation. We're no different, of course, but -since documentation is as important as the code itself, -we are committed to doing it. Our source code is extremely clean and well commented as well.

    - - -

    CodeIgniter has a Friendly Community of Users

    - -

    Our growing community of users can be seen actively participating in our Community Forums.

    - - -
    - - - - - - + + + + + +CodeIgniter at a Glance : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    CodeIgniter at a Glance

    + + +

    CodeIgniter is an Application Framework

    + +

    CodeIgniter is a toolkit for people who build web application 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.

    + +

    CodeIgniter is Free

    +

    CodeIgniter is licensed under an Apache/BSD-style open source license so you can use it however you please. +For more information please read the license agreement.

    + + +

    CodeIgniter Runs on PHP 4

    +

    CodeIgniter is written to be compatible with PHP 4. Although we would have loved to take advantage of the better object handling +in PHP 5 since it would have simplified some things we had to find creative solutions for (looking your way, multiple inheritance), +at the time of this writing PHP 5 is not in widespread use, which means we would be alienating most of our +potential audience. Major OS vendors like RedHat are moving slowly to support PHP 5, and they are unlikely to do so in the short term, so +we felt that it did not serve the best interests of the PHP community to write CodeIgniter in PHP 5.

    + +

    Note: CodeIgniter will run on PHP 5. It simply does not take advantage of any native features that are only available in that version.

    + +

    CodeIgniter is Light Weight

    +

    Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system +is very lean and quite fast. +

    + +

    CodeIgniter is Fast

    +

    Really fast. We challenge you to find a framework that has better performance than CodeIgniter.

    + + +

    CodeIgniter Uses M-V-C

    +

    CodeIgniter uses the Model-View-Controller approach, which allows great separation between logic and presentation. +This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

    + +

    CodeIgniter Generates Clean URLs

    +

    The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" +approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

    + +example.com/news/article/345 + +

    Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

    + +

    CodeIgniter Packs a Punch

    +

    CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, +like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and +much more.

    + +

    CodeIgniter is Extensible

    +

    The system can be easily extended through the use of plugins and helper libraries, or through class extensions or system hooks.

    + + +

    CodeIgniter Does Not Require a Template Engine

    +

    Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. + +Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

    + +<ul>
    +
    +<?php foreach ($addressbook as $name):?>
    +
    +<li><?=$name?></li>
    +
    +<?php endforeach; ?>
    +
    +</ul>
    + +

    Contrast this with the pseudo-code used by a template engine:

    + +<ul>
    +
    +{foreach from=$addressbook item="name"}
    +
    +<li>{$name}</li>
    +
    +{/foreach}
    +
    +</ul>
    + +

    Yes, the template engine example is a bit cleaner, but it comes at the price of performance, as the pseudo-code must be converted +back into PHP to run. Since one of our goals is maximum performance, we opted to not require the use of a template engine.

    + + +

    CodeIgniter is Thoroughly Documented

    +

    Programmers love to code and hate to write documentation. We're no different, of course, but +since documentation is as important as the code itself, +we are committed to doing it. Our source code is extremely clean and well commented as well.

    + + +

    CodeIgniter has a Friendly Community of Users

    + +

    Our growing community of users can be seen actively participating in our Community Forums.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 31f0c305..9710ca90 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -1,120 +1,120 @@ - - - - - -CodeIgniter Features : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    CodeIgniter Features

    - -

    Features in and of themselves are a very poor way to judge an application since they tell you nothing -about the user experience, or how intuitively or intelligently it is designed. Features -don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. -The only way to really judge an app is to try it and get to know the code. Installing -CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

    - -
      -
    • Model-View-Controller Based System
    • -
    • PHP 4 Compatible
    • -
    • Extremely Light Weight
    • -
    • Full Featured database classes with support for several platforms.
    • -
    • Active Record Database Support
    • -
    • Form and Data Validation
    • -
    • Security and XSS Filtering
    • -
    • Session Management
    • -
    • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
    • -
    • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
    • -
    • File Uploading Class
    • -
    • FTP Class
    • -
    • Localization
    • -
    • Pagination
    • -
    • Data Encryption
    • -
    • Benchmarking
    • -
    • Full Page Caching
    • -
    • Error Logging
    • -
    • Application Profiling
    • -
    • Scaffolding
    • -
    • Calendaring Class
    • -
    • User Agent Class
    • -
    • Zip Encoding Class
    • -
    • Template Engine Class
    • -
    • Trackback Class
    • -
    • XML-RPC Library
    • -
    • Unit Testing Class
    • -
    • Search-engine Friendly URLs
    • -
    • Flexible URI Routing
    • -
    • Support for Hooks, Class Extensions, and Plugins
    • -
    • Large library of "helper" functions
    • -
    - - - - -
    - - - - - - + + + + + +CodeIgniter Features : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    CodeIgniter Features

    + +

    Features in and of themselves are a very poor way to judge an application since they tell you nothing +about the user experience, or how intuitively or intelligently it is designed. Features +don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. +The only way to really judge an app is to try it and get to know the code. Installing +CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

    + +
      +
    • Model-View-Controller Based System
    • +
    • PHP 4 Compatible
    • +
    • Extremely Light Weight
    • +
    • Full Featured database classes with support for several platforms.
    • +
    • Active Record Database Support
    • +
    • Form and Data Validation
    • +
    • Security and XSS Filtering
    • +
    • Session Management
    • +
    • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
    • +
    • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
    • +
    • File Uploading Class
    • +
    • FTP Class
    • +
    • Localization
    • +
    • Pagination
    • +
    • Data Encryption
    • +
    • Benchmarking
    • +
    • Full Page Caching
    • +
    • Error Logging
    • +
    • Application Profiling
    • +
    • Scaffolding
    • +
    • Calendaring Class
    • +
    • User Agent Class
    • +
    • Zip Encoding Class
    • +
    • Template Engine Class
    • +
    • Trackback Class
    • +
    • XML-RPC Library
    • +
    • Unit Testing Class
    • +
    • Search-engine Friendly URLs
    • +
    • Flexible URI Routing
    • +
    • Support for Hooks, Class Extensions, and Plugins
    • +
    • Large library of "helper" functions
    • +
    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 2061467b..7439bea5 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -1,92 +1,92 @@ - - - - - -Getting Started With CodeIgniter : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    Getting Started With CodeIgniter

    - -

    Any software application requires some effort to learn. We've done our best to minimize the learning -curve while making the process as enjoyable as possible. -

    - -

    The first step is to install CodeIgniter, then read -all the topics in the Introduction section of the Table of Contents.

    - -

    Next, read each of the General Topics pages in order. -Each topic builds on the previous one, and includes code examples that you are encouraged to try.

    - -

    Once you understand the basics you'll be ready to explore the Class Reference and -Helper Reference pages to learn to utilize the native libraries and helper files.

    - -

    Feel free to take advantage of our Community Forums -if you have questions or problems, and -our Wiki to see code examples posted by other users.

    - - -
    - - - - - - + + + + + +Getting Started With CodeIgniter : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Getting Started With CodeIgniter

    + +

    Any software application requires some effort to learn. We've done our best to minimize the learning +curve while making the process as enjoyable as possible. +

    + +

    The first step is to install CodeIgniter, then read +all the topics in the Introduction section of the Table of Contents.

    + +

    Next, read each of the General Topics pages in order. +Each topic builds on the previous one, and includes code examples that you are encouraged to try.

    + +

    Once you understand the basics you'll be ready to explore the Class Reference and +Helper Reference pages to learn to utilize the native libraries and helper files.

    + +

    Feel free to take advantage of our Community Forums +if you have questions or problems, and +our Wiki to see code examples posted by other users.

    + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 67c6cdc6..ded76204 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -1,98 +1,98 @@ - - - - - -Design and Architectural Goals : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - - -

    Design and Architectural Goals

    - -

    Our goal for CodeIgniter is maximum performance, capability, and flexibility in the smallest, lightest possible package.

    - -

    To meet this goal we are committed to benchmarking, re-factoring, and simplifying at every step of the development process, -rejecting anything that doesn't further the stated objective.

    - -

    From a technical and architectural standpoint, CodeIgniter was created with the following objectives:

    - -
      -
    • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
    • -
    • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
    • -
    • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
    • -
    - -

    CodeIgniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

    - - - - - - -
    - - - - - - + + + + + +Design and Architectural Goals : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + + +

    Design and Architectural Goals

    + +

    Our goal for CodeIgniter is maximum performance, capability, and flexibility in the smallest, lightest possible package.

    + +

    To meet this goal we are committed to benchmarking, re-factoring, and simplifying at every step of the development process, +rejecting anything that doesn't further the stated objective.

    + +

    From a technical and architectural standpoint, CodeIgniter was created with the following objectives:

    + +
      +
    • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
    • +
    • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
    • +
    • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
    • +
    + +

    CodeIgniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

    + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 9bb1e6b7..bf977a25 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -1,84 +1,84 @@ - - - - - -CodeIgniter Overview : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    CodeIgniter Overview

    - -

    The following pages describe the broad concepts behind CodeIgniter:

    - - - - - - -
    - - - - - - + + + + + +CodeIgniter Overview : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    CodeIgniter Overview

    + +

    The following pages describe the broad concepts behind CodeIgniter:

    + + + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 9a6267f9..964ca588 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -1,100 +1,100 @@ - - - - - -Model-View-Controller : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    Model-View-Controller

    - -

    CodeIgniter is based on the Model-View-Controller development pattern. - -MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

    - -
      -
    • The Model represents your data structures. Typically your model classes will contain functions that help you -retrieve, insert, and update information in your database.
    • -
    • The View is the information that is being presented to a user. A View will normally be a web page, but -in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
    • -
    • The Controller serves as an intermediary between the Model, the View, -and any other resources needed to process the HTTP request and generate a web page.
    • - -
    - -

    CodeIgniter has a fairly loose approach to MVC since Models are not required. -If you don't need the added separation, or find that maintaining models requires more complexity than you -want, you can ignore them and build your application minimally using Controllers and Views. CodeIgniter also -enables you to incorporate your own existing scripts, or even develop core libraries for the system, - enabling you to work in a way that makes the most sense to you.

    - - - - -
    - - - - - - + + + + + +Model-View-Controller : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + +
    + + +
    + + + +
    + + +

    Model-View-Controller

    + +

    CodeIgniter is based on the Model-View-Controller development pattern. + +MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

    + +
      +
    • The Model represents your data structures. Typically your model classes will contain functions that help you +retrieve, insert, and update information in your database.
    • +
    • The View is the information that is being presented to a user. A View will normally be a web page, but +in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
    • +
    • The Controller serves as an intermediary between the Model, the View, +and any other resources needed to process the HTTP request and generate a web page.
    • + +
    + +

    CodeIgniter has a fairly loose approach to MVC since Models are not required. +If you don't need the added separation, or find that maintaining models requires more complexity than you +want, you can ignore them and build your application minimally using Controllers and Views. CodeIgniter also +enables you to incorporate your own existing scripts, or even develop core libraries for the system, + enabling you to work in a way that makes the most sense to you.

    + + + + +
    + + + + + + \ No newline at end of file diff --git a/user_guide/toc.html b/user_guide/toc.html index a87139b9..b9898b5c 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -1,207 +1,207 @@ - - - - - -Table of Contents : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -

    CodeIgniter User Guide Version 1.7

    -
    - - - - - - - - - - -
    - - -
    - - -
    - - -

    Table of Contents

    - - - - - - - - -
    - -

    Basic Info

    - - -

    Installation

    - - -

    Introduction

    - - - -
    - -

    General Topics

    - - -
    - - -

    Class Reference

    - - - -
    - -

    Helper Reference

    - - -

    Additional Resources

    - - - - -
    - -
    - - - - - - - + + + + + +Table of Contents : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +

    CodeIgniter User Guide Version 1.7

    +
    + + + + + + + + + + +
    + + +
    + + +
    + + +

    Table of Contents

    + + + + + + + + +
    + +

    Basic Info

    + + +

    Installation

    + + +

    Introduction

    + + + +
    + +

    General Topics

    + + +
    + + +

    Class Reference

    + + + +
    + +

    Helper Reference

    + + +

    Additional Resources

    + + + + +
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/userguide.css b/user_guide/userguide.css index 45663882..0f850009 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -1,406 +1,406 @@ -body { - margin: 0; - padding: 0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 14px; - color: #333; - background-color: #fff; -} - -a { - color: #0134c5; - background-color: transparent; - text-decoration: none; - font-weight: normal; -} -a:visited { - color: #0134c5; - background-color: transparent; - text-decoration: none; -} -a:hover { - color: #000; - text-decoration: none; - background-color: transparent; -} - -#breadcrumb { - float: left; - background-color: transparent; - margin: 10px 0 0 42px; - padding: 0; - font-size: 10px; - color: #666; -} -#breadcrumb_right { - float: right; - width: 175px; - background-color: transparent; - padding: 8px 8px 3px 0; - text-align: right; - font-size: 10px; - color: #666; -} -#nav { - background-color: #494949; - margin: 0; - padding: 0; -} -#nav2 { - background: #fff url(images/nav_bg_darker.jpg) repeat-x left top; - padding: 0 310px 0 0; - margin: 0; - text-align: right; -} -#nav_inner { - background-color: transparent; - padding: 8px 12px 0 20px; - margin: 0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; -} - -#nav_inner h3 { - font-size: 12px; - color: #fff; - margin: 0; - padding: 0; -} - -#nav_inner .td_sep { - background: transparent url(images/nav_separator_darker.jpg) repeat-y left top; - width: 25%; - padding: 0 0 0 20px; -} -#nav_inner .td { - width: 25%; -} -#nav_inner p { - color: #eee; - background-color: transparent; - padding:0; - margin: 0 0 10px 0; -} -#nav_inner ul { - list-style-image: url(images/arrow.gif); - padding: 0 0 0 18px; - margin: 8px 0 12px 0; -} -#nav_inner li { - padding: 0; - margin: 0 0 4px 0; -} - -#nav_inner a { - color: #eee; - background-color: transparent; - text-decoration: none; - font-weight: normal; -} - -#nav_inner a:visited { - color: #eee; - background-color: transparent; - text-decoration: none; -} - -#nav_inner a:hover { - color: #ccc; - text-decoration: none; - background-color: transparent; -} - -#masthead { - margin: 0 40px 0 35px; - padding: 0 0 0 6px; - border-bottom: 1px solid #999; -} - -#masthead h1 { -background-color: transparent; -color: #e13300; -font-size: 18px; -font-weight: normal; -margin: 0; -padding: 0 0 6px 0; -} - -#searchbox { - background-color: transparent; - padding: 6px 40px 0 0; - text-align: right; - font-size: 10px; - color: #666; -} - -#img_welcome { - border-bottom: 1px solid #D0D0D0; - margin: 0 40px 0 40px; - padding: 0; - text-align: center; -} - -#content { - margin: 20px 40px 0 40px; - padding: 0; -} - -#content p { - margin: 12px 20px 12px 0; -} - -#content h1 { -color: #e13300; -border-bottom: 1px solid #666; -background-color: transparent; -font-weight: normal; -font-size: 24px; -margin: 0 0 20px 0; -padding: 3px 0 7px 3px; -} - -#content h2 { - background-color: transparent; - border-bottom: 1px solid #999; - color: #000; - font-size: 18px; - font-weight: bold; - margin: 28px 0 16px 0; - padding: 5px 0 6px 0; -} - -#content h3 { - background-color: transparent; - color: #333; - font-size: 16px; - font-weight: bold; - margin: 16px 0 15px 0; - padding: 0 0 0 0; -} - -#content h4 { - background-color: transparent; - color: #444; - font-size: 14px; - font-weight: bold; - margin: 22px 0 0 0; - padding: 0 0 0 0; -} - -#content img { - margin: auto; - padding: 0; -} - -#content code { - font-family: Monaco, Verdana, Sans-serif; - font-size: 12px; - background-color: #f9f9f9; - border: 1px solid #D0D0D0; - color: #002166; - display: block; - margin: 14px 0 14px 0; - padding: 12px 10px 12px 10px; -} - -#content pre { - font-family: Monaco, Verdana, Sans-serif; - font-size: 12px; - background-color: #f9f9f9; - border: 1px solid #D0D0D0; - color: #002166; - display: block; - margin: 14px 0 14px 0; - padding: 12px 10px 12px 10px; -} - -#content .path { - background-color: #EBF3EC; - border: 1px solid #99BC99; - color: #005702; - text-align: center; - margin: 0 0 14px 0; - padding: 5px 10px 5px 8px; -} - -#content dfn { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - color: #00620C; - font-weight: bold; - font-style: normal; -} -#content var { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - color: #8F5B00; - font-weight: bold; - font-style: normal; -} -#content samp { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - color: #480091; - font-weight: bold; - font-style: normal; -} -#content kbd { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - color: #A70000; - font-weight: bold; - font-style: normal; -} - -#content ul { - list-style-image: url(images/arrow.gif); - margin: 10px 0 12px 0; -} - -#content li { - margin-bottom: 9px; -} - -#content li p { - margin-left: 0; - margin-right: 0; -} - -#content .tableborder { - border: 1px solid #999; -} -#content th { - font-weight: bold; - text-align: left; - font-size: 12px; - background-color: #666; - color: #fff; - padding: 4px; -} - -#content .td { - font-weight: normal; - font-size: 12px; - padding: 6px; - background-color: #f3f3f3; -} - -#content .tdpackage { - font-weight: normal; - font-size: 12px; -} - -#content .important { - background: #FBE6F2; - border: 1px solid #D893A1; - color: #333; - margin: 10px 0 5px 0; - padding: 10px; -} - -#content .important p { - margin: 6px 0 8px 0; - padding: 0; -} - -#content .important .leftpad { - margin: 6px 0 8px 0; - padding-left: 20px; -} - -#content .critical { - background: #FBE6F2; - border: 1px solid #E68F8F; - color: #333; - margin: 10px 0 5px 0; - padding: 10px; -} - -#content .critical p { - margin: 5px 0 6px 0; - padding: 0; -} - - -#footer { -background-color: transparent; -font-size: 10px; -padding: 16px 0 15px 0; -margin: 20px 0 0 0; -text-align: center; -} - -#footer p { - font-size: 10px; - color: #999; - text-align: center; -} -#footer address { - font-style: normal; -} - -.center { - text-align: center; -} - -img { - padding:0; - border: 0; - margin: 0; -} - -.nopad { - padding:0; - border: 0; - margin: 0; -} - - -form { - margin: 0; - padding: 0; -} - -.input { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - color: #333; - border: 1px solid #B3B4BD; - width: 100%; - font-size: 11px; - height: 1.5em; - padding: 0; - margin: 0; -} - -.textarea { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 14px; - color: #143270; - background-color: #f9f9f9; - border: 1px solid #B3B4BD; - width: 100%; - padding: 6px; - margin: 0; -} - -.select { - background-color: #fff; - font-size: 11px; - font-weight: normal; - color: #333; - padding: 0; - margin: 0 0 3px 0; -} - -.checkbox { - background-color: transparent; - padding: 0; - border: 0; -} - -.submit { - background-color: #000; - color: #fff; - font-weight: normal; - font-size: 10px; - border: 1px solid #fff; - margin: 0; - padding: 1px 5px 2px 5px; +body { + margin: 0; + padding: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 14px; + color: #333; + background-color: #fff; +} + +a { + color: #0134c5; + background-color: transparent; + text-decoration: none; + font-weight: normal; +} +a:visited { + color: #0134c5; + background-color: transparent; + text-decoration: none; +} +a:hover { + color: #000; + text-decoration: none; + background-color: transparent; +} + +#breadcrumb { + float: left; + background-color: transparent; + margin: 10px 0 0 42px; + padding: 0; + font-size: 10px; + color: #666; +} +#breadcrumb_right { + float: right; + width: 175px; + background-color: transparent; + padding: 8px 8px 3px 0; + text-align: right; + font-size: 10px; + color: #666; +} +#nav { + background-color: #494949; + margin: 0; + padding: 0; +} +#nav2 { + background: #fff url(images/nav_bg_darker.jpg) repeat-x left top; + padding: 0 310px 0 0; + margin: 0; + text-align: right; +} +#nav_inner { + background-color: transparent; + padding: 8px 12px 0 20px; + margin: 0; + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; +} + +#nav_inner h3 { + font-size: 12px; + color: #fff; + margin: 0; + padding: 0; +} + +#nav_inner .td_sep { + background: transparent url(images/nav_separator_darker.jpg) repeat-y left top; + width: 25%; + padding: 0 0 0 20px; +} +#nav_inner .td { + width: 25%; +} +#nav_inner p { + color: #eee; + background-color: transparent; + padding:0; + margin: 0 0 10px 0; +} +#nav_inner ul { + list-style-image: url(images/arrow.gif); + padding: 0 0 0 18px; + margin: 8px 0 12px 0; +} +#nav_inner li { + padding: 0; + margin: 0 0 4px 0; +} + +#nav_inner a { + color: #eee; + background-color: transparent; + text-decoration: none; + font-weight: normal; +} + +#nav_inner a:visited { + color: #eee; + background-color: transparent; + text-decoration: none; +} + +#nav_inner a:hover { + color: #ccc; + text-decoration: none; + background-color: transparent; +} + +#masthead { + margin: 0 40px 0 35px; + padding: 0 0 0 6px; + border-bottom: 1px solid #999; +} + +#masthead h1 { +background-color: transparent; +color: #e13300; +font-size: 18px; +font-weight: normal; +margin: 0; +padding: 0 0 6px 0; +} + +#searchbox { + background-color: transparent; + padding: 6px 40px 0 0; + text-align: right; + font-size: 10px; + color: #666; +} + +#img_welcome { + border-bottom: 1px solid #D0D0D0; + margin: 0 40px 0 40px; + padding: 0; + text-align: center; +} + +#content { + margin: 20px 40px 0 40px; + padding: 0; +} + +#content p { + margin: 12px 20px 12px 0; +} + +#content h1 { +color: #e13300; +border-bottom: 1px solid #666; +background-color: transparent; +font-weight: normal; +font-size: 24px; +margin: 0 0 20px 0; +padding: 3px 0 7px 3px; +} + +#content h2 { + background-color: transparent; + border-bottom: 1px solid #999; + color: #000; + font-size: 18px; + font-weight: bold; + margin: 28px 0 16px 0; + padding: 5px 0 6px 0; +} + +#content h3 { + background-color: transparent; + color: #333; + font-size: 16px; + font-weight: bold; + margin: 16px 0 15px 0; + padding: 0 0 0 0; +} + +#content h4 { + background-color: transparent; + color: #444; + font-size: 14px; + font-weight: bold; + margin: 22px 0 0 0; + padding: 0 0 0 0; +} + +#content img { + margin: auto; + padding: 0; +} + +#content code { + font-family: Monaco, Verdana, Sans-serif; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#content pre { + font-family: Monaco, Verdana, Sans-serif; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; +} + +#content .path { + background-color: #EBF3EC; + border: 1px solid #99BC99; + color: #005702; + text-align: center; + margin: 0 0 14px 0; + padding: 5px 10px 5px 8px; +} + +#content dfn { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #00620C; + font-weight: bold; + font-style: normal; +} +#content var { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #8F5B00; + font-weight: bold; + font-style: normal; +} +#content samp { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #480091; + font-weight: bold; + font-style: normal; +} +#content kbd { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + color: #A70000; + font-weight: bold; + font-style: normal; +} + +#content ul { + list-style-image: url(images/arrow.gif); + margin: 10px 0 12px 0; +} + +#content li { + margin-bottom: 9px; +} + +#content li p { + margin-left: 0; + margin-right: 0; +} + +#content .tableborder { + border: 1px solid #999; +} +#content th { + font-weight: bold; + text-align: left; + font-size: 12px; + background-color: #666; + color: #fff; + padding: 4px; +} + +#content .td { + font-weight: normal; + font-size: 12px; + padding: 6px; + background-color: #f3f3f3; +} + +#content .tdpackage { + font-weight: normal; + font-size: 12px; +} + +#content .important { + background: #FBE6F2; + border: 1px solid #D893A1; + color: #333; + margin: 10px 0 5px 0; + padding: 10px; +} + +#content .important p { + margin: 6px 0 8px 0; + padding: 0; +} + +#content .important .leftpad { + margin: 6px 0 8px 0; + padding-left: 20px; +} + +#content .critical { + background: #FBE6F2; + border: 1px solid #E68F8F; + color: #333; + margin: 10px 0 5px 0; + padding: 10px; +} + +#content .critical p { + margin: 5px 0 6px 0; + padding: 0; +} + + +#footer { +background-color: transparent; +font-size: 10px; +padding: 16px 0 15px 0; +margin: 20px 0 0 0; +text-align: center; +} + +#footer p { + font-size: 10px; + color: #999; + text-align: center; +} +#footer address { + font-style: normal; +} + +.center { + text-align: center; +} + +img { + padding:0; + border: 0; + margin: 0; +} + +.nopad { + padding:0; + border: 0; + margin: 0; +} + + +form { + margin: 0; + padding: 0; +} + +.input { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 11px; + color: #333; + border: 1px solid #B3B4BD; + width: 100%; + font-size: 11px; + height: 1.5em; + padding: 0; + margin: 0; +} + +.textarea { + font-family: Lucida Grande, Verdana, Geneva, Sans-serif; + font-size: 14px; + color: #143270; + background-color: #f9f9f9; + border: 1px solid #B3B4BD; + width: 100%; + padding: 6px; + margin: 0; +} + +.select { + background-color: #fff; + font-size: 11px; + font-weight: normal; + color: #333; + padding: 0; + margin: 0 0 3px 0; +} + +.checkbox { + background-color: transparent; + padding: 0; + border: 0; +} + +.submit { + background-color: #000; + color: #fff; + font-weight: normal; + font-size: 10px; + border: 1px solid #fff; + margin: 0; + padding: 1px 5px 2px 5px; } \ No newline at end of file From 9babd66d3f0a115ce2113ca9ed6f4ab10af090e9 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 14 Nov 2008 02:09:00 +0000 Subject: [PATCH 1558/2544] added file format guidelines --- user_guide/general/styleguide.html | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 43385d06..feccbd7b 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -69,6 +69,7 @@

    General Style and Syntax

    Table of Contents

    +
  • + +

    File Format

    +
    +

    Files should be saved with Unicode (UTF-8) encoding. The BOM + should not be used. Unlike UTF-16 and UTF-32, there's no byte order to indicate in + a UTF-8 encoded file, and the BOM can have a negative side effect in PHP of sending output, + preventing the application from being able to set its own headers. Unix line endings should + be used (LF).

    + +

    Here is how to apply these settings in some of the more common text editors. Instructions for your + text editor may vary; check your text editor's documentation.

    + +
    TextMate
    + +
      +
    1. Open the Application Preferences
    2. +
    3. Click Advanced, and then the "Saving" tab
    4. +
    5. In "File Encoding", select "UTF-8 (recommended)"
    6. +
    7. In "Line Endings", select "LF (recommended)"
    8. +
    9. Optional: Check "Use for existing files as well" if you wish to modify the line + endings of files you open to your new preference.
    10. +
    + +
    BBEdit
    + +
      +
    1. Open the Application Preferences
    2. +
    3. Select "Text Encodings" on the left.
    4. +
    5. In "Default text encoding for new documents", select "Unicode (UTF-8, no BOM)"
    6. +
    7. Optional: In "If file's encoding can't be guessed, use", select + "Unicode (UTF-8, no BOM)"
    8. +
    9. Select "Text Files" on the left.
    10. +
    11. In "Default line breaks", select "Mac OS X and Unix (LF)"
    12. +
    +
    +

    PHP Closing Tag

    The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced From d5738d9fcafa831be8a1e709e42fdafb70d4330f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 14 Nov 2008 16:53:34 +0000 Subject: [PATCH 1559/2544] added some block level tag tracking so we can add inner block level elements when required --- system/libraries/Typography.php | 82 ++++++++++----------------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 29b871e2..0502eef1 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -34,7 +34,13 @@ class CI_Typography { // Tags we want the parser to completely ignore when splitting the string. var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; - + + // array of block level elements that require inner content to be within another block level element + var $inner_block_required = array('blockquote'); + + // the last block element parsed + var $last_block_element = ''; + // whether or not to protect quotes within { curly braces } var $protect_braced_quotes = FALSE; @@ -80,7 +86,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE) if ($reduce_linebreaks === TRUE) { $str = preg_replace("/\n\n+/", "\n\n", $str); - } + } // Convert quotes within tags to temporary markers. We don't want quotes converted // within tags so we'll temporarily convert them to {@DQ} and {@SQ} @@ -133,37 +139,30 @@ function auto_typography($str, $reduce_linebreaks = FALSE) { // Are we dealing with a tag? If so, we'll skip the processing for this cycle. // Well also set the "process" flag which allows us to skip

     tags and a few other things.
    -			if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunk, $match))
    +			if (preg_match("#<(/*)(".$this->block_elements.").*?\>#", $chunk, $match))
     			{
     				if (preg_match("#".$this->skip_elements."#", $match[2]))
     				{
     					$process =  ($match[1] == '/') ? TRUE : FALSE;
     				}
     				
    -				$str .= $chunk;
    -				continue;
    -			}
    -			elseif (preg_match('/<(\/?)([a-z]*).*?>/s', $chunk, $tagmatch))
    -			{
    -				if ($tagmatch[1] == '/' && $tagmatch[2] == $this->last_tag)
    +				if ($match[1] == '')
     				{
    -					$process = FALSE;
    +					$this->last_block_element = $match[2];
     				}
    -				else
    -				{
    -					$process = TRUE;
    -					$this->last_tag = $tagmatch[2];					
    -				}
    -			}
     
    +				$str .= $chunk;
    +				continue;
    +			}
    +			
     			if ($process == FALSE)
     			{
     				$str .= $chunk;
     				continue;
     			}
    -			
    +
     			//  Convert Newlines into 

    and
    tags - $str .= $this->format_characters($this->_format_newlines($chunk)); + $str .= $this->_format_newlines($chunk); } // is the whole of the content inside a block level element? @@ -171,20 +170,16 @@ function auto_typography($str, $reduce_linebreaks = FALSE) { $str = "

    {$str}

    "; } - - - // some special linebreak cleanup - $str = preg_replace_callback('#<(?!/|'.$this->block_elements.')([^>]*)>

    (.*?)

    <(\w*)#si', array($this, '_linebreak_cleanup'), $str); - - // and cleanup empty paragraph tags sitting between two closing tags - $str = preg_replace('#()

    (\s*)

    ()#si', '$1$2$3', $str); + // Convert quotes, elipsis, and em-dashes + $str = $this->format_characters($str); + // Final clean up $table = array( // If the user submitted their own paragraph tags within the text // we will retain them instead of using our tags. - '/(*?]>)

    /' => '$1', // *?]>)

    /' => '$1', // )+#' => '

    ', @@ -192,13 +187,10 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // Clean up stray paragraph tags that appear before block level elements '#

    <('.$this->block_elements.')#' => '<$1', - - // Clean up open paragraph tags that appear before block level elements - '#

    (\W)<('.$this->block_elements.')#' => '

    $1<$2', // Clean up stray non-breaking spaces preceeding block elements '#[  ]+<('.$this->block_elements.')#' => ' <$1', - + // Replace the temporary markers we added earlier '/\{@TAG\}/' => '<', '/\{@DQ\}/' => '"', @@ -207,7 +199,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE) '/\{@NBS\}/' => ' ' ); - + // Do we need to reduce empty lines? if ($reduce_linebreaks === TRUE) { @@ -226,30 +218,6 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // -------------------------------------------------------------------- - /** - * Linebreak Cleanup - * - * Removes paragraph and line break tags inserted inbetween - * inline content and a new opening block level element - * - * @access private - * @param array - * @return string - */ - function _linebreak_cleanup($match) - { - if (in_array($match[3], explode('|', $this->block_elements))) - { - return "<{$match[1]}>".str_replace('
    ', '', $match[2])."<{$match[3]}"; - } - else - { - return $match[0]; - } - } - - // -------------------------------------------------------------------- - /** * Format Characters * @@ -320,8 +288,8 @@ function _format_newlines($str) { return $str; } - - if (strpos($str, "\n") === FALSE) + + if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)) { return $str; } From 89cd0a752fd6f165f06a345bb04ce45529c618fc Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 14 Nov 2008 17:12:14 +0000 Subject: [PATCH 1560/2544] switched order of parsing opening and closing curly quotes for greater accuracy --- system/libraries/Typography.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 0502eef1..808a7695 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -246,13 +246,13 @@ function format_characters($str) '/"\'(\s|\W|$)/' => '”’$1', // single quote smart quotes - '/\'(\s|\W|$)/' => '’$1', '/(^|\W|\s)\'/' => '$1‘', + '/\'(\s|\W|$)/' => '’$1', // double quote smart quotes - '/"(\s|\W|$)/' => '”$1', '/(^|\W|\s)"/' => '$1“', - + '/"(\s|\W|$)/' => '”$1', + // apostrophes "/(\w)'(\w)/" => '$1’$2', From 7b49203821a1e36ef566e0e08e4f658b8232f10c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 15 Nov 2008 22:26:13 +0000 Subject: [PATCH 1561/2544] fix broken link to getting started page --- user_guide/installation/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 01d4db7c..d64c13ee 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -72,7 +72,7 @@

    Installation Instructions

    That's it!

    -

    If you're new to CodeIgniter, please read the Getting Started section of the User Guide to begin learning how +

    If you're new to CodeIgniter, please read the Getting Started section of the User Guide to begin learning how to build dynamic PHP applications. Enjoy!

    From c630bcfca816f625b8cd70a1a7467a77c8065bbd Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 17 Nov 2008 21:09:45 +0000 Subject: [PATCH 1562/2544] added sendmail debugging and fixed a bug with single to double quoted string syntax in from() --- system/libraries/Email.php | 18 ++++++++++++------ user_guide/changelog.html | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 94f517c4..89d0976a 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -189,7 +189,7 @@ function from($from, $name = '') if ( ! preg_match('/[\200-\377]/', $name)) { // add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes - $name = '"'.addcslashes($name, '\0..\37\177"\\').'"'; + $name = '"'.addcslashes($name, "\0..\37\177'\"\\").'"'; } else { @@ -1539,16 +1539,22 @@ function _send_with_sendmail() { $fp = @popen($this->mailpath . " -oi -f ".$this->clean_email($this->_headers['From'])." -t", 'w'); - if ( ! is_resource($fp)) + fputs($fp, $this->_header_str); + fputs($fp, $this->_finalbody); + + $status = pclose($fp); + + if (version_compare(PHP_VERSION, '4.2.3') == -1) + { + $status = $status >> 8 & 0xFF; + } + + if ($status == 0) { $this->_set_error_message('email_no_socket'); return FALSE; } - fputs($fp, $this->_header_str); - fputs($fp, $this->_finalbody); - pclose($fp) >> 8 & 0xFF; - return TRUE; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6f23617b..670e82c3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

    Version 1.7.1

  • Changed default current page indicator in the Pagination library to use <strong> instead of <b>
  • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
  • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
  • +
  • Added more accurate error reporting for the Email library when using sendmail.
  • Helpers From b859df894145b8a41609958917cf394fc46b8b10 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 18 Nov 2008 15:24:20 +0000 Subject: [PATCH 1563/2544] Smart curly quotes! Spaces trump all, then worry about \W, you can't convert them all at once or either your opening or your ending (whichever you process first) is going to be too greedy. --- system/libraries/Typography.php | 37 +++++++++++++++++++++------------ user_guide/changelog.html | 1 + 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 808a7695..27fa4219 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -235,26 +235,37 @@ function format_characters($str) if ( ! isset($table)) { - $table = array( + $table = array( // nested smart quotes, opening and closing // note that rules for grammar (English) allow only for two levels deep // and that single quotes are _supposed_ to always be on the outside // but we'll accommodate both - '/(^|\W|\s)\'"/' => '$1‘“', - '/\'"(\s|\W|$)/' => '’”$1', - '/(^|\W|\s)"\'/' => '$1“‘', - '/"\'(\s|\W|$)/' => '”’$1', + // Note that in all cases, whitespace is the primary determining factor + // on which direction to curl, with non-word characters like punctuation + // being a secondary factor only after whitespace is addressed. + '/\'"(\s|$)/' => '’”$1', + '/(^|\s)\'"/' => '$1‘“', + '/\'"(\W)/' => '’”$1', + '/(\W)\'"/' => '$1‘“', + '/"\'(\s|$)/' => '”’$1', + '/(^|\s)"\'/' => '$1“‘', + '/"\'(\W)/' => '”’$1', + '/(\W)"\'/' => '$1“‘', // single quote smart quotes - '/(^|\W|\s)\'/' => '$1‘', - '/\'(\s|\W|$)/' => '’$1', + '/\'(\s|$)/' => '’$1', + '/(^|\s)\'/' => '$1‘', + '/\'(\W)/' => '’$1', + '/(\W)\'/' => '$1‘', // double quote smart quotes - '/(^|\W|\s)"/' => '$1“', - '/"(\s|\W|$)/' => '”$1', - + '/"(\s|$)/' => '”$1', + '/(^|\s)"/' => '$1“', + '/"(\W)/' => '”$1', + '/(\W)"/' => '$1“', + // apostrophes - "/(\w)'(\w)/" => '$1’$2', + "/(\w)'(\w)/" => '$1’$2', // Em dash and ellipses dots '/\s?\-\-\s?/' => '—', @@ -265,8 +276,8 @@ function format_characters($str) // ampersands, if not a character entity '/&(?!#?[a-zA-Z0-9]{2,};)/' => '&' - ); - } + ); + } return preg_replace(array_keys($table), $table, $str); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 670e82c3..7aea9a6c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,6 +85,7 @@

    Bug fixes for 1.7.1

  • Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.
  • Fixed a bug where double dashes within tag attributes were being converted to em dash entities.
  • Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.
  • +
  • Fixed some accuracy issues with curly quotes in Typography::format_characters()
  • Changed a few docblock comments to reflect actual return values.
  • Fixed a bug with high ascii characters in subject and from email headers.
  • From 604873fe068c39c55afa1deaafaf34a95fd3359e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 18 Nov 2008 15:57:24 +0000 Subject: [PATCH 1564/2544] better error messages for sendmail failure --- system/language/english/email_lang.php | 1 + system/libraries/Email.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index 93242778..e3bd113c 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -17,6 +17,7 @@ $lang['email_smtp_auth_un'] = "Failed to authenticate username. Error: %s"; $lang['email_smtp_auth_pw'] = "Failed to authenticate password. Error: %s"; $lang['email_smtp_data_failure'] = "Unable to send data: %s"; +$lang['email_exit_status'] = "Exit status code: %s"; /* End of file email_lang.php */ diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 89d0976a..99a5ea38 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1549,8 +1549,9 @@ function _send_with_sendmail() $status = $status >> 8 & 0xFF; } - if ($status == 0) + if ($status != 0) { + $this->_set_error_message('email_exit_status', $status); $this->_set_error_message('email_no_socket'); return FALSE; } From ef22efd7c7b0a9006d43ef207450768722815453 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 20 Nov 2008 15:25:45 +0000 Subject: [PATCH 1565/2544] Added where_in to the list of expected arguments received by delete() --- system/database/DB_active_rec.php | 2 +- user_guide/changelog.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index e8cefa2d..b8dce6df 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1374,7 +1374,7 @@ function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) $this->limit($limit); } - if (count($this->ar_where) == 0 && count($this->ar_like) == 0) + if (count($this->ar_where) == 0 && count($this->ar_wherein) == 0 && count($this->ar_like)) { if ($this->db_debug) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7aea9a6c..a0c0fd06 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,7 +70,11 @@

    Version 1.7.1

  • Added more accurate error reporting for the Email library when using sendmail.
  • -
  • Helpers +
  • Database +
      +
    • Added where_in to the list of expected arguments received by delete().
    • +
    +
  • Helpers From d9c7f031cf525229238c1f8ab02a44436ee2c32e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 1 Dec 2008 20:18:00 +0000 Subject: [PATCH 1566/2544] Removed a strict type check from the rotate() function of the Image Manipulation Class. --- system/libraries/Image_lib.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 16201ee9..1b2d33de 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -397,7 +397,7 @@ function rotate() // Allowed rotation values $degs = array(90, 180, 270, 'vrt', 'hor'); - if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs, TRUE)) + if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs)) { $this->set_error('imglib_rotation_angle_required'); return FALSE; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a0c0fd06..2c2f63ba 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@

    Version 1.7.1

  • A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.
  • Added <big>, <small>, <q>, and <tt> to the Typography parser's inline elements.
  • Added more accurate error reporting for the Email library when using sendmail.
  • +
  • Removed a strict type check from the rotate() function of the Image Manipulation Class.
  • Database From 272d30a8ec4fc2a6ff42359cff859f9c030a6a1d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Dec 2008 15:25:19 +0000 Subject: [PATCH 1567/2544] spelling --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2c2f63ba..48b19708 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -185,7 +185,7 @@

    Bug fixes for 1.7.0

  • Fixed a Form Validation bug in which the "isset" error message was being trigged by the "required" rule.
  • Fixed a spelling error in a Loader error message.
  • Fixed a bug (5050) with IP validation with empty segments.
  • -
  • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were enountered.
  • +
  • Fixed a bug in which the parser was being greedy if multiple identical sets of tags were encountered.
  • Version 1.6.3

    From ab0e31f09a8cf3596e6547fc47fd085a0d2bcdd0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Dec 2008 22:03:47 +0000 Subject: [PATCH 1568/2544] fixed a bug where whitespace would be lost if a string was forced into a character entity e.g. &foo you know? would become &foo;you know? instead of &foo; you know? --- system/libraries/Input.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index f26df755..347aac3a 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -555,7 +555,7 @@ function xss_clean($str, $is_image = FALSE) * the conversion of entities to ASCII later. * */ - $str = preg_replace('#(&\#?[0-9a-z]{2,})[\x00-\x20]*;?#i', "\\1;", $str); + $str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str); /* * Validate UTF16 two byte encoding (x00) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 48b19708..19681755 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -93,6 +93,7 @@

    Bug fixes for 1.7.1

  • Fixed some accuracy issues with curly quotes in Typography::format_characters()
  • Changed a few docblock comments to reflect actual return values.
  • Fixed a bug with high ascii characters in subject and from email headers.
  • +
  • Fixed a bug in xss_clean() where whitespace following a validated character entity would not be preserved.
  • From 3f45bbdcfabac41fa3ee33277a21727f71de991a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 7 Dec 2008 17:00:09 +0000 Subject: [PATCH 1569/2544] fixed a broken link, fixed a typo --- user_guide/changelog.html | 1 + user_guide/database/connecting.html | 2 +- user_guide/libraries/loader.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 19681755..3dd056d0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -84,6 +84,7 @@

    Version 1.7.1

    Bug fixes for 1.7.1

      +
    • Fixed assorted user guide typos or examples.
    • Fixed a bug in the MySQLi driver when no port is specified
    • Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.
    • Fixed a bug in which identifers were not being escaped properly when reserved characters were used.
    • diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 90f90110..373c0567 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -89,7 +89,7 @@

      Available Parameters

      -

      Manuallly Connecting to a Database

      +

      Manually Connecting to a Database

      The first parameter of this function can optionally be used to specify a particular database group from your config file, or you can even submit connection values for a database that is not specified in your config file. diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 2680dfab..5bf938c0 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -153,7 +153,7 @@

      $this->load->model('Model_name');

      $this->fubar->function();

      $this->load->database('options', true/false)

      This function lets you load the database class. The two parameters are optional. Please see the -database section for more info.

      +database section for more info.

      $this->load->scaffolding('table_name')

      From 4b6d493593b7400b7fa81d976fd3dc07ad30fe86 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 7 Dec 2008 17:04:56 +0000 Subject: [PATCH 1570/2544] changed some code in examples from Let's try it:  Hello World! @@ -150,7 +150,7 @@

      Functions

      Now load the following URL to see the comment function:

      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index a8c3d602..120e7bbf 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -97,7 +97,7 @@

      Loading a View

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index a840c1ec..ef8ecf18 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -142,7 +142,7 @@

      The Controller

      folder:

      - +?>

      The Upload Folder

      diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 684fe9b5..b49117ed 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -313,7 +313,7 @@

      Setting Validation Rules

      Your controller should now look like this:

      - + + + +

       

      + + +

      Function Reference

      + +

      $this->cart->insert();

      + +

      Permits you to add items to the shopping cart, as outlined above.

      + + +

      $this->cart->update();

      + +

      Permits you to update items in the shopping cart, as outlined above.

      + + +

      $this->cart->total();

      + +

      Displays the total amount in the cart.

      + + +

      $this->cart->total_items();

      + +

      Displays the total number of items in the cart.

      + + +

      $this->cart->contents();

      + +

      Returns an array containing everything in the cart.

      + + + +

      $this->cart->has_options(rowid);

      + +

      Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

      + + +

      $this->cart->options(rowid);

      + +

      Returns an array of options for a particular product. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

      + + + +

      $this->cart->destroy();

      + +

      Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

      + + + + +
    + + + + + + + \ No newline at end of file From edac17e48ca6b81fbf6ed5913322cc289ba2164e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 02:28:47 +0000 Subject: [PATCH 1632/2544] Tweaked nav --- user_guide/libraries/benchmark.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index f76dba9c..a3ce0e4e 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -182,13 +182,14 @@

    Displaying Memory Consumption

    + From 134bdde1b8d46d026b472cfebcb6f6df58c93f05 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 02:29:11 +0000 Subject: [PATCH 1633/2544] Tweaked nav --- user_guide/libraries/calendar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index f166cf8b..941ebf5c 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -236,7 +236,7 @@

    Creating a Calendar Template

    From 0837e24c4f4bdfa24f74e85f17c9ad7e4a19cb9f Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 02:33:29 +0000 Subject: [PATCH 1641/2544] --- user_guide/libraries/calendar.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 941ebf5c..abfcee5b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -236,11 +236,11 @@

    Creating a Calendar Template

    From fd50315792307240cdf9ab17b950f5a02bfd5b04 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 02:33:53 +0000 Subject: [PATCH 1642/2544] --- user_guide/libraries/cart.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 7c709d39..4649c5dd 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -368,11 +368,11 @@

    $this->cart->destroy();

    From c7d12d369209bd9c7abba8e6536e3a7fe66ec172 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 02:35:08 +0000 Subject: [PATCH 1643/2544] --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 19d85c07..384e0ef3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -64,6 +64,7 @@

    Version 1.7.2

    • Libraries
    • From 9c86ce5ca11c2d7471d016a7195254c1934472e2 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 17 Feb 2009 19:54:14 +0000 Subject: [PATCH 1644/2544] Updated the destroy function to only remove the cart session and not kill the general session data --- system/libraries/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index a0b782bb..61223c59 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -517,7 +517,7 @@ function destroy() $this->_cart_contents['cart_total'] = 0; $this->_cart_contents['total_items'] = 0; - $this->CI->session->sess_destroy(); + $this->CI->session->unset_userdata('cart_contents'); } From 3343f462766d110e8c15c6f52d1ef047418c2c98 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 18 Feb 2009 01:29:50 +0000 Subject: [PATCH 1645/2544] added a missing bracket --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 03a7b21f..9a47aa88 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -187,7 +187,7 @@ function do_upload($field = 'userfile') // Set the uploaded data as class variables $this->file_temp = $_FILES[$field]['tmp_name']; - $this->file_name = $this->_prep_filename($_FILES[$field]['name']; + $this->file_name = $this->_prep_filename($_FILES[$field]['name']); $this->file_size = $_FILES[$field]['size']; $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); $this->file_type = strtolower($this->file_type); From 9c023d4325d9b6cc1e9fd0eb9212763ffcf1a288 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 18 Feb 2009 14:36:59 +0000 Subject: [PATCH 1646/2544] little tweak for ORIG_PATH_INFO servers so the URI isn't left with just a / --- system/libraries/URI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index b95c74e1..e74af31f 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -89,11 +89,11 @@ function _fetch_uri_string() } // No QUERY_STRING?... Maybe the ORIG_PATH_INFO variable exists? - $path = (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO'); + $path = str_replace($_SERVER['SCRIPT_NAME'], '', (isset($_SERVER['ORIG_PATH_INFO'])) ? $_SERVER['ORIG_PATH_INFO'] : @getenv('ORIG_PATH_INFO')); if (trim($path, '/') != '' && $path != "/".SELF) { // remove path and script information so we have good URI data - $this->uri_string = str_replace($_SERVER['SCRIPT_NAME'], '', $path); + $this->uri_string = $path; return; } From 85a7cfb75616fb5d41496bb009adbdab0b3f6165 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 18 Feb 2009 14:42:07 +0000 Subject: [PATCH 1647/2544] changelog note for ORIG_PATH_INFO fix --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 384e0ef3..f48bb0be 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,7 @@

      Version 1.7.2

      Bug fixes for 1.7.2

      • Fixed assorted user guide typos or examples (#6743).
      • +
      • Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a slash through.

      Version 1.7.1

      From 436e6e2583c574a4628984c4a95c5d3da5fcce1f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 Feb 2009 20:10:00 +0000 Subject: [PATCH 1648/2544] $CI->_remove_invisible_characters($str); fixed to $CI->input->_remove_invisible_characters($str); --- system/database/drivers/oci8/oci8_driver.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index b949a962..42dd5176 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -375,7 +375,7 @@ function escape_str($str) // Access the CI object $CI =& get_instance(); - return $CI->_remove_invisible_characters($str); + return $CI->input->_remove_invisible_characters($str); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f48bb0be..06375d6f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -136,6 +136,7 @@

      Bug fixes for 1.7.1

    • Fixed a bug where TRUNCATE was not considered a "write" query (#6619).
    • Fixed a bug where csv_from_result() was checking for a nonexistent method.
    • Fixed a bug _protect_identifiers() where it was improperly removing all pipe symbols from items
    • +
    • Fixed a fatal error in the Oracle driver (#6752)
  • Fixed assorted user guide typos or examples (#5998, #6093, #6259, #6339, #6432, #6521).
  • From e4ed583067095144eb20aefc61d4499d8386532a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 Feb 2009 21:44:59 +0000 Subject: [PATCH 1649/2544] added LIKE condition escaping to all drivers and Active Record updated all DB drivers to accept arrays in escape_str() --- system/database/DB_active_rec.php | 8 ++++- system/database/DB_driver.php | 19 ++++++++++- .../database/drivers/mssql/mssql_driver.php | 30 +++++++++++++++-- .../database/drivers/mysql/mysql_driver.php | 25 ++++++++++---- .../database/drivers/mysqli/mysqli_driver.php | 31 ++++++++++++++--- system/database/drivers/oci8/oci8_driver.php | 31 +++++++++++++++-- system/database/drivers/odbc/odbc_driver.php | 33 ++++++++++++++++--- .../drivers/postgre/postgre_driver.php | 31 +++++++++++++++-- .../database/drivers/sqlite/sqlite_driver.php | 29 ++++++++++++++-- user_guide/changelog.html | 5 ++- user_guide/database/queries.html | 9 ++++- 11 files changed, 223 insertions(+), 28 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index c757e6ae..d48f43e5 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -707,7 +707,7 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') $prefix = (count($this->ar_like) == 0) ? '' : $type; - $v = $this->escape_str($v); + $v = $this->escape_like_str($v); if ($side == 'before') { @@ -722,6 +722,12 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') $like_statement = $prefix." $k $not LIKE '%{$v}%'"; } + // some platforms require an escape sequence definition for LIKE wildcards + if ($this->_like_escape_str != '') + { + $like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_char); + } + $this->ar_like[] = $like_statement; if ($this->ar_caching === TRUE) { diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 9385870e..729af5bf 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -670,7 +670,7 @@ function last_query() * * @access public * @param string - * @return integer + * @return mixed */ function escape($str) { @@ -691,7 +691,24 @@ function escape($str) } // -------------------------------------------------------------------- + + /** + * Smart Escape LIKE String + * + * Calls the individual driver for platform + * specific escaping for LIKE conditions + * + * @access public + * @param string + * @return mixed + */ + function escape_like_str($str) + { + return $this->escape_str($str, TRUE); + } + // -------------------------------------------------------------------- + /** * Primary * diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index addbd6b9..c89e2549 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -34,6 +34,11 @@ class CI_DB_mssql_driver extends CI_DB { // The character used for escaping var $_escape_char = ''; + + // clause and character used for LIKE escape sequences + var $_like_escape_str = " ESCAPE '%s' "; + var $_like_escape_chr = '!'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -225,15 +230,36 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + // Access the CI object $CI =& get_instance(); // Escape single quotes - return str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); + $str = str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace( array('%', '_', $this->_like_escape_chr), + array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), + $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index a0cdb58a..5b2ba62b 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -34,7 +34,11 @@ class CI_DB_mysql_driver extends CI_DB { // The character used for escaping var $_escape_char = '`'; - + + // clause and character used for LIKE escape sequences - not used in MySQL + var $_like_escape_str = ''; + var $_like_escape_chr = ''; + /** * Whether to use the MySQL "delete hack" which allows the number * of affected rows to be shown. Uses a preg_replace when enabled, @@ -256,15 +260,16 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { if (is_array($str)) { foreach($str as $key => $val) { - $str[$key] = $this->escape_str($val); + $str[$key] = $this->escape_str($val, $like); } return $str; @@ -272,16 +277,24 @@ function escape_str($str) if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id)) { - return mysql_real_escape_string($str, $this->conn_id); + $str = mysql_real_escape_string($str, $this->conn_id); } elseif (function_exists('mysql_escape_string')) { - return mysql_escape_string($str); + $str = mysql_escape_string($str); } else { - return addslashes($str); + $str = addslashes($str); } + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 9ef18e02..92d87111 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -35,6 +35,10 @@ class CI_DB_mysqli_driver extends CI_DB { // The character used for escaping var $_escape_char = '`'; + // clause and character used for LIKE escape sequences - not used in MySQL + var $_like_escape_str = ''; + var $_like_escape_chr = ''; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -257,22 +261,41 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + if (function_exists('mysqli_real_escape_string') AND is_object($this->conn_id)) { - return mysqli_real_escape_string($this->conn_id, $str); + $str = mysqli_real_escape_string($this->conn_id, $str); } elseif (function_exists('mysql_escape_string')) { - return mysql_escape_string($str); + $str = mysql_escape_string($str); } else { - return addslashes($str); + $str = addslashes($str); } + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 42dd5176..1fdb1bc4 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -47,7 +47,11 @@ class CI_DB_oci8_driver extends CI_DB { // The character used for excaping var $_escape_char = '"'; - + + // clause and character used for LIKE escape sequences + var $_like_escape_str = " escape '%s' "; + var $_like_escape_chr = '!'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -368,14 +372,35 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + // Access the CI object $CI =& get_instance(); - return $CI->input->_remove_invisible_characters($str); + $str = $CI->input->_remove_invisible_characters($str); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace( array('%', '_', $this->_like_escape_chr), + array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), + $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 0f8b4200..a14aaa1f 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -34,7 +34,11 @@ class CI_DB_odbc_driver extends CI_DB { // the character used to excape - not necessary for ODBC var $_escape_char = ''; - + + // clause and character used for LIKE escape sequences + var $_like_escape_str = " {escape '%s'} "; + var $_like_escape_chr = '!'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -237,15 +241,36 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + // Access the CI object $CI =& get_instance(); - + // ODBC doesn't require escaping - return $CI->_remove_invisible_characters($str); + $str = $CI->input->_remove_invisible_characters($str); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace( array('%', '_', $this->_like_escape_chr), + array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), + $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 9d53b1ef..8d0d8901 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -34,6 +34,10 @@ class CI_DB_postgre_driver extends CI_DB { var $_escape_char = '"'; + // clause and character used for LIKE escape sequences + var $_like_escape_str = " ESCAPE '%s' "; + var $_like_escape_chr = '!'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -253,11 +257,32 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) - { - return pg_escape_string($str); + function escape_str($str, $like = FALSE) + { + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + + $str = pg_escape_string($str); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace( array('%', '_', $this->_like_escape_chr), + array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), + $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 3ef88dbb..104a3bc3 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -37,6 +37,10 @@ class CI_DB_sqlite_driver extends CI_DB { // The character used to escape with - not needed for SQLite var $_escape_char = ''; + // clause and character used for LIKE escape sequences + var $_like_escape_str = " ESCAPE '%s' "; + var $_like_escape_chr = '!'; + /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is @@ -253,11 +257,32 @@ function trans_rollback() * * @access public * @param string + * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str) + function escape_str($str, $like = FALSE) { - return sqlite_escape_string($str); + if (is_array($str)) + { + foreach($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + + $str = sqlite_escape_string($str); + + // escape LIKE condition wildcards + if ($like === TRUE) + { + $str = str_replace( array('%', '_', $this->_like_escape_chr), + array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), + $str); + } + + return $str; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 06375d6f..cdbfbbd0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,9 @@

    Version 1.7.2

  • Database
    • Switched from using gettype() in escape() to is_* methods, since future PHP versions might change its output.
    • +
    • Updated all database drivers to handle arrays in escape_str()
    • +
    • Added escape_like_str() method for escaping strings to be used in LIKE conditions
    • +
    • Updated Active Record to utilize the new LIKE escaping mechanism.
  • @@ -80,6 +83,7 @@

    Bug fixes for 1.7.2

    • Fixed assorted user guide typos or examples (#6743).
    • Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a slash through.
    • +
    • Fixed a fatal error in the Oracle and ODBC drivers (#6752)

    Version 1.7.1

    @@ -136,7 +140,6 @@

    Bug fixes for 1.7.1

  • Fixed a bug where TRUNCATE was not considered a "write" query (#6619).
  • Fixed a bug where csv_from_result() was checking for a nonexistent method.
  • Fixed a bug _protect_identifiers() where it was improperly removing all pipe symbols from items
  • -
  • Fixed a fatal error in the Oracle driver (#6752)
  • Fixed assorted user guide typos or examples (#5998, #6093, #6259, #6339, #6432, #6521).
  • diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index f42e179a..9665af23 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -96,7 +96,7 @@

    Protecting identifiers

    Escaping Queries

    It's a very good security practice to escape your data before submitting it into your database. -CodeIgniter has two functions that help you do this:

    +CodeIgniter has three methods that help you do this:

    1. $this->db->escape() This function determines the data type so that it @@ -108,6 +108,13 @@

      Escaping Queries

      Most of the time you'll use the above function rather than this one. Use the function like this: $sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
    2. + +
    3. $this->db->escape_like_str() This method should be used when strings are to be used in LIKE +conditions so that LIKE wildcards ('%', '_') in the string are also properly escaped. + +$search = '20% raise';
      +$sql = "SELECT id FROM table WHERE column LIKE '%".$this->db->escape_like_str($search)."%'";
      +
    From bdc7fb907f04469f526868058103e35460f4e52d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 Feb 2009 21:55:10 +0000 Subject: [PATCH 1650/2544] fixed docblock --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 729af5bf..161569d3 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -693,7 +693,7 @@ function escape($str) // -------------------------------------------------------------------- /** - * Smart Escape LIKE String + * Escape LIKE String * * Calls the individual driver for platform * specific escaping for LIKE conditions From 3c11b6f5dee83ebe11dfdcec3022313c45a4a4e2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 Feb 2009 22:36:27 +0000 Subject: [PATCH 1651/2544] updated _list_tables() in db drivers to escape the db prefix for LIKE wildcards --- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/mysql/mysql_driver.php | 2 +- system/database/drivers/mysqli/mysqli_driver.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- system/database/drivers/postgre/postgre_driver.php | 2 +- system/database/drivers/sqlite/sqlite_driver.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index c89e2549..ddc036da 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -373,7 +373,7 @@ function _list_tables($prefix_limit = FALSE) // for future compatibility if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - //$sql .= " LIKE '".$this->dbprefix."%'"; + //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_char); return FALSE; // not currently supported } diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 5b2ba62b..2b05c3f1 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -370,7 +370,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - $sql .= " LIKE '".$this->dbprefix."%'"; + $sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 92d87111..6558112c 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -371,7 +371,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - $sql .= " LIKE '".$this->dbprefix."%'"; + $sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 1fdb1bc4..4dfec2e3 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -477,7 +477,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - $sql .= " WHERE TABLE_NAME LIKE '".$this->dbprefix."%'"; + $sql .= " WHERE TABLE_NAME LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_char); } return $sql; diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index a14aaa1f..f7db4ca4 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -346,7 +346,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - //$sql .= " LIKE '".$this->dbprefix."%'"; + //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_char); return FALSE; // not currently supported } diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 8d0d8901..4bc5b7d9 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -386,7 +386,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - $sql .= " AND table_name LIKE '".$this->dbprefix."%'"; + $sql .= " AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_char); } return $sql; diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 104a3bc3..bb1e6d02 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -358,7 +358,7 @@ function _list_tables($prefix_limit = FALSE) if ($prefix_limit !== FALSE AND $this->dbprefix != '') { - $sql .= " AND 'name' LIKE '".$this->dbprefix."%'"; + $sql .= " AND 'name' LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_char); } return $sql; } From a34a2b2c6761e7a331934f948db6b334a6316cd0 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 24 Feb 2009 22:04:25 +0000 Subject: [PATCH 1652/2544] Updated the "update cart" information, as it was incorrect. --- user_guide/libraries/cart.html | 150 +++++++++++++-------------------- 1 file changed, 58 insertions(+), 92 deletions(-) diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 4649c5dd..d63be495 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -155,98 +155,6 @@

    Adding Multiple Items to The Cart

    -

    Updating The Cart

    - -

    To update the information in your cart, pass an array containing the product ID and quantity to the $this->cart->update() function:

    - - - -$data = array(
    -               'id'  => '123XYZ',
    -               'qty' => 3
    -            );
    -
    - -$this->cart->update($data); - -
    - -

    Just as you can when inserting, you may use a multi-dimensional array in order to update multiple items simultaneously:

    - - - -$data = array(
    - -               array(
    -                       'id'      => 'sku_123ABC',
    -                       'qty'     => 3
    -                    ),
    - -               array(
    -                       'id'      => 'sku_567ZYX',
    -                       'qty'     => 4
    -                    ),
    - -               array(
    -                       'id'      => 'sku_965QRS',
    -                       'qty'     => 2
    -                    )
    - -            );
    -
    - -$this->cart->update($data); - -
    - - - - -

    Deleting an Item From The Cart

    - -

    To delete an item from your cart, pass an array containing the product ID and a quantity of zero to the $this->cart->update() function:

    - - - -$data = array(
    -               'id'  => '123XYZ',
    -               'qty' => 0
    -            );
    -
    - -$this->cart->update($data); - -
    - - -

    You may use a multi-dimensional array in order to delete multiple items simultaneously:

    - - - -$data = array(
    - -               array(
    -                       'id'      => 'sku_123ABC',
    -                       'qty'     => 0
    -                    ),
    - -               array(
    -                       'id'      => 'sku_567ZYX',
    -                       'qty'     => 0
    -                    ),
    - -               array(
    -                       'id'      => 'sku_965QRS',
    -                       'qty'     => 0
    -                    )
    - -            );
    -
    - -$this->cart->update($data); - -
    -

    Displaying the Cart

    @@ -313,6 +221,64 @@

    Displaying the Cart

    + + +

    Updating The Cart

    + +

    To update the information in your cart, you must pass an array containing the Row ID and quantity to the $this->cart->update() function:

    + +

    Note: If the quantity is set to zero, the item will be removed from the cart.

    + + +$data = array(
    +               'rowid' => 'b99ccdf16028f015540f341130b6d8ec',
    +               'qty'   => 3
    +            );
    +
    + +$this->cart->update($data); +

    +// Or a multi-dimensional array

    +$data = array(
    + +               array(
    +                       'rowid'   => 'b99ccdf16028f015540f341130b6d8ec',
    +                       'qty'     => 3
    +                    ),
    + +               array(
    +                       'rowid'   => 'xw82g9q3r495893iajdh473990rikw23',
    +                       'qty'     => 4
    +                    ),
    + +               array(
    +                       'rowid'   => 'fh4kdkkkaoe30njgoe92rkdkkobec333',
    +                       'qty'     => 2
    +                    )
    + +            );
    +
    + +$this->cart->update($data); + + + + +
    + +

    What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a +unique ID is created is so that identical products with different options can be managed by the cart.

    + +

    For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be +identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this +difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.

    + +

    In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself +with the "row ID", other then making sure your "view cart" page contains this information in a hidden form field, and making sure it gets passed to the update +function when the update form is submitted. Please examine the construction of the "view cart" page above for more information.

    + + +

     

    From df39d51e3d4f18343666a2e4b991c656d0e61a13 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 24 Feb 2009 22:29:37 +0000 Subject: [PATCH 1653/2544] Removed the hard coded number formatting and added a "format number" function. --- system/libraries/Cart.php | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 61223c59..800c21f7 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -32,7 +32,7 @@ class CI_Cart { // Private variables. Do not change! var $CI; - var $_cart_contents = array(); + var $_cart_contents = array(); /** @@ -382,7 +382,7 @@ function _save_cart() // Set the subtotal // Note: "subtotal" is a reserved array index. We need to make a note of that in the docs - $this->_cart_contents[$key]['subtotal'] = number_format(($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']), 2); + $this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']); } // Unset these so our total can be calculated correctly below @@ -420,7 +420,7 @@ function _save_cart() */ function total() { - return number_format($this->_cart_contents['cart_total'], 2); + return $this->_cart_contents['cart_total']; } // -------------------------------------------------------------------- @@ -499,7 +499,30 @@ function product_options($rowid = '') return $this->_cart_contents[$rowid]['options']; } + + // -------------------------------------------------------------------- + /** + * Format Number + * + * Returns the supplied number with commas and a decimal point. + * + * @access public + * @return integer + */ + function format_number($n = '') + { + if ($n == '') + { + return ''; + } + + // Remove anything that isn't a number or decimal point. + $n = trim(preg_replace('/([^0-9\.])/i', '', $n)); + + return number_format($n, 2, '.', ','); + } + // -------------------------------------------------------------------- /** From f4ed69e80c553486a8f3d69e46911fcb25c73b9e Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 24 Feb 2009 22:31:49 +0000 Subject: [PATCH 1654/2544] Updated the view cart info in light of the changes to the cart class. --- user_guide/libraries/cart.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index d63be495..bd3caef9 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -200,8 +200,8 @@

    Displaying the Cart

    <?php endif; ?> </td> - <td style="text-align:right"><?php echo $items['price']; ?></td> - <td style="text-align:right">$<?php echo $items['subtotal']; ?></td> + <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> + <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> </tr> <?php $i++; ?> @@ -211,7 +211,7 @@

    Displaying the Cart

    <tr> <td colspan="2"> </td> <td class="right"><strong>Total</strong></td> - <td class="right">$<?php echo $this->cart->total(); ?></td> + <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> </tr> </table> @@ -222,7 +222,6 @@

    Displaying the Cart

    -

    Updating The Cart

    To update the information in your cart, you must pass an array containing the Row ID and quantity to the $this->cart->update() function:

    From af4fb22745413cac182064a495da83318a41fde9 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Tue, 24 Feb 2009 22:44:22 +0000 Subject: [PATCH 1655/2544] Fixed a bug in the "save cart" function that was causing the total to be calcluated incorrectly --- system/libraries/Cart.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 800c21f7..2eb8b75b 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -368,12 +368,16 @@ function _update($items = array()) */ function _save_cart() { - // First we add up the individual prices and get the cart total + // 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; foreach ($this->_cart_contents as $key => $val) { // We make sure the array contains the proper indexes - if ( ! isset($val['price']) or ! isset($val['qty'])) + if ( ! is_array($val) OR ! isset($val['price']) OR ! isset($val['qty'])) { continue; } @@ -381,14 +385,9 @@ function _save_cart() $total += ($val['price'] * $val['qty']); // Set the subtotal - // Note: "subtotal" is a reserved array index. We need to make a note of that in the docs $this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']); } - // Unset these so our total can be calculated correctly below - unset($this->_cart_contents['total_items']); - unset($this->_cart_contents['cart_total']); - // Set the cart total and total items. $this->_cart_contents['total_items'] = count($this->_cart_contents); $this->_cart_contents['cart_total'] = $total; From 87cbafce2d6803af78714baf8bba64309c01fc33 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 27 Feb 2009 16:29:59 +0000 Subject: [PATCH 1656/2544] added reconnect() method to db drivers --- .../database/drivers/mssql/mssql_driver.php | 16 ++++++++++++++++ .../database/drivers/mysql/mysql_driver.php | 19 +++++++++++++++++++ .../database/drivers/mysqli/mysqli_driver.php | 19 +++++++++++++++++++ system/database/drivers/oci8/oci8_driver.php | 16 ++++++++++++++++ system/database/drivers/odbc/odbc_driver.php | 16 ++++++++++++++++ .../drivers/postgre/postgre_driver.php | 19 +++++++++++++++++++ .../database/drivers/sqlite/sqlite_driver.php | 16 ++++++++++++++++ user_guide/changelog.html | 1 + user_guide/database/connecting.html | 5 +++++ 9 files changed, 127 insertions(+) diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index ddc036da..241b280d 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -82,7 +82,23 @@ function db_pconnect() } // -------------------------------------------------------------------- + + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + // not implemented in MSSQL + } + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 2b05c3f1..334daf3a 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -90,6 +90,25 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + if (mysql_ping($this->conn_id) === FALSE) + { + $this->conn_id = FALSE; + } + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 6558112c..74cfff44 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -90,6 +90,25 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + if (mysqli_ping($this->conn_id) === FALSE) + { + $this->conn_id = FALSE; + } + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 4dfec2e3..f4ef42a1 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -97,6 +97,22 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + // not implemented in oracle + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index f7db4ca4..2e529f32 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -81,6 +81,22 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + // not implemented in odbc + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 4bc5b7d9..db3a3f29 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -101,6 +101,25 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + if (pg_ping($this->conn_id) === FALSE) + { + $this->conn_id = FALSE; + } + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index bb1e6d02..cd7b26bc 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -99,6 +99,22 @@ function db_pconnect() // -------------------------------------------------------------------- + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + // not implemented in SQLite + } + + // -------------------------------------------------------------------- + /** * Select the database * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cdbfbbd0..3ddaf8d0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@

    Version 1.7.2

  • Updated all database drivers to handle arrays in escape_str()
  • Added escape_like_str() method for escaping strings to be used in LIKE conditions
  • Updated Active Record to utilize the new LIKE escaping mechanism.
  • +
  • Added reconnect() method to DB drivers to try to keep alive / reestablish a connection after a long idle.
  • diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 3579e1af..b4d51794 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -158,6 +158,11 @@

    Connecting to Multiple Databases

    +

    Reconnecting / Keeping the Connection Alive

    + +

    If the database server's idle timeout is exceeded while you're doing some heavy PHP lifting (processing an image, for instance), you should consider pinging the server by using the reconnect() method before sending further queries, which can gracefully keep the connection alive or re-establish it.

    + +$this->db->reconnect(); From 8a54ef21839dd970c85491cddff836b391d48882 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Wed, 4 Mar 2009 14:49:53 +0000 Subject: [PATCH 1657/2544] Altered modify_column and add_column to loop through multiple fields rather than returning after first field. --- system/database/DB_forge.php | 56 ++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index f708910f..c4597bd1 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -257,18 +257,28 @@ function add_column($table = '', $field = array(), $after_field = '') } // add field info into field array, but we can only do one at a time - // so only grab the first field in the event there are more then one - $this->add_field(array_slice($field, 0, 1)); + // so we cycle through - if (count($this->fields) == 0) - { - show_error('Field information is required.'); - } + foreach ($field as $k => $v) + { + $this->add_field(array($k => $field[$k])); - $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); + if (count($this->fields) == 0) + { + show_error('Field information is required.'); + } + + $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); - $this->_reset(); - return $this->db->query($sql); + $this->_reset(); + + if ($this->db->query($sql) === FALSE) + { + return FALSE; + } + } + + return TRUE; } // -------------------------------------------------------------------- @@ -318,18 +328,28 @@ function modify_column($table = '', $field = array()) } // add field info into field array, but we can only do one at a time - // so only grab the first field in the event there are more then one - $this->add_field(array_slice($field, 0, 1)); + // so we cycle through - if (count($this->fields) == 0) - { - show_error('Field information is required.'); - } + foreach ($field as $k => $v) + { + $this->add_field(array($k => $field[$k])); - $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); + if (count($this->fields) == 0) + { + show_error('Field information is required.'); + } + + $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); - $this->_reset(); - return $this->db->query($sql); + $this->_reset(); + + if ($this->db->query($sql) === FALSE) + { + return FALSE; + } + } + + return TRUE; } // -------------------------------------------------------------------- From 6559ec305aeddf5fc13b2c0b460d7c22e8ded191 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Wed, 4 Mar 2009 14:50:59 +0000 Subject: [PATCH 1658/2544] Altered modify_column and add_column to loop through multiple fields rather than returning after first field. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3ddaf8d0..3650e03a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,6 +85,7 @@

    Bug fixes for 1.7.2

  • Fixed assorted user guide typos or examples (#6743).
  • Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a slash through.
  • Fixed a fatal error in the Oracle and ODBC drivers (#6752)
  • +
  • Fixed a bug where Database Forge's add_column and modify_column were not looping through when sent multiple fields.
  • Version 1.7.1

    From 7523ef1012514bb382b06f2169b4b419b4ed0e7d Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 6 Mar 2009 22:31:19 +0000 Subject: [PATCH 1659/2544] Removed the "index.php" portion from the FCPATH constant, as it was not needed. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 39aeda5c..bac85d9a 100644 --- a/index.php +++ b/index.php @@ -79,15 +79,15 @@ |--------------------------------------------------------------- | | EXT - The file extension. Typically ".php" -| FCPATH - The full server path to THIS file | SELF - The name of THIS file (typically "index.php") +| FCPATH - The full server path to THIS file | BASEPATH - The full server path to the "system" folder | APPPATH - The full server path to the "application" folder | */ define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); -define('FCPATH', __FILE__); define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); +define('FCPATH', str_replace(SELF, '', __FILE__)); define('BASEPATH', $system_folder.'/'); if (is_dir($application_folder)) From f88ad5e88fded3d1bfbf71ef9c194ebcc433c5e0 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Fri, 6 Mar 2009 22:32:23 +0000 Subject: [PATCH 1660/2544] Updated _parse_request_uri to reflect the fact that FCPATH no longer contains index.php as part of the path. --- system/libraries/URI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/URI.php b/system/libraries/URI.php index e74af31f..73ddec87 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -146,7 +146,7 @@ function _parse_request_uri() return ''; } - $fc_path = FCPATH; + $fc_path = FCPATH.SELF; if (strpos($request_uri, '?') !== FALSE) { $fc_path .= '?'; From faac15e56fd45a18049f83d4282436c3d86f6939 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 7 Mar 2009 17:17:58 +0000 Subject: [PATCH 1661/2544] spaces for tabs --- system/libraries/Pagination.php | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 09b5bec8..629cbf14 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -63,14 +63,14 @@ function CI_Pagination($params = array()) { if (count($params) > 0) { - $this->initialize($params); + $this->initialize($params); } - + log_message('debug', "Pagination Class Initialized"); } - + // -------------------------------------------------------------------- - + /** * Initialize Preferences * @@ -91,21 +91,21 @@ function initialize($params = array()) } } } - + // -------------------------------------------------------------------- - + /** * Generate the pagination links * * @access public * @return string - */ + */ 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) { - return ''; + return ''; } // Calculate the total number of pages @@ -117,15 +117,15 @@ function create_links() return ''; } - // Determine the current page number. + // Determine the current page number. $CI =& get_instance(); - + if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) { if ($CI->input->get($this->query_string_segment) != 0) { $this->cur_page = $CI->input->get($this->query_string_segment); - + // Prep the current page - no funny business! $this->cur_page = (int) $this->cur_page; } @@ -135,31 +135,31 @@ function create_links() if ($CI->uri->segment($this->uri_segment) != 0) { $this->cur_page = $CI->uri->segment($this->uri_segment); - + // Prep the current page - no funny business! $this->cur_page = (int) $this->cur_page; } } $this->num_links = (int)$this->num_links; - + if ($this->num_links < 1) { show_error('Your number of links must be a positive number.'); } - + if ( ! is_numeric($this->cur_page)) { $this->cur_page = 0; } - + // Is the page number beyond the result range? // If so we show the last page if ($this->cur_page > $this->total_rows) { $this->cur_page = ($num_pages - 1) * $this->per_page; } - + $uri_page_number = $this->cur_page; $this->cur_page = floor(($this->cur_page/$this->per_page) + 1); @@ -200,7 +200,7 @@ function create_links() for ($loop = $start -1; $loop <= $end; $loop++) { $i = ($loop * $this->per_page) - $this->per_page; - + if ($i >= 0) { if ($this->cur_page == $loop) @@ -234,8 +234,8 @@ function create_links() // Add the wrapper HTML if exists $output = $this->full_tag_open.$output.$this->full_tag_close; - - return $output; + + return $output; } } // END Pagination Class From 28e5c8fc0ed79017a67b896613698e98fa7da8b3 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 9 Mar 2009 22:36:48 +0000 Subject: [PATCH 1662/2544] Fixed a bug that was not setting the default checkbox/radio/pull-down value correctly --- system/helpers/form_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 4a62cdb5..05616f70 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -644,7 +644,7 @@ function set_select($field = '', $value = '', $default = FALSE) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0) + if (count($_POST) === 0 AND $default == TRUE) { return ' selected="selected"'; } @@ -699,7 +699,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0) + if (count($_POST) === 0 AND $default == TRUE) { return ' checked="checked"'; } @@ -754,7 +754,7 @@ function set_radio($field = '', $value = '', $default = FALSE) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0) + if (count($_POST) === 0 AND $default == TRUE) { return ' checked="checked"'; } From 1322ec54289f09f7e176924902d5642f269aec48 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Mar 2009 17:01:14 +0000 Subject: [PATCH 1663/2544] ereg eradication --- system/helpers/date_helper.php | 2 +- system/libraries/Image_lib.php | 8 ++++---- system/libraries/Trackback.php | 7 ++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index dbd7e0ec..7f607342 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -460,7 +460,7 @@ function human_to_unix($datestr = '') $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) + if (isset($ex['2']) && preg_match('/[0-9]{1,2}/', $ex['2'])) { $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; } diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 2896c9e0..1e1ae7db 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -350,7 +350,7 @@ function resize() { $protocol = 'image_process_'.$this->image_library; - if (eregi("gd2$", $protocol)) + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; } @@ -373,7 +373,7 @@ function crop() { $protocol = 'image_process_'.$this->image_library; - if (eregi("gd2$", $protocol)) + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; } @@ -559,9 +559,9 @@ function image_process_imagemagick($action = 'resize') return FALSE; } - if ( ! eregi("convert$", $this->library_path)) + if ( ! preg_match("/convert$/i", $this->library_path)) { - if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; + $this->library_path = rtrim($this->library_path, '/').'/'; $this->library_path .= 'convert'; } diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 844e5036..d53f17fe 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -267,7 +267,7 @@ function process($url, $data) } @fclose($fp); - if ( ! eregi("0", $this->response)) + if (stristr($this->response, '0') === FALSE) { $message = 'An unknown error was encountered'; @@ -370,10 +370,7 @@ function get_id($url) } else { - if (ereg("/$", $url)) - { - $url = substr($url, 0, -1); - } + $url = rtrim($url, '/'); $tb_array = explode('/', $url); $tb_id = $tb_array[count($tb_array)-1]; From 50d45c0c4332e942a2f11d37f5f6fe0f0efc79e3 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Thu, 26 Mar 2009 18:58:38 +0000 Subject: [PATCH 1664/2544] Modified form_hidden() to accept multi-dimensional arrays. --- user_guide/changelog.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3650e03a..e4d57f6b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,7 +77,11 @@

    Version 1.7.2

  • Added reconnect() method to DB drivers to try to keep alive / reestablish a connection after a long idle.
  • - +
  • Helpers +
      +
    • Modified form_hidden() in the Form helper to accept multi-dimensional arrays.
    • +
    +
  • Bug fixes for 1.7.2

    From 57fe41072c9d97d3cba2cd5faef529ac94571bfb Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Thu, 26 Mar 2009 18:58:46 +0000 Subject: [PATCH 1665/2544] Modified form_hidden() to accept multi-dimensional arrays. --- system/helpers/form_helper.php | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 05616f70..0173340c 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -103,19 +103,35 @@ function form_open_multipart($action, $attributes = array(), $hidden = array()) */ if ( ! function_exists('form_hidden')) { - function form_hidden($name, $value = '') + function form_hidden($name, $value = '', $recursing = FALSE) { - if ( ! is_array($name)) + static $form; + + if ($recursing === FALSE) { - return ''; + $form = "\n"; } - $form = ''; + if (is_array($name)) + { + foreach ($name as $key => $val) + { + form_hidden($key, $val, TRUE); + } + return $form; + } - foreach ($name as $name => $value) + if ( ! is_array($value)) + { + $form .= ''."\n"; + } + else { - $form .= "\n"; - $form .= ''; + foreach ($value as $k => $v) + { + $k = (is_int($k)) ? '' : $k; + form_hidden($name.'['.$k.']', $v, TRUE); + } } return $form; @@ -264,7 +280,7 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; $form = '"; + return ""; } } From b8d3c3defbef3563889641bf4448eeaa51519e42 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Jun 2009 15:27:01 +0000 Subject: [PATCH 1679/2544] some mods to xmlrpc library to handle data types better, and to exit() content so Output class does not muck with it --- system/libraries/Xmlrpc.php | 6 +++--- system/libraries/Xmlrpcs.php | 2 +- user_guide/changelog.html | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 4a5b97fb..2022a7eb 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1351,13 +1351,13 @@ function serializedata($typ, $val) switch ($typ) { case $this->xmlrpcBase64: - $rs .= "<{$typ}>" . base64_encode($val) . "\n"; + $rs .= "<{$typ}>" . base64_encode((string)$val) . "\n"; break; case $this->xmlrpcBoolean: - $rs .= "<{$typ}>" . ($val ? '1' : '0') . "\n"; + $rs .= "<{$typ}>" . ((bool)$val ? '1' : '0') . "\n"; break; case $this->xmlrpcString: - $rs .= "<{$typ}>" . htmlspecialchars($val). "\n"; + $rs .= "<{$typ}>" . htmlspecialchars((string)$val). "\n"; break; default: $rs .= "<{$typ}>{$val}\n"; diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index b7382fae..c7daa600 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -123,7 +123,7 @@ function serve() header("Content-Type: text/xml"); header("Content-Length: ".strlen($payload)); - echo $payload; + exit($payload); } //------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3ae2cb61..9db5c150 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -96,6 +96,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug where Database Forge's add_column and modify_column were not looping through when sent multiple fields.
  • Fixed a bug where the File Helper was using '/' instead of the DIRECTORY_SEPARATOR constant.
  • Fixed a bug to prevent PHP errors when attempting to use sendmail on servers that have manually disabled the PHP popen() function.
  • +
  • Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
  • Version 1.7.1

    From 7e39c0cdbaab7be5f8738ee964739e176d1639b7 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Jun 2009 16:25:03 +0000 Subject: [PATCH 1680/2544] fixed dateTime.iso8601 processing in XML-RPC class --- system/libraries/Xmlrpc.php | 4 ++-- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 2022a7eb..4b3470c3 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -38,7 +38,7 @@ class CI_Xmlrpc { var $xmlrpcBoolean = 'boolean'; var $xmlrpcDouble = 'double'; var $xmlrpcString = 'string'; - var $xmlrpcDateTime = 'datetime.iso8601'; + var $xmlrpcDateTime = 'dateTime.iso8601'; var $xmlrpcBase64 = 'base64'; var $xmlrpcArray = 'array'; var $xmlrpcStruct = 'struct'; @@ -231,7 +231,7 @@ function values_parsing($value, $return = FALSE) { if (is_array($value) && isset($value['0'])) { - if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])])) + if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']]) && ! isset($this->xmlrpcTypes[strtolower($value['1'])]))) { if (is_array($value[0])) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9db5c150..0e127799 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -97,6 +97,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug where the File Helper was using '/' instead of the DIRECTORY_SEPARATOR constant.
  • Fixed a bug to prevent PHP errors when attempting to use sendmail on servers that have manually disabled the PHP popen() function.
  • Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
  • +
  • Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.
  • Version 1.7.1

    From 626d71d54f3dbbbd67b904f009bda36597757e56 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 24 Jun 2009 16:30:41 +0000 Subject: [PATCH 1681/2544] tweaked and dropped the strtolower altogether from checking xmlrpcTypes array since it's accessed later without changing the type's casing anyway --- system/libraries/Xmlrpc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 4b3470c3..5460842b 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -231,7 +231,7 @@ function values_parsing($value, $return = FALSE) { if (is_array($value) && isset($value['0'])) { - if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']]) && ! isset($this->xmlrpcTypes[strtolower($value['1'])]))) + if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']]))) { if (is_array($value[0])) { From 15b93ca14fb65565561cc9c38d02dc3df1f8ba07 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 2 Jul 2009 21:23:38 +0000 Subject: [PATCH 1682/2544] changed EXT to always be defined as '.php' to allow the renaming of the index.php file --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index bac85d9a..d60e79f6 100644 --- a/index.php +++ b/index.php @@ -85,7 +85,7 @@ | APPPATH - The full server path to the "application" folder | */ -define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); +define('EXT', '.php'); define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); define('FCPATH', str_replace(SELF, '', __FILE__)); define('BASEPATH', $system_folder.'/'); From 4e5cf1ca1cfcb4559d8b18898a526181963890f6 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 6 Jul 2009 20:53:41 +0000 Subject: [PATCH 1683/2544] Fixed a bug in the Form Validation library where multiple callbacks weren't working (#6110) --- system/libraries/Form_validation.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f8077b8e..1497d851 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -601,7 +601,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) // If the field isn't required and we just processed a callback we'll move on... if ( ! in_array('required', $rules, TRUE) AND $result !== FALSE) { - return; + continue; } } else diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0e127799..d99a52f8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

    Version 1.7.2

    Bug fixes for 1.7.2

    • Fixed assorted user guide typos or examples (#6743, #7214, #7516, #7287).
    • +
    • Fixed a bug in the Form Validation library where multiple callbacks weren't working (#6110)
    • doctype helper default value was missing a "1".
    • Fixed a bug with ORIG_PATH_INFO that was allowing URIs of just a slash through.
    • Fixed a fatal error in the Oracle and ODBC drivers (#6752)
    • From 16d40d713b1d8d924ac20b542d344552a4c29648 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 10 Jul 2009 17:53:57 +0000 Subject: [PATCH 1684/2544] Fixed a case sensitive string replacement, simplified redundant string replacement --- system/libraries/Input.php | 4 ++-- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 40799037..e7bf7277 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -656,11 +656,11 @@ function xss_clean($str, $is_image = FALSE) { // Images have a tendency to have the PHP short opening and closing tags every so often // so we skip those and only do the long opening tags. - $str = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); + $str = str_replace(array(''), array('<?', '?>'), $str); } /* diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d99a52f8..2cd5c68e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -99,6 +99,7 @@

      Bug fixes for 1.7.2

    • Fixed a bug to prevent PHP errors when attempting to use sendmail on servers that have manually disabled the PHP popen() function.
    • Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
    • Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.
    • +
    • Fixed a case sensitive string replacement in xss_clean()

    Version 1.7.1

    From c8dddd97b96f74ebf080fedde5a2630019783c78 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 10 Jul 2009 18:58:03 +0000 Subject: [PATCH 1685/2544] Simplified some conditional syntax --- system/libraries/Loader.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 715bdf97..d615a136 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -868,12 +868,9 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU { include_once(APPPATH.'config/'.strtolower($class).EXT); } - else + elseif (file_exists(APPPATH.'config/'.ucfirst(strtolower($class)).EXT)) { - if (file_exists(APPPATH.'config/'.ucfirst(strtolower($class)).EXT)) - { - include_once(APPPATH.'config/'.ucfirst(strtolower($class)).EXT); - } + include_once(APPPATH.'config/'.ucfirst(strtolower($class)).EXT); } } From 8c5299640fed112bb86e7a3930432bd084e86dad Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 10 Jul 2009 19:05:08 +0000 Subject: [PATCH 1686/2544] removed entity protection from form_prep() so as to preserve the user's input when called back into a form element --- system/helpers/form_helper.php | 11 ----------- user_guide/changelog.html | 1 + 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index bdc87b86..987ff18e 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -610,22 +610,11 @@ function form_prep($str = '') return ''; } - $temp = '__TEMP_AMPERSANDS__'; - - // Replace entities to temporary markers so that - // htmlspecialchars won't mess them up - $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - $str = htmlspecialchars($str); // In case htmlspecialchars misses these. $str = str_replace(array("'", '"'), array("'", """), $str); - // Decode the temp markers back to entities - $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;",$str); - return $str; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2cd5c68e..b3ac1671 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -100,6 +100,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
  • Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.
  • Fixed a case sensitive string replacement in xss_clean()
  • +
  • Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
  • Version 1.7.1

    From 55acc8b4d980c43e4bde04f0e0b99a594dea28ff Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 11 Jul 2009 03:38:13 +0000 Subject: [PATCH 1687/2544] fixed a bug with _protect_identifiers() and db/swap prefixes. It was appending the prefix, but not accounting for the need to swap --- system/database/DB_driver.php | 14 +++++++++++++- user_guide/changelog.html | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 54aa5ed7..014dfd44 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1309,7 +1309,13 @@ function _protect_identifiers($item, $prefix_single = FALSE, $protect_identifier { $i++; } - + + // Verify table prefix and replace if necessary + if ($this->swap_pre != '' && strncmp($parts[$i], $this->swap_pre, strlen($this->swap_pre)) === 0) + { + $parts[$i] = preg_replace("/^".$this->swap_pre."(\S+?)/", $this->dbprefix."\\1", $parts[$i]); + } + // We only add the table prefix if it does not already exist if (substr($parts[$i], 0, strlen($this->dbprefix)) != $this->dbprefix) { @@ -1331,6 +1337,12 @@ function _protect_identifiers($item, $prefix_single = FALSE, $protect_identifier // Is there a table prefix? If not, no need to insert it if ($this->dbprefix != '') { + // Verify table prefix and replace if necessary + if ($this->swap_pre != '' && strncmp($item, $this->swap_pre, strlen($this->swap_pre)) === 0) + { + $item = preg_replace("/^".$this->swap_pre."(\S+?)/", $this->dbprefix."\\1", $item); + } + // Do we prefix an item with no segments? if ($prefix_single == TRUE AND substr($item, 0, strlen($this->dbprefix)) != $this->dbprefix) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b3ac1671..323467b6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -101,6 +101,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.
  • Fixed a case sensitive string replacement in xss_clean()
  • Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
  • +
  • Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.
  • Version 1.7.1

    From 817163a1bcff02285f763bcf72ff02e86f218cf8 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 11 Jul 2009 17:05:58 +0000 Subject: [PATCH 1688/2544] Modified show_error() to allow sending of HTTP server response codes. Added set_status_header() to the Common functions to allow use when the Output class is unavailable. Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments. --- system/codeigniter/Common.php | 89 +++++++++++++++++++++++- system/libraries/Exceptions.php | 4 +- system/libraries/Output.php | 75 +------------------- system/libraries/URI.php | 3 +- user_guide/changelog.html | 7 ++ user_guide/general/common_functions.html | 17 +++++ user_guide/general/errors.html | 3 +- user_guide/libraries/output.html | 2 +- 8 files changed, 121 insertions(+), 79 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index c7f95688..340be245 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -203,10 +203,10 @@ function config_item($item) * @access public * @return void */ -function show_error($message) +function show_error($message, $status_code = 500) { $error =& load_class('Exceptions'); - echo $error->show_error('An Error Was Encountered', $message); + echo $error->show_error('An Error Was Encountered', $message, 'error_general', $status_code); exit; } @@ -252,6 +252,91 @@ function log_message($level = 'error', $message, $php_error = FALSE) $LOG->write_log($level, $message, $php_error); } + +/** + * Set HTTP Status Header + * + * @access public + * @param int the status code + * @param string + * @return void + */ +function set_status_header($code = 200, $text = '') +{ + $stati = array( + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + + 400 => 'Bad Request', + 401 => 'Unauthorized', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported' + ); + + if ($code == '' OR ! is_numeric($code)) + { + show_error('Status codes must be numeric', 500); + } + + if (isset($stati[$code]) AND $text == '') + { + $text = $stati[$code]; + } + + if ($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; + + if (substr(php_sapi_name(), 0, 3) == 'cgi') + { + header("Status: {$code} {$text}", TRUE); + } + elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') + { + header($server_protocol." {$code} {$text}", TRUE, $code); + } + else + { + header("HTTP/1.1 {$code} {$text}", TRUE, $code); + } +} + + /** * Exception Handler * diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 902b574f..1f99d01c 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -113,8 +113,10 @@ function show_404($page = '') * @param string the template name * @return string */ - function show_error($heading, $message, $template = 'error_general') + function show_error($heading, $message, $template = 'error_general', $status_code = 500) { + set_status_header($status_code); + $message = '

    '.implode('

    ', ( ! is_array($message)) ? array($message) : $message).'

    '; if (ob_get_level() > $this->ob_level + 1) diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 6bfb9c7e..4423ac72 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -116,7 +116,8 @@ function set_header($header, $replace = TRUE) /** * Set HTTP Status Header - * + * moved to Common procedural functions in 1.7.2 + * * @access public * @param int the status code * @param string @@ -124,77 +125,7 @@ function set_header($header, $replace = TRUE) */ function set_status_header($code = '200', $text = '') { - $stati = array( - '200' => 'OK', - '201' => 'Created', - '202' => 'Accepted', - '203' => 'Non-Authoritative Information', - '204' => 'No Content', - '205' => 'Reset Content', - '206' => 'Partial Content', - - '300' => 'Multiple Choices', - '301' => 'Moved Permanently', - '302' => 'Found', - '304' => 'Not Modified', - '305' => 'Use Proxy', - '307' => 'Temporary Redirect', - - '400' => 'Bad Request', - '401' => 'Unauthorized', - '403' => 'Forbidden', - '404' => 'Not Found', - '405' => 'Method Not Allowed', - '406' => 'Not Acceptable', - '407' => 'Proxy Authentication Required', - '408' => 'Request Timeout', - '409' => 'Conflict', - '410' => 'Gone', - '411' => 'Length Required', - '412' => 'Precondition Failed', - '413' => 'Request Entity Too Large', - '414' => 'Request-URI Too Long', - '415' => 'Unsupported Media Type', - '416' => 'Requested Range Not Satisfiable', - '417' => 'Expectation Failed', - - '500' => 'Internal Server Error', - '501' => 'Not Implemented', - '502' => 'Bad Gateway', - '503' => 'Service Unavailable', - '504' => 'Gateway Timeout', - '505' => 'HTTP Version Not Supported' - ); - - if ($code == '' OR ! is_numeric($code)) - { - show_error('Status codes must be numeric'); - } - - if (isset($stati[$code]) AND $text == '') - { - $text = $stati[$code]; - } - - if ($text == '') - { - show_error('No status text available. Please check your status code number or supply your own message text.'); - } - - $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE; - - if (substr(php_sapi_name(), 0, 3) == 'cgi') - { - header("Status: {$code} {$text}", TRUE); - } - elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') - { - header($server_protocol." {$code} {$text}", TRUE, $code); - } - else - { - header("HTTP/1.1 {$code} {$text}", TRUE, $code); - } + set_status_header($code, $text); } // -------------------------------------------------------------------- diff --git a/system/libraries/URI.php b/system/libraries/URI.php index f09a5cd7..efc7a18b 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -188,8 +188,7 @@ function _filter_uri($str) { if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) { - header('HTTP/1.1 400 Bad Request'); - show_error('The URI you submitted has disallowed characters.'); + show_error('The URI you submitted has disallowed characters.', 400); } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 323467b6..e4199cd3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,6 +85,12 @@

    Version 1.7.2

  • Modified directory_map() in the Directory helper to allow the inclusion of hidden files.
  • +
  • General + +
  • Bug fixes for 1.7.2

    @@ -102,6 +108,7 @@

    Bug fixes for 1.7.2

  • Fixed a case sensitive string replacement in xss_clean()
  • Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
  • Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.
  • +
  • Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
  • Version 1.7.1

    diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index df5dfea6..980a5a96 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -58,8 +58,11 @@

    Common Functions

    CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.

    +

    is_really_writable('path/to/file')

    +

    is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

    + if (is_really_writable('file.txt'))
    {
        echo "I could write to this if I wanted to";
    @@ -68,11 +71,25 @@

    is_really_writable('path/to/file')

    {
        echo "File is not writable";
    }
    +

    config_item('item_key')

    The Config library is the preferred way of accessing configuration information, however config_item() can be used to retrieve single keys. See Config library documentation for more information.

    +

    show_error('message'), show_404('page'), log_message('level', 'message')

    These are each outlined on the Error Handling page.

    + +

    set_status_header(code, 'text');

    + +

    Permits you to manually set a server status header. Example:

    + +set_status_header(401);
    +// Sets the header as: Unauthorized
    + +

    See here for a full list of headers.

    +
    + + diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index c1bb6911..af118459 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -71,9 +71,10 @@

    Error Handling

    The following functions let you generate errors:

    -

    show_error('message')

    +

    show_error('message' [, int $status_code= 500 ] )

    This function will display the error message supplied to it using the following error template:

    application/errors/error_general.php

    +

    The optional parameter $status_code determines what HTTP status code should be sent with the error.

    show_404('page')

    This function will display the 404 error message supplied to it using the following error template:

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 6d75fe7b..ba6a0d33 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -100,7 +100,7 @@

    $this->output->set_header();

    $this->output->set_header("Pragma: no-cache"); -

    $this->output->set_status_header();

    +

    $this->output->set_status_header(code, 'text');

    Permits you to manually set a server status header. Example:

    From f6b442bba6666f3265680223e1ef9df08b94eb08 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 11 Jul 2009 18:23:30 +0000 Subject: [PATCH 1689/2544] add 404 headers to show_404() proper instead of in the error_404.php template --- system/application/errors/error_404.php | 1 - system/libraries/Exceptions.php | 2 +- user_guide/changelog.html | 1 + user_guide/installation/upgrade_172.html | 105 +++++++++++++++++++++++ 4 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 user_guide/installation/upgrade_172.html diff --git a/system/application/errors/error_404.php b/system/application/errors/error_404.php index bfe9444b..1c513a20 100644 --- a/system/application/errors/error_404.php +++ b/system/application/errors/error_404.php @@ -1,4 +1,3 @@ - 404 Page Not Found diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 1f99d01c..9c655a17 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -94,7 +94,7 @@ function show_404($page = '') $message = "The page you requested was not found."; log_message('error', '404 Page Not Found --> '.$page); - echo $this->show_error($heading, $message, 'error_404'); + echo $this->show_error($heading, $message, 'error_404', 404); exit; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e4199cd3..56081456 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -88,6 +88,7 @@

    Version 1.7.2

  • General
  • diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html new file mode 100644 index 00000000..ee775a33 --- /dev/null +++ b/user_guide/installation/upgrade_172.html @@ -0,0 +1,105 @@ + + + + + +Upgrading from 1.7.1 to 1.7.2 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +

    CodeIgniter User Guide Version 1.7.1

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    Upgrading from 1.7.1 to 1.7.2

    + +

    Before performing an update you should take your site offline by replacing the index.php file with a static one.

    + + + +

    Step 1: Update your CodeIgniter files

    + +

    Replace these files and directories in your "system" folder with the new versions:

    + +
      + +
    • system/codeigniter
    • +
    • system/database
    • +
    • system/helpers
    • +
    • system/language
    • +
    • system/libraries
    • +
    + +

    Note: If you have any custom developed files in these folders please make copies of them first.

    + +

    Step 2: Remove header() from 404 error template

    +

    If you are using header() in your 404 error template, such as the case with the default error_404.php template shown below, remove that line of code.

    + +<?php header("HTTP/1.1 404 Not Found"); ?> + +

    404 status headers are now properly handled in the show_404() method itself.

    + +

    Step 2: Update your user guide

    +

    Please replace your local copy of the user guide with the new version, including the image files.

    + +
    + + + + + + + \ No newline at end of file From a14ab128263c4fe107f0412f659e96843a63cf30 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 13 Jul 2009 12:01:01 +0000 Subject: [PATCH 1690/2544] spelling in code comment --- system/libraries/Ftp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 90c65946..6fb17049 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -154,13 +154,13 @@ function _is_conn() /** - * Change direcotry + * Change directory * * The second parameter lets us momentarily turn off debugging so that - * this function can be used to test for the existance of a folder + * this function can be used to test for the existence of a folder * without throwing an error. There's no FTP equivalent to is_dir() * so we do it by trying to change to a particular directory. - * Internally, this paramter is only used by the "mirror" function below. + * Internally, this parameter is only used by the "mirror" function below. * * @access public * @param string From 94026d914090861da9c2826508a4597badb86af6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 15 Jul 2009 15:56:58 +0000 Subject: [PATCH 1691/2544] added return FALSE if directory_map() cannot read the directory --- system/helpers/directory_helper.php | 4 ++++ user_guide/changelog.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index b1c49768..a6fb7841 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -72,6 +72,10 @@ function directory_map($source_dir, $top_level_only = FALSE, $hidden = FALSE) closedir($fp); return $filedata; } + else + { + return FALSE; + } } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 56081456..2bbe832d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,7 +82,7 @@

    Version 1.7.2

    • Added form_multiselect() to the Form helper.
    • Modified form_hidden() in the Form helper to accept multi-dimensional arrays.
    • -
    • Modified directory_map() in the Directory helper to allow the inclusion of hidden files.
    • +
    • Modified directory_map() in the Directory helper to allow the inclusion of hidden files, and to return FALSE on failure to read directory.
  • General From 01a9b107cab449d1ce24746612e9cf7074e6608d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 17 Jul 2009 18:30:36 +0000 Subject: [PATCH 1692/2544] modified Form Helper so that form_prep() keeps track of strings it's already processed, to prevent encoding and prep from occurring more than once --- system/helpers/form_helper.php | 31 ++++++++++++++++++++++--------- user_guide/changelog.html | 2 ++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 987ff18e..4c229ae9 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -123,7 +123,7 @@ function form_hidden($name, $value = '', $recursing = FALSE) if ( ! is_array($value)) { - $form .= ''."\n"; + $form .= ''."\n"; } else { @@ -239,8 +239,9 @@ function form_textarea($data = '', $value = '', $extra = '') $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } - - return ""; + + $name = (is_array($data)) ? $data['name'] : $data; + return ""; } } @@ -264,7 +265,7 @@ function form_multiselect($name = '', $options = array(), $selected = array(), $ { $extra .= ' multiple="multiple"'; } - + return form_dropdown($name, $options, $selected, $extra); } } @@ -592,8 +593,10 @@ function form_close($extra = '') */ if ( ! function_exists('form_prep')) { - function form_prep($str = '') + function form_prep($str = '', $field_name = '') { + static $prepped_fields = array(); + // if the field name is an array we do this recursively if (is_array($str)) { @@ -610,11 +613,21 @@ function form_prep($str = '') return ''; } + if (isset($prepped_fields[$field_name])) + { + return $prepped_fields[$field_name]; + } + $str = htmlspecialchars($str); // In case htmlspecialchars misses these. $str = str_replace(array("'", '"'), array("'", """), $str); + if ($field_name != '') + { + $prepped_fields[$field_name] = $str; + } + return $str; } } @@ -643,10 +656,10 @@ function set_value($field = '', $default = '') return $default; } - return form_prep($_POST[$field]); + return form_prep($_POST[$field], $field); } - return form_prep($OBJ->set_value($field, $default)); + return form_prep($OBJ->set_value($field, $default), $field); } } @@ -902,12 +915,12 @@ function _parse_form_attributes($attributes, $default) } $att = ''; - + foreach ($default as $key => $val) { if ($key == 'value') { - $val = form_prep($val); + $val = form_prep($val, $default['name']); } $att .= $key . '="' . $val . '" '; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2bbe832d..42529d1f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,6 +82,8 @@

    Version 1.7.2

    • Added form_multiselect() to the Form helper.
    • Modified form_hidden() in the Form helper to accept multi-dimensional arrays.
    • +
    • Modified form_prep() in the Form helper to keep track of prepped fields to avoid multiple prep/mutation from subsequent calls which can occur when using Form Validation + and form helper functions to output form fields.
    • Modified directory_map() in the Directory helper to allow the inclusion of hidden files, and to return FALSE on failure to read directory.
  • From 3eb9faceb9fedb0fa50a2b2d1fc4952c2652af70 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 17 Jul 2009 20:25:13 +0000 Subject: [PATCH 1693/2544] modification to form_prep() solution. A bandaid really, to return the $str if the field has already been prepped --- system/helpers/form_helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 4c229ae9..c5e977a4 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -613,9 +613,13 @@ function form_prep($str = '', $field_name = '') return ''; } + // we've already prepped a field with this name + // @todo need to figure out a way to namespace this so + // that we know the *exact* field and not just one with + // the same name if (isset($prepped_fields[$field_name])) { - return $prepped_fields[$field_name]; + return $str; } $str = htmlspecialchars($str); From 8db2d5ebf30d7d8e648f36e9d669297a9a52cd3d Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 17 Jul 2009 22:07:04 +0000 Subject: [PATCH 1694/2544] Added heading tags to skippable elements in the typography class- started as 1.6 EE bug fix- carried over. --- system/libraries/Typography.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index a1683936..242ca3cb 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -30,7 +30,7 @@ class CI_Typography { var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'; // Elements that should not have

    and
    tags within them. - var $skip_elements = 'p|pre|ol|ul|dl|object|table'; + var $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; // Tags we want the parser to completely ignore when splitting the string. var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 42529d1f..7bf5028d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -112,6 +112,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
  • Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.
  • Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
  • +
  • Fixed a bug in the typography class where heading tags could have paragraph tags inserted when using auto_typography().
  • Version 1.7.1

    From 1414987474e8d9a96e640ba9378d447677cfc387 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 22 Jul 2009 11:52:09 +0000 Subject: [PATCH 1695/2544] nav links in html helper --- user_guide/helpers/html_helper.html | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index ec924241..94a98b93 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -60,6 +60,16 @@

    HTML Helper

    The HTML Helper file contains functions that assist in working with HTML.

    +

    Loading this Helper

    @@ -68,17 +78,18 @@

    Loading this Helper

    The following functions are available:

    -

    br()

    +

    br()

    Generates line break tags (<br />) based on the number you submit. Example:

    echo br(3);

    The above would produce: <br /><br /><br />

    -

    heading()

    +

    heading()

    Lets you create HTML <h1> tags. The first parameter will contain the data, the second the size of the heading. Example:

    echo heading('Welcome!', 3);

    The above would produce: <h3>Welcome!</h3>

    -

    img()

    + +

    img()

    Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

    echo img('images/picture.jpg');
    // gives <img src="http://site.com/images/picture.jpg" />
    @@ -98,7 +109,8 @@

    img()


    img($image_properties);
    // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" />

    -

    link_tag()

    + +

    link_tag()

    Lets you create HTML <link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates. echo link_tag('css/mystyles.css');
    // gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />

    @@ -123,12 +135,12 @@

    link_tag()

    echo link_tag($link);
    // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    -

    nbs()

    +

    nbs()

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    echo nbs(3);

    The above would produce: &nbsp;&nbsp;&nbsp;

    -

    ol()  and  ul()

    +

    ol()  and  ul()

    Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

    @@ -252,7 +264,7 @@

    ol()  and  ul()

    -

    meta()

    +

    meta()

    Helps you generate meta tags. You can pass strings to the function, or simple arrays, or multidimensional ones. Examples:

    @@ -290,7 +302,7 @@

    meta()

    -

    doctype()

    +

    doctype()

    Helps you generate document type declarations, or DTD's. XHTML 1.0 Strict is used by default, but many doctypes are available.

    From 086ee5a06dc2a9b8273574c8c883efdbaa815765 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 28 Jul 2009 14:42:12 +0000 Subject: [PATCH 1696/2544] add is_php() to Common.php --- system/codeigniter/Common.php | 23 +++++++++++++++++++++++ user_guide/changelog.html | 1 + user_guide/general/common_functions.html | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 340be245..39005f60 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -29,6 +29,29 @@ // ------------------------------------------------------------------------ +/** +* Determines if the current version of PHP is greater then the supplied value +* +* Since there are a few places where we conditionally test for PHP > 5 +* we'll set a static variable. +* +* @access public +* @return bool +*/ + function is_php($version = '5.0.0') + { + static $_is_php; + + if ( ! isset($_is_php[$version])) + { + $_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE; + } + + return $_is_php[$version]; + } + +// ------------------------------------------------------------------------ + /** * Tests for file writability * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7bf5028d..1de9effe 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -92,6 +92,7 @@

    Version 1.7.2

  • Modified show_error() to allow sending of HTTP server response codes.
  • Modified show_404() to send 404 status code, removing non-CGI compatible header() statement from error_404.php template.
  • Added set_status_header() to the Common functions to allow use when the Output class is unavailable.
  • +
  • Added is_php() to Common functions to facilitate PHP version comparisons.

  • diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 980a5a96..1f439442 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -59,6 +59,18 @@

    Common Functions

    CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers.

    +

    is_php('version_number')

    + +

    is_php() determines of the PHP version being used is greater than the supplied version_number.

    + +if (is_php('5.3.0'))
    +{
    +    $str = quoted_printable_encode($str);
    +}
    + +

    Returns boolean TRUE if the installed version of PHP is equal to or greater than the supplied version number. Returns FALSE if the installed version of PHP is lower than the supplied version number.

    + +

    is_really_writable('path/to/file')

    is_writable() returns TRUE on Windows servers when you really can't write to the file as the OS reports to PHP as FALSE only if the read-only attribute is marked. This function determines if a file is actually writable by attempting to write to it first. Generally only recommended on platforms where this information may be unreliable.

    From 5bcfd2e83e52155f199058479ac116a136f334a3 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 28 Jul 2009 14:42:42 +0000 Subject: [PATCH 1697/2544] whitespace --- system/codeigniter/Common.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 39005f60..f45c85c2 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -38,18 +38,18 @@ * @access public * @return bool */ - function is_php($version = '5.0.0') - { - static $_is_php; - - if ( ! isset($_is_php[$version])) - { - $_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE; - } +function is_php($version = '5.0.0') +{ + static $_is_php; - return $_is_php[$version]; + if ( ! isset($_is_php[$version])) + { + $_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE; } + return $_is_php[$version]; +} + // ------------------------------------------------------------------------ /** From de8f409e84c4b2c428cba3f2845f2658d3db9b90 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Wed, 29 Jul 2009 13:46:37 +0000 Subject: [PATCH 1698/2544] Updating the smiley helper to work with more than one field. Also changing insertion position to be at the cursor and using ids instead of form names. --- system/helpers/smiley_helper.php | 140 ++++++++++++++++++++++---- user_guide/changelog.html | 2 + user_guide/helpers/smiley_helper.html | 43 +++++--- 3 files changed, 148 insertions(+), 37 deletions(-) diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index f9a2cf2b..f085e53b 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -28,29 +28,91 @@ // ------------------------------------------------------------------------ /** - * JS Insert Smiley + * Smiley Javascript * - * Generates the javascrip function needed to insert smileys into a form field + * Returns the javascript required for the smiley insertion. Optionally takes + * an array of aliases to loosely couple the smiley array to the view. * * @access public - * @param string form name - * @param string field name - * @return string + * @param mixed alias name or array of alias->field_id pairs + * @param string field_id if alias name was passed in + * @return array */ -if ( ! function_exists('js_insert_smiley')) +if ( ! function_exists('smiley_js')) { - function js_insert_smiley($form_name = '', $form_field = '') - { - return << - function insert_smiley(smiley) + function smiley_js($alias = '', $field_id = '') { - document.{$form_name}.{$form_field}.value += " " + smiley; - } - + static $do_setup = TRUE; + + $r = ''; + + if ($alias != '' && ! is_array($alias)) + { + $alias = array($alias => $field_id); + } + + if ($do_setup === TRUE) + { + $do_setup = FALSE; + + $m = array(); + + if (is_array($alias)) + { + foreach($alias as $name => $id) + { + $m[] = '"'.$name.'" : "'.$id.'"'; + } + } + + $m = '{'.implode(',', $m).'}'; + + $r .= << $id) + { + $r .= 'smiley_map["'.$name.'"] = "'.$id.'";'."\n"; + } + } + } + + return ''; } } + // ------------------------------------------------------------------------ /** @@ -65,8 +127,15 @@ function insert_smiley(smiley) */ if ( ! function_exists('get_clickable_smileys')) { - function get_clickable_smileys($image_url = '', $smileys = NULL) + function get_clickable_smileys($image_url, $alias = '', $smileys = NULL) { + // For backward compatibility with js_insert_smiley + + if (is_array($alias)) + { + $smileys = $alias; + } + if ( ! is_array($smileys)) { if (FALSE === ($smileys = _get_smiley_array())) @@ -76,8 +145,8 @@ function get_clickable_smileys($image_url = '', $smileys = NULL) } // Add a trailing slash to the file path if needed - $image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url); - + $image_url = rtrim($image_url, '/').'/'; + $used = array(); foreach ($smileys as $key => $val) { @@ -89,12 +158,12 @@ function get_clickable_smileys($image_url = '', $smileys = NULL) { continue; } - - $link[] = "\"".$smileys[$key][3]."\""; - + + $link[] = "\"".$smileys[$key][3]."\""; + $used[$smileys[$key][0]] = TRUE; } - + return $link; } } @@ -170,6 +239,35 @@ function _get_smiley_array() } } +// ------------------------------------------------------------------------ + +/** + * JS Insert Smiley + * + * Generates the javascript function needed to insert smileys into a form field + * + * DEPRECATED as of version 1.7.2, use smiley_js instead + * + * @access public + * @param string form name + * @param string field name + * @return string + */ +if ( ! function_exists('js_insert_smiley')) +{ + function js_insert_smiley($form_name = '', $form_field = '') + { + return << + function insert_smiley(smiley) + { + document.{$form_name}.{$form_field}.value += " " + smiley; + } + +EOF; + } +} + /* End of file smiley_helper.php */ /* Location: ./system/helpers/smiley_helper.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 1de9effe..354652fd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -85,6 +85,7 @@

    Version 1.7.2

  • Modified form_prep() in the Form helper to keep track of prepped fields to avoid multiple prep/mutation from subsequent calls which can occur when using Form Validation and form helper functions to output form fields.
  • Modified directory_map() in the Directory helper to allow the inclusion of hidden files, and to return FALSE on failure to read directory.
  • +
  • Modified the Smiley helper to work with multiple fields and insert the smiley at the last known cursor position.
  • General @@ -110,6 +111,7 @@

    Bug fixes for 1.7.2

  • Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
  • Fixed a bug in the XML-RPC class with parsing dateTime.iso8601 data types.
  • Fixed a case sensitive string replacement in xss_clean()
  • +
  • Fixed a bug in form_textarea() where form data was not prepped correctly.
  • Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
  • Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.
  • Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
  • diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 3c88bcf7..8c85cb3f 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -111,10 +111,10 @@

    The Controller

    $this->load->helper('smiley'); $this->load->library('table'); - $image_array = get_clickable_smileys('http://example.com/images/smileys/'); - - $col_array = $this->table->make_columns($image_array, 8); - + $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comments'); + + $col_array = $this->table->make_columns($image_array, 8); + $data['smiley_table'] = $this->table->generate($col_array); $this->load->view('smiley_view', $data); @@ -126,19 +126,18 @@

    The Controller

    In your application/views/ folder, create a file called smiley_view.php and place this code in it:

    - -

    When you have created the above controller and view, load it by visiting http://www.your=site.com/index.php/smileys/

    +

    When you have created the above controller and view, load it by visiting http://www.example.com/index.php/smileys/

    -

    Function Reference

    +

    Field Aliases

    + +

    When making changes to a view it can be inconvenient to have the field id in the controller. To work around this, +you can give your smiley links a generic name that will be tied to a specific id in your view.

    +$image_array = get_smiley_links("http://example.com/images/smileys/", "comment_textarea_alias"); + +

    To map the alias to the field id, pass them both into the smiley_js function:

    +$image_array = smiley_js("comment_textarea_alias", "comments"); + + +

    Function Reference

    get_clickable_smileys()

    Returns an array containing your smiley images wrapped in a clickable link. You must supply the URL to your smiley folder -via the first parameter:

    +and a field id or field alias.

    -$image_array = get_clickable_smileys("http://example.com/images/smileys/"); +$image_array = get_smiley_links("http://example.com/images/smileys/", "comment"); +

    Note: Usage of this function without the second parameter, in combination with js_insert_smiley has been deprecated.

    -

    js_insert_smiley()

    +

    smiley_js()

    Generates the JavaScript that allows the images to be clicked and inserted into a form field. -The first parameter must contain the name of your form, the second parameter must contain the name of the -form field. This function is designed to be placed into the <head> area of your web page.

    +If you supplied an alias instead of an id when generating your smiley links, you need to pass the +alias and corresponding form id into the function. +This function is designed to be placed into the <head> area of your web page.

    -<?php echo js_insert_smiley('blog', 'comments'); ?> +<?php echo smiley_js(); ?> +

    Note: This function replaces js_insert_smiley, which has been deprecated.

    parse_smileys()

    @@ -178,7 +190,6 @@

    parse_smileys()

    equivalent. The first parameter must contain your string, the second must contain the URL to your smiley folder:

    - $str = 'Here are some simileys: :-) ;-)'; $str = parse_smileys($str, "http://example.com/images/smileys/"); From f0a9b332445977cfb05fee2dacc02667946a9cd2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 29 Jul 2009 14:19:18 +0000 Subject: [PATCH 1699/2544] PHP 5.3.0 compatibility changes --- system/codeigniter/CodeIgniter.php | 6 +++--- system/codeigniter/Common.php | 24 +++++++++++++++++++++--- system/database/DB.php | 2 +- system/libraries/Loader.php | 2 +- system/libraries/Profiler.php | 4 ++-- system/libraries/URI.php | 4 +++- user_guide/changelog.html | 1 + 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php index 68f6c759..b78736a0 100644 --- a/system/codeigniter/CodeIgniter.php +++ b/system/codeigniter/CodeIgniter.php @@ -56,8 +56,8 @@ * Define a custom error handler so we can log PHP errors * ------------------------------------------------------ */ -set_error_handler('_exception_handler'); -set_magic_quotes_runtime(0); // Kill magic quotes +//set_error_handler('_exception_handler'); +@set_magic_quotes_runtime(0); // Kill magic quotes /* * ------------------------------------------------------ @@ -130,7 +130,7 @@ * Note: The Loader class needs to be included first * */ -if (floor(phpversion()) < 5) +if ( ! is_php(5)) { load_class('Loader', FALSE); require(BASEPATH.'codeigniter/Base4'.EXT); diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index f45c85c2..1ffed6a0 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -150,16 +150,34 @@ function &load_class($class, $instantiate = TRUE) if ($is_subclass == TRUE) { $name = config_item('subclass_prefix').$class; - $objects[$class] =& new $name(); + + $objects[$class] =& instantiate_class(new $name()); return $objects[$class]; } $name = ($class != 'Controller') ? 'CI_'.$class : $class; - - $objects[$class] =& new $name(); + + $objects[$class] =& instantiate_class(new $name()); return $objects[$class]; } +/** + * Instantiate Class + * + * Returns a new class object by reference, used by load_class() and the DB class. + * Required to retain PHP 4 compatibility and also not make PHP 5.3 cry. + * + * Use: $obj =& instantiate_class(new Foo()); + * + * @access public + * @param object + * @return object + */ +function &instantiate_class(&$class_object) +{ + return $class_object; +} + /** * Loads the main config.php file * diff --git a/system/database/DB.php b/system/database/DB.php index efe1d388..0f734d74 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -130,7 +130,7 @@ function &DB($params = '', $active_record_override = FALSE) // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; - $DB =& new $driver($params); + $DB =& instantiate_class(new $driver($params)); if ($DB->autoinit == TRUE) { diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index d615a136..781c83c6 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -252,7 +252,7 @@ function dbutil() require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; - $CI->dbutil =& new $class(); + $CI->dbutil =& instantiate_class(new $class()); $CI->load->_ci_assign_to_models(); } diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 98cec065..ecd0e708 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -103,11 +103,11 @@ function _compile_benchmarks() function _compile_queries() { $dbs = array(); - + // Let's determine which databases are currently connected to foreach (get_object_vars($this->CI) as $CI_object) { - if ( is_subclass_of(get_class($CI_object), 'CI_DB') ) + if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB') ) { $dbs[] = $CI_object; } diff --git a/system/libraries/URI.php b/system/libraries/URI.php index efc7a18b..68b67805 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -186,7 +186,9 @@ function _filter_uri($str) { if ($str != '' && $this->config->item('permitted_uri_chars') != '' && $this->config->item('enable_query_strings') == FALSE) { - if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) + // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards + // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern + if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str)) { show_error('The URI you submitted has disallowed characters.', 400); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 354652fd..61a02804 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

    Version 1.7.2

  • General
  • diff --git a/user_guide/images/codeigniter_1.7.1_helper_reference.pdf b/user_guide/images/codeigniter_1.7.1_helper_reference.pdf new file mode 100644 index 0000000000000000000000000000000000000000..85af7c83ba79a27fc075aedcb3cc0cec75656b7b GIT binary patch literal 499096 zcmeFYcQoAV_dhBpM+ylNBGDy!j}pB^v>=Gyi59(=VFr^B(TNfzT6Cgi^zKCOqm4c$ zjNS)h7-jBoKIeSCzq{@~cdfhbx@+B^Kk%ONy!W%qYrpn>_M7Fcydn=juOJai&vtAM z5kKQ|MpsJ*B1uU;9X~f4Mm{+UFAFDETOz)<7PdB?i~{)gwTPspiELb~uRcd~^}_%1 zh3n4|@yWS*yLd736Y;6qTYEAZzqtCI>Hqwq;D5jP*2C4>+sej+k^QZWho`-lC!@CO zdoO^6hYh2wryE{CMjl200Kn_^_q)7SuFf3)b19+!F7>z21{#(QHdbCleA?cYUf0`D zcE*cO#HVj>?PbR(ASC*ni0`$Hy{(-Wqu`6@qF3TNxq4{3SyEN|muZ)KyU^ooe@ z6qO5(g>2t5TB?h2j`=dgFe!bTCv@E^C!@& zj+venGGC{jTuh-0nkv4K4j9IjBE}ptsu*-@09mG{h;mobkVP_r>z@z8o+p2OL;+fT zG6Q^8^8fhzRs8P{+hL*qy|UBol)Lfod)1sv+5cV;7(GJ0{qI#-gfIKQS0D5gBq{#A zdRg*}p6K7J@46323IDws`SE}6b{~T7g)Y7yc$7hx?CtGTCX^j$;NLoUQ_TFagwP;szM#x?%=R0GE#Rcm7Skg~=j0yQCgs-dH zQP3=e*nuyL!T&7E%}S|0=lC#X!wp7w>+jtekzOhML(n>EBwALK_R|#RGx(D0m*e9} zMan646N>X#b5fTK%JMYd@^#jKEcNon^{y$bPj*tXmk_X;{r>VR@iNce?MyGtjvj8| zE}^88fdE-IQ-G*JiIQsgKlX26y3)ayro}qvZ?8W!J-wq(xVTdl#0D;-zZ-zgt&w9W zqr0%%=^~w?$FBSq9BzCxo#5Uwv&T{8H%G# z-<}o5PIQu11Xl0v4U@ErHnsi*{67i3?1-F;8v#BS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j3Fuqw6pcGB zN8x22mqv|b3B!wS7fC{`x)2x#H-R>ldy*<58!V*re9Mxy$cB0;pYOx44)bm5^ddh^ z&eZS0OUaY9MOuiWB~T_&soFu&jxZwU#9`8umS)h35*Z^#F)w~$4j}IXC6I{whP;Z@5C{3j zI43JYKcrbrm9Zmm^jNl6mc)c0&twSd$z9h>EI%fmP4vT1mf=@;j%)B;DxZ9r*h&~*e^;Ff;(J=e4vyZ=@Dr2?&JIev=@5+9 zZnB;0{K_9=V_nG)@7MhN>;4!A){rK`b&SCfp~Wz(!%8AP&pb*SHv0J|wcb5h(A}`cQ8TdafBAQ7(A-=xbn%o1*(2DI95EvU*Ma;;>@jx)YOn2nvjF)F! zjS5hwfj?HQ8ewZ(Y9zmL9aV0=um##a-mH6%C3C40;pUy&8(nRo%=WR6$;jUs`Emy4 zTS6c3NO#aGvKR0=Q+(6vvtuJ%1+tdwH{(4(d*$ZUgdzLGO51Qi)iTxFOvsXa+{rTi zLf-)D*;h|BcWVHO`)IQB%2zQ@+X3;|swn`7*NB|JPsV_dN%+dgbSjB@7c$l^K!ZlB5|oRSYlr1AGuAaUSw9@0ql2OH?JL1I|~@Q4a| z70`?_yB$p@8Bt95ybwzR^;>8=(C-ODT`9n@48XAFNH%8Q`~yXbx*`f5VYyy(oV3-* z^3DuNr?cMw3h?owSzT!0s4${7S#7#HXN?7^n_@!LvSEYc z1)v1209(VY*+4qdFta;ATIwb54Gs951QS>}?Fi>&wkvnNKrYkzw@R&*C@WLykGm=z zSvK{VV&tK(>L7x4cA2_Iz8a>gnfB+(n~|SKGyLShmlNZ`@vcC_7{_q!Wkkbd +

    + +
    + + + + + +

    CodeIgniter User Guide Version 1.7.1

    +
    + + + + + + + + + +
    + + +
    + + + +
    + +

    CodeIgniter Cheatsheets

    + +

    Library Reference

    + +
    CodeIgniter Library Reference
    + +

    Helpers Reference

    +
    CodeIgniter Library Reference
    + +
    + + + + + + + \ No newline at end of file diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 7d9875bf..530ee906 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -107,7 +107,7 @@

    CodeIgniter Features

    diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d6bf9b70..8a4d70b3 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -750,7 +750,7 @@

    $this->db->flush_cache()

    User Guide Home   ·   Next Topic:  Transactions

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index d25e5564..b550a890 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -213,7 +213,7 @@

    $this->db->cache_delete_all()

    User Guide Home   ·   Next Topic:  Database manipulation with Database Forge

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 88e5779a..19c1dd48 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -111,7 +111,7 @@

    $this->db->call_function();

    User Guide Home   ·   Next Topic:  Query Caching

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index c6535db6..dcced6cf 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -150,7 +150,7 @@

    Explanation of Values:

    User Guide Home   ·   Next Topic:  Connecting to your Database

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 700c9ee0..fb766288 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -179,7 +179,7 @@

    Reconnecting / Keeping the Connection Alive

    User Guide Home   ·   Next Topic:  Queries

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 9b7b97a4..d20b77d7 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -210,7 +210,7 @@

    Active Record Insert

    User Guide Home   ·   Next Topic:  Database Configuration

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index a3ad20fd..5cc2441c 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -156,7 +156,7 @@

    $this->db->field_data()

    User Guide Home   ·   Next Topic:  Custom Function Calls

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 7b7925c6..d02046af 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -227,7 +227,7 @@

    $this->dbforge->modify_column()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Database Utilities Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 641d4411..0d38d8f6 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -144,7 +144,7 @@

    $this->db->update_string();

    User Guide Home   ·   Next Topic:  Active Record Pattern

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 504e0f39..46b299fe 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -92,7 +92,7 @@

    The Database Class

    User Guide Home   ·   Next Topic:  Quick Start: Usage Examples

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 45c53e5a..f51ee07a 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -146,7 +146,7 @@

    Query Bindings

    User Guide Home   ·   Next Topic:  Query Results

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 5fb0961a..f944a64c 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -231,7 +231,7 @@

    $query->free_result()

    User Guide Home   ·   Next Topic:  Query Helper Functions

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index ac9ebd84..2bc75c25 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -106,7 +106,7 @@

    $this->db->table_exists();

    User Guide Home   ·   Next Topic:   Field Metadata

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index ad285cc4..94022f69 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -193,7 +193,7 @@

    Running Transactions Manually

    User Guide Home   ·   Next Topic:  Table Metadata

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 9f37196e..a26e0f35 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -288,7 +288,7 @@

    Description of Backup Preferences

    Top of Page   ·   User Guide Home   ·   Next Topic:   Email Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 2530b392..7021b9d2 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -79,7 +79,7 @@

    Files

    Top of Page   ·   User Guide Home   ·  

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index a6b4b34b..05bdafd0 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -121,7 +121,7 @@

    $this->foo->bar()

    User Guide Home   ·   Next Topic:  Next Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 961574a3..fc9653de 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -140,7 +140,7 @@

    Alternative Control Structures

    User Guide Home   ·   Next Topic:  Security

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index ab83c5e2..30aa0a61 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -110,7 +110,7 @@

    get_instance()

    User Guide Home   ·   Next Topic:  Auto-loading Resources

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 4ec77471..ba87c771 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -94,7 +94,7 @@

    Auto-loading Resources

    Top of Page   ·   User Guide Home   ·   Next Topic:  Common Functions

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 6a723985..64dbab82 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -108,7 +108,7 @@

    Deleting Caches

    User Guide Home   ·   Next Topic:  Profiling Your Application

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index ae1b99ba..696815e2 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -112,7 +112,7 @@

    set_status_header(code, 'text');

    Top of Page   ·   User Guide Home   ·   Next Topic:  Scaffolding

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 981ab60f..3eda8c4a 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -378,7 +378,7 @@

    That's it!

    Top of Page   ·   User Guide Home   ·   Next Topic:  Reserved Names

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index a27499d2..1f95173f 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -178,7 +178,7 @@

    Setting Your Own Prefix

    User Guide Home   ·   Next Topic:  Hooks - Extending the Core

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index d0facf12..aaecbdc4 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -291,7 +291,7 @@

    Setting Your Own Prefix

    User Guide Home   ·   Next Topic:  Creating Core System Classes

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index d0a692d0..d0597bce 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -79,7 +79,7 @@

    Credits

    User Guide Home   ·   Next Topic:  Downloading CodeIgniter

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 5eb14d4f..cf50319a 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -131,7 +131,7 @@

    log_message('level', 'message')

    User Guide Home   ·   Next Topic:  Page Caching

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 168aac23..80a06c8c 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -178,7 +178,7 @@

    Now What?

    User Guide Home   ·   Next Topic:  Plugins

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 651baefe..eb0d99ac 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -160,7 +160,7 @@

    Hook Points

    User Guide Home   ·   Next Topic:  Auto-loading Resources

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index a51f6fe7..aec9f121 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -87,7 +87,7 @@

    Creating Your Own Libraries

    User Guide Home   ·   Next Topic:  Creating Libraries

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 7862c02a..195480ca 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -126,7 +126,7 @@

    Running Multiple Applications with one CodeIgniter Installation

    User Guide Home   ·   Next Topic:  Alternative PHP Syntax

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/models.html b/user_guide/general/models.html index aeb11b5a..878934bc 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -244,7 +244,7 @@

    Connecting to your Database

    User Guide Home   ·   Next Topic:  Helpers

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index eca425c5..58ae22e7 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -120,7 +120,7 @@

    Using a Plugin

    User Guide Home   ·   Next Topic:  Using Libraries

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 9924df3e..f0c550b1 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -97,7 +97,7 @@

    Setting Benchmark Points

    User Guide Home   ·   Next Topic:  Managing Applications

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 3709dec6..74ea0a7f 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -70,7 +70,7 @@

    Quick Reference Chart

    Top of Page   ·   User Guide Home

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index a45111e5..fab9d6f1 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -75,7 +75,7 @@

    Server Requirements

    User Guide Home   ·   Next Topic:  License Agreement

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 25a24129..2d637e8e 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -149,7 +149,7 @@

    Constants

    Top of Page   ·   User Guide Home   ·   Next Topic:  Views

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 23101230..ab79c926 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -169,7 +169,7 @@

    Reserved Routes

    User Guide Home   ·   Next Topic:  Error Handling

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 18e0dada..8597b6c1 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -140,7 +140,7 @@

    A Final Note:

    Top of Page   ·   User Guide Home   ·   Next Topic:  URI Routing

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/security.html b/user_guide/general/security.html index ea42013d..40ec5e28 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -146,7 +146,7 @@

    Best Practices

    User Guide Home   ·   Next Topic:  PHP Style Guide

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index c378f8ec..2a5c440b 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -680,7 +680,7 @@

    Overlapping Tag Parameters

    User Guide Home   ·   Next Topic:  Writing Documentation

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 7fe16c33..6a61c340 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -144,7 +144,7 @@

    Enabling Query Strings

    Top of Page   ·   User Guide Home   ·   Next Topic:  Controllers

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 0af60a27..3ad9699e 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -267,7 +267,7 @@

    Returning views as data

    User Guide Home   ·   Next Topic:  Models

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 43781a00..f0986402 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -112,7 +112,7 @@

    random_element()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Compatibility Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index 04c145dd..15712eb4 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -111,7 +111,7 @@

    stripos()

    User Guide Home   ·   Next Topic:  Cookie Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index bf148fe1..7b1a171a 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -140,7 +140,7 @@

    delete_cookie()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Date Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index e1d0cc28..2ec17fb3 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -401,7 +401,7 @@

    Timezone Reference

    User Guide Home   ·   Next Topic:  Directory Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index a8badfd1..eae2c52e 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -136,7 +136,7 @@

    directory_map('source directory')

    User Guide Home   ·   Next Topic:  Download Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 511b7d66..5c1c2670 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -105,7 +105,7 @@

    force_download('filename', 'data')

    Top of Page   ·   User Guide Home   ·   Next Topic:  Email Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index b723e538..01579f82 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -95,7 +95,7 @@

    send_email('recipient', 'subject', 'message Top of Page   ·   User Guide Home   ·   Next Topic:  File Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index b3f81be1..358aa982 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -172,7 +172,7 @@

    octal_permissions($perms)

    Top of Page   ·   User Guide Home   ·   Next Topic:  Form Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 4ddde622..06967860 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -477,7 +477,7 @@

    set_radio()

    User Guide Home   ·   Next Topic:  HTML Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index b288e623..a6920ee1 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -378,7 +378,7 @@

    doctype()

    Top of Page   ·   User Guide Home   ·   Next Topic:   Path Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 06262421..ba25e071 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -144,7 +144,7 @@

    humanize()

    User Guide Home   ·   Next Topic:  Number Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index ed6daf35..e21a605a 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -91,7 +91,7 @@

    lang('language line', 'element id')

    User Guide Home   ·   Next Topic:  Download Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index b9b7152b..722b7f6e 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -100,7 +100,7 @@

    byte_format()

    User Guide Home   ·   Next Topic:  Path Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index cf910a93..232c1b6b 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -99,7 +99,7 @@

     

    User Guide Home   ·   Next Topic:  Security Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index dfc813c6..e7320001 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -119,7 +119,7 @@

    encode_php_tags()

    Top of Page   ·   User Guide Home   ·   Next Topic:  Smiley Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 1acfcc9b..5bc58a33 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -208,7 +208,7 @@

    parse_smileys()

    User Guide Home   ·   Next Topic:  String Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 633342cd..36fa40f9 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -169,7 +169,7 @@

    strip_quotes()

    User Guide Home   ·   Next Topic:  Text Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index c7281f50..120b3803 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -185,7 +185,7 @@

    word_wrap()

    User Guide Home   ·   Next Topic:  Typography Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index c84bc000..046da425 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -105,7 +105,7 @@

    nl2br_except_pre()

    User Guide Home   ·   Next Topic:  URL Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index e6fe5f2f..f9435e0b 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -282,7 +282,7 @@

    redirect()

    User Guide Home   ·   Next Topic:  XML Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index afe7c897..495b80b6 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -98,7 +98,7 @@

    xml_convert('string')

    Top of Page   ·   User Guide Home

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/index.html b/user_guide/index.html index e949de59..a234b19b 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -90,7 +90,7 @@

    Who is CodeIgniter For?

    diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index d5010df0..15c0f303 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -98,7 +98,7 @@

    Subversion Server

    User Guide Home   ·   Next Topic:  Installation Instructions

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 3e17b111..f960e285 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -90,7 +90,7 @@

    Installation Instructions

    Next Topic:  Upgrading from a Previous Version

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 430fc281..08c5d9ff 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -83,7 +83,7 @@

    Troubleshooting

    User Guide Home   ·   Next Topic:  CodeIgniter at a Glance

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 91450cb7..2ac9ab26 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -85,7 +85,7 @@

    Upgrading From Beta 1.0 to Final 1.2

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index 37c5c60e..b36f39de 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -196,7 +196,7 @@

    Step 6: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 90b6f181..002f07c5 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -95,7 +95,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 53df8050..01a17624 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -93,7 +93,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 0b7fb7da..f12a9600 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -105,7 +105,7 @@

    Step 3: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index ee9a431f..e3f6d829 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -138,7 +138,7 @@

    Step 3: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 1c0c7f55..886542d6 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -141,7 +141,7 @@

    Step 4: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 0846ffd3..4ebc78c5 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -171,7 +171,7 @@

    Step 5: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 9ed53530..7930638f 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -104,7 +104,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 891d8aa5..52efd708 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -93,7 +93,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 5f7f9839..c241160a 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -109,7 +109,7 @@

    Step 4: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index f46f176f..35da95b7 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -118,7 +118,7 @@

    Step 5: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index c0b884d7..2a9d047a 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -91,7 +91,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index f20e1a4d..0e86d5c5 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -99,7 +99,7 @@

    Step 5: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 69ae5c25..54a7c559 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -92,7 +92,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 61a8833c..d3715e14 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -114,7 +114,7 @@

    Step 4: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index 2f63212f..9b37bd12 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -91,7 +91,7 @@

    Step 2: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index 0fd192b9..f4f3c03f 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -98,7 +98,7 @@

    Step 3: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_173.html b/user_guide/installation/upgrade_173.html index d395c1fd..6f306d19 100644 --- a/user_guide/installation/upgrade_173.html +++ b/user_guide/installation/upgrade_173.html @@ -99,7 +99,7 @@

    Step 3: Update your user guide

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 8c1980d1..647dd885 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -137,7 +137,7 @@

    Step 5: Edit your config file

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 907917ec..14a4455c 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -94,7 +94,7 @@

    Upgrading From a Previous Version

    User Guide Home   ·   Next Topic:  Troubleshooting

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 0a0598f4..30db0deb 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -191,7 +191,7 @@

    Displaying Memory Consumption

    User Guide Home   ·   Next Topic:  Calendar Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 4f28f275..187aade0 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -242,7 +242,7 @@

    Creating a Calendar Template

    User Guide Home   ·   Next Topic:  Cart Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index cb623254..2aec24be 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -339,7 +339,7 @@

    $this->cart->destroy();

    User Guide Home   ·   Next Topic:  Config Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index e4963002..d911a427 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -174,7 +174,7 @@

    $this->config->system_url();

    User Guide Home   ·   Next Topic:  Database Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 20b77eba..3b38b268 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -300,7 +300,7 @@

    Overriding Word Wrapping

    User Guide Home   ·   Next Topic:  Encryption Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 124b6479..3b2846ac 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -183,7 +183,7 @@

    $this->encrypt->sha1();

    User Guide Home   ·   Next Topic:  File Uploading Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 550dc87d..35ef1798 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -441,7 +441,7 @@

    Explanation

    User Guide Home   ·   Next Topic:  Form Validation Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 799a714f..400af0e5 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1214,7 +1214,7 @@

    set_radio()

    User Guide Home   ·   Next Topic:  FTP Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index bd64690c..c0c8e620 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -296,7 +296,7 @@

    $this->ftp->close();

    User Guide Home   ·   Next Topic:  HTML Table Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 3b81d53c..b6a34472 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -659,7 +659,7 @@

    Overlay Preferences

    User Guide Home   ·   Next Topic:  Input Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index e7c21de3..dbc79257 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -224,7 +224,7 @@

    $this->input->user_agent()

    User Guide Home   ·   Next Topic:  Loader Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index bb102956..eb4835a1 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -130,7 +130,7 @@

    Auto-loading Languages

    User Guide Home   ·   Next Topic:  Output Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index ec73579c..19a10e4d 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -207,7 +207,7 @@

    $this->load->config('file_name')

    User Guide Home   ·   Next Topic:  Language Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index f2bfffbf..1e425910 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -138,7 +138,7 @@

    $this->output->cache();

    User Guide Home   ·   Next Topic:  Pagination Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index c589807d..187b331f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -211,7 +211,7 @@

    $config['num_tag_close'] = '</div>';

    User Guide Home   ·   Next Topic:  Session Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index a8549f11..4bf63efb 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -201,7 +201,7 @@

    Variable Pairs

    User Guide Home   ·   Next Topic:  Typography

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index eabad035..11313b51 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -304,7 +304,7 @@

    Session Preferences

    User Guide Home   ·   Next Topic:  Trackback Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 8094dab4..1c67e4b8 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -285,7 +285,7 @@

    $this->table->clear()

    User Guide Home   ·   Next Topic:  Image Manipulation Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 4a904bb8..9e54bbfb 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -239,7 +239,7 @@

    Notes:

    User Guide Home   ·   Next Topic:  Template Parser Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index a53d7e73..bcb2e66c 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -153,7 +153,7 @@

    protect_braced_quotes

    User Guide Home   ·   Next Topic:  Unit Testing Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index a30343fb..b9916045 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -199,7 +199,7 @@

    Creating a Template

    User Guide Home   ·   Next Topic:  URI Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 0995f75e..818115ff 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -245,7 +245,7 @@

    $this->uri->rsegment_array()

    User Guide Home   ·   Next Topic:  User Agent Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index bddd77ce..98bd7b12 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -194,7 +194,7 @@

    $this->agent->accept_charset()

    User Guide Home   ·   Next Topic:  XML-RPC Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index a2d6287b..25ea91df 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -733,7 +733,7 @@

    set_radio()

    User Guide Home   ·   Next Topic:  XML-RPC Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index f5ad48b4..cd4ed1c5 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -510,7 +510,7 @@

    Data Types

    User Guide Home   ·   Next Topic:  Zip Encoding Class

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 98a6d511..36b969b7 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -271,7 +271,7 @@

    $this->zip->clear_data()

    User Guide Home   ·   Next Topic:  Array Helper

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/license.html b/user_guide/license.html index 63cf3647..fc79c22f 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -60,7 +60,7 @@

    CodeIgniter License Agreement

    -

    Copyright (c) 2008 - 2009, EllisLab, Inc.
    +

    Copyright (c) 2008 - 2010, 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.

    @@ -100,7 +100,7 @@

    Limitations of Liability

    User Guide Home   ·   Next Topic:  Change Log

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index fbc51c9e..8504ae85 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -88,7 +88,7 @@

    Application Flow Chart

    User Guide Home   ·   Next Topic:  Model-View-Controller

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 36ff54d4..1c7aae83 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -165,7 +165,7 @@

    CodeIgniter has a Friendly Community of Users

    User Guide Home   ·   Next Topic:  CodeIgniter Cheatsheets

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index 7a00202d..a34cf719 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -76,7 +76,7 @@

    Helpers Reference

    User Guide Home   ·   Next Topic:  CodeIgniter Features

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 1aa5d1ed..3f584cd9 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -113,7 +113,7 @@

    CodeIgniter Features

    User Guide Home   ·   Next Topic:  Application Flow Chart

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 6d3e7c77..b37d546b 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -85,7 +85,7 @@

    Getting Started With CodeIgniter

    User Guide Home   ·   Next Topic:  CodeIgniter At a Glance

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index f24d2495..cdd93a35 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -91,7 +91,7 @@

    Design and Architectural Goals

    User Guide Home   ·   Next Topic:  Getting Started

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 2a5fbb48..4dbe55c6 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -77,7 +77,7 @@

    CodeIgniter Overview

    diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 8c5d2be0..67bae89d 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -93,7 +93,7 @@

    Model-View-Controller

    User Guide Home   ·   Next Topic:  Architectural Goals

    -

    CodeIgniter  ·  Copyright © 2006-2009  ·  Ellislab, Inc.

    +

    CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    diff --git a/user_guide/toc.html b/user_guide/toc.html index ddd249ba..45911d18 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -201,7 +201,7 @@

    Additional Resources

    From 8c4b5e78a8f3a87e30ffc3b09b897153ffe86193 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 6 Jan 2010 22:21:41 +0000 Subject: [PATCH 1755/2544] changed isset() to array_key_exists() in values_parsing() conditional of XML-RPC class to allow for array keys set with NULL values --- system/libraries/Xmlrpc.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index fe5562fe..5a82391d 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -229,7 +229,7 @@ function set_debug($flag = TRUE) function values_parsing($value, $return = FALSE) { - if (is_array($value) && isset($value['0'])) + if (is_array($value) && array_key_exists(0, $value)) { if ( ! isset($value['1']) OR (! isset($this->xmlrpcTypes[$value['1']]))) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 198cef23..93a7025f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -97,6 +97,7 @@

    Bug fixes for 1.7.3

  • Fixed bugs in get_dir_file_info() and get_file_info() in the File Helper with recursion, and file paths on Windows.
  • Fixed a bug where Active Record override parameter would not let you disable Active Record if it was enabled in your database config file.
  • Fixed a bug in reduce_double_slashes() in the String Helper to properly remove duplicate leading slashes (#7585)
  • +
  • Fixed a bug in values_parsing() of the XML-RPC library which prevented NULL variables typed as 'string' from being handled properly.
  • Version 1.7.2

    From 98a447ac363d00d856c18f34ffbd4d14cad51eb3 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Jan 2010 18:14:28 +0000 Subject: [PATCH 1756/2544] changing the second parameter in directory_map to an integer that controls recursion depth. A depth of 0 is fully recursive to maintain backward compatibility with the boolean values. --- system/helpers/directory_helper.php | 32 +++++++++++------------- user_guide/changelog.html | 1 + user_guide/helpers/directory_helper.html | 6 ++--- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 791cf0d1..7de6a3c5 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -36,32 +36,30 @@ * * @access public * @param string path to source - * @param bool whether to limit the result to the top level only + * @param int depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) * @return array */ if ( ! function_exists('directory_map')) { - function directory_map($source_dir, $top_level_only = FALSE, $hidden = FALSE) - { + function directory_map($source_dir, $directory_depth = 0, $hidden = FALSE) + { if ($fp = @opendir($source_dir)) { - $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; - $filedata = array(); - + $filedata = array(); + $new_depth = $directory_depth - 1; + $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; + while (FALSE !== ($file = readdir($fp))) { - if (($hidden == FALSE && strncmp($file, '.', 1) == 0) OR ($file == '.' OR $file == '..')) + // Remove '.', '..', and hidden files [optional] + if ( ! trim($file, '.') OR ($hidden == FALSE && $file[0] == '.')) { continue; } - - if ($top_level_only == FALSE && @is_dir($source_dir.$file)) + + if (($directory_depth < 1 OR $new_depth > 0) && @is_dir($source_dir.$file)) { - $temp_array = array(); - - $temp_array = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, $hidden); - - $filedata[$file] = $temp_array; + $filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden); } else { @@ -72,10 +70,8 @@ function directory_map($source_dir, $top_level_only = FALSE, $hidden = FALSE) closedir($fp); return $filedata; } - else - { - return FALSE; - } + + return FALSE; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 93a7025f..4758d49b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -81,6 +81,7 @@

    Version 1.7.3

  • Deprecated the dohash() function in favour of do_hash() for naming consistency.
  • Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses by default so as to encourage responsible use (this function can cause server performance issues when used without caution).
  • +
  • Modified the second parameter of directory_map() in the Directory Helper to accept an integer to specify recursion depth.
  • diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index eae2c52e..3b70799d 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -78,10 +78,10 @@

    directory_map('source directory')

    Note: Paths are almost always relative to your main index.php file.

    -

    Sub-folders contained within the directory will be mapped as well. If you wish to map -only the top level directory set the second parameter to true (boolean):

    +

    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:

    -$map = directory_map('./mydirectory/', TRUE); +$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):

    From 0ce9f781778505e7f4b186bc7948b24c6f63a6d3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 8 Jan 2010 12:43:17 +0000 Subject: [PATCH 1757/2544] Table library will generate an empty cell with a blank string, or NULL value. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4758d49b..3f4fbdb1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@

    Version 1.7.3

  • Fixed an error in the Zip library that didn't allow downloading on PHP 4 servers.
  • Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".
  • Added "is_object" into the list of unit tests capable of being run.
  • +
  • Table library will generate an empty cell with a blank string, or NULL value.
  • Database From a7b2e451ef9f9c471da43442633506bb6e33dde3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 14 Jan 2010 14:35:04 +0000 Subject: [PATCH 1758/2544] added a parse_string() method to the Parser --- user_guide/changelog.html | 1 + user_guide/libraries/parser.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3f4fbdb1..f7520194 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

    Version 1.7.3

  • Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".
  • Added "is_object" into the list of unit tests capable of being run.
  • Table library will generate an empty cell with a blank string, or NULL value.
  • +
  • Added a parse_string() method to the Parser Class.
  • Database diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 4bf63efb..3dc26815 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -123,6 +123,10 @@

    $this->parser->parse()

    $string = $this->parser->parse('blog_template', $data, TRUE); +

    $this->parser->parse_string()

    + +

    This method works exactly like parse(), only accepts a string as the first parameter in place of a view file.

    +

    Variable Pairs

    From e28c7ae966df7e698727f28b75356f692ae84a8e Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 14 Jan 2010 15:14:51 +0000 Subject: [PATCH 1759/2544] fixing a routing example --- user_guide/general/routing.html | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index ab79c926..01a8aef8 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -96,13 +96,8 @@

    Wildcards

    You can match literal values or you can use two wildcard types:

    -

    -:num
    -:any -

    - -

    :num will match a segment containing only numbers.
    -:any will match a segment containing any character. +

    (:num) will match a segment containing only numbers.
    +(:any) will match a segment containing any character.

    Note: Routes will run in the order they are defined. @@ -118,7 +113,7 @@

    Examples

    $route['blog/joe'] = "blogs/users/34";

    A URL containing the segments blog/joe will be remapped to the "blogs" class and the "users" method. The ID will be set to "34".

    -$route['product/:any'] = "catalog/product_lookup"; +$route['product/(:any)'] = "catalog/product_lookup";

    A URL with "product" as the first segment, and anything in the second will be remapped to the "catalog" class and the "product_lookup" method.

    $route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; From c710211f85e3eb2107c167f6a66161f2b82c1c1c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 14 Jan 2010 15:15:52 +0000 Subject: [PATCH 1760/2544] changelog note about fixing typos/examples. Should probably have added this in the last commit --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f7520194..f54c0076 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

    Version 1.7.3

    Bug fixes for 1.7.3

      +
    • Fixed assorted user guide typos or examples.
    • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
    • Fixed or clarified assorted user guide typos or examples.
    • Made get_mime_by_extension() case insensitive.
    • From 3e9519e07af366f9bd7b48de34db689f573d37ea Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 15 Jan 2010 00:09:34 +0000 Subject: [PATCH 1761/2544] Update to file helper to return FALSE on failure. --- system/helpers/file_helper.php | 8 ++++++-- user_guide/changelog.html | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 114b2927..2be06ac4 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -124,7 +124,9 @@ function delete_files($path, $del_dir = FALSE, $level = 0) $path = rtrim($path, DIRECTORY_SEPARATOR); if ( ! $current_dir = @opendir($path)) - return; + { + return TRUE; + } while(FALSE !== ($filename = @readdir($current_dir))) { @@ -148,8 +150,10 @@ function delete_files($path, $del_dir = FALSE, $level = 0) if ($del_dir == TRUE AND $level > 0) { - @rmdir($path); + return @rmdir($path); } + + return TRUE; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f54c0076..0e49bbdc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -84,6 +84,7 @@

      Version 1.7.3

    • Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses by default so as to encourage responsible use (this function can cause server performance issues when used without caution).
    • Modified the second parameter of directory_map() in the Directory Helper to accept an integer to specify recursion depth.
    • +
    • Modified delete_files() in the File Helper to return FALSE on failure.
  • From d827058bb0b1d2b54f7cb0e8343885cedac43334 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 15 Jan 2010 17:10:56 +0000 Subject: [PATCH 1762/2544] adding parse_string method adding null values generating an empty cell in table lib --- system/libraries/Parser.php | 51 ++++++++++++++++++++++++++++++++----- system/libraries/Table.php | 2 +- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 399b14b2..56d27e7d 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -29,11 +29,11 @@ class CI_Parser { var $l_delim = '{'; var $r_delim = '}'; var $object; - + /** * Parse a template * - * Parses pseudo-variables contained in the specified template, + * Parses pseudo-variables contained in the specified template view, * replacing them with the data in the second param * * @access public @@ -46,12 +46,50 @@ function parse($template, $data, $return = FALSE) { $CI =& get_instance(); $template = $CI->load->view($template, $data, TRUE); - + + return $this->_parse($template, $data, $return); + } + + // -------------------------------------------------------------------- + + /** + * Parse a String + * + * Parses pseudo-variables contained in the specified string, + * replacing them with the data in the second param + * + * @access public + * @param string + * @param array + * @param bool + * @return string + */ + function parse_string($template, $data, $return = FALSE) + { + return $this->_parse($template, $data, $return); + } + + // -------------------------------------------------------------------- + + /** + * Parse a template + * + * Parses pseudo-variables contained in the specified template, + * replacing them with the data in the second param + * + * @access public + * @param string + * @param array + * @param bool + * @return string + */ + function _parse($template, $data, $return = FALSE) + { if ($template == '') { return FALSE; } - + foreach ($data as $key => $val) { if (is_array($val)) @@ -63,12 +101,13 @@ function parse($template, $data, $return = FALSE) $template = $this->_parse_single($key, (string)$val, $template); } } - + if ($return == FALSE) { + $CI =& get_instance(); $CI->output->append_output($template); } - + return $template; } diff --git a/system/libraries/Table.php b/system/libraries/Table.php index a990d406..6d36121f 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -260,7 +260,7 @@ function generate($table_data = NULL) { $out .= $this->template['cell_'.$name.'start']; - if ($cell === "") + if ($cell === "" OR $cell === NULL) { $out .= $this->empty_cells; } From 03151b09a805f0e91700a7f49a3deffed8beecf8 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 16 Jan 2010 19:06:30 +0000 Subject: [PATCH 1763/2544] preg_quote() in parser --- system/libraries/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 56d27e7d..161de613 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -197,7 +197,7 @@ function _parse_pair($variable, $data, $string) */ function _match_pair($string, $variable) { - if ( ! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+?)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match)) + 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)) { return FALSE; } From 76af409a0157f981c145973e5668052621c38415 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 16 Jan 2010 19:20:49 +0000 Subject: [PATCH 1764/2544] adding http headers and config to CI profiler --- system/language/english/profiler_lang.php | 2 + system/libraries/Profiler.php | 81 +++++++++++++++++++++-- user_guide/changelog.html | 1 + 3 files changed, 78 insertions(+), 6 deletions(-) diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index 7c40e3f3..bf218300 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -8,6 +8,8 @@ $lang['profiler_post_data'] = 'POST DATA'; $lang['profiler_uri_string'] = 'URI STRING'; $lang['profiler_memory_usage'] = 'MEMORY USAGE'; +$lang['profiler_config'] = 'CONFIG VARIABLES'; +$lang['profiler_headers'] = 'HTTP HEADERS'; $lang['profiler_no_db'] = 'Database driver is not currently loaded'; $lang['profiler_no_queries'] = 'No queries were run'; $lang['profiler_no_post'] = 'No POST data exists'; diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ec185a1e..ebadf861 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -74,16 +74,16 @@ function _compile_benchmarks() // be modified. We also might want to make this data available to be logged $output = "\n\n"; - $output .= '
    '; + $output .= '
    '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; + $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; $output .= "\n"; $output .= "\n\n\n"; foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "\n"; + $output .= "\n"; } $output .= "
    ".$key."  ".$val."
    ".$key."  ".$val."
    \n"; @@ -161,7 +161,7 @@ function _compile_queries() $val = str_replace($bold, ''.$bold.'', $val); } - $output .= "".$time."  ".$val."\n"; + $output .= "".$time."  ".$val."\n"; } } @@ -327,6 +327,7 @@ function _compile_controller_info() return $output; } + // -------------------------------------------------------------------- /** @@ -351,7 +352,7 @@ function _compile_memory_usage() } else { - $output .= "
    ".$this->CI->lang->line('profiler_no_memory')."
    "; + $output .= "
    ".$this->CI->lang->line('profiler_no_memory_usage')."
    "; } $output .= "
    "; @@ -361,6 +362,73 @@ function _compile_memory_usage() // -------------------------------------------------------------------- + /** + * Compile header information + * + * Lists HTTP headers + * + * @access public + * @return string + */ + function _compile_http_headers() + { + $output = "\n\n"; + $output .= '
    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_headers').'  '; + $output .= "\n"; + + $output .= "\n\n\n"; + + foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING') as $header) + { + $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; + $output .= "\n"; + } + + $output .= "
    ".$header."  ".$val."
    \n"; + $output .= "
    "; + + $output .= "
    "; + + return $output; + } + + // -------------------------------------------------------------------- + + /** + * Compile config information + * + * Lists developer config variables + * + * @access public + * @return string + */ + function _compile_config() + { + $output = "\n\n"; + $output .= '
    '; + $output .= "\n"; + $output .= '  '.$this->CI->lang->line('profiler_config').'  '; + $output .= "\n"; + + $output .= "\n\n\n"; + + foreach($this->CI->config->config as $config=>$val) + { + $output .= "\n"; + } + + $output .= "
    ".$config."  ".$val."
    \n"; + $output .= "
    "; + + $output .= ""; + + return $output; + } + + // -------------------------------------------------------------------- + /** * Run the Profiler * @@ -378,7 +446,8 @@ function run() $output .= $this->_compile_get(); $output .= $this->_compile_post(); $output .= $this->_compile_queries(); - + $output .= $this->_compile_config(); + $output .= $this->_compile_http_headers(); $output .= ''; return $output; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0e49bbdc..aef9d71a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@

    Version 1.7.3

  • Added "is_object" into the list of unit tests capable of being run.
  • Table library will generate an empty cell with a blank string, or NULL value.
  • Added a parse_string() method to the Parser Class.
  • +
  • Added HTTP headers and Config information to the Profiler output.
  • Database From 1ca94e82c8fc8c2acf4bb7b3927abff736779163 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 16 Jan 2010 19:24:21 +0000 Subject: [PATCH 1765/2544] Documented append_output() in the Output Class. --- user_guide/changelog.html | 1 + user_guide/libraries/output.html | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index aef9d71a..ceb016cf 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

    Version 1.7.3

  • Table library will generate an empty cell with a blank string, or NULL value.
  • Added a parse_string() method to the Parser Class.
  • Added HTTP headers and Config information to the Profiler output.
  • +
  • Documented append_output() in the Output Class.
  • Database diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 1e425910..7be42b44 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -87,6 +87,14 @@

    $this->output->get_output();

    CodeIgniter functions like $this->load->view().

    +

    $this->output->append_output();

    + +

    Appends data onto the output string. Usage example:

    + +$this->output->append_output($data); + + +

    $this->output->set_header();

    Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

    From 04eb070b87da9ffa40e48ef3660e664b48760c97 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:07:13 +0000 Subject: [PATCH 1766/2544] Documentd db->close() --- user_guide/changelog.html | 1 + user_guide/database/connecting.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ceb016cf..ba7ab2be 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,6 +77,7 @@

    Version 1.7.3

  • Database
    • Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.
    • +
    • Documentd db->close().
  • Helpers diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index fb766288..217a2357 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -164,9 +164,11 @@

    Reconnecting / Keeping the Connection Alive

    $this->db->reconnect(); +

    Manually closing the Connection

    - +

    While CodeIgniter intelligently takes care of closing your database connections, you can explicitly close the connection.

    +$this->db->close(); From 33d4b6aac7f33d6cddfa5fb39c5701ecc9cfa80b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:23:00 +0000 Subject: [PATCH 1767/2544] adding the ability for form_open_multipart() to accept string attribute arguments --- system/helpers/form_helper.php | 10 +++++++++- user_guide/changelog.html | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index c78b805e..60d2631e 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -84,7 +84,15 @@ function form_open($action = '', $attributes = '', $hidden = array()) { function form_open_multipart($action, $attributes = array(), $hidden = array()) { - $attributes['enctype'] = 'multipart/form-data'; + if (is_string($attributes)) + { + $attributes .= ' enctype="multipart/form-data"'; + } + else + { + $attributes['enctype'] = 'multipart/form-data'; + } + return form_open($action, $attributes, $hidden); } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ba7ab2be..92765c4e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -106,6 +106,7 @@

    Bug fixes for 1.7.3

  • Fixed a bug where Active Record override parameter would not let you disable Active Record if it was enabled in your database config file.
  • Fixed a bug in reduce_double_slashes() in the String Helper to properly remove duplicate leading slashes (#7585)
  • Fixed a bug in values_parsing() of the XML-RPC library which prevented NULL variables typed as 'string' from being handled properly.
  • +
  • Fixed a bug were form_open_multipart() didn't accept string attribute arguments (#10930).
  • Version 1.7.2

    From 563885b0a62bd4c4251f4df6a81f3e05493f5be1 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:31:03 +0000 Subject: [PATCH 1768/2544] fixed an incorrectly labelled config key example --- user_guide/changelog.html | 2 +- user_guide/libraries/sessions.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 92765c4e..a322d357 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,7 +94,7 @@

    Version 1.7.3

    Bug fixes for 1.7.3

      -
    • Fixed assorted user guide typos or examples.
    • +
    • Fixed assorted user guide typos or examples (#10693).
    • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
    • Fixed or clarified assorted user guide typos or examples.
    • Made get_mime_by_extension() case insensitive.
    • diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 11313b51..c93c7614 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -123,7 +123,7 @@

      What is Session Data?

      Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time -the cookie was written. This time is configurable by changing the $config['time_to_update'] line in your system/config/config.php file.

      +the cookie was written. This time is configurable by changing the $config['sess_time_to_update'] line in your system/config/config.php file.

      Retrieving Session Data

      From f063ed7a0d51fd2abd5dd716ab7f92a54e45cd11 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:48:25 +0000 Subject: [PATCH 1769/2544] making get_mime_by_extension case insensitive --- system/helpers/file_helper.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 2be06ac4..9ea5018a 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -346,7 +346,7 @@ function get_file_info($file, $returned_values = array('name', 'server_path', 's { function get_mime_by_extension($file) { - $extension = strtolower(substr(strrchr($file, '.'), 1)); + $extension = strtolower(substr(strrchr(strtolower($file), '.'), 1)); global $mimes; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a322d357..55718c6b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -107,6 +107,7 @@

      Bug fixes for 1.7.3

    • Fixed a bug in reduce_double_slashes() in the String Helper to properly remove duplicate leading slashes (#7585)
    • Fixed a bug in values_parsing() of the XML-RPC library which prevented NULL variables typed as 'string' from being handled properly.
    • Fixed a bug were form_open_multipart() didn't accept string attribute arguments (#10930).
    • +
    • Fixed a bug (#10470) where get_mime_by_extension() case sensitive.

    Version 1.7.2

    From 9502311beeda23042370bb891f850eab3aadad96 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:51:21 +0000 Subject: [PATCH 1770/2544] change already made - revert --- system/helpers/file_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 9ea5018a..2be06ac4 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -346,7 +346,7 @@ function get_file_info($file, $returned_values = array('name', 'server_path', 's { function get_mime_by_extension($file) { - $extension = strtolower(substr(strrchr(strtolower($file), '.'), 1)); + $extension = strtolower(substr(strrchr($file, '.'), 1)); global $mimes; From c47eb1e3009cb4d0760748c9c1fe029fb988dd55 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 07:56:56 +0000 Subject: [PATCH 1771/2544] Added "default" to the list Reserved Names --- user_guide/changelog.html | 5 +++++ user_guide/general/reserved_names.html | 1 + 2 files changed, 6 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 55718c6b..bb175c21 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,11 @@

    Version 1.7.3

  • Modified delete_files() in the File Helper to return FALSE on failure.
  • +
  • Other Changes + +
  • Bug fixes for 1.7.3

    diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 2d637e8e..0d697b38 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -68,6 +68,7 @@

    Controller names

  • CI_Base
  • _ci_initialize
  • _ci_scaffolding
  • +
  • Default (PHP 5)
  • index

  • From 028cbb5de098b74780d57c24d574e531fb23f33c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 17 Jan 2010 08:07:49 +0000 Subject: [PATCH 1772/2544] extra period in a sentence (the horror!) :) --- user_guide/changelog.html | 2 +- user_guide/libraries/form_validation.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bb175c21..92282323 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -99,7 +99,7 @@

    Version 1.7.3

    Bug fixes for 1.7.3

      -
    • Fixed assorted user guide typos or examples (#10693).
    • +
    • Fixed assorted user guide typos or examples (#10693, #8951).
    • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
    • Fixed or clarified assorted user guide typos or examples.
    • Made get_mime_by_extension() case insensitive.
    • diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 400af0e5..49c30ef3 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -449,7 +449,7 @@

      Re-populating the form

      Open your myform.php view file and update the value in each field using the set_value() function:

      -

      Don't forget to include each. field name in the set_value() functions!

      +

      Don't forget to include each field name in the set_value() functions!

      - - - - - - - - - - - - -load->view('footer'); -/* End of file add.php */ -/* Location: ./system/scaffolding/views/add.php */ diff --git a/system/scaffolding/views/delete.php b/system/scaffolding/views/delete.php deleted file mode 100644 index d1954219..00000000 --- a/system/scaffolding/views/delete.php +++ /dev/null @@ -1,9 +0,0 @@ -load->view('header'); ?> - -

      - -

        |   - -load->view('footer'); -/* End of file delete.php */ -/* Location: ./system/scaffolding/views/delete.php */ diff --git a/system/scaffolding/views/edit.php b/system/scaffolding/views/edit.php deleted file mode 100644 index fe553e59..00000000 --- a/system/scaffolding/views/edit.php +++ /dev/null @@ -1,33 +0,0 @@ -load->view('header'); ?> - - -

      - - - - - - - -primary_key == 1) continue; ?> - - - - - type == 'blob'): ?> - - - - - - - -
      name; ?>
      - - - - - -load->view('footer'); -/* End of file edit.php */ -/* Location: ./system/scaffolding/views/edit.php */ \ No newline at end of file diff --git a/system/scaffolding/views/footer.php b/system/scaffolding/views/footer.php deleted file mode 100644 index 0e71401c..00000000 --- a/system/scaffolding/views/footer.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/system/scaffolding/views/header.php b/system/scaffolding/views/header.php deleted file mode 100644 index 50f234a4..00000000 --- a/system/scaffolding/views/header.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - -<?php echo $title; ?> - - - - - - - - - - - - -
      -
      \ No newline at end of file diff --git a/system/scaffolding/views/index.html b/system/scaffolding/views/index.html deleted file mode 100644 index c942a79c..00000000 --- a/system/scaffolding/views/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/system/scaffolding/views/no_data.php b/system/scaffolding/views/no_data.php deleted file mode 100644 index bc81e748..00000000 --- a/system/scaffolding/views/no_data.php +++ /dev/null @@ -1,8 +0,0 @@ -load->view('header'); ?> - -

      -

      - -load->view('footer'); -/* End of file no_data.php */ -/* Location: ./system/scaffolding/views/no_data.php */ \ No newline at end of file diff --git a/system/scaffolding/views/stylesheet.css b/system/scaffolding/views/stylesheet.css deleted file mode 100644 index 3f487dd0..00000000 --- a/system/scaffolding/views/stylesheet.css +++ /dev/null @@ -1,143 +0,0 @@ -body { - margin: 0; - padding: 0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - color: #4F5155; - background: #fff url(background.jpg) repeat-x left top; -} - -a { - color: #8B0D00; - background-color: transparent; - text-decoration: none; - font-weight: bold; -} - -a:visited { - color: #8B0D00; - background-color: transparent; - text-decoration: none; -} - -a:hover { - color: #000; - text-decoration: none; - background-color: transparent; -} - - -#header { - margin: 0; - padding: 0; -} - -#header_left { - background-color: transparent; - float: left; - padding: 21px 0 0 32px; - margin: 0 -} - -#header_right { - background-color: transparent; - float: right; - text-align: right; - padding: 35px 50px 20px 0; - margin: 0 -} - -#footer { - margin: 20px 0 15px 0; - padding: 0; -} - -#footer p { - font-size: 10px; - color: #999; - text-align: center; -} - -#outer { - margin: 30px 40px 0 40px; -} - -img { - padding:0; - border: 0; - margin: 0; -} - -.nopad { - padding:0; - border: 0; - margin: 0; -} - -table { - background-color: #efefef; -} - -th { - background-color: #eee; - font-weight: bold; - padding: 6px; - text-align: left; -} - -td { - background-color: #fff; - padding: 6px; -} - - -form { - margin: 0; - padding: 0; -} - -.input { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - width: 600px; - color: #333; - border: 1px solid #B3B4BD; - font-size: 11px; - height: 2em; - padding: 0; - margin: 0; -} - -.textarea { - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 12px; - width: 600px; - color: #333; - border: 1px solid #B3B4BD; - padding: 0; - margin: 0; -} - -.select { - background-color: #fff; - font-size: 11px; - font-weight: normal; - color: #333; - padding: 0; - margin: 0 0 3px 0; -} - -.checkbox { - background-color: transparent; - padding: 0; - border: 0; -} - -.submit { - background-color: #8B0D00; - color: #FFF; - font-weight: normal; - border: 1px solid #000; - margin: 6px 0 0 0; - padding: 1px 5px 1px 5px; -} diff --git a/system/scaffolding/views/view.php b/system/scaffolding/views/view.php deleted file mode 100644 index a81241d3..00000000 --- a/system/scaffolding/views/view.php +++ /dev/null @@ -1,27 +0,0 @@ -load->view('header'); ?> - - - - - - - - - - -result() as $row): ?> - - - - - - - - -
      EditDelete
       $primary), $scaff_edit); ?> $primary), $scaff_delete); ?>$field);?>
      - - - -load->view('footer'); -/* End of file view.php */ -/* Location: ./system/scaffolding/views/view.php */ \ No newline at end of file From fcb7bfd9c78f87f93b53c276c92f239794839501 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 15:45:15 -0600 Subject: [PATCH 1822/2544] brought captcha plugin up to date --- system/plugins/captcha_pi.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php index 77f29f8b..7092f28e 100644 --- a/system/plugins/captcha_pi.php +++ b/system/plugins/captcha_pi.php @@ -28,7 +28,7 @@ 'word' => 'Random word', 'img_path' => './captcha/', 'img_url' => 'http://example.com/captcha/', - 'font_path' => './system/fonts/texb.ttf', + 'font_path' => './path/to/fonts/texb.ttf', 'img_width' => '150', 'img_height' => 30, 'expiration' => 7200 @@ -110,7 +110,6 @@ $cap = create_captcha($vals); $data = array( - 'captcha_id' => '', 'captcha_time' => $cap['time'], 'ip_address' => $this->input->ip_address(), 'word' => $cap['word'] @@ -128,7 +127,7 @@ // First, delete old captchas $expiration = time()-7200; // Two hour limit - $DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); + $this->db->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); // Then see if a captcha exists: $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; @@ -180,7 +179,7 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = return FALSE; } - if ( ! is_really_writable($img_path)) + if ( ! is_writable($img_path)) { return FALSE; } @@ -243,7 +242,7 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = // ----------------------------------- // Create image // ----------------------------------- - + // PHP.net recommends imagecreatetruecolor(), but it isn't always available if (function_exists('imagecreatetruecolor')) { From b2fd44474b126ce8fa179651ea8ad1edc110131c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 15:45:30 -0600 Subject: [PATCH 1823/2544] lowercased all tag attribute values --- system/plugins/js_calendar_pi.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/plugins/js_calendar_pi.php b/system/plugins/js_calendar_pi.php index a35ab56b..f722777b 100644 --- a/system/plugins/js_calendar_pi.php +++ b/system/plugins/js_calendar_pi.php @@ -33,7 +33,7 @@
      -

      Today

      +

      Today

      @@ -210,9 +210,9 @@ function build_calendar() str += '
      '; str += ''; str += ''; - str += ' @@ -83,38 +83,12 @@

      Security Filtering

      XSS Filtering

      -

      CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not -run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

      - -

      The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

      - -

      -Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

      - - -

      To filter data through the XSS filter use this function:

      - -

      $this->input->xss_clean()

      - -

      Here is an usage example:

      - -$data = $this->input->xss_clean($data); - -

      If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +

      The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:

      $config['global_xss_filtering'] = TRUE; -

      Note: If you use the form validation class, it gives you the option of XSS filtering as well.

      - -

      An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

      - -if ($this->input->xss_clean($file, TRUE) === FALSE)
      -{
      -    // file failed the XSS test
      -}
      +

      Please refer to the Security class documentation for information on using XSS Filtering in your application.

      Using POST, COOKIE, or SERVER Data

      @@ -183,6 +157,55 @@

      $this->input->server()

      $this->input->server('some_data'); +

      $this->input->set_cookie()

      + +

      Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +Array Method, and Discrete Parameters:

      + +

      Array Method

      + +

      Using this method, an associative array is passed to the first parameter:

      + +$cookie = array(
      +                   'name'   => 'The Cookie Name',
      +                   'value'  => 'The Value',
      +                   'expire' => '86500',
      +                   'domain' => '.some-domain.com',
      +                   'path'   => '/',
      +                   'prefix' => 'myprefix_',
      +               );
      +
      +$this->input->set_cookie($cookie); +
      + +

      Notes:

      + +

      Only the name and value are required. To delete a cookie set it with the expiration blank.

      + +

      The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to +zero the cookie will only last as long as the browser is open.

      +

      For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

      +

      The path is usually not needed since the function sets a root path.

      +

      The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

      + +

      Discrete Parameters

      + +

      If you prefer, you can set the cookie by passing data using individual parameters:

      + +$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); + +

      $this->input->get_cookie()

      + +

      Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

      + +get_cookie('some_cookie'); + +

      The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

      + +

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      + +

      get_cookie('some_cookie', TRUE);

      $this->input->ip_address()

      diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html new file mode 100644 index 00000000..d5d72538 --- /dev/null +++ b/user_guide/libraries/security.html @@ -0,0 +1,123 @@ + + + + + +Security Class : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
      +
      <<<\/td>'; + str += '<<<\/td>'; str += '' + months[this.month] + ' ' + this.year + '<\/td>'; - str += '>><\/td>'; + str += '>><\/td>'; str += '<\/tr>'; // Day Names @@ -242,7 +242,7 @@ function build_calendar() } else if (displayNum == selDate && this.highlight == true) // Selected date { - str += '' + displayNum + '<\/td>'; + str += '' + displayNum + '<\/td>'; } else if (displayNum > this.total_days()) { @@ -250,7 +250,7 @@ function build_calendar() } else // Unselected days { - str += '' + displayNum + '<\/td>'; + str += '' + displayNum + '<\/td>'; } if (j % 7 == 6) From c16f49eebbc00b33902dcdb05c4b652937d4b2e9 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 16:39:47 -0600 Subject: [PATCH 1824/2544] added .htaccess file to cache folder --- system/cache/.htaccess | 1 + 1 file changed, 1 insertion(+) create mode 100644 system/cache/.htaccess diff --git a/system/cache/.htaccess b/system/cache/.htaccess new file mode 100644 index 00000000..3418e55a --- /dev/null +++ b/system/cache/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file From 71141ce88b5d77e28049b4f641045125921e3dc0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 16:41:20 -0600 Subject: [PATCH 1825/2544] whitespace in Email lib --- system/libraries/Email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index d0f2ea9a..8014bd21 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1544,7 +1544,7 @@ function _send_with_sendmail() // server probably has popen disabled, so nothing we can do to get a verbose error. return FALSE; } - + fputs($fp, $this->_header_str); fputs($fp, $this->_finalbody); @@ -1554,7 +1554,7 @@ function _send_with_sendmail() { $status = $status >> 8 & 0xFF; } - + if ($status != 0) { $this->_set_error_message('email_exit_status', $status); From d10e89666380d717e3e40dda046be78dbb7a38c4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:10:36 -0600 Subject: [PATCH 1826/2544] added batch insert/update and a replace method to active record --- system/database/DB_active_rec.php | 327 +++++++++++++++++++++++++++++- 1 file changed, 325 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index a3abff11..88690a8f 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -721,13 +721,13 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') { $like_statement = $prefix." $k $not LIKE '%{$v}%'"; } - + // some platforms require an escape sequence definition for LIKE wildcards if ($this->_like_escape_str != '') { $like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_chr); } - + $this->ar_like[] = $like_statement; if ($this->ar_caching === TRUE) { @@ -1134,7 +1134,127 @@ function getwhere($table = '', $where = null, $limit = null, $offset = null) { return $this->get_where($table, $where, $limit, $offset); } + + // -------------------------------------------------------------------- + + /** + * Insert_Batch + * + * Compiles batch insert strings and runs the queries + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of insert values + * @return object + */ + function insert_batch($table = '', $set = NULL) + { + if ( ! is_null($set)) + { + $this->set_insert_batch($set); + } + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + //No valid data array. Folds in cases where keys and values did not match up + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + // Batch this baby + for ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100) + { + + $sql = $this->_insert_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_keys, array_slice($this->ar_set, $i, 100)); + + //echo $sql; + + $this->query($sql); + } + + $this->_reset_write(); + + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts + * + * @access public + * @param mixed + * @param string + * @param boolean + * @return object + */ + + function set_insert_batch($key, $value = '', $escape = TRUE) + { + $key = $this->_object_to_array_batch($key); + + if ( ! is_array($key)) + { + $key = array($key => $value); + } + + $keys = array_keys(current($key)); + sort($keys); + + foreach ($key as $row) + { + if (count(array_diff($keys, array_keys($row))) > 0 OR count(array_diff(array_keys($row), $keys)) > 0) + { + // batch function above returns an error on an empty array + $this->ar_set[] = array(); + return; + } + + ksort($row); // puts $row in the same order as our keys + + if ($escape === FALSE) + { + $this->ar_set[] = '('.implode(',', $row).')'; + } + else + { + $clean = array(); + + foreach($row as $value) + { + $clean[] = $this->escape($value); + } + + $this->ar_set[] = '('.implode(',', $clean).')'; + } + } + + foreach ($keys as $k) + { + $this->ar_keys[] = $this->_protect_identifiers($k); + } + + return $this; + } + // -------------------------------------------------------------------- /** @@ -1183,6 +1303,42 @@ function insert($table = '', $set = NULL) return $this->query($sql); } + function replace($table = '', $set = NULL) + { + if ( ! is_null($set)) + { + $this->set($set); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + $sql = $this->_replace($this->_protect_identifiers($table, TRUE, NULL, FALSE), array_keys($this->ar_set), array_values($this->ar_set)); + + $this->_reset_write(); + return $this->query($sql); + } + // -------------------------------------------------------------------- /** @@ -1245,6 +1401,133 @@ function update($table = '', $set = NULL, $where = NULL, $limit = NULL) return $this->query($sql); } + + // -------------------------------------------------------------------- + + /** + * Update_Batch + * + * Compiles an update string and runs the query + * + * @access public + * @param string the table to retrieve the results from + * @param array an associative array of update values + * @param string the where key + * @return object + */ + function update_batch($table = '', $set = NULL, $index = NULL) + { + // Combine any cached components with the current statements + $this->_merge_cache(); + + if (is_null($index)) + { + if ($this->db_debug) + { + return $this->display_error('db_myst_use_index'); + } + + return FALSE; + } + + if ( ! is_null($set)) + { + $this->set_update_batch($set, $index); + } + + if (count($this->ar_set) == 0) + { + if ($this->db_debug) + { + return $this->display_error('db_must_use_set'); + } + + return FALSE; + } + + if ($table == '') + { + if ( ! isset($this->ar_from[0])) + { + if ($this->db_debug) + { + return $this->display_error('db_must_set_table'); + } + return FALSE; + } + + $table = $this->ar_from[0]; + } + + // Batch this baby + for ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100) + { + $sql = $this->_update_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), array_slice($this->ar_set, $i, 100), $this->_protect_identifiers($index), $this->ar_where); + + $this->query($sql); + } + + $this->_reset_write(); + } + + // -------------------------------------------------------------------- + + /** + * The "set_update_batch" function. Allows key/value pairs to be set for batch updating + * + * @access public + * @param array + * @param string + * @param boolean + * @return object + */ + + function set_update_batch($key, $index = '', $escape = TRUE) + { + $key = $this->_object_to_array_batch($key); + + if ( ! is_array($key)) + { + // @todo error + } + + foreach ($key as $k => $v) + { + $index_set = FALSE; + $clean = array(); + + foreach($v as $k2 => $v2) + { + if ($k2 == $index) + { + $index_set = TRUE; + } + else + { + $not[] = $k.'-'.$v; + } + + if ($escape === FALSE) + { + $clean[$this->_protect_identifiers($k2)] = $v2; + } + else + { + $clean[$this->_protect_identifiers($k2)] = $this->escape($v2); + } + } + + if ($index_set == FALSE) + { + return $this->display_error('db_batch_missing_index'); + } + + $this->ar_set[] = $clean; + } + + return $this; + } + // -------------------------------------------------------------------- /** @@ -1638,7 +1921,47 @@ function _object_to_array($object) $array[$key] = $val; } } + + return $array; + } + // -------------------------------------------------------------------- + + /** + * Object to Array + * + * Takes an object as input and converts the class variables to array key/vals + * + * @access public + * @param object + * @return array + */ + function _object_to_array_batch($object) + { + if ( ! is_object($object)) + { + return $object; + } + + $array = array(); + $out = get_object_vars($object); + $fields = array_keys($out); + + foreach ($fields as $val) + { + // There are some built in keys we need to ignore for this conversion + if ($val != '_parent_name' && $val != '_ci_scaffolding' && $val != '_ci_scaff_table') + { + + $i = 0; + foreach ($out[$val] as $data) + { + $array[$i][$val] = $data; + $i++; + } + } + } + return $array; } From e77922026939fed28a607338e24c1c37066a97b4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:24:46 -0600 Subject: [PATCH 1827/2544] whitespace and changes to load_class() to use core --- system/database/DB_driver.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index d7f17ccb..dfef4275 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -261,10 +261,10 @@ function query($sql, $binds = FALSE, $return_object = TRUE) // Verify table prefix and replace if necessary if ( ($this->dbprefix != '' AND $this->swap_pre != '') AND ($this->dbprefix != $this->swap_pre) ) - { + { $sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql); } - + // Is query caching enabled? If the query is a "read type" // we will load the caching class and return the previously // cached query if it exists @@ -679,7 +679,7 @@ function last_query() * @return mixed */ function escape($str) - { + { if (is_string($str)) { $str = "'".$this->escape_str($str)."'"; @@ -697,7 +697,7 @@ function escape($str) } // -------------------------------------------------------------------- - + /** * Escape LIKE String * @@ -714,7 +714,7 @@ function escape_like_str($str) } // -------------------------------------------------------------------- - + /** * Primary * @@ -1155,7 +1155,7 @@ function close() */ function display_error($error = '', $swap = '', $native = FALSE) { - $LANG =& load_class('Language'); + $LANG =& load_class('Lang', 'core'); $LANG->load('db'); $heading = $LANG->line('db_error_heading'); @@ -1169,7 +1169,7 @@ function display_error($error = '', $swap = '', $native = FALSE) $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; } - $error =& load_class('Exceptions'); + $error =& load_class('Exceptions', 'core'); echo $error->show_error($heading, $message, 'error_db'); exit; } @@ -1315,13 +1315,13 @@ function _protect_identifiers($item, $prefix_single = FALSE, $protect_identifier { $i++; } - + // Verify table prefix and replace if necessary if ($this->swap_pre != '' && strncmp($parts[$i], $this->swap_pre, strlen($this->swap_pre)) === 0) { $parts[$i] = preg_replace("/^".$this->swap_pre."(\S+?)/", $this->dbprefix."\\1", $parts[$i]); } - + // We only add the table prefix if it does not already exist if (substr($parts[$i], 0, strlen($this->dbprefix)) != $this->dbprefix) { From 30b35eb12edef6018fe61f383a002d895683e468 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:25:41 -0600 Subject: [PATCH 1828/2544] whitespace --- system/database/DB_forge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index c5931db2..8be65e0d 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -259,8 +259,8 @@ function add_column($table = '', $field = array(), $after_field = '') // add field info into field array, but we can only do one at a time // so we cycle through - foreach ($field as $k => $v) - { + foreach ($field as $k => $v) + { $this->add_field(array($k => $field[$k])); if (count($this->fields) == 0) @@ -279,6 +279,7 @@ function add_column($table = '', $field = array(), $after_field = '') } return TRUE; + } // -------------------------------------------------------------------- From 20aa2bd6d852530b3d4b2e76076fe7e7b48bf148 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:28:07 -0600 Subject: [PATCH 1829/2544] added batch insert/update and replace methods to MySQL driver --- .../database/drivers/mysql/mysql_driver.php | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index bd60d9ff..d684c8a4 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -537,6 +537,44 @@ function _insert($table, $keys, $values) // -------------------------------------------------------------------- + + /** + * 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).")"; + } + + // -------------------------------------------------------------------- + + /** + * Insert_batch statement + * + * 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 + */ + function _insert_batch($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + } + + // -------------------------------------------------------------------- + + /** * Update statement * @@ -572,6 +610,60 @@ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) // -------------------------------------------------------------------- + + /** + * Update_Batch statement + * + * Generates a platform-specific batch update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update_batch($table, $values, $index, $where = NULL) + { + $ids = array(); + $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; + + foreach($values as $key => $val) + { + $ids[] = $val[$index]; + + foreach(array_keys($val) as $field) + { + if ($field != $index) + { + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; + } + } + } + + $sql = "UPDATE ".$table." SET "; + $cases = ''; + + foreach($final as $k => $v) + { + $cases .= $k.' = CASE '."\n"; + foreach ($v as $row) + { + $cases .= $row."\n"; + } + + $cases .= 'ELSE '.$k.' END, '; + } + + $sql .= substr($cases, 0, -2); + + $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')'; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** * Truncate statement * From c34e578c4bf993481381b1efb8f95089482135a4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:35:55 -0600 Subject: [PATCH 1830/2544] added stricton db config item to force strict mode - good for ensuring strict sql during development --- system/application/config/database.php | 3 +++ system/database/DB.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/system/application/config/database.php b/system/application/config/database.php index ee11c8a7..28dfff5c 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -26,6 +26,8 @@ | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database +| ['stricton'] TRUE/FALSE - forces "Strict Mode" connections +| - good for ensuring strict SQL while developing | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the "default" group). @@ -49,6 +51,7 @@ $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; +$db['default']['stricton'] = FALSE; /* End of file database.php */ diff --git a/system/database/DB.php b/system/database/DB.php index 6930411c..a91ca08f 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -137,6 +137,11 @@ function &DB($params = '', $active_record_override = NULL) $DB->initialize(); } + if (isset($params['stricton']) && $params['stricton'] == TRUE) + { + $DB->query('SET SESSION sql_mode="STRICT_ALL_TABLES"'); + } + return $DB; } From 2a58e7a6945c47929d5003f15f1bdc32a1717270 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 17:53:38 -0600 Subject: [PATCH 1831/2544] bringing language files up to date --- system/language/english/date_lang.php | 1 + system/language/english/db_lang.php | 3 +- system/language/english/scaffolding_lang.php | 17 ---------- system/language/english/validation_lang.php | 33 +++++++++----------- 4 files changed, 18 insertions(+), 36 deletions(-) delete mode 100644 system/language/english/scaffolding_lang.php diff --git a/system/language/english/date_lang.php b/system/language/english/date_lang.php index 628e55b1..c0ace16e 100644 --- a/system/language/english/date_lang.php +++ b/system/language/english/date_lang.php @@ -56,5 +56,6 @@ $lang['UP13'] = '(UTC +13:00) Phoenix Islands Time, Tonga'; $lang['UP14'] = '(UTC +14:00) Line Islands'; + /* End of file date_lang.php */ /* Location: ./system/language/english/date_lang.php */ \ No newline at end of file diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php index dc98afca..79b82c73 100644 --- a/system/language/english/db_lang.php +++ b/system/language/english/db_lang.php @@ -6,8 +6,9 @@ $lang['db_unable_to_create'] = 'Unable to create the specified database: %s'; $lang['db_invalid_query'] = 'The query you submitted is not valid.'; $lang['db_must_set_table'] = 'You must set the database table to be used with your query.'; -$lang['db_must_set_database'] = 'You must set the database name in your database config file.'; $lang['db_must_use_set'] = 'You must use the "set" method to update an entry.'; +$lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.'; +$lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.'; $lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.'; $lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.'; $lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.'; diff --git a/system/language/english/scaffolding_lang.php b/system/language/english/scaffolding_lang.php deleted file mode 100644 index c4d54d5c..00000000 --- a/system/language/english/scaffolding_lang.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Tue, 2 Mar 2010 18:13:59 -0600 Subject: [PATCH 1832/2544] adding initial Javascript and Jquery libs --- system/libraries/Javascript.php | 847 ++++++++++++++++++++++++ system/libraries/Jquery.php | 1071 +++++++++++++++++++++++++++++++ 2 files changed, 1918 insertions(+) create mode 100644 system/libraries/Javascript.php create mode 100644 system/libraries/Jquery.php diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php new file mode 100644 index 00000000..3b7dcc6f --- /dev/null +++ b/system/libraries/Javascript.php @@ -0,0 +1,847 @@ + 'jquery', 'autoload' => TRUE); + + foreach ($defaults as $key => $val) + { + if (isset($params[$key]) && $params[$key] !== "") + { + $defaults[$key] = $params[$key]; + } + } + + extract($defaults); + + $this->CI =& get_instance(); + + // load the requested js library + $this->CI->load->library($js_library_driver, array('autoload' => $autoload)); + // make js to refer to current library + $this->js =& $this->CI->$js_library_driver; + + log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); + } + + // -------------------------------------------------------------------- + // Event Code + // -------------------------------------------------------------------- + + /** + * Blur + * + * Outputs a javascript library blur event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function blur($element = 'this', $js = '') + { + return $this->js->_blur($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Change + * + * Outputs a javascript library change event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function change($element = 'this', $js = '') + { + return $this->js->_change($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Click + * + * Outputs a javascript library click event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @param boolean whether or not to return false + * @return string + */ + function click($element = 'this', $js = '', $ret_false = TRUE) + { + return $this->js->_click($element, $js, $ret_false); + } + + // -------------------------------------------------------------------- + + /** + * Double Click + * + * Outputs a javascript library dblclick event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function dblclick($element = 'this', $js = '') + { + return $this->js->_dblclick($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Error + * + * Outputs a javascript library error event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function error($element = 'this', $js = '') + { + return $this->js->_error($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Focus + * + * Outputs a javascript library focus event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function focus($element = 'this', $js = '') + { + return $this->js->__add_event($focus, $js); + } + + // -------------------------------------------------------------------- + + /** + * Hover + * + * Outputs a javascript library hover event + * + * @access public + * @param string - element + * @param string - Javascript code for mouse over + * @param string - Javascript code for mouse out + * @return string + */ + function hover($element = 'this', $over, $out) + { + return $this->js->__hover($element, $over, $out); + } + + // -------------------------------------------------------------------- + + /** + * Keydown + * + * Outputs a javascript library keydown event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function keydown($element = 'this', $js = '') + { + return $this->js->_keydown($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Keyup + * + * Outputs a javascript library keydown event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function keyup($element = 'this', $js = '') + { + return $this->js->_keyup($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Load + * + * Outputs a javascript library load event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function load($element = 'this', $js = '') + { + return $this->js->_load($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Mousedown + * + * Outputs a javascript library mousedown event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function mousedown($element = 'this', $js = '') + { + return $this->js->_mousedown($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Mouse Out + * + * Outputs a javascript library mouseout event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function mouseout($element = 'this', $js = '') + { + return $this->js->_mouseout($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Mouse Over + * + * Outputs a javascript library mouseover event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function mouseover($element = 'this', $js = '') + { + return $this->js->_mouseover($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Mouseup + * + * Outputs a javascript library mouseup event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function mouseup($element = 'this', $js = '') + { + return $this->js->_mouseup($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Output + * + * Outputs the called javascript to the screen + * + * @access public + * @param string The code to output + * @return string + */ + function output($js) + { + return $this->js->_output($js); + } + + // -------------------------------------------------------------------- + + /** + * Ready + * + * Outputs a javascript library mouseup event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function ready($js) + { + return $this->js->_document_ready($js); + } + + // -------------------------------------------------------------------- + + /** + * Resize + * + * Outputs a javascript library resize event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function resize($element = 'this', $js = '') + { + return $this->js->_resize($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Scroll + * + * Outputs a javascript library scroll event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function scroll($element = 'this', $js = '') + { + return $this->js->_scroll($element, $js); + } + + // -------------------------------------------------------------------- + + /** + * Unload + * + * Outputs a javascript library unload event + * + * @access public + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function unload($element = 'this', $js = '') + { + return $this->js->_unload($element, $js); + } + + // -------------------------------------------------------------------- + // Effects + // -------------------------------------------------------------------- + + + /** + * Add Class + * + * Outputs a javascript library addClass event + * + * @access public + * @param string - element + * @param string - Class to add + * @return string + */ + function addClass($element = 'this', $class = '') + { + return $this->js->_addClass($element, $class); + } + + // -------------------------------------------------------------------- + + /** + * Animate + * + * Outputs a javascript library animate event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function animate($element = 'this', $params = array(), $speed = '', $extra = '') + { + return $this->js->_animate($element, $params, $speed, $extra); + } + + // -------------------------------------------------------------------- + + /** + * Fade In + * + * Outputs a javascript library hide event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function fadeIn($element = 'this', $speed = '', $callback = '') + { + return $this->js->_fadeIn($element, $speed, $callback); + } + + // -------------------------------------------------------------------- + + /** + * Fade Out + * + * Outputs a javascript library hide event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function fadeOut($element = 'this', $speed = '', $callback = '') + { + return $this->js->_fadeOut($element, $speed, $callback); + } + // -------------------------------------------------------------------- + + /** + * Slide Up + * + * Outputs a javascript library slideUp event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function slideUp($element = 'this', $speed = '', $callback = '') + { + return $this->js->_slideUp($element, $speed, $callback); + + } + + // -------------------------------------------------------------------- + + /** + * Remove Class + * + * Outputs a javascript library removeClass event + * + * @access public + * @param string - element + * @param string - Class to add + * @return string + */ + function removeClass($element = 'this', $class = '') + { + return $this->js->_removeClass($element, $class); + } + + // -------------------------------------------------------------------- + + /** + * Slide Down + * + * Outputs a javascript library slideDown event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function slideDown($element = 'this', $speed = '', $callback = '') + { + return $this->js->_slideDown($element, $speed, $callback); + } + + // -------------------------------------------------------------------- + + /** + * Slide Toggle + * + * Outputs a javascript library slideToggle event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function slideToggle($element = 'this', $speed = '', $callback = '') + { + return $this->js->_slideToggle($element, $speed, $callback); + + } + + // -------------------------------------------------------------------- + + /** + * Hide + * + * Outputs a javascript library hide action + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function hide($element = 'this', $speed = '', $callback = '') + { + return $this->js->_hide($element, $speed, $callback); + } + + // -------------------------------------------------------------------- + + /** + * Toggle + * + * Outputs a javascript library toggle event + * + * @access public + * @param string - element + * @return string + */ + function toggle($element = 'this') + { + return $this->js->_toggle($element); + + } + + // -------------------------------------------------------------------- + + /** + * Toggle Class + * + * Outputs a javascript library toggle class event + * + * @access public + * @param string - element + * @return string + */ + function toggleClass($element = 'this', $class='') + { + return $this->js->_toggleClass($element, $class); + } + + // -------------------------------------------------------------------- + + /** + * Show + * + * Outputs a javascript library show event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function show($element = 'this', $speed = '', $callback = '') + { + return $this->js->_show($element, $speed, $callback); + } + + + // -------------------------------------------------------------------- + + /** + * Compile + * + * gather together all script needing to be output + * + * @access public + * @param string The element to attach the event to + * @return string + */ + function compile($view_var = 'script_foot', $script_tags = TRUE) + { + $this->js->_compile($view_var, $script_tags); + } + + /** + * Clear Compile + * + * Clears any previous javascript collected for output + * + * @access public + * @return void + */ + function clear_compile() + { + $this->js->_clear_compile(); + } + + // -------------------------------------------------------------------- + + /** + * External + * + * Outputs a + * + * @access private + * @param string + * @return string + */ + function _close_script($extra = "\n") + { + return "$extra"; + } + + + // -------------------------------------------------------------------- + // -------------------------------------------------------------------- + // AJAX-Y STUFF - still a testbed + // -------------------------------------------------------------------- + // -------------------------------------------------------------------- + + /** + * Update + * + * Outputs a javascript library slideDown event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function update($element = 'this', $speed = '', $callback = '') + { + return $this->js->_updater($element, $speed, $callback); + } + + // -------------------------------------------------------------------- + + /** + * Generate JSON + * + * Can be passed a database result or associative array and returns a JSON formatted string + * + * @param mixed result set or array + * @param bool match array types (defaults to objects) + * @return string a json formatted string + */ + function generate_json($result = NULL, $match_array_type = FALSE) + { + // JSON data can optionally be passed to this function + // either as a database result object or an array, or a user supplied array + if ( ! is_null($result)) + { + if (is_object($result)) + { + $json_result = $result->result_array(); + } + elseif (is_array($result)) + { + $json_result = $result; + } + else + { + return $this->_prep_args($result); + } + } + else + { + return 'null'; + } + + $json = array(); + $_is_assoc = TRUE; + + if ( ! is_array($json_result) AND empty($json_result)) + { + show_error("Generate JSON Failed - Illegal key, value pair."); + } + elseif ($match_array_type) + { + $_is_assoc = $this->_is_associative_array($json_result); + } + + foreach ($json_result as $k => $v) + { + if ($_is_assoc) + { + $json[] = $this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type); + } + else + { + $json[] = $this->generate_json($v, $match_array_type); + } + } + + $json = implode(',', $json); + + return $_is_assoc ? "{".$json."}" : "[".$json."]"; + + } + + // -------------------------------------------------------------------- + + /** + * Is associative array + * + * Checks for an associative array + * + * @access public + * @param type + * @return type + */ + function _is_associative_array($arr) + { + foreach (array_keys($arr) as $key => $val) + { + if ($key !== $val) + { + return TRUE; + } + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Prep Args + * + * Ensures a standard json value and escapes values + * + * @access public + * @param type + * @return type + */ + function _prep_args($result, $is_key = FALSE) + { + if (is_null($result)) + { + return 'null'; + } + elseif (is_bool($result)) + { + return ($result === TRUE) ? 'true' : 'false'; + } + elseif (is_string($result) OR $is_key) + { + return '"'.str_replace(array('\\', "\t", "\n", "\r", '"'), array('\\\\', '\\t', '\\n', "\\r", '\"'), $result).'"'; + } + elseif (is_scalar($result)) + { + return $result; + } + } +} + + +/* End of file Javascript.php */ +/* Location: ./system/libraries/Javascript.php */ \ No newline at end of file diff --git a/system/libraries/Jquery.php b/system/libraries/Jquery.php new file mode 100644 index 00000000..c63a7423 --- /dev/null +++ b/system/libraries/Jquery.php @@ -0,0 +1,1071 @@ +CI =& get_instance(); + extract($params); + + if ($autoload === TRUE) + { + $this->script(); + } + + log_message('debug', "Jquery Class Initialized"); + } + + // -------------------------------------------------------------------- + // Event Code + // -------------------------------------------------------------------- + + /** + * Blur + * + * Outputs a jQuery blur event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _blur($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'blur'); + } + + // -------------------------------------------------------------------- + + /** + * Change + * + * Outputs a jQuery change event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _change($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'change'); + } + + // -------------------------------------------------------------------- + + /** + * Click + * + * Outputs a jQuery click event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @param boolean whether or not to return false + * @return string + */ + function _click($element = 'this', $js = '', $ret_false = TRUE) + { + if ( ! is_array($js)) + { + $js = array($js); + } + + if ($ret_false) + { + $js[] = "return false;"; + } + + return $this->_add_event($element, $js, 'click'); + } + + // -------------------------------------------------------------------- + + /** + * Double Click + * + * Outputs a jQuery dblclick event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _dblclick($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'dblclick'); + } + + // -------------------------------------------------------------------- + + /** + * Error + * + * Outputs a jQuery error event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _error($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'error'); + } + + // -------------------------------------------------------------------- + + /** + * Focus + * + * Outputs a jQuery focus event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _focus($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'focus'); + } + + // -------------------------------------------------------------------- + + /** + * Hover + * + * Outputs a jQuery hover event + * + * @access private + * @param string - element + * @param string - Javascript code for mouse over + * @param string - Javascript code for mouse out + * @return string + */ + function _hover($element = 'this', $over, $out) + { + $event = "\n\t$(" . $this->_prep_element($element) . ").hover(\n\t\tfunction()\n\t\t{\n\t\t\t{$over}\n\t\t}, \n\t\tfunction()\n\t\t{\n\t\t\t{$out}\n\t\t});\n"; + + $this->jquery_code_for_compile[] = $event; + + return $event; + } + + // -------------------------------------------------------------------- + + /** + * Keydown + * + * Outputs a jQuery keydown event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _keydown($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'keydown'); + } + + // -------------------------------------------------------------------- + + /** + * Keyup + * + * Outputs a jQuery keydown event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _keyup($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'keyup'); + } + + // -------------------------------------------------------------------- + + /** + * Load + * + * Outputs a jQuery load event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _load($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'load'); + } + + // -------------------------------------------------------------------- + + /** + * Mousedown + * + * Outputs a jQuery mousedown event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _mousedown($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'mousedown'); + } + + // -------------------------------------------------------------------- + + /** + * Mouse Out + * + * Outputs a jQuery mouseout event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _mouseout($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'mouseout'); + } + + // -------------------------------------------------------------------- + + /** + * Mouse Over + * + * Outputs a jQuery mouseover event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _mouseover($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'mouseover'); + } + + // -------------------------------------------------------------------- + + /** + * Mouseup + * + * Outputs a jQuery mouseup event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _mouseup($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'mouseup'); + } + + // -------------------------------------------------------------------- + + /** + * Output + * + * Outputs script directly + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _output($array_js = '') + { + if ( ! is_array($array_js)) + { + $array_js = array($array_js); + } + + foreach ($array_js as $js) + { + $this->jquery_code_for_compile[] = "\t$js\n"; + } + } + + // -------------------------------------------------------------------- + + /** + * Resize + * + * Outputs a jQuery resize event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _resize($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'resize'); + } + + // -------------------------------------------------------------------- + + /** + * Scroll + * + * Outputs a jQuery scroll event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _scroll($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'scroll'); + } + + // -------------------------------------------------------------------- + + /** + * Unload + * + * Outputs a jQuery unload event + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @return string + */ + function _unload($element = 'this', $js = '') + { + return $this->_add_event($element, $js, 'unload'); + } + + // -------------------------------------------------------------------- + // Effects + // -------------------------------------------------------------------- + + /** + * Add Class + * + * Outputs a jQuery addClass event + * + * @access private + * @param string - element + * @return string + */ + function _addClass($element = 'this', $class='') + { + $element = $this->_prep_element($element); + $str = "$({$element}).addClass(\"$class\");"; + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Animate + * + * Outputs a jQuery animate event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _animate($element = 'this', $params = array(), $speed = '', $extra = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + $animations = "\t\t\t"; + + foreach ($params as $param=>$value) + { + $animations .= $param.': \''.$value.'\', '; + } + + $animations = substr($animations, 0, -2); // remove the last ", " + + if ($speed != '') + { + $speed = ', '.$speed; + } + + if ($extra != '') + { + $extra = ', '.$extra; + } + + $str = "$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Fade In + * + * Outputs a jQuery hide event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _fadeIn($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).fadeIn({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Fade Out + * + * Outputs a jQuery hide event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _fadeOut($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).fadeOut({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Hide + * + * Outputs a jQuery hide action + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _hide($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).hide({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Remove Class + * + * Outputs a jQuery remove class event + * + * @access private + * @param string - element + * @return string + */ + function _removeClass($element = 'this', $class='') + { + $element = $this->_prep_element($element); + $str = "$({$element}).removeClass(\"$class\");"; + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Slide Up + * + * Outputs a jQuery slideUp event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _slideUp($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).slideUp({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Slide Down + * + * Outputs a jQuery slideDown event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _slideDown($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).slideDown({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Slide Toggle + * + * Outputs a jQuery slideToggle event + * + * @access public + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _slideToggle($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).slideToggle({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Toggle + * + * Outputs a jQuery toggle event + * + * @access private + * @param string - element + * @return string + */ + function _toggle($element = 'this') + { + $element = $this->_prep_element($element); + $str = "$({$element}).toggle();"; + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Toggle Class + * + * Outputs a jQuery toggle class event + * + * @access private + * @param string - element + * @return string + */ + function _toggleClass($element = 'this', $class='') + { + $element = $this->_prep_element($element); + $str = "$({$element}).toggleClass(\"$class\");"; + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Show + * + * Outputs a jQuery show event + * + * @access private + * @param string - element + * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds + * @param string - Javascript callback function + * @return string + */ + function _show($element = 'this', $speed = '', $callback = '') + { + $element = $this->_prep_element($element); + $speed = $this->_validate_speed($speed); + + if ($callback != '') + { + $callback = ", function(){\n{$callback}\n}"; + } + + $str = "$({$element}).show({$speed}{$callback});"; + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Updater + * + * An Ajax call that populates the designated DOM node with + * returned content + * + * @access private + * @param string The element to attach the event to + * @param string the controller to run the call against + * @param string optional parameters + * @return string + */ + + function _updater($container = 'this', $controller, $options = '') + { + $container = $this->_prep_element($container); + + $controller = (strpos('://', $controller) === FALSE) ? $controller : $this->CI->config->site_url($controller); + + // ajaxStart and ajaxStop are better choices here... but this is a stop gap + if ($this->CI->config->item('javascript_ajax_img') == '') + { + $loading_notifier = "Loading..."; + } + else + { + $loading_notifier = 'CI->config->slash_item('base_url') . $this->CI->config->item('javascript_ajax_img') . '\' alt=\'Loading\' />'; + } + + $updater = "$($container).empty();\n"; // anything that was in... get it out + $updater .= "\t\t$($container).prepend(\"$loading_notifier\");\n"; // to replace with an image + + $request_options = ''; + if ($options != '') + { + $request_options .= ", {"; + $request_options .= (is_array($options)) ? "'".implode("', '", $options)."'" : "'".str_replace(":", "':'", $options)."'"; + $request_options .= "}"; + } + + $updater .= "\t\t$($container).load('$controller'$request_options);"; + return $updater; + } + + + // -------------------------------------------------------------------- + // Pre-written handy stuff + // -------------------------------------------------------------------- + + /** + * Zebra tables + * + * @access private + * @param string table name + * @param string plugin location + * @return string + */ + function _zebraTables($class = '', $odd = 'odd', $hover = '') + { + $class = ($class != '') ? '.'.$class : ''; + + $zebra = "\t\$(\"table{$class} tbody tr:nth-child(even)\").addClass(\"{$odd}\");"; + + $this->jquery_code_for_compile[] = $zebra; + + if ($hover != '') + { + $hover = $this->hover("table{$class} tbody tr", "$(this).addClass('hover');", "$(this).removeClass('hover');"); + } + + return $zebra; + } + + + + // -------------------------------------------------------------------- + // Plugins + // -------------------------------------------------------------------- + + /** + * Corner Plugin + * + * http://www.malsup.com/jquery/corner/ + * + * @access public + * @param string target + * @return string + */ + function corner($element = '', $corner_style = '') + { + // may want to make this configurable down the road + $corner_location = '/plugins/jquery.corner.js'; + + if ($corner_style != '') + { + $corner_style = '"'.$corner_style.'"'; + } + + return "$(" . $this->_prep_element($element) . ").corner(".$corner_style.");"; + } + + // -------------------------------------------------------------------- + + /** + * modal window + * + * Load a thickbox modal window + * + * @access public + * @return void + */ + function modal($src, $relative = FALSE) + { + $this->jquery_code_for_load[] = $this->external($src, $relative); + } + + // -------------------------------------------------------------------- + + /** + * Effect + * + * Load an Effect library + * + * @access public + * @return void + */ + function effect($src, $relative = FALSE) + { + $this->jquery_code_for_load[] = $this->external($src, $relative); + } + + // -------------------------------------------------------------------- + + /** + * Plugin + * + * Load a plugin library + * + * @access public + * @return void + */ + function plugin($src, $relative = FALSE) + { + $this->jquery_code_for_load[] = $this->external($src, $relative); + } + + // -------------------------------------------------------------------- + + /** + * UI + * + * Load a user interface library + * + * @access public + * @return void + */ + function ui($src, $relative = FALSE) + { + $this->jquery_code_for_load[] = $this->external($src, $relative); + } + // -------------------------------------------------------------------- + + /** + * Sortable + * + * Creates a jQuery sortable + * + * @access public + * @return void + */ + function sortable($element, $options = array()) + { + + if (count($options) > 0) + { + $sort_options = array(); + foreach ($options as $k=>$v) + { + $sort_options[] = "\n\t\t".$k.': '.$v.""; + } + $sort_options = implode(",", $sort_options); + } + else + { + $sort_options = ''; + } + + return "$(" . $this->_prep_element($element) . ").sortable({".$sort_options."\n\t});"; + } + + // -------------------------------------------------------------------- + + /** + * Table Sorter Plugin + * + * @access public + * @param string table name + * @param string plugin location + * @return string + */ + function tablesorter($table = '', $options = '') + { + $this->jquery_code_for_compile[] = "\t$(" . $this->_prep_element($table) . ").tablesorter($options);\n"; + } + + // -------------------------------------------------------------------- + // Class functions + // -------------------------------------------------------------------- + + /** + * Add Event + * + * Constructs the syntax for an event, and adds to into the array for compilation + * + * @access private + * @param string The element to attach the event to + * @param string The code to execute + * @param string The event to pass + * @return string + */ + function _add_event($element, $js, $event) + { + if (is_array($js)) + { + $js = implode("\n\t\t", $js); + + } + + $event = "\n\t$(" . $this->_prep_element($element) . ").{$event}(function(){\n\t\t{$js}\n\t});\n"; + $this->jquery_code_for_compile[] = $event; + return $event; + } + + // -------------------------------------------------------------------- + + /** + * Compile + * + * As events are specified, they are stored in an array + * This funciton compiles them all for output on a page + * + * @access private + * @return string + */ + function _compile($view_var = 'script_foot', $script_tags = TRUE) + { + // External references + $external_scripts = implode('', $this->jquery_code_for_load); + $this->CI->load->vars(array('library_src' => $external_scripts)); + + if (count($this->jquery_code_for_compile) == 0 ) + { + // no inline references, let's just return + return; + } + + // Inline references + $script = '$(document).ready(function() {' . "\n"; + $script .= implode('', $this->jquery_code_for_compile); + $script .= '});'; + + $output = ($script_tags === FALSE) ? $script : $this->inline($script); + + $this->CI->load->vars(array($view_var => $output)); + + } + + // -------------------------------------------------------------------- + + /** + * Clear Compile + * + * Clears the array of script events collected for output + * + * @access public + * @return void + */ + function _clear_compile() + { + $this->jquery_code_for_compile = array(); + } + + // -------------------------------------------------------------------- + + /** + * Document Ready + * + * A wrapper for writing document.ready() + * + * @access private + * @return string + */ + function _document_ready($js) + { + if ( ! is_array($js)) + { + $js = array ($js); + + } + + foreach ($js as $script) + { + $this->jquery_code_for_compile[] = $script; + } + } + + // -------------------------------------------------------------------- + + /** + * Script Tag + * + * Outputs the script tag that loads the jquery.js file into an HTML document + * + * @access public + * @param string + * @return string + */ + function script($library_src = '', $relative = FALSE) + { + $library_src = $this->external($library_src, $relative); + $this->jquery_code_for_load[] = $library_src; + return $library_src; + } + + // -------------------------------------------------------------------- + + /** + * Prep Element + * + * Puts HTML element in quotes for use in jQuery code + * unless the supplied element is the Javascript 'this' + * object, in which case no quotes are added + * + * @access public + * @param string + * @return string + */ + function _prep_element($element) + { + if ($element != 'this') + { + $element = '"'.$element.'"'; + } + + return $element; + } + + // -------------------------------------------------------------------- + + /** + * Validate Speed + * + * Ensures the speed parameter is valid for jQuery + * + * @access private + * @param string + * @return string + */ + function _validate_speed($speed) + { + if (in_array($speed, array('slow', 'normal', 'fast'))) + { + $speed = '"'.$speed.'"'; + } + elseif (preg_match("/[^0-9]/", $speed)) + { + $speed = ''; + } + + return $speed; + } + +} + +/* End of file Jquery.php */ +/* Location: ./system/libraries/Jquery.php */ \ No newline at end of file From 079303e4240ac6661f21d56bc22001c3963ab599 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 18:16:23 -0600 Subject: [PATCH 1833/2544] adding HTTP_X_FORWARDED_FOR header to Profiler --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ebadf861..bf20f172 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -380,7 +380,7 @@ function _compile_http_headers() $output .= "\n\n\n"; - foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING') as $header) + foreach(array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; $output .= "\n"; From e701d76c5050b18d576523e5a997fa5ff4ba6251 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 18:17:01 -0600 Subject: [PATCH 1834/2544] added Security library --- system/libraries/Security.php | 710 ++++++++++++++++++++++++++++++++++ 1 file changed, 710 insertions(+) create mode 100644 system/libraries/Security.php diff --git a/system/libraries/Security.php b/system/libraries/Security.php new file mode 100644 index 00000000..93da5920 --- /dev/null +++ b/system/libraries/Security.php @@ -0,0 +1,710 @@ + '[removed]', + 'document.write' => '[removed]', + '.parentNode' => '[removed]', + '.innerHTML' => '[removed]', + 'window.location' => '[removed]', + '-moz-binding' => '[removed]', + '' => '-->', + ' '<![CDATA[' + ); + /* never allowed, regex replacement */ + var $never_allowed_regex = array( + "javascript\s*:" => '[removed]', + "expression\s*(\(|&\#40;)" => '[removed]', // CSS and IE + "vbscript\s*:" => '[removed]', // IE, surprise! + "Redirect\s+302" => '[removed]' + ); + + function CI_Security() + { + // Set the CSRF hash + $this->_csrf_set_hash(); + + log_message('debug', "Security Class Initialized"); + } + + // -------------------------------------------------------------------- + + /** + * Verify Cross Site Request Forgery Protection + * + * @access public + * @return null + */ + function csrf_verify() + { + // If no POST data exists we will set the CSRF cookie + if (count($_POST) == 0) + { + return $this->csrf_set_cookie(); + } + + // Do the tokens exist in both the _POST and _COOKIE arrays? + if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csrf_token_name])) + { + $this->csrf_show_error(); + } + + // Do the tokens match? + if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csrf_token_name]) + { + $this->csrf_show_error(); + } + + // We kill this since we're done and we don't want to polute the _POST array + unset($_POST[$this->csrf_token_name]); + + log_message('debug', "CSRF token verified "); + } + + // -------------------------------------------------------------------- + + /** + * Set Cross Site Request Forgery Protection Cookie + * + * @access public + * @return null + */ + function csrf_set_cookie() + { + $prefix = ( ! is_string(config_item('cookie_prefix'))) ? '' : config_item('cookie_prefix'); + + $expire = time() + $this->csrf_expire; + + setcookie($prefix.$this->csrf_token_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); + + log_message('debug', "CRSF cookie Set"); + } + + // -------------------------------------------------------------------- + + /** + * Set Cross Site Request Forgery Protection Cookie + * + * @access public + * @return null + */ + function _csrf_set_hash() + { + if ($this->csrf_hash == '') + { + // If the cookie exists we will use it's value. We don't necessarily want to regenerate it with + // each page load since a page could contain embedded sub-pages causing this feature to fail + if (isset($_COOKIE[$this->csrf_token_name]) AND $_COOKIE[$this->csrf_token_name] != '') + { + $this->csrf_hash = $_COOKIE[$this->csrf_token_name]; + } + else + { + $this->csrf_hash = md5(uniqid(rand(), TRUE)); + } + } + + return $this->csrf_hash; + } + + // -------------------------------------------------------------------- + + /** + * Show CSRF Error + * + * @access public + * @return null + */ + function csrf_show_error() + { + show_error('The action you have requested is not allowed.'); + } + + // -------------------------------------------------------------------- + + /** + * XSS Clean + * + * Sanitizes data so that Cross Site Scripting Hacks can be + * prevented. This function does a fair amount of work but + * it is extremely thorough, designed to prevent even the + * most obscure XSS attempts. Nothing is ever 100% foolproof, + * of course, but I haven't been able to get anything passed + * the filter. + * + * Note: This function should only be used to deal with data + * upon submission. It's not something that should + * be used for general runtime processing. + * + * This function was based in part on some code and ideas I + * got from Bitflux: http://channel.bitflux.ch/wiki/XSS_Prevention + * + * To help develop this script I used this great list of + * vulnerabilities along with a few other hacks I've + * harvested from examining vulnerabilities in other programs: + * http://ha.ckers.org/xss.html + * + * @access public + * @param mixed string or array + * @return string + */ + function xss_clean($str, $is_image = FALSE) + { + /* + * Is the string an array? + * + */ + if (is_array($str)) + { + while (list($key) = each($str)) + { + $str[$key] = $this->xss_clean($str[$key]); + } + + return $str; + } + + /* + * Remove Invisible Characters + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Protect GET variables in URLs + */ + + // 901119URL5918AMP18930PROTECT8198 + + $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str); + + /* + * Validate standard character entities + * + * Add a semicolon if missing. We do this to enable + * the conversion of entities to ASCII later. + * + */ + $str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str); + + /* + * Validate UTF16 two byte encoding (x00) + * + * Just as above, adds a semicolon if missing. + * + */ + $str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str); + + /* + * Un-Protect GET variables in URLs + */ + $str = str_replace($this->xss_hash(), '&', $str); + + /* + * URL Decode + * + * Just in case stuff like this is submitted: + * + * Google + * + * Note: Use rawurldecode() so it does not remove plus signs + * + */ + $str = rawurldecode($str); + + /* + * Convert character entities to ASCII + * + * This permits our tests below to work reliably. + * We only convert entities that are within tags since + * these are the ones that will pose security problems. + * + */ + + $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); + + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); + + /* + * Remove Invisible Characters Again! + */ + $str = $this->_remove_invisible_characters($str); + + /* + * Convert all tabs to spaces + * + * This prevents strings like this: ja vascript + * NOTE: we deal with spaces between characters later. + * NOTE: preg_replace was found to be amazingly slow here on large blocks of data, + * so we use str_replace. + * + */ + + if (strpos($str, "\t") !== FALSE) + { + $str = str_replace("\t", ' ', $str); + } + + /* + * Capture converted string for later comparison + */ + $converted_string = $str; + + /* + * Not Allowed Under Any Conditions + */ + + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Makes PHP tags safe + * + * Note: XML tags are inadvertently replaced too: + * + * '), array('<?', '?>'), $str); + } + + /* + * Compact any exploded words + * + * This corrects words like: j a v a s c r i p t + * These words are compacted back to their correct state. + * + */ + $words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window'); + foreach ($words as $word) + { + $temp = ''; + + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) + { + $temp .= substr($word, $i, 1)."\s*"; + } + + // We only want to do this when it is followed by a non-word character + // That way valid stuff like "dealer to" does not become "dealerto" + $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); + } + + /* + * Remove disallowed Javascript in links or img tags + * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared + * to these simplified non-capturing preg_match(), especially if the pattern exists in the string + */ + do + { + $original = $str; + + if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); + } + + if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); + } + + if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) + { + $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); + } + } + while($original != $str); + + unset($original); + + /* + * Remove JavaScript Event Handlers + * + * Note: This code is a little blunt. It removes + * the event handler and anything up to the closing >, + * but it's unlikely to be a problem. + * + */ + $event_handlers = array('[^a-z_\-]on\w*','xmlns'); + + if ($is_image === TRUE) + { + /* + * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, + * so we have to allow this for images. -Paul + */ + unset($event_handlers[array_search('xmlns', $event_handlers)]); + } + + $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); + + /* + * Sanitize naughty HTML elements + * + * If a tag containing any of the words in the list + * below is found, the tag gets converted to entities. + * + * So this: + * Becomes: <blink> + * + */ + $naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss'; + $str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str); + + /* + * Sanitize naughty scripting elements + * + * Similar to above, only instead of looking for + * tags it looks for PHP and JavaScript commands + * that are disallowed. Rather than removing the + * code, it simply converts the parenthesis to entities + * rendering the code un-executable. + * + * For example: eval('some code') + * Becomes: eval('some code') + * + */ + $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); + + /* + * Final clean up + * + * This adds a bit of extra precaution in case + * something got through the above filters + * + */ + foreach ($this->never_allowed_str as $key => $val) + { + $str = str_replace($key, $val, $str); + } + + foreach ($this->never_allowed_regex as $key => $val) + { + $str = preg_replace("#".$key."#i", $val, $str); + } + + /* + * Images are Handled in a Special Way + * - Essentially, we want to know that after all of the character conversion is done whether + * any unwanted, likely XSS, code was found. If not, we return TRUE, as the image is clean. + * However, if the string post-conversion does not matched the string post-removal of XSS, + * then it fails, as there was unwanted XSS code found and removed/changed during processing. + */ + + if ($is_image === TRUE) + { + if ($str == $converted_string) + { + return TRUE; + } + else + { + return FALSE; + } + } + + log_message('debug', "XSS Filtering completed"); + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Random Hash for protecting URLs + * + * @access public + * @return string + */ + function xss_hash() + { + if ($this->xss_hash == '') + { + if (phpversion() >= 4.2) + mt_srand(); + else + mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); + + $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); + } + + return $this->xss_hash; + } + + // -------------------------------------------------------------------- + + /** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ + function _remove_invisible_characters($str) + { + static $non_displayables; + + if ( ! isset($non_displayables)) + { + // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', '/\x0c/', // 11, 12 + '/[\x0e-\x1f]/' // 14-31 + ); + } + + do + { + $cleaned = $str; + $str = preg_replace($non_displayables, '', $str); + } + while ($cleaned != $str); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Compact Exploded Words + * + * Callback function for xss_clean() to remove whitespace from + * things like j a v a s c r i p t + * + * @access public + * @param type + * @return type + */ + function _compact_exploded_words($matches) + { + return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; + } + + // -------------------------------------------------------------------- + + /** + * Sanitize Naughty HTML + * + * Callback function for xss_clean() to remove naughty HTML elements + * + * @access private + * @param array + * @return string + */ + function _sanitize_naughty_html($matches) + { + // encode opening brace + $str = '<'.$matches[1].$matches[2].$matches[3]; + + // encode captured opening or closing brace to prevent recursive vectors + $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * JS Link Removal + * + * Callback function for xss_clean() to sanitize links + * This limits the PCRE backtracks, making it more performance friendly + * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in + * PHP 5.2+ on link-heavy strings + * + * @access private + * @param array + * @return string + */ + function _js_link_removal($match) + { + $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<', '\\'), array('>', '<', '\\\\'), $match[0]); + } + + // -------------------------------------------------------------------- + + /** + * Filter Attributes + * + * Filters tag attributes for consistency and safety + * + * @access public + * @param string + * @return string + */ + function _filter_attributes($str) + { + $out = ''; + + if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches)) + { + foreach ($matches[0] as $match) + { + $out .= preg_replace("#/\*.*?\*/#s", '', $match); + } + } + + return $out; + } + + // -------------------------------------------------------------------- + + /** + * HTML Entity Decode Callback + * + * Used as a callback for XSS Clean + * + * @access public + * @param array + * @return string + */ + function _decode_entity($match) + { + $CI =& get_instance(); + $CI->load->helper('typography'); + return entity_decode($match[0], strtoupper($CI->config->item('charset'))); + } + + // -------------------------------------------------------------------- + + /** + * Filename Security + * + * @access public + * @param string + * @return string + */ + function sanitize_filename($str) + { + $bad = array( + "../", + "./", + "", + "<", + ">", + "'", + '"', + '&', + '$', + '#', + '{', + '}', + '[', + ']', + '=', + ';', + '?', + '/', + "%20", + "%22", + "%3c", // < + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; + "%3d" // = + ); + + return stripslashes(str_replace($bad, '', $str)); + } + +} +// END Security Class + +/* End of file Security.php */ +/* Location: ./system/libraries/Security.php */ \ No newline at end of file From 7b5b0e2d4000fadabcdad894538e42c23ebb9ecd Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 22:48:53 -0600 Subject: [PATCH 1835/2544] expanded abilities of Table library --- system/libraries/Table.php | 138 ++++++++++++++++++++++++++------ user_guide/libraries/table.html | 41 +++++++--- 2 files changed, 145 insertions(+), 34 deletions(-) diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 6d36121f..1f920ea9 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -35,7 +35,7 @@ class CI_Table { var $template = NULL; var $newline = "\n"; var $empty_cells = ""; - + var $function = FALSE; function CI_Table() { @@ -75,7 +75,7 @@ function set_template($template) function set_heading() { $args = func_get_args(); - $this->heading = (is_array($args[0])) ? $args[0] : $args; + $this->heading = $this->_prep_args($args); } // -------------------------------------------------------------------- @@ -110,7 +110,7 @@ function make_columns($array = array(), $col_limit = 0) $new = array(); while(count($array) > 0) { - $temp = array_splice($array, 0, $col_limit); + $temp = array_splice($array, 0, $col_limit); if (count($temp) < $col_limit) { @@ -156,11 +156,59 @@ function set_empty($value) function add_row() { $args = func_get_args(); - $this->rows[] = (is_array($args[0])) ? $args[0] : $args; + $this->rows[] = $this->_prep_args($args); } // -------------------------------------------------------------------- + + /** + * Prep Args + * + * Ensures a standard associative array format for all cell data + * + * @access public + * @param type + * @return type + */ + function _prep_args($args) + { + // If there is no $args[0], skip this and treat as an associative array + // This can happen if there is only a single key, for example this is passed to table->generate + // array(array('foo'=>'bar')) + if (isset($args[0]) AND (count($args) == 1 && is_array($args[0]))) + { + // args sent as indexed array + if ( ! isset($args[0]['data'])) + { + foreach ($args[0] as $key => $val) + { + if (is_array($val) && isset($val['data'])) + { + $args[$key] = $val; + } + else + { + $args[$key] = array('data' => $val); + } + } + } + } + else + { + foreach ($args as $key => $val) + { + if ( ! is_array($val)) + { + $args[$key] = array('data' => $val); + } + } + } + + return $args; + } + // -------------------------------------------------------------------- + /** * Add a table caption * @@ -208,7 +256,9 @@ function generate($table_data = NULL) // Compile and validate the template date $this->_compile_template(); - + // set a custom cell manipulation function to a locally scoped variable so its callable + $function = $this->function; + // Build the table! $out = $this->template['table_open']; @@ -225,23 +275,40 @@ function generate($table_data = NULL) // Is there a table heading to display? if (count($this->heading) > 0) { + $out .= $this->template['thead_open']; + $out .= $this->newline; $out .= $this->template['heading_row_start']; - $out .= $this->newline; + $out .= $this->newline; foreach($this->heading as $heading) { - $out .= $this->template['heading_cell_start']; - $out .= $heading; + $temp = $this->template['heading_cell_start']; + + foreach ($heading as $key => $val) + { + if ($key != 'data') + { + $temp = str_replace('template['heading_cell_end']; } $out .= $this->template['heading_row_end']; - $out .= $this->newline; + $out .= $this->newline; + $out .= $this->template['thead_close']; + $out .= $this->newline; } - + // Build the table rows if (count($this->rows) > 0) { + $out .= $this->template['tbody_open']; + $out .= $this->newline; + $i = 1; foreach($this->rows as $row) { @@ -258,15 +325,33 @@ function generate($table_data = NULL) foreach($row as $cell) { - $out .= $this->template['cell_'.$name.'start']; + $temp = $this->template['cell_'.$name.'start']; + + foreach ($cell as $key => $val) + { + if ($key != 'data') + { + $temp = str_replace('empty_cells; } else { - $out .= $cell; + if ($function !== FALSE && is_callable($function)) + { + $out .= $function($cell); + } + else + { + $out .= $cell; + } } $out .= $this->template['cell_'.$name.'end']; @@ -275,6 +360,9 @@ function generate($table_data = NULL) $out .= $this->template['row_'.$name.'end']; $out .= $this->newline; } + + $out .= $this->template['tbody_close']; + $out .= $this->newline; } $out .= $this->template['table_close']; @@ -321,7 +409,7 @@ function _set_from_object($query) return FALSE; } - $this->heading = $query->list_fields(); + $this->heading = $this->_prep_args($query->list_fields()); } // Next blast through the result array and build out the rows @@ -330,7 +418,7 @@ function _set_from_object($query) { foreach ($query->result_array() as $row) { - $this->rows[] = $row; + $this->rows[] = $this->_prep_args($row); } } } @@ -353,21 +441,15 @@ function _set_from_array($data, $set_heading = TRUE) $i = 0; foreach ($data as $row) - { - if ( ! is_array($row)) - { - $this->rows[] = $data; - break; - } - + { // If a heading hasn't already been set we'll use the first row of the array as the heading if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE) { - $this->heading = $row; + $this->heading = $this->_prep_args($row); } else { - $this->rows[] = $row; + $this->rows[] = $this->_prep_args($row); } $i++; @@ -391,7 +473,7 @@ function _compile_template() } $this->temp = $this->_default_template(); - foreach (array('table_open','heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val) + foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val) { if ( ! isset($this->template[$val])) { @@ -412,12 +494,18 @@ function _default_template() { return array ( 'table_open' => '
      ".$header."  ".$val."
      ', - + + 'thead_open' => '', + 'thead_close' => '', + 'heading_row_start' => '', 'heading_row_end' => '', 'heading_cell_start' => '', + 'tbody_open' => '', + 'tbody_close' => '', + 'row_start' => '', 'row_end' => '', 'cell_start' => ' @@ -55,7 +55,7 @@
      -

      Upgrading from 1.7.2 to 1.7.3

      +

      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.

      @@ -78,7 +78,7 @@

      Step 1: Update your CodeIgniter files

      Step 2: Adjust get_dir_file_info() where necessary

      -

      Version 1.7.3 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare +

      Version 2.0.0 brings a non-backwards compatible change to get_dir_file_info() in the File Helper. Non-backwards compatible changes are extremely rare in CodeIgniter, but this one we feel was warranted due to how easy it was to create serious server performance issues. If you need recursiveness where you are using this helper function, change such instances, setting the second parameter, $top_level_only to FALSE:

      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 647dd885..52a6d84e 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
      ', 'heading_cell_end' => '
      ', diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 1c67e4b8..b233dbf8 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -2,17 +2,16 @@ - -HTML Table Class : CodeIgniter User Guide +CodeIgniter User Guide : HTML Table Class - - + - - - - + + + + + @@ -24,7 +23,7 @@ - +
      @@ -199,6 +198,14 @@

      $this->table->add_row()

      $this->table->add_row('Blue', 'Red', 'Green');$this->table->add_row(array('Blue', 'Red', 'Green')); +

      If you would like to set an individual cell's tag attributes, you can use an associative array for that cell. The associative key 'data' defines the cell's data. Any other key => val pairs are added as key='val' attributes to the tag:

      + +$cell = array('data' => 'Blue', 'class' => 'highlight', 'colspan' => 2);
      +$this->table->add_row($cell, 'Red', 'Green');
      +
      +// generates
      +// <td class='highlight' colspan='2'>Blue</td><td>Red</td><td>Green</td> +

      $this->table->make_columns()

      @@ -274,6 +281,22 @@

      $this->table->clear()

      echo $this->table->generate(); +

      $this->table->function

      + +

      Allows you to specify a native PHP function or a valid function array object to be applied to all cell data.

      + +$this->load->library('table');
      +
      +$this->table->set_heading('Name', 'Color', 'Size');
      +$this->table->add_row('Fred', '<strong>Blue</strong>', 'Small');
      +
      +$this->table->function = 'htmlspecialchars';
      +echo $this->table->generate();
      +
      + +

      In the above example, all cell data would be ran through PHP's htmlspecialchars() function, resulting in:

      + +<td>Fred</td><td>&lt;strong&gt;Blue&lt;/strong&gt;</td><td>Small</td> From 5052e27db22d41c5d01c65d03ad515041def63a3 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 22:53:38 -0600 Subject: [PATCH 1836/2544] changing casing on some booleans --- system/libraries/Trackback.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 9b1737c5..a604c0b2 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -128,7 +128,7 @@ function send($tb_data) * Receive Trackback Data * * This function simply validates the incoming TB data. - * It returns false on failure and true on success. + * It returns FALSE on failure and TRUE on success. * If the data is valid it is set to the $this->data array * so that it can be inserted into a database. * @@ -221,7 +221,7 @@ function data($item) * Process Trackback * * Opens a socket connection and passes the data to - * the server. Returns true on success, false on failure + * the server. Returns TRUE on success, FALSE on failure * * @access public * @param string @@ -267,6 +267,7 @@ function process($url, $data) } @fclose($fp); + if (stristr($this->response, '0') === FALSE) { $message = 'An unknown error was encountered'; @@ -383,7 +384,7 @@ function get_id($url) if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) { - return false; + return FALSE; } else { @@ -436,7 +437,7 @@ function limit_characters($str, $n = 500, $end_char = '…') { return $str; } - + $str = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str)); if (strlen($str) <= $n) From e12f64e70fad08c02668ab2fda00cd5d56b8116b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 22:55:08 -0600 Subject: [PATCH 1837/2544] updating Upload features and use of security library --- system/libraries/Upload.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 5ff47826..ac9323c0 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -454,6 +454,11 @@ function set_max_height($n) */ function set_allowed_types($types) { + if ( ! is_array($types) && $types == '*') + { + $this->allowed_types = '*'; + return; + } $this->allowed_types = explode('|', $types); } @@ -551,6 +556,11 @@ function is_image() */ function is_allowed_filetype() { + if ($this->allowed_types == '*') + { + return TRUE; + } + if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types)) { $this->set_error('upload_no_file_types'); @@ -805,7 +815,7 @@ function do_xss_clean() } $CI =& get_instance(); - $data = $CI->input->xss_clean($data); + $data = $CI->security->xss_clean($data); flock($fp, LOCK_EX); fwrite($fp, $data); From a9647e8ed7eb19ca55e84fba9c5ee62e0045881d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 22:59:07 -0600 Subject: [PATCH 1838/2544] updating XMLRPC class to use Security lib --- system/libraries/Xmlrpc.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 5a82391d..c46d52cd 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -513,7 +513,7 @@ function decode($array=FALSE) } else { - $array[$key] = $CI->input->xss_clean($array[$key]); + $array[$key] = $CI->security->xss_clean($array[$key]); } } @@ -529,7 +529,7 @@ function decode($array=FALSE) } else { - $result = $CI->input->xss_clean($result); + $result = $CI->security->xss_clean($result); } } @@ -1127,7 +1127,9 @@ function output_parameters($array=FALSE) } else { - $array[$key] = $CI->input->xss_clean($array[$key]); + // 'bits' is for the MetaWeblog API image bits + // @todo - this needs to be made more general purpose + $array[$key] = ($key == 'bits') ? $array[$key] : $CI->security->xss_clean($array[$key]); } } @@ -1147,7 +1149,7 @@ function output_parameters($array=FALSE) } else { - $parameters[] = $CI->input->xss_clean($a_param); + $parameters[] = $CI->security->xss_clean($a_param); } } } @@ -1322,7 +1324,7 @@ function kindOf() function serializedata($typ, $val) { $rs = ''; - + switch($this->xmlrpcTypes[$typ]) { case 3: From c4c34ee996bfa583b45484b4bc7bbd7dc036bb29 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 23:00:28 -0600 Subject: [PATCH 1839/2544] whitespace --- system/libraries/Xmlrpcs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 429ab847..fe1c99bf 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -40,10 +40,10 @@ class CI_Xmlrpcs extends CI_Xmlrpc var $debug_msg = ''; // Debug Message var $system_methods = array(); // XML RPC Server methods var $controller_obj; - - var $object = FALSE; - + var $object = FALSE; + + //------------------------------------- // Constructor, more or less //------------------------------------- From 22224b513bf5dcb3f34798f0a9568049966d7ee8 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 23:06:53 -0600 Subject: [PATCH 1840/2544] modified cookie helper to use input class --- system/helpers/cookie_helper.php | 43 +------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 40afadb5..4be371ef 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -46,50 +46,9 @@ { function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '') { - if (is_array($name)) - { - foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name') as $item) - { - if (isset($name[$item])) - { - $$item = $name[$item]; - } - } - } - // Set the config file options $CI =& get_instance(); - - if ($prefix == '' AND $CI->config->item('cookie_prefix') != '') - { - $prefix = $CI->config->item('cookie_prefix'); - } - if ($domain == '' AND $CI->config->item('cookie_domain') != '') - { - $domain = $CI->config->item('cookie_domain'); - } - if ($path == '/' AND $CI->config->item('cookie_path') != '/') - { - $path = $CI->config->item('cookie_path'); - } - - if ( ! is_numeric($expire)) - { - $expire = time() - 86500; - } - else - { - if ($expire > 0) - { - $expire = time() + $expire; - } - else - { - $expire = 0; - } - } - - setcookie($prefix.$name, $value, $expire, $path, $domain, 0); + $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); } } From 626d39f92bb9185ea85daafd6679529d054b85ab Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 23:14:56 -0600 Subject: [PATCH 1841/2544] code comments fix --- system/helpers/file_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 2be06ac4..274c4ad3 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -125,7 +125,7 @@ function delete_files($path, $del_dir = FALSE, $level = 0) if ( ! $current_dir = @opendir($path)) { - return TRUE; + return FALSE; } while(FALSE !== ($filename = @readdir($current_dir))) @@ -218,7 +218,7 @@ function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE) * * @access public * @param string path to source - * @param bool whether to include the path as part of the filename + * @param bool Look only at the top level directory specified? * @param bool internal variable to determine recursion status - do not use in calls * @return array */ From aacfe480da6859cd74b70884de34d987c6682267 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 3 Mar 2010 12:26:31 -0600 Subject: [PATCH 1842/2544] Moving Jquery library to javascript/Jquery.php --- system/libraries/Javascript.php | 2 +- system/libraries/{ => javascript}/Jquery.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename system/libraries/{ => javascript}/Jquery.php (99%) diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 3b7dcc6f..af85e650 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -23,7 +23,7 @@ function CI_Javascript($params = array()) $this->CI =& get_instance(); // load the requested js library - $this->CI->load->library($js_library_driver, array('autoload' => $autoload)); + $this->CI->load->library('javsacript/'.$js_library_driver, array('autoload' => $autoload)); // make js to refer to current library $this->js =& $this->CI->$js_library_driver; diff --git a/system/libraries/Jquery.php b/system/libraries/javascript/Jquery.php similarity index 99% rename from system/libraries/Jquery.php rename to system/libraries/javascript/Jquery.php index c63a7423..f6b8dce6 100644 --- a/system/libraries/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -24,7 +24,7 @@ * @link http://www.codeigniter.com/user_guide/libraries/jquery.html */ -class Jquery extends CI_Javascript { +class CI_Jquery extends CI_Javascript { var $_javascript_folder = 'js'; var $jquery_code_for_load = array(); From 1a445f877bc18bd98d9ef722a775d6def09c0b21 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 09:40:14 -0600 Subject: [PATCH 1843/2544] whitespace --- system/libraries/Image_lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 21e0a709..fc78f6b0 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -349,7 +349,7 @@ function initialize($props = array()) function resize() { $protocol = 'image_process_'.$this->image_library; - + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; From f53d1c7e129594d2e38f319d5190e14d7a7c1c98 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 09:40:49 -0600 Subject: [PATCH 1844/2544] more whitespace --- system/libraries/Image_lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index fc78f6b0..21e0a709 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -349,7 +349,7 @@ function initialize($props = array()) function resize() { $protocol = 'image_process_'.$this->image_library; - + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; From 9d653edd03fcc325e94a2c9da36eb250f2a8f889 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 09:52:53 -0600 Subject: [PATCH 1845/2544] fixing docblock for Javascript class --- system/libraries/Javascript.php | 36 +++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index af85e650..efaaab4b 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -1,13 +1,35 @@ 'jquery', 'autoload' => TRUE); foreach ($defaults as $key => $val) @@ -23,7 +45,7 @@ function CI_Javascript($params = array()) $this->CI =& get_instance(); // load the requested js library - $this->CI->load->library('javsacript/'.$js_library_driver, array('autoload' => $autoload)); + $this->CI->load->library('javascript/'.$js_library_driver, array('autoload' => $autoload)); // make js to refer to current library $this->js =& $this->CI->$js_library_driver; @@ -840,8 +862,10 @@ function _prep_args($result, $is_key = FALSE) return $result; } } + + // -------------------------------------------------------------------- } - +// END Javascript Class /* End of file Javascript.php */ /* Location: ./system/libraries/Javascript.php */ \ No newline at end of file From 36591099aa01107294f8b2794351b078b7575a25 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:05:51 -0600 Subject: [PATCH 1846/2544] little cleaner regex in human_to_unix() --- system/helpers/date_helper.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 0e978166..2c60f030 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -288,7 +288,7 @@ function days_in_month($month = 0, $year = '') return $days_in_month[$month - 1]; } } - + // ------------------------------------------------------------------------ /** @@ -343,7 +343,7 @@ function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) return $time; } } - + // ------------------------------------------------------------------------ /** @@ -440,14 +440,14 @@ function human_to_unix($datestr = '') } $datestr = trim($datestr); - $datestr = preg_replace("/\040+/", "\040", $datestr); - + $datestr = preg_replace("/\040+/", ' ', $datestr); + if ( ! preg_match('/^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s[0-9]{1,2}:[0-9]{1,2}(?::[0-9]{1,2})?(?:\s[AP]M)?$/i', $datestr)) { return FALSE; } - - $split = preg_split("/\040/", $datestr); + + $split = explode(' ', $datestr); $ex = explode("-", $split['0']); From 68788d5577d9f101220e3e6e8fba0829feb136de Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:11:31 -0600 Subject: [PATCH 1847/2544] bringing form helper in sync --- system/helpers/form_helper.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 60d2631e..5feb3ce6 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -66,7 +66,6 @@ function form_open($action = '', $attributes = '', $hidden = array()) } } - // ------------------------------------------------------------------------ /** @@ -266,7 +265,7 @@ function form_textarea($data = '', $value = '', $extra = '') * @param string * @return type */ -if (! function_exists('form_multiselect')) +if ( ! function_exists('form_multiselect')) { function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') { @@ -320,7 +319,7 @@ function form_dropdown($name = '', $options = array(), $selected = array(), $ext { $key = (string) $key; - if (is_array($val)) + if (is_array($val) && ! empty($val)) { $form .= ''."\n"; @@ -638,7 +637,7 @@ function form_prep($str = '', $field_name = '') if ($field_name != '') { - $prepped_fields[$field_name] = $str; + $prepped_fields[$field_name] = $field_name; } return $str; From d4433348afe653a0472cbe4d023db883fd142d11 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:13:55 -0600 Subject: [PATCH 1848/2544] whitespace --- system/helpers/number_helper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php index 1fdd3032..f7979215 100644 --- a/system/helpers/number_helper.php +++ b/system/helpers/number_helper.php @@ -72,6 +72,5 @@ function byte_format($num, $precision = 1) } - /* End of file number_helper.php */ /* Location: ./system/helpers/number_helper.php */ \ No newline at end of file From 11b1e51f8df7a1e47d002a14a76748f6f629f988 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:22:44 -0600 Subject: [PATCH 1849/2544] no in helpers, updated security lib to use Security class instead of Input --- system/helpers/security_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 1f0a6290..654cfd10 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -40,7 +40,7 @@ function xss_clean($str, $is_image = FALSE) { $CI =& get_instance(); - return $CI->input->xss_clean($str, $is_image); + return $CI->security->xss_clean($str, $is_image); } } @@ -56,7 +56,7 @@ function xss_clean($str, $is_image = FALSE) { function dohash($str, $type = 'sha1') { - return $this->do_hash($str, $type); + return do_hash($str, $type); } } From 48822fa77cd02a7974a56cf92d989aefbd98e9af Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:23:39 -0600 Subject: [PATCH 1850/2544] updating attributes to lowercase and added CDATA block around js --- system/helpers/smiley_helper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 931f1308..775cc1b9 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -68,7 +68,6 @@ function smiley_js($alias = '', $field_id = '') $m = '{'.implode(',', $m).'}'; $r .= <<'.$r.''; + return ''; } } @@ -159,7 +158,7 @@ function get_clickable_smileys($image_url, $alias = '', $smileys = NULL) continue; } - $link[] = "\"".$smileys[$key][3]."\""; + $link[] = "\"".$smileys[$key][3]."\""; $used[$smileys[$key][0]] = TRUE; } From 1e1419229ea85b9928f2b0f7d2bad1f5cefc3946 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:24:50 -0600 Subject: [PATCH 1851/2544] whitespace, code comments --- system/helpers/string_helper.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 4767f0b5..60f6ed17 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -30,7 +30,7 @@ /** * Trim Slashes * - * Removes any leading/traling slashes from a string: + * Removes any leading/trailing slashes from a string: * * /this/that/theother/ * @@ -46,10 +46,10 @@ { function trim_slashes($str) { - return trim($str, '/'); - } + return trim($str, '/'); + } } - + // ------------------------------------------------------------------------ /** @@ -120,6 +120,7 @@ function quotes_to_entities($str) } // ------------------------------------------------------------------------ + /** * Reduce Double Slashes * @@ -143,7 +144,7 @@ function reduce_double_slashes($str) return preg_replace("#(^|[^:])//+#", "\\1/", $str); } } - + // ------------------------------------------------------------------------ /** @@ -173,7 +174,7 @@ function reduce_multiples($str, $character = ',', $trim = FALSE) { $str = trim($str, $character); } - + return $str; } } @@ -238,6 +239,7 @@ function random_string($type = 'alnum', $len = 8) } } } + // ------------------------------------------------------------------------ /** From daf9c01a2c25515eea87fb4f4c905f49c30d0214 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:29:30 -0600 Subject: [PATCH 1852/2544] added convert_accented_characters() function to Text Helper --- system/application/config/foreign_chars.php | 64 +++++++++++++++++++++ system/helpers/text_helper.php | 48 ++++++++++++++-- 2 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 system/application/config/foreign_chars.php diff --git a/system/application/config/foreign_chars.php b/system/application/config/foreign_chars.php new file mode 100644 index 00000000..8d70a2f6 --- /dev/null +++ b/system/application/config/foreign_chars.php @@ -0,0 +1,64 @@ + "ss", // ß + '224' => "a", + '225' => "a", + '226' => "a", + '229' => "a", + '227' => "ae", + '230' => "ae", + '228' => "ae", + '231' => "c", + '232' => "e", // è + '233' => "e", // é + '234' => "e", // ê + '235' => "e", // ë + '236' => "i", + '237' => "i", + '238' => "i", + '239' => "i", + '241' => "n", + '242' => "o", + '243' => "o", + '244' => "o", + '245' => "o", + '246' => "oe", // ö + '249' => "u", + '250' => "u", + '251' => "u", + '252' => "ue", // ü + '255' => "y", + '257' => "aa", + '269' => "ch", + '275' => "ee", + '291' => "gj", + '299' => "ii", + '311' => "kj", + '316' => "lj", + '326' => "nj", + '353' => "sh", + '363' => "uu", + '382' => "zh", + '256' => "aa", + '268' => "ch", + '274' => "ee", + '290' => "gj", + '298' => "ii", + '310' => "kj", + '315' => "lj", + '325' => "nj", + '352' => "sh", + '362' => "uu", + '381' => "zh", + ); + + +/* End of file foreign_chars.php */ +/* Location: ./system/application/config/foreign_chars.php */ \ No newline at end of file diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 1e672937..47726021 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -87,7 +87,7 @@ function character_limiter($str, $n = 500, $end_char = '…') { return $str; } - + $out = ""; foreach (explode(' ', trim($str)) as $val) { @@ -136,7 +136,7 @@ function ascii_to_entities($str) $out .= '&#'.array_shift($temp).';'; $count = 1; } - + $out .= $str[$i]; } else @@ -248,7 +248,7 @@ function word_censor($str, $censored, $replacement = '') // \w, \b and a few others do not match on a unicode character // set for performance reasons. As a result words like über // will not match on a word boundary. Instead, we'll assume that - // a bad word will be bookended by any of these characters. + // a bad word will be bookeneded by any of these characters. $delim = '[-_\'\"`(){}<>\[\]|!?@#%&,.:;^~*+=\/ 0-9\n\r\t]'; foreach ($censored as $badword) @@ -352,6 +352,44 @@ function highlight_phrase($str, $phrase, $tag_open = '', $tag_close = '< return $str; } } + +// ------------------------------------------------------------------------ + +/** + * Convert Accented Foreign Characters to ASCII + * + * @access public + * @param string the text string + * @return string + */ +if ( ! function_exists('convert_accented_characters')) +{ + function convert_accented_characters($match) + { + if ( ! file_exists(APPPATH.'config/foreign_chars'.EXT)) + { + return $match; + } + + include APPPATH.'config/foreign_chars'.EXT; + + if ( ! isset($foreign_characters)) + { + return $match; + } + + $ord = ord($match['1']); + + if (isset($foreign_characters[$ord])) + { + return $foreign_characters[$ord]; + } + else + { + return $match['1']; + } + } +} // ------------------------------------------------------------------------ @@ -431,7 +469,7 @@ function word_wrap($str, $charlim = '76') // word into smaller chunks so we'll add it back to our current line if ($temp != '') { - $output .= $temp . "\n" . $line; + $output .= $temp."\n".$line; } else { @@ -456,7 +494,7 @@ function word_wrap($str, $charlim = '76') return $output; } } - + /* End of file text_helper.php */ /* Location: ./system/helpers/text_helper.php */ \ No newline at end of file From 2b7de06bd0e2184c9bffc971490f7f640c736a6a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:31:08 -0600 Subject: [PATCH 1853/2544] added entity_decode() to Typography helper, updated auto_typography() --- system/helpers/typography_helper.php | 59 +++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 5621e6dd..712b5750 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -54,16 +54,71 @@ function nl2br_except_pre($str) * * @access public * @param string + * @param bool whether to allow javascript event handlers * @param bool whether to reduce multiple instances of double newlines to two * @return string */ if ( ! function_exists('auto_typography')) { - function auto_typography($str, $reduce_linebreaks = FALSE) + function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE) { $CI =& get_instance(); $CI->load->library('typography'); - return $CI->typography->auto_typography($str, $reduce_linebreaks); + return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks); + } +} + + +// -------------------------------------------------------------------- + +/** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + * character set, and the PHP developers said they were not back porting the + * fix to versions other than PHP 5.x. + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('entity_decode')) +{ + function entity_decode($str, $charset='UTF-8') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) + { + $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); + } + + // Numeric Entities + $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; } } From 85b2bb7df5e5308b5283e24a3d83aadd1fa9d4de Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:32:03 -0600 Subject: [PATCH 1854/2544] improved xml_convert() of XML helper --- system/helpers/xml_helper.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index 712f6777..09b7aee4 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -36,25 +36,33 @@ */ if ( ! function_exists('xml_convert')) { - function xml_convert($str) + function xml_convert($str, $protect_all = FALSE) { $temp = '__TEMP_AMPERSANDS__'; // Replace entities to temporary markers so that - // ampersands won't get messed up + // ampersands won't get messed up $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); - $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + + if ($protect_all === TRUE) + { + $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); + } $str = str_replace(array("&","<",">","\"", "'", "-"), - array("&", "<", ">", """, "'", "-"), - $str); + array("&", "<", ">", """, "'", "-"), + $str); // Decode the temp markers back to entities $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); - $str = preg_replace("/$temp(\w+);/","&\\1;", $str); - + + if ($protect_all === TRUE) + { + $str = preg_replace("/$temp(\w+);/","&\\1;", $str); + } + return $str; - } + } } From 99111e3abe02e9a40795fa96f33ea08e492eadcd Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 10:39:08 -0600 Subject: [PATCH 1855/2544] added end of function marker --- system/helpers/xml_helper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index 09b7aee4..56f5e011 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -65,6 +65,7 @@ function xml_convert($str, $protect_all = FALSE) } } +// ------------------------------------------------------------------------ /* End of file xml_helper.php */ /* Location: ./system/helpers/xml_helper.php */ \ No newline at end of file From b41032d2df1e63566f1183533b388372538c46d0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 11:22:45 -0600 Subject: [PATCH 1856/2544] moved CAPTCHA plugin to a helper --- system/helpers/captcha_helper.php | 246 +++++++++++++++++ system/plugins/captcha_pi.php | 355 ------------------------- user_guide/helpers/captcha_helper.html | 195 ++++++++++++++ 3 files changed, 441 insertions(+), 355 deletions(-) create mode 100644 system/helpers/captcha_helper.php delete mode 100644 system/plugins/captcha_pi.php create mode 100644 user_guide/helpers/captcha_helper.html diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php new file mode 100644 index 00000000..a5878921 --- /dev/null +++ b/system/helpers/captcha_helper.php @@ -0,0 +1,246 @@ + '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); + + foreach ($defaults as $key => $val) + { + if ( ! is_array($data)) + { + if ( ! isset($$key) OR $$key == '') + { + $$key = $val; + } + } + else + { + $$key = ( ! isset($data[$key])) ? $val : $data[$key]; + } + } + + if ($img_path == '' OR $img_url == '') + { + return FALSE; + } + + if ( ! @is_dir($img_path)) + { + return FALSE; + } + + if ( ! is_writable($img_path)) + { + return FALSE; + } + + if ( ! extension_loaded('gd')) + { + return FALSE; + } + + // ----------------------------------- + // Remove old images + // ----------------------------------- + + list($usec, $sec) = explode(" ", microtime()); + $now = ((float)$usec + (float)$sec); + + $current_dir = @opendir($img_path); + + while($filename = @readdir($current_dir)) + { + if ($filename != "." and $filename != ".." and $filename != "index.html") + { + $name = str_replace(".jpg", "", $filename); + + if (($name + $expiration) < $now) + { + @unlink($img_path.$filename); + } + } + } + + @closedir($current_dir); + + // ----------------------------------- + // Do we have a "word" yet? + // ----------------------------------- + + if ($word == '') + { + $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + + $str = ''; + for ($i = 0; $i < 8; $i++) + { + $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); + } + + $word = $str; + } + + // ----------------------------------- + // Determine angle and position + // ----------------------------------- + + $length = strlen($word); + $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; + $x_axis = rand(6, (360/$length)-16); + $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); + + // ----------------------------------- + // Create image + // ----------------------------------- + + // PHP.net recommends imagecreatetruecolor(), but it isn't always available + if (function_exists('imagecreatetruecolor')) + { + $im = imagecreatetruecolor($img_width, $img_height); + } + else + { + $im = imagecreate($img_width, $img_height); + } + + // ----------------------------------- + // Assign colors + // ----------------------------------- + + $bg_color = imagecolorallocate ($im, 255, 255, 255); + $border_color = imagecolorallocate ($im, 153, 102, 102); + $text_color = imagecolorallocate ($im, 204, 153, 153); + $grid_color = imagecolorallocate($im, 255, 182, 182); + $shadow_color = imagecolorallocate($im, 255, 240, 240); + + // ----------------------------------- + // Create the rectangle + // ----------------------------------- + + ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); + + // ----------------------------------- + // Create the spiral pattern + // ----------------------------------- + + $theta = 1; + $thetac = 7; + $radius = 16; + $circles = 20; + $points = 32; + + for ($i = 0; $i < ($circles * $points) - 1; $i++) + { + $theta = $theta + $thetac; + $rad = $radius * ($i / $points ); + $x = ($rad * cos($theta)) + $x_axis; + $y = ($rad * sin($theta)) + $y_axis; + $theta = $theta + $thetac; + $rad1 = $radius * (($i + 1) / $points); + $x1 = ($rad1 * cos($theta)) + $x_axis; + $y1 = ($rad1 * sin($theta )) + $y_axis; + imageline($im, $x, $y, $x1, $y1, $grid_color); + $theta = $theta - $thetac; + } + + // ----------------------------------- + // Write the text + // ----------------------------------- + + $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; + + if ($use_font == FALSE) + { + $font_size = 5; + $x = rand(0, $img_width/($length/3)); + $y = 0; + } + else + { + $font_size = 16; + $x = rand(0, $img_width/($length/1.5)); + $y = $font_size+2; + } + + for ($i = 0; $i < strlen($word); $i++) + { + if ($use_font == FALSE) + { + $y = rand(0 , $img_height/2); + imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); + $x += ($font_size*2); + } + else + { + $y = rand($img_height/2, $img_height-3); + imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); + $x += $font_size; + } + } + + + // ----------------------------------- + // Create the border + // ----------------------------------- + + imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); + + // ----------------------------------- + // Generate the image + // ----------------------------------- + + $img_name = $now.'.jpg'; + + ImageJPEG($im, $img_path.$img_name); + + $img = "\""; + + ImageDestroy($im); + + return array('word' => $word, 'time' => $now, 'image' => $img); + } +} + +// ------------------------------------------------------------------------ + +/* End of file captcha_pi.php */ +/* Location: ./system/plugins/captcha_pi.php */ \ No newline at end of file diff --git a/system/plugins/captcha_pi.php b/system/plugins/captcha_pi.php deleted file mode 100644 index 7092f28e..00000000 --- a/system/plugins/captcha_pi.php +++ /dev/null @@ -1,355 +0,0 @@ -load->plugin('captcha'); - -Once loaded you can generate a captcha like this: - - $vals = array( - 'word' => 'Random word', - 'img_path' => './captcha/', - 'img_url' => 'http://example.com/captcha/', - 'font_path' => './path/to/fonts/texb.ttf', - 'img_width' => '150', - 'img_height' => 30, - 'expiration' => 7200 - ); - - $cap = create_captcha($vals); - echo $cap['image']; - - -NOTES: - - The captcha function requires the GD image library. - - Only the img_path and img_url are required. - - If a "word" is not supplied, the function will generate a random - ASCII string. You might put together your own word library that - you can draw randomly from. - - If you do not specify a path to a TRUE TYPE font, the native ugly GD - font will be used. - - The "captcha" folder must be writable (666, or 777) - - The "expiration" (in seconds) signifies how long an image will - remain in the captcha folder before it will be deleted. The default - is two hours. - -RETURNED DATA - -The create_captcha() function returns an associative array with this data: - - [array] - ( - 'image' => IMAGE TAG - 'time' => TIMESTAMP (in microtime) - 'word' => CAPTCHA WORD - ) - -The "image" is the actual image tag: - - -The "time" is the micro timestamp used as the image name without the file -extension. It will be a number like this: 1139612155.3422 - -The "word" is the word that appears in the captcha image, which if not -supplied to the function, will be a random string. - - -ADDING A DATABASE - -In order for the captcha function to prevent someone from posting, you will need -to add the information returned from create_captcha() function to your database. -Then, when the data from the form is submitted by the user you will need to verify -that the data exists in the database and has not expired. - -Here is a table prototype: - - CREATE TABLE captcha ( - captcha_id bigint(13) unsigned NOT NULL auto_increment, - captcha_time int(10) unsigned NOT NULL, - ip_address varchar(16) default '0' NOT NULL, - word varchar(20) NOT NULL, - PRIMARY KEY `captcha_id` (`captcha_id`), - KEY `word` (`word`) - ) - - -Here is an example of usage with a DB. - -On the page where the captcha will be shown you'll have something like this: - - $this->load->plugin('captcha'); - $vals = array( - 'img_path' => './captcha/', - 'img_url' => 'http://example.com/captcha/' - ); - - $cap = create_captcha($vals); - - $data = array( - 'captcha_time' => $cap['time'], - 'ip_address' => $this->input->ip_address(), - 'word' => $cap['word'] - ); - - $query = $this->db->insert_string('captcha', $data); - $this->db->query($query); - - echo 'Submit the word you see below:'; - echo $cap['image']; - echo ''; - - -Then, on the page that accepts the submission you'll have something like this: - - // First, delete old captchas - $expiration = time()-7200; // Two hour limit - $this->db->query("DELETE FROM captcha WHERE captcha_time < ".$expiration); - - // Then see if a captcha exists: - $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?"; - $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration); - $query = $this->db->query($sql, $binds); - $row = $query->row(); - - if ($row->count == 0) - { - echo "You must submit the word that appears in the image"; - } - -*/ - - - -/** -|========================================================== -| Create Captcha -|========================================================== -| -*/ -function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') -{ - $defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200); - - foreach ($defaults as $key => $val) - { - if ( ! is_array($data)) - { - if ( ! isset($$key) OR $$key == '') - { - $$key = $val; - } - } - else - { - $$key = ( ! isset($data[$key])) ? $val : $data[$key]; - } - } - - if ($img_path == '' OR $img_url == '') - { - return FALSE; - } - - if ( ! @is_dir($img_path)) - { - return FALSE; - } - - if ( ! is_writable($img_path)) - { - return FALSE; - } - - if ( ! extension_loaded('gd')) - { - return FALSE; - } - - // ----------------------------------- - // Remove old images - // ----------------------------------- - - list($usec, $sec) = explode(" ", microtime()); - $now = ((float)$usec + (float)$sec); - - $current_dir = @opendir($img_path); - - while($filename = @readdir($current_dir)) - { - if ($filename != "." and $filename != ".." and $filename != "index.html") - { - $name = str_replace(".jpg", "", $filename); - - if (($name + $expiration) < $now) - { - @unlink($img_path.$filename); - } - } - } - - @closedir($current_dir); - - // ----------------------------------- - // Do we have a "word" yet? - // ----------------------------------- - - if ($word == '') - { - $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $str = ''; - for ($i = 0; $i < 8; $i++) - { - $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); - } - - $word = $str; - } - - // ----------------------------------- - // Determine angle and position - // ----------------------------------- - - $length = strlen($word); - $angle = ($length >= 6) ? rand(-($length-6), ($length-6)) : 0; - $x_axis = rand(6, (360/$length)-16); - $y_axis = ($angle >= 0 ) ? rand($img_height, $img_width) : rand(6, $img_height); - - // ----------------------------------- - // Create image - // ----------------------------------- - - // PHP.net recommends imagecreatetruecolor(), but it isn't always available - if (function_exists('imagecreatetruecolor')) - { - $im = imagecreatetruecolor($img_width, $img_height); - } - else - { - $im = imagecreate($img_width, $img_height); - } - - // ----------------------------------- - // Assign colors - // ----------------------------------- - - $bg_color = imagecolorallocate ($im, 255, 255, 255); - $border_color = imagecolorallocate ($im, 153, 102, 102); - $text_color = imagecolorallocate ($im, 204, 153, 153); - $grid_color = imagecolorallocate($im, 255, 182, 182); - $shadow_color = imagecolorallocate($im, 255, 240, 240); - - // ----------------------------------- - // Create the rectangle - // ----------------------------------- - - ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color); - - // ----------------------------------- - // Create the spiral pattern - // ----------------------------------- - - $theta = 1; - $thetac = 7; - $radius = 16; - $circles = 20; - $points = 32; - - for ($i = 0; $i < ($circles * $points) - 1; $i++) - { - $theta = $theta + $thetac; - $rad = $radius * ($i / $points ); - $x = ($rad * cos($theta)) + $x_axis; - $y = ($rad * sin($theta)) + $y_axis; - $theta = $theta + $thetac; - $rad1 = $radius * (($i + 1) / $points); - $x1 = ($rad1 * cos($theta)) + $x_axis; - $y1 = ($rad1 * sin($theta )) + $y_axis; - imageline($im, $x, $y, $x1, $y1, $grid_color); - $theta = $theta - $thetac; - } - - // ----------------------------------- - // Write the text - // ----------------------------------- - - $use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE; - - if ($use_font == FALSE) - { - $font_size = 5; - $x = rand(0, $img_width/($length/3)); - $y = 0; - } - else - { - $font_size = 16; - $x = rand(0, $img_width/($length/1.5)); - $y = $font_size+2; - } - - for ($i = 0; $i < strlen($word); $i++) - { - if ($use_font == FALSE) - { - $y = rand(0 , $img_height/2); - imagestring($im, $font_size, $x, $y, substr($word, $i, 1), $text_color); - $x += ($font_size*2); - } - else - { - $y = rand($img_height/2, $img_height-3); - imagettftext($im, $font_size, $angle, $x, $y, $text_color, $font_path, substr($word, $i, 1)); - $x += $font_size; - } - } - - - // ----------------------------------- - // Create the border - // ----------------------------------- - - imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); - - // ----------------------------------- - // Generate the image - // ----------------------------------- - - $img_name = $now.'.jpg'; - - ImageJPEG($im, $img_path.$img_name); - - $img = "\""; - - ImageDestroy($im); - - return array('word' => $word, 'time' => $now, 'image' => $img); -} - - -/* End of file captcha_pi.php */ -/* Location: ./system/plugins/captcha_pi.php */ \ No newline at end of file diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html new file mode 100644 index 00000000..297e47e2 --- /dev/null +++ b/user_guide/helpers/captcha_helper.html @@ -0,0 +1,195 @@ + + + + + +CAPTCHA Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
      +
      + + + + +

      CodeIgniter User Guide Version 1.7.2

      +
      + + + + + + + + + +
      + + +
      + + + +
      + + +

      CAPTCHA Helper

      + +

      The CAPTCHA Helper file contains functions that assist in creating CAPTCHA images.

      + + +

      Loading this Helper

      + +

      This helper is loaded using the following code:

      +$this->load->helper('captcha'); + +

      The following functions are available:

      + +

      captcha_create($data)

      + +

      Takes an array of information to generate the CAPTCHA as input and creates the image to your specifications, returning an array of associative data about the image.

      + +[array]
      +(
      +  'image' => IMAGE TAG
      +  'time' => TIMESTAMP (in microtime)
      +  'word' => CAPTCHA WORD
      +)
      + +

      The "image" is the actual image tag: +<img src="http://example.com/captcha/12345.jpg" width="140" height="50" />

      + +

      The "time" is the micro timestamp used as the image name without the file + extension. It will be a number like this: 1139612155.3422

      + +

      The "word" is the word that appears in the captcha image, which if not + supplied to the function, will be a random string.

      + +

      Using the CAPTCHA plugin

      + +

      Once loaded you can generate a captcha like this:

      + +$vals = array(
      +    'word' => 'Random word',
      +    'img_path' => './captcha/',
      +    'img_url' => 'http://example.com/captcha/',
      +    'font_path' => './path/to/fonts/texb.ttf',
      +    'img_width' => '150',
      +    'img_height' => 30,
      +    'expiration' => 7200
      +    );
      +
      +$cap = create_captcha($vals);
      +echo $cap['image'];
      + +
        +
      • The captcha function requires the GD image library.
      • +
      • Only the img_path and img_url are required.
      • +
      • If a "word" is not supplied, the function will generate a random + ASCII string. You might put together your own word library that + you can draw randomly from.
      • +
      • If you do not specify a path to a TRUE TYPE font, the native ugly GD + font will be used.
      • +
      • The "captcha" folder must be writable (666, or 777)
      • +
      • The "expiration" (in seconds) signifies how long an image will + remain in the captcha folder before it will be deleted. The default + is two hours.
      • +
      + +

      Adding a Database

      + +

      In order for the captcha function to prevent someone from submitting, you will need + to add the information returned from create_captcha() function to your database. + Then, when the data from the form is submitted by the user you will need to verify + that the data exists in the database and has not expired.

      + +

      Here is a table prototype:

      + +CREATE TABLE captcha (
      + captcha_id bigint(13) unsigned NOT NULL auto_increment,
      + captcha_time int(10) unsigned NOT NULL,
      + ip_address varchar(16) default '0' NOT NULL,
      + word varchar(20) NOT NULL,
      + PRIMARY KEY `captcha_id` (`captcha_id`),
      + KEY `word` (`word`)
      +)
      + +

      Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:

      + +$this->load->plugin('captcha');
      +$vals = array(
      +    'img_path' => './captcha/',
      +    'img_url' => 'http://example.com/captcha/'
      +    );
      +
      +$cap = create_captcha($vals);
      +
      +$data = array(
      +    'captcha_time' => $cap['time'],
      +    'ip_address' => $this->input->ip_address(),
      +    'word' => $cap['word']
      +    );
      +
      +$query = $this->db->insert_string('captcha', $data);
      +$this->db->query($query);
      +
      +echo 'Submit the word you see below:';
      +echo $cap['image'];
      +echo '<input type="text" name="captcha" value="" />';
      + +

      Then, on the page that accepts the submission you'll have something like this:

      + +// First, delete old captchas
      +$expiration = time()-7200; // Two hour limit
      +$this->db->query("DELETE FROM captcha WHERE captcha_time < ".$expiration);
      +
      +// Then see if a captcha exists:
      +$sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?";
      +$binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);
      +$query = $this->db->query($sql, $binds);
      +$row = $query->row();
      +
      +if ($row->count == 0)
      +{
      +    echo "You must submit the word that appears in the image";
      +}
      + +
      + + + + + + + \ No newline at end of file From 1c73f4e9a1b8d33e7eeda622b9ae44b9b2f41251 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 11:27:41 -0600 Subject: [PATCH 1857/2544] fixed eof code comment --- system/helpers/captcha_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index a5878921..67db5094 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -242,5 +242,5 @@ function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = // ------------------------------------------------------------------------ -/* End of file captcha_pi.php */ -/* Location: ./system/plugins/captcha_pi.php */ \ No newline at end of file +/* End of file captcha_helper.php */ +/* Location: ./system/heleprs/captcha_helper.php */ \ No newline at end of file From bb76839b9a2679475399420eaaf56ca7a2e49d39 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 11:32:53 -0600 Subject: [PATCH 1858/2544] killing scaffolding trigger --- system/application/config/routes.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/system/application/config/routes.php b/system/application/config/routes.php index c2f1e99d..4d9f340a 100644 --- a/system/application/config/routes.php +++ b/system/application/config/routes.php @@ -23,25 +23,16 @@ | RESERVED ROUTES | ------------------------------------------------------------------------- | -| There are two reserved routes: +| There is one reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded. -| -| $route['scaffolding_trigger'] = 'scaffolding'; -| -| This route lets you set a "secret" word that will trigger the -| scaffolding feature for added security. Note: Scaffolding must be -| enabled in the controller in which you intend to use it. The reserved -| routes must come before any wildcard or regular expression routes. -| */ $route['default_controller'] = "welcome"; -$route['scaffolding_trigger'] = ""; /* End of file routes.php */ From e659fbbffd63d019b1a3753a8e3b3dd74e1cb225 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 11:34:09 -0600 Subject: [PATCH 1859/2544] moving js cal plugin to a helper --- .../js_calendar_pi.php => helpers/js_calendar_helper.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename system/{plugins/js_calendar_pi.php => helpers/js_calendar_helper.php} (100%) diff --git a/system/plugins/js_calendar_pi.php b/system/helpers/js_calendar_helper.php similarity index 100% rename from system/plugins/js_calendar_pi.php rename to system/helpers/js_calendar_helper.php From b6de7d13eb06d7736d255eaa0b60391a4d2b4bf5 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 11:34:34 -0600 Subject: [PATCH 1860/2544] REMOVING js calendar helper / plugin. No need with the prolific jQuery calendars --- system/helpers/js_calendar_helper.php | 629 -------------------------- 1 file changed, 629 deletions(-) delete mode 100644 system/helpers/js_calendar_helper.php diff --git a/system/helpers/js_calendar_helper.php b/system/helpers/js_calendar_helper.php deleted file mode 100644 index f722777b..00000000 --- a/system/helpers/js_calendar_helper.php +++ /dev/null @@ -1,629 +0,0 @@ -load->plugin('js_calendar'); - -Once loaded you'll add the calendar script to the of your page like this: - - - -The above function will be passed the name of your form. - -Then to show the actual calendar you'll do this: - - -
      - -

      Today

      -
      - - -Note: The first parameter is the name of the field containing your date, the second parameter contains the "now" time, -and the third tells the calendar whether to highlight the current day or not. - -Lastly, you'll need some CSS for your calendar: - -.calendar { - border: 1px #6975A3 solid; - background-color: transparent; -} -.calheading { - background-color: #7C8BC0; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; -} -.calnavleft { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - padding: 4px; - cursor: pointer; -} -.calnavright { - background-color: #7C8BC0; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - font-weight: bold; - color: #fff; - text-align: right; - padding: 4px; - cursor: pointer; -} -.caldayheading { - background-color: #000; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 10px; - text-align: center; - padding: 6px 2px 6px 2px; -} -.caldaycells{ - color: #000; - background-color: #D1D7E6; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #E0E5F1 solid; - cursor: pointer; -} -.caldaycellhover{ - color: #fff; - background-color: #B3BCD4; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - text-align: center; - padding: 4px; - border: 1px #B3BCD4 solid; - cursor: pointer; -} -.caldayselected{ - background-color: #737FAC; - color: #fff; - font-family: Lucida Grande, Verdana, Geneva, Sans-serif; - font-size: 11px; - font-weight: bold; - text-align: center; - border: 1px #566188 solid; - padding: 3px; - cursor: pointer; -} -.calblanktop { - background-color: #fff; - padding: 4px; -} -.calblankbot { - background-color: #fff; - padding: 4px; -} - - -*/ - -function js_calendar_script($form_name = 'entryform') -{ -$CI =& get_instance(); -$CI->load->language('calendar'); -ob_start(); -?> - - - var '.$field_id.' = new calendar("'.$field_id.'", '.$time.', '.(($highlight == TRUE) ? 'true' : 'false').'); - document.write('.$field_id.'.write()); - '; -} - - -/* End of file js_calendar_pi.php */ -/* Location: ./system/plugins/js_calendar_pi.php */ \ No newline at end of file From 8917af710a7698ce64b6004d9157ad2bb0d93652 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 12:41:45 -0600 Subject: [PATCH 1861/2544] changing docs refs to future release 2.0.0 --- user_guide/changelog.html | 21 ++++++++++--------- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/plugins.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/scaffolding.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/captcha_helper.html | 2 +- user_guide/helpers/compatibility_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_170.html | 2 +- user_guide/installation/upgrade_171.html | 2 +- user_guide/installation/upgrade_172.html | 2 +- .../{upgrade_173.html => upgrade_200.html} | 10 ++++----- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/cheatsheets.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 126 files changed, 140 insertions(+), 139 deletions(-) rename user_guide/installation/{upgrade_173.html => upgrade_200.html} (94%) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9b62dc89..a136234e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      @@ -57,9 +57,9 @@

      Change Log

      -

      Version 1.7.3

      +

      Version 2.0.0

      Release Date: not yet released
      -SVN Revision:

      +Hg Tag:

      • Libraries @@ -107,7 +107,7 @@

        Version 1.7.3

      -

      Bug fixes for 1.7.3

      +

      Bug fixes for 2.0.0

      • Fixed assorted user guide typos or examples (#10693, #8951, #7825, #8660, #7883, #6771, #10656).
      • Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".
      • @@ -126,7 +126,7 @@

        Bug fixes for 1.7.3

        Version 1.7.2

        Release Date: September 11, 2009
        -SVN Revision: 1737

        +Hg Tag: v1.7.2

        • Libraries @@ -193,7 +193,7 @@

          Bug fixes for 1.7.2

          Version 1.7.1

          Release Date: February 10, 2009
          -SVN Revision: 1640

          +Hg Tag: 1.7.1

          • Libraries @@ -277,7 +277,7 @@

            Bug fixes for 1.7.1

            Version 1.7

            Release Date: October 23, 2008
            -SVN Revision: 1541

            +Hg Tag: 1.7.0

            • Libraries @@ -369,7 +369,8 @@

              Bug fixes for 1.7.0

              Version 1.6.3

              Release Date: June 26, 2008
              -SVN Revision: 1238

              +Hg Tag: v1.6.3

              +

              Version 1.6.3 is a security and maintenance release and is recommended for all users.

              • Database @@ -428,7 +429,7 @@

                Bug fixes for 1.6.3

                Version 1.6.2

                Release Date: May 13, 2008
                -SVN Revision: 1155

                +Hg Tag: 1.6.2

                • Active Record
                    @@ -531,7 +532,7 @@

                    Bugfixes for 1.6.2

                    Version 1.6.1

                    Release Date: February 12, 2008
                    - SVN Revision: 984

                    +Hg Tag: 1.6.1

                    • Active Record
                        diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 8a4d70b3..5703dcfe 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index b550a890..8064d344 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 19c1dd48..7c01a770 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index dcced6cf..4ef76ed1 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 217a2357..bd910a41 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index d20b77d7..6b4b6390 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 5cc2441c..bbf2912e 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index d02046af..6ba3702c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 0d38d8f6..d60f1619 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 46b299fe..868e00d2 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index f51ee07a..0fb05c88 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/results.html b/user_guide/database/results.html index f944a64c..784ea324 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 2bc75c25..837e04d2 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 94022f69..19edfb8e 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 7f74abb2..3d08182a 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 7021b9d2..e0dc9741 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index fc9653de..4879076e 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 30aa0a61..9e711a8c 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index ba87c771..8d7f5d8c 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 64dbab82..59edade3 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 696815e2..132287c6 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 3eda8c4a..b0cbc058 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 1f95173f..f67c0053 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index aaecbdc4..4311416e 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index d0597bce..410f9598 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index cf50319a..17e21003 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 80a06c8c..f1aa56e7 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index eb0d99ac..1cda08e6 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index aec9f121..71189dfb 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 195480ca..babed5f6 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 878934bc..91972686 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -27,7 +27,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/plugins.html b/user_guide/general/plugins.html index 58ae22e7..b378ea95 100644 --- a/user_guide/general/plugins.html +++ b/user_guide/general/plugins.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index f0c550b1..ec71278b 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 74ea0a7f..2b651756 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index fab9d6f1..c74a3c0b 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 0d697b38..c9946e7d 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 11ff4a2f..85e91af7 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/scaffolding.html b/user_guide/general/scaffolding.html index 8597b6c1..b7217f27 100644 --- a/user_guide/general/scaffolding.html +++ b/user_guide/general/scaffolding.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 40ec5e28..593ffd58 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 2a5c440b..b523d5a1 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -34,7 +34,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 6a61c340..7dbd7fe5 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 3ad9699e..9c124d91 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index f0986402..ede12072 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 297e47e2..f418823e 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index 15712eb4..d43e7746 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 7b1a171a..b73daf66 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 2ec17fb3..a5c46f3d 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 3b70799d..d0799c7c 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index 5c1c2670..b0e7da09 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 01579f82..01d3faa3 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 358aa982..4c5b4927 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -27,7 +27,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 06967860..fa44f6b0 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index a6920ee1..b79b92b0 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index ba25e071..4ba6820a 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index e21a605a..4dede49c 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 545c4b76..c2fc685b 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 232c1b6b..15118674 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -27,7 +27,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index e7320001..351a5047 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 5bc58a33..2e050b93 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index b799390c..71a8ef77 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 120b3803..c80300c8 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index 046da425..ae4ade11 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 1ccb8a71..dbc5969f 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -27,7 +27,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index 495b80b6..caf8239b 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/index.html b/user_guide/index.html index a234b19b..f6264fdb 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index ddf75f2c..f5f6b324 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index f960e285..08f37ac9 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index 08c5d9ff..e6ab9a98 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 2ac9ab26..ab09a7bc 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index b36f39de..b85d92d5 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 002f07c5..43fc1680 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 01a17624..52396dca 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index f12a9600..f3dec87f 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index e3f6d829..2d502717 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 886542d6..d400f98b 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 4ebc78c5..07ee9c21 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 7930638f..c8f1ad3e 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 52efd708..042dd9ba 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index c241160a..5e446866 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index 35da95b7..e817e245 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index 2a9d047a..fcfa0a06 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index 0e86d5c5..fd34ab08 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 54a7c559..9f39e21b 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index d3715e14..d3892cf8 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index 9b37bd12..32dab56d 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index f4f3c03f..fb035667 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        diff --git a/user_guide/installation/upgrade_173.html b/user_guide/installation/upgrade_200.html similarity index 94% rename from user_guide/installation/upgrade_173.html rename to user_guide/installation/upgrade_200.html index 6f306d19..bf57fe3c 100644 --- a/user_guide/installation/upgrade_173.html +++ b/user_guide/installation/upgrade_200.html @@ -3,7 +3,7 @@ -Upgrading from 1.7.2 to 1.7.3 : CodeIgniter User Guide +Upgrading from 1.7.2 to 2.0.0 : CodeIgniter User Guide @@ -28,7 +28,7 @@
                        - +

                        CodeIgniter User Guide Version 1.7.2

                        CodeIgniter User Guide Version 2.0.0

                        @@ -42,7 +42,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 14a4455c..41ff226a 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 30db0deb..d82c3223 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 187aade0..f6a96022 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 2aec24be..698f438b 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index d911a427..54462c79 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 3b38b268..9fa68d79 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 3b2846ac..adcd7dc5 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 35ef1798..151b95cb 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 49c30ef3..ec1357e5 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -27,7 +27,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index c0c8e620..10acdcda 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 0baad8c4..2e92fdf7 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index dbc79257..59198a24 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index eb4835a1..9e50901a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index cefe8ef0..bb1a9836 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 7be42b44..de22fbe2 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 187b331f..d6b260be 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 3dc26815..19ad6dec 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index c93c7614..059f6fbc 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index b233dbf8..c871d7cb 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -27,7 +27,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 9e54bbfb..30720601 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index bcb2e66c..9db565a1 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index bf86738f..ede938cd 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index af5994cb..ae420d78 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 98bd7b12..6de6b6e6 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index 25ea91df..dc7915c6 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -27,7 +27,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index cd4ed1c5..9f163ae5 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 36b969b7..d8b3ea36 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/license.html b/user_guide/license.html index fc79c22f..354c08c4 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 8504ae85..4a1c8a38 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 1c7aae83..56f208a7 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index a34cf719..1232bd67 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 3f584cd9..fe0bbe99 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index b37d546b..3bcfdcc0 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index cdd93a35..f6fa103e 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 4dbe55c6..5b930a48 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 67bae89d..05e22d90 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      diff --git a/user_guide/toc.html b/user_guide/toc.html index 45911d18..70a3f29a 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
      - +

      CodeIgniter User Guide Version 1.7.2

      CodeIgniter User Guide Version 2.0.0

      From b8354c1e8c85399697af2d8ffd3584095594bba2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 12:47:30 -0600 Subject: [PATCH 1862/2544] adding initial docs for javascript and jquery libs --- user_guide/libraries/javascript.html | 194 ++++++++++++++++++++++ user_guide/libraries/jquery.html | 236 +++++++++++++++++++++++++++ 2 files changed, 430 insertions(+) create mode 100644 user_guide/libraries/javascript.html create mode 100644 user_guide/libraries/jquery.html diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html new file mode 100644 index 00000000..2856fdbf --- /dev/null +++ b/user_guide/libraries/javascript.html @@ -0,0 +1,194 @@ + + + + +CodeIgniter User Guide : Input Class + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 2.0.0

      +
      + + + + + + + + + +
      + + +
      + + + +
      + + +

      Javascript Class

      +

      Rewrite this paragraph: jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

      +

      Initializing the Class

      +

      To initialize the jQuery class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

      + +$this->load->library('javascript'); + +

      The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

      + +$this->load->library('javascript', array('js_library_driver' => 'scripto', 'autoload' => FALSE)); + +

      Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

      + +

      Once loaded, the jQuery library object will be available using: $this->javascript

      +

      Setup and Configuration

      +

      Set these variables in your view

      +

      As a javascript library, your files must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

      +

      As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

      +

      <?php echo $library_src;?>
      +<?php echo $script_head;?> +

      +

      $library_src, is where the actual library file will be loaded, as well as any subsequent plugin script calls; $script_head is where specific events, functions and other commands will be rendered.

      +

      Set the path to the librarys with config items

      +

      There are some configuration items in javascript library. These can either be set in system/application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function.

      +

      An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      +

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
      + $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      +

      If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.

      +

      Events

      +

      Events are set using the following syntax.

      +

      $this->jquery->event('element_path', code_to_run());

      +

      In the above example:

      +
        +
      • "event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.
      • +
      • "element_path" is any valid jQuery selector. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".
      • +
      • "code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.
      • +
      +

      Effects

      +

      The query library supports a powerful effects repertoire.

      +

      hide() / show()

      +

      Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

      +

      $this->jquery->hide(target, optional speed, optional extra information);
      + $this->jquery->show(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      toggle()

      +

      toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

      +

      $this->jquery->toggle(target);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      +

      animate()

      +

      $this->jquery->animate(target, parameters, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "paramters" in jQuery would generally include a series of CSS properties that you wish to change.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      For a full summary, see http://docs.jquery.com/Effects/animate

      +

      Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

      +

      $params = array(
      + 'height' => 80,
      + 'width' => '50%',
      + 'marginLeft' => 125
      +);
      +$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

      +

      fadeIn() / fadeOut()

      +

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      + $this->jquery->fadeOut(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      toggleClass()

      +

      This function will add or remove a CSS class to its target.

      +

      $this->jquery->toggleClass(target, class)

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.
      • +
      +

      fadeIn() / fadeOut()

      +

      These effects cause an element(s) to disappear or reappear over time.

      +

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      + $this->jquery->fadeOut(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      slideUp() / slideDown() / slideToggle()

      +

      These effects cause an element(s) to slide.

      +

      $this->jquery->slideUp(target, optional speed, optional extra information);
      + $this->jquery->slideDown(target, optional speed, optional extra information);
      +$this->jquery->slideToggle(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      Plugins

      +

      Some select jQuery plugins are made available using this library.

      +

      corner()

      +

      Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

      +

      $this->jquery->corner(target, corner_style);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).
      • +
      +

      $this->jquery->corner("#note", "cool tl br");

      +

      tablesorter()

      +

      description to come

      +

      modal()

      +

      description to come

      +

      calendar()

      +

      description to come

      +
      + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html new file mode 100644 index 00000000..98c9a9cb --- /dev/null +++ b/user_guide/libraries/jquery.html @@ -0,0 +1,236 @@ + + + + +CodeIgniter User Guide : Input Class + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 2.0.0

      +
      + + + + + + + + + +
      + + +
      + + + +
      + + +

      jQuery Class

      + +

      jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

      + +

      Initializing the Class

      + +

      To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:

      + +$this->load->library('jquery'); + +

      You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

      + +$this->load->library('jquery', FALSE); + +

      Once loaded, the jQuery library object will be available using: $this->jquery

      + +

      Setup and Configuration

      + +

      As a javascript library, jquery.js must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

      + +

      As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

      + +

      <?php echo $jquery_script;?>
      +<?php echo $script_head;?>

      + +

      There are 2 configuration items in jQuery library. These can either be set in system/application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      + +

      $config['javascript_folder'] = 'js';
      + $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      + +

      If you keep your files in the same directories they were downloaded from, then you needed set this configuration items.

      + +

      Events

      + +

      Events are set using the following syntax.

      + +

      $this->jquery->event('element_path', code_to_run());

      + +

      In the above example:

      + +
        +
      • "event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.
      • +
      • "element_path" is any valid jQuery selector. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".
      • +
      • "code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.
      • +
      + +

      Effects

      + +

      The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

      + +

      $this->jquery->effect([optional path] plugin name); +// for example +$this->jquery->effect('bounce'); +

      + +

      hide() / show()

      + +

      Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

      +

      $this->jquery->hide(target, optional speed, optional extra information);
      + $this->jquery->show(target, optional speed, optional extra information);

      + +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      + +

      toggle()

      + +

      toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

      +

      $this->jquery->toggle(target);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      + +

      animate()

      + +

      $this->jquery->animate(target, parameters, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "paramters" in jQuery would generally include a series of CSS properties that you wish to change.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      +

      For a full summary, see http://docs.jquery.com/Effects/animate

      +

      Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

      +

      $params = array(
      + 'height' => 80,
      + 'width' => '50%',
      + 'marginLeft' => 125
      +);
      +$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

      + +

      fadeIn() / fadeOut()

      + +

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      + $this->jquery->fadeOut(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      + +

      toggleClass()

      + +

      This function will add or remove a CSS class to its target.

      +

      $this->jquery->toggleClass(target, class)

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.
      • +
      + +

      fadeIn() / fadeOut()

      + +

      These effects cause an element(s) to disappear or reappear over time.

      +

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      + $this->jquery->fadeOut(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      + +

      slideUp() / slideDown() / slideToggle()

      + +

      These effects cause an element(s) to slide.

      +

      $this->jquery->slideUp(target, optional speed, optional extra information);
      + $this->jquery->slideDown(target, optional speed, optional extra information);
      +$this->jquery->slideToggle(target, optional speed, optional extra information);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • +
      • "extra information" is optional, and could include a callback, or other additional information.
      • +
      + +

      Plugins

      + +

      + +

      Some select jQuery plugins are made available using this library.

      + +

      corner()

      +

      Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

      +

      $this->jquery->corner(target, corner_style);

      +
        +
      • "target" will be any valid jQuery selector or selectors.
      • +
      • "corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).
      • +
      +

      $this->jquery->corner("#note", "cool tl br");

      + +

      tablesorter()

      + +

      description to come

      + +

      modal()

      + +

      description to come

      + +

      calendar()

      + +

      description to come

      + +
      + + + + + + + \ No newline at end of file From 8dca04163a79701021043fcd3e267a5d965af993 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 5 Mar 2010 13:01:44 -0600 Subject: [PATCH 1863/2544] added Driver lib --- system/core/Loader.php | 23 ++++ system/libraries/Driver.php | 232 ++++++++++++++++++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 system/libraries/Driver.php diff --git a/system/core/Loader.php b/system/core/Loader.php index f70ee033..c399f296 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -543,6 +543,29 @@ function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) // -------------------------------------------------------------------- + /** + * Driver + * + * Loads a driver library + * + * @param string the name of the class + * @param mixed the optional parameters + * @param string an optional object name + * @return void + */ + function driver($library = '', $params = NULL, $object_name = NULL) + { + if ( ! class_exists('CI_Driver_Library')) + { + // we aren't instantiating an object here, that'll be done by the Library itself + require_once BASEPATH.'libraries/Driver'.EXT; + } + + return $this->library($library, $params, $object_name); + } + + // -------------------------------------------------------------------- + /** * Add Package Path * diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php new file mode 100644 index 00000000..07ef2e72 --- /dev/null +++ b/system/libraries/Driver.php @@ -0,0 +1,232 @@ +lib_name)) + { + $this->lib_name = get_class($this); + } + + // The class will be prefixed with the parent lib + $child_class = $this->lib_name.'_'.$child; + + if (in_array(strtolower($child_class), array_map('strtolower', $this->valid_drivers))) + { + // check and see if the driver is in a separate file + if ( ! class_exists($child_class)) + { + // check application path first + foreach (array(APPPATH, BASEPATH) as $path) + { + // and check for case sensitivity of both the parent and child libs + foreach (array(ucfirst($this->lib_name), strtolower($this->lib_name)) as $lib) + { + // loves me some nesting! + foreach (array(ucfirst($child_class), strtolower($child_class)) as $class) + { + $filepath = $path.'libraries/'.$this->lib_name.'/drivers/'.$child_class.EXT; + + if (file_exists($filepath)) + { + include_once $filepath; + break; + } + } + } + } + + // it's a valid driver, but the file simply can't be found + if ( ! class_exists($child_class)) + { + log_message('error', "Unable to load the requested driver: ".$child_class); + show_error("Unable to load the requested driver: ".$child_class); + } + } + + $obj = new $child_class; + $obj->decorate($this); + $this->$child = $obj; + return $this->$child; + } + + // The requested driver isn't valid! + log_message('error', "Invalid driver requested: ".$child_class); + show_error("Invalid driver requested: ".$child_class); + } + + // -------------------------------------------------------------------- + +} +// END CI_Driver_Library CLASS + + +/** + * CodeIgniter Driver Class + * + * This class enables you to create drivers for a Library based on the Driver Library. + * It handles the drivers' access to the parent library + * + * @package CodeIgniter + * @subpackage Libraries + * @category Libraries + * @author EllisLab Dev Team + * @link + */ +class CI_Driver { + protected $parent; + + private $methods = array(); + private $properties = array(); + + private static $reflections = array(); + + /** + * Decorate + * + * Decorates the child with the parent driver lib's methods and properties + * + * @access public + * @param object + * @return void + */ + function decorate($parent) + { + $this->parent = $parent; + + // Lock down attributes to what is defined in the class + // and speed up references in magic methods + + $class_name = get_class($parent); + + if ( ! isset(self::$reflections[$class_name])) + { + $r = new ReflectionObject($parent); + + foreach ($r->getMethods() as $method) + { + if ($method->isPublic()) + { + $this->methods[] = $method->getName(); + } + } + + foreach($r->getProperties() as $prop) + { + if ($prop->isPublic()) + { + $this->properties[] = $prop->getName(); + } + } + + self::$reflections[$class_name] = array($this->methods, $this->properties); + } + else + { + list($this->methods, $this->properties) = self::$reflections[$class_name]; + } + } + + // -------------------------------------------------------------------- + + /** + * __call magic method + * + * Handles access to the parent driver library's methods + * + * @access public + * @param string + * @param array + * @return mixed + */ + public function __call($method, $args = array()) + { + if (in_array($method, $this->methods)) + { + return call_user_func_array(array($this->parent, $method), $args); + } + + $trace = debug_backtrace(); + _exception_handler(E_ERROR, "No such method '{$method}'", $trace[1]['file'], $trace[1]['line']); + exit; + } + + // -------------------------------------------------------------------- + + /** + * __get magic method + * + * Handles reading of the parent driver library's properties + * + * @access public + * @param string + * @return mixed + */ + function __get($var) + { + if (in_array($var, $this->properties)) + { + return $this->parent->$var; + } + } + + // -------------------------------------------------------------------- + + /** + * __set magic method + * + * Handles writing to the parent driver library's properties + * + * @access public + * @param string + * @param array + * @return mixed + */ + function __set($var, $val) + { + if (in_array($var, $this->properties)) + { + $this->parent->$var = $val; + } + } + + // -------------------------------------------------------------------- + +} +// END CI_Driver CLASS + +/* End of file Driver.php */ +/* Location: ./system/libraries/Driver.php */ \ No newline at end of file From c64ca0128ab0cc015ed37d1833bd79ee63e35eba Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 7 Mar 2010 07:55:56 -0600 Subject: [PATCH 1864/2544] fixed load_class() call in Hooks to get Config from core --- system/core/Hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 5e017ccb..3b063f79 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -52,7 +52,7 @@ function CI_Hooks() */ function _initialize() { - $CFG =& load_class('Config'); + $CFG =& load_class('Config', 'core'); // If hooks are not enabled in the config file // there is nothing else to do From d5e0cb5fe94fb7a89cc12842511481a3c3d37d8e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 9 Mar 2010 20:20:46 -0600 Subject: [PATCH 1865/2544] sped up Driver loading slightly by predicting subfolder location --- system/core/Loader.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/core/Loader.php b/system/core/Loader.php index c399f296..1726f0a5 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -558,7 +558,14 @@ function driver($library = '', $params = NULL, $object_name = NULL) if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself - require_once BASEPATH.'libraries/Driver'.EXT; + require BASEPATH.'libraries/Driver'.EXT; + } + + // 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, '/')) + { + $library = $library.'/'.$library; } return $this->library($library, $params, $object_name); From a9730c337ef046f1c5391cec2a9e54ac613a4e6d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 9 Mar 2010 20:38:13 -0600 Subject: [PATCH 1866/2544] changed SVN location change to BitBucket --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a136234e..20cb9b75 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,7 +94,7 @@

      Version 2.0.0

    • Other Changes
        -
      • The SVN repository for CodeIgniter has moved to http://svn.ellislab.com/CodeIgniter/trunk.
      • +
      • In-development code is now hosted at BitBucket
      • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
      • Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.
      • get_mime_by_extension() is now case insensitive.
      • From c6da50384e06c60e242cb4442abb9c6c9b450674 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 9 Mar 2010 20:44:27 -0600 Subject: [PATCH 1867/2544] completely removed Plugins from CodeIgniter --- system/application/config/autoload.php | 19 +--- system/core/Loader.php | 67 +----------- system/plugins/index.html | 10 -- user_guide/changelog.html | 8 +- user_guide/general/autoloader.html | 3 +- user_guide/general/helpers.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/plugins.html | 127 ----------------------- user_guide/general/reserved_names.html | 4 +- user_guide/helpers/captcha_helper.html | 4 +- user_guide/installation/upgrade_200.html | 25 +++-- user_guide/libraries/loader.html | 5 +- user_guide/nav/nav.js | 1 - user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/toc.html | 5 +- 17 files changed, 41 insertions(+), 247 deletions(-) delete mode 100644 system/plugins/index.html delete mode 100644 user_guide/general/plugins.html diff --git a/system/application/config/autoload.php b/system/application/config/autoload.php index 1745d5ca..e7c6f0db 100644 --- a/system/application/config/autoload.php +++ b/system/application/config/autoload.php @@ -20,10 +20,9 @@ | | 1. Libraries | 2. Helper files -| 3. Plugins -| 4. Custom config files -| 5. Language files -| 6. Models +| 3. Custom config files +| 4. Language files +| 5. Models | */ @@ -54,18 +53,6 @@ $autoload['helper'] = array(); -/* -| ------------------------------------------------------------------- -| Auto-load Plugins -| ------------------------------------------------------------------- -| Prototype: -| -| $autoload['plugin'] = array('captcha', 'js_calendar'); -*/ - -$autoload['plugin'] = array(); - - /* | ------------------------------------------------------------------- | Auto-load Config files diff --git a/system/core/Loader.php b/system/core/Loader.php index 1726f0a5..976823f8 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -41,7 +41,6 @@ class CI_Loader { var $_ci_loaded_files = array(); var $_ci_models = array(); var $_ci_helpers = array(); - var $_ci_plugins = array(); var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); @@ -445,64 +444,6 @@ function helpers($helpers = array()) // -------------------------------------------------------------------- - /** - * Load Plugin - * - * This function loads the specified plugin. - * - * @access public - * @param array - * @return void - */ - function plugin($plugins = array()) - { - foreach ($this->_ci_prep_filename($plugins, '_pi') as $plugin) - { - if (isset($this->_ci_plugins[$plugin])) - { - continue; - } - - if (file_exists(APPPATH.'plugins/'.$plugin.EXT)) - { - include_once(APPPATH.'plugins/'.$plugin.EXT); - } - else - { - if (file_exists(BASEPATH.'plugins/'.$plugin.EXT)) - { - include_once(BASEPATH.'plugins/'.$plugin.EXT); - } - else - { - show_error('Unable to load the requested file: plugins/'.$plugin.EXT); - } - } - - $this->_ci_plugins[$plugin] = TRUE; - log_message('debug', 'Plugin loaded: '.$plugin); - } - } - - // -------------------------------------------------------------------- - - /** - * Load Plugins - * - * This is simply an alias to the above function in case the - * user has written the plural form of this function. - * - * @access public - * @param array - * @return void - */ - function plugins($plugins = array()) - { - $this->plugin($plugins); - } - - // -------------------------------------------------------------------- - /** * Loads a language file * @@ -987,7 +928,7 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU * Autoloader * * The config/autoload.php file contains an array that permits sub-systems, - * libraries, plugins, and helpers to be loaded automatically. + * libraries, and helpers to be loaded automatically. * * @access private * @param array @@ -1012,8 +953,8 @@ function _ci_autoloader() } } - // Autoload plugins, helpers and languages - foreach (array('helper', 'plugin', 'language') as $type) + // Autoload helpers and languages + foreach (array('helper', 'language') as $type) { if (isset($autoload[$type]) AND count($autoload[$type]) > 0) { @@ -1058,7 +999,7 @@ function _ci_autoloader() /** * Assign to Models * - * Makes sure that anything loaded by the loader class (libraries, plugins, etc.) + * Makes sure that anything loaded by the loader class (libraries, etc.) * will be available to models, if any exist. * * @access private diff --git a/system/plugins/index.html b/system/plugins/index.html deleted file mode 100644 index c942a79c..00000000 --- a/system/plugins/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

        Directory access is forbidden.

        - - - \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 20cb9b75..4f8c86ff 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -62,6 +62,13 @@

        Version 2.0.0

        Hg Tag:

          +
        • General changes +
            +
          • PHP 4 support is deprecated. Features new to 2.0.0 may not be support PHP 4, and all legacy features will no longer support PHP 4 as of 2.1.0.
          • +
          • Scaffolding, having been deprecated for a number of versions, has been removed.
          • +
          • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
          • +
          • In-development code is now hosted at BitBucket.
          • +
        • Libraries
          • Added "is_object" into the list of unit tests capable of being run.
          • @@ -94,7 +101,6 @@

            Version 2.0.0

          • Other Changes
              -
            • In-development code is now hosted at BitBucket
            • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
            • Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.
            • get_mime_by_extension() is now case insensitive.
            • diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 8d7f5d8c..d697c8a9 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -57,7 +57,7 @@

              Auto-loading Resources

              -

              CodeIgniter comes with an "Auto-load" feature that permits libraries, helpers, and plugins to be initialized +

              CodeIgniter comes with an "Auto-load" feature that permits libraries, helpers, and models to be initialized automatically every time the system runs. If you need certain resources globally throughout your application you should consider auto-loading them for convenience.

              @@ -66,7 +66,6 @@

              Auto-loading Resources

              • Core classes found in the "libraries" folder
              • Helper files found in the "helpers" folder
              • -
              • Plugins found in the "plugins" folder
              • Custom config files found in the "config" folder
              • Language files found in the "system/language" folder
              • Models found in the "models" folder
              • diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index f1aa56e7..ef24e8c9 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -176,7 +176,7 @@

                Now What?

                   ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Plugins +Next Topic:  Using Libraries

                CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

    • diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 71189dfb..2634b18a 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -81,7 +81,7 @@

      Creating Your Own Libraries

      diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html new file mode 100644 index 00000000..649b6d4d --- /dev/null +++ b/user_guide/general/drivers.html @@ -0,0 +1,104 @@ + + + + + +Using CodeIgniter Drivers : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 2.0.0

      +
      + + + + + + + + + +
      + + +
      + + + +
      + +

      Using CodeIgniter Drivers

      + + +

      Drivers are a special type of Library that has a parent class and any number of potential child classes. Child classes have access to the parent class, but not their siblings. Drivers provide an elegant syntax in your controllers for libraries that benefit from or require being broken down into discrete classes.

      + +

      Drivers are found in the system/libraries folder, in their own folder which is identically named to the parent library class. Also inside that folder is a subfolder named drivers, which contains all of the possible child class files.

      + +

      To use a driver you will initialize it within a controller using the following initialization function:

      + +$this->load->driver('class name'); + +

      Where class name is the name of the driver class you want to invoke. For example, to load a driver named "Some Parent" you would do this:

      + +$this->load->driver('some_parent'); + +

      Methods of that class can then be invoked with:

      + +$this->some_parent->some_method(); + +

      The child classes, the drivers themselves, can then be called directly through the parent class, without initializing them:

      + +$this->some_parent->child_one->some_method();
      +$this->some_parent->child_two->another_method();
      + +

      Creating Your Own Drivers

      + +

      Please read the section of the user guide that discusses how to create your own drivers.

      + + + +
      + + + + + + + \ No newline at end of file From cc64e97e502ce60491811b27e50b768f2517ba9b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 9 Mar 2010 21:22:25 -0600 Subject: [PATCH 1869/2544] change log note for Drivers --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4f8c86ff..b196acf4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

      Version 2.0.0

    • PHP 4 support is deprecated. Features new to 2.0.0 may not be support PHP 4, and all legacy features will no longer support PHP 4 as of 2.1.0.
    • Scaffolding, having been deprecated for a number of versions, has been removed.
    • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
    • +
    • Added new special Library type: Drivers.
    • In-development code is now hosted at BitBucket.
    • Libraries From ee71c80dd20bcfc60169af3eb1f628229ca30d67 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 10:05:05 -0600 Subject: [PATCH 1870/2544] added ability to enable/disable individual sections of the Profiler --- system/application/config/profiler.php | 17 +++++ system/core/Output.php | 28 ++++++- system/language/english/profiler_lang.php | 1 + system/libraries/Profiler.php | 74 ++++++++++++++++--- user_guide/changelog.html | 1 + user_guide/general/profiling.html | 90 ++++++++++++++++++++--- user_guide/libraries/output.html | 3 + 7 files changed, 193 insertions(+), 21 deletions(-) create mode 100644 system/application/config/profiler.php diff --git a/system/application/config/profiler.php b/system/application/config/profiler.php new file mode 100644 index 00000000..f30432d9 --- /dev/null +++ b/system/application/config/profiler.php @@ -0,0 +1,17 @@ +enable_profiler = (is_bool($val)) ? $val : TRUE; } + // -------------------------------------------------------------------- + + /** + * Set Profiler Sections + * + * Allows override of default / config settings for Profiler section display + * + * @access public + * @param array + * @return void + */ + function set_profiler_sections($sections) + { + foreach ($sections as $section => $enable) + { + $this->_profiler_sections[$section] = ($enable !== FALSE) ? TRUE : FALSE; + } + } + // -------------------------------------------------------------------- /** @@ -258,7 +279,12 @@ function _display($output = '') if ($this->enable_profiler == TRUE) { $CI->load->library('profiler'); - + + if ( ! empty($this->_profiler_sections)) + { + $CI->profiler->set_sections($this->_profiler_sections); + } + // If the output data contains closing and tags // we will remove them and add them back after we insert the profile data if (preg_match("|.*?|is", $output)) diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index bf218300..7876331f 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -16,6 +16,7 @@ $lang['profiler_no_get'] = 'No GET data exists'; $lang['profiler_no_uri'] = 'No URI data exists'; $lang['profiler_no_memory'] = 'Memory Usage Unavailable'; +$lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.'; /* End of file profiler_lang.php */ /* Location: ./system/language/english/profiler_lang.php */ \ No newline at end of file diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index bf20f172..b2c008fc 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -34,14 +34,59 @@ class CI_Profiler { var $CI; - function CI_Profiler() + var $_available_sections = array( + 'benchmarks', + 'config', + 'controller_info', + 'get', + 'http_headers', + 'memory_usage', + 'post', + 'queries', + 'uri_string' + ); + + function CI_Profiler($config = array()) { $this->CI =& get_instance(); $this->CI->load->language('profiler'); + + // default all sections to display + foreach ($this->_available_sections as $section) + { + if ( ! isset($config[$section])) + { + $this->_compile_{$section} = TRUE; + } + } + + $this->set_sections($config); } // -------------------------------------------------------------------- + /** + * Set Sections + * + * Sets the private _compile_* properties to enable/disable Profiler sections + * + * @access public + * @param mixed + * @return void + */ + function set_sections($config) + { + foreach ($config as $method => $enable) + { + if (in_array($method, $this->_available_sections)) + { + $this->_compile_{$method} = ($enable !== FALSE) ? TRUE : FALSE; + } + } + } + + // -------------------------------------------------------------------- + /** * Auto Profiler * @@ -49,7 +94,7 @@ function CI_Profiler() * matches any two points that are named identically (ending in "_start" * and "_end" respectively). It then compiles the execution times for * all points and returns it as an array - * + * @PHP4 - all methods should be declared private * @access private * @return array */ @@ -438,16 +483,23 @@ function _compile_config() function run() { $output = "
      "; + $fields_displayed = 0; + + foreach ($this->_available_sections as $section) + { + if ($this->_compile_{$section} !== FALSE) + { + $func = "_compile_{$section}"; + $output .= $this->{$func}(); + $fields_displayed++; + } + } - $output .= $this->_compile_uri_string(); - $output .= $this->_compile_controller_info(); - $output .= $this->_compile_memory_usage(); - $output .= $this->_compile_benchmarks(); - $output .= $this->_compile_get(); - $output .= $this->_compile_post(); - $output .= $this->_compile_queries(); - $output .= $this->_compile_config(); - $output .= $this->_compile_http_headers(); + if ($fields_displayed == 0) + { + $output .= '

      '.$this->CI->lang->line('profiler_no_profiles').'

      '; + } + $output .= '
      '; return $output; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b196acf4..ac421286 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,6 +72,7 @@

      Version 2.0.0

    • Libraries
        +
      • Added ability to enable / disable individual sections of the Profiler
      • Added "is_object" into the list of unit tests capable of being run.
      • Table library will generate an empty cell with a blank string, or NULL value.
      • Added a parse_string() method to the Parser Class.
      • diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index ec71278b..8622edeb 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -69,20 +69,92 @@

        Initializing the Class

        Enabling the Profiler

        -

        To enable the profiler place the following function anywhere within your Controller functions:

        -$this->output->enable_profiler(TRUE); +

        To enable the profiler place the following function anywhere within your Controller functions:

        + $this->output->enable_profiler(TRUE); -

        When enabled a report will be generated and inserted at the bottom of your pages.

        +

        When enabled a report will be generated and inserted at the bottom of your pages.

        -

        To disable the profiler you will use:

        -$this->output->enable_profiler(FALSE); +

        To disable the profiler you will use:

        + $this->output->enable_profiler(FALSE); -

        Setting Benchmark Points

        - -

        In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.

        -

        Please read the information on setting Benchmark points in Benchmark Class page.

        +

        Setting Benchmark Points

        +

        In order for the Profiler to compile and display your benchmark data you must name your mark points using specific syntax.

        + +

        Please read the information on setting Benchmark points in Benchmark Class page.

        + + +

        Enabling and Disabling Profiler Sections

        + +

        Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to TRUE or FALSE. This can be done one of two ways. First, you can set application wide defaults with the system/application/config/profiler.php config file.

        + + $config['config']          = FALSE;
        + $config['queries']         = FALSE;
        + +

        In your controllers, you can override the defaults and config file values by calling the set_profiler_sections() method of the Output class:

        + + $sections = array(
        +     'config'  => TRUE,
        +     'queries' => TRUE
        +     );
        +
        + $this->output->set_profiler_sections($sections);
        + +

        Available sections and the array key used to access them are described in the table below.

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        KeyDescriptionDefault
        benchmarksElapsed time of Benchmark points and total execution timeTRUE
        configCodeIgniter Config variablesTRUE
        controller_infoThe Controller class and method requestedTRUE
        getAny GET data passed in the requestTRUE
        http_headersThe HTTP headers for the current requestTRUE
        memory_usageAmount of memory consumed by the current request, in bytesTRUE
        postAny POST data passed in the requestTRUE
        queriesListing of all database queries executed, including execution timeTRUE
        uri_stringThe URI of the current requestTRUE
    • diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index de22fbe2..70f0c1f7 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -130,6 +130,9 @@

      $this->output->enable_profiler();

      To disable the profiler you will use:

      $this->output->enable_profiler(FALSE); +

      $this->output->set_profiler_sections();

      + +

      Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

      $this->output->cache();

      The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

      From 5034e3fe8442fcb558225f6c528497227474c9ca Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 13:33:43 -0600 Subject: [PATCH 1871/2544] added docs for Output class property --- user_guide/changelog.html | 1 + user_guide/libraries/output.html | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ac421286..8dcc9060 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,6 +72,7 @@

      Version 2.0.0

    • Libraries
        +
      • Added $parse_exec_vars property to Output library.
      • Added ability to enable / disable individual sections of the Profiler
      • Added "is_object" into the list of unit tests capable of being run.
      • Table library will generate an empty cell with a blank string, or NULL value.
      • diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 70f0c1f7..41104808 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -137,6 +137,12 @@

        $this->output->set_profiler_sections();

        $this->output->cache();

        The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

        +

        Parsing Execution Variables

        + +

        CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. + + $this->output->parse_exec_vars = FALSE; +

    • From 9898b892baed8d20f4138cb88c4f4ca3a082e444 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:04:17 -0600 Subject: [PATCH 1872/2544] added Security class docs, cleaned up Input class for changes to both --- user_guide/changelog.html | 1 + user_guide/general/security.html | 2 +- user_guide/helpers/cookie_helper.html | 44 +-------- user_guide/libraries/input.html | 81 +++++++++++------ user_guide/libraries/security.html | 123 ++++++++++++++++++++++++++ user_guide/libraries/sessions.html | 2 +- user_guide/nav/nav.js | 1 + user_guide/toc.html | 1 + 8 files changed, 182 insertions(+), 73 deletions(-) create mode 100644 user_guide/libraries/security.html diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8dcc9060..eb5cf93c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,6 +72,7 @@

      Version 2.0.0

    • Libraries
        +
      • Added Security library, which now contains the xss_clean function, filename_security function and other security related functions.
      • Added $parse_exec_vars property to Output library.
      • Added ability to enable / disable individual sections of the Profiler
      • Added "is_object" into the list of unit tests capable of being run.
      • diff --git a/user_guide/general/security.html b/user_guide/general/security.html index 593ffd58..bc969f73 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -112,7 +112,7 @@

        Best Practices

        CodeIgniter comes with a Cross Site Scripting filter. This filter looks for commonly used techniques to embed malicious Javascript into your data, or other types of code that attempt to hijack cookies -or do other malicious things. The XSS Filter is described here. +or do other malicious things. The XSS Filter is described here.

        diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index b73daf66..d7120d51 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -70,53 +70,13 @@

        Loading this Helper

        set_cookie()

        -

        Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: -Array Method, and Discrete Parameters:

        - -

        Array Method

        - -

        Using this method, an associative array is passed to the first parameter:

        - -$cookie = array(
        -                   'name'   => 'The Cookie Name',
        -                   'value'  => 'The Value',
        -                   'expire' => '86500',
        -                   'domain' => '.some-domain.com',
        -                   'path'   => '/',
        -                   'prefix' => 'myprefix_',
        -               );
        -
        -set_cookie($cookie); -
        - -

        Notes:

        - -

        Only the name and value are required. To delete a cookie set it with the expiration blank.

        - -

        The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to -zero the cookie will only last as long as the browser is open.

        -

        For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

        -

        The path is usually not needed since the function sets a root path.

        -

        The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

        - -

        Discrete Parameters

        - -

        If you prefer, you can set the cookie by passing data using individual parameters:

        - -set_cookie($name, $value, $expire, $domain, $path, $prefix); +

        This helper function gives you view file friendly syntax to set browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->set_cookie().

        get_cookie()

        -

        Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

        - -get_cookie('some_cookie'); - -

        The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

        +

        This helper function gives you view file friendly syntax to get browser cookies. Refer to the Input class for a description of use, as this function is an alias to $this->input->cookie().

        -

        The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

        -

        get_cookie('some_cookie', TRUE);

        delete_cookie()

        Lets you delete a cookie. Unless you've set a custom path or other values, only the name of the cookie is needed:

        diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 59198a24..055f12bf 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -42,7 +42,7 @@
    • + + + + +

      CodeIgniter User Guide Version 2.0.0

      +
      + + + + + + + + + +
      + + +
      + + + +
      + + +

      Security Class

      + +

      The Security Class contains methods that help you create a secure application, processing input data for security.

      + +

      XSS Filtering

      + +

      CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

      + +

      The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

      + +

      +Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

      + + +

      To filter data through the XSS filter use this function:

      + +

      $this->security->xss_clean()

      + +

      Here is an usage example:

      + +$data = $this->security->xss_clean($data); + +

      If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +application/config/config.php file and setting this:

      + +$config['global_xss_filtering'] = TRUE; + +

      Note: If you use the form validation class, it gives you the option of XSS filtering as well.

      + +

      An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

      + +if ($this->security->xss_clean($file, TRUE) === FALSE)
      +{
      +    // file failed the XSS test
      +}
      + + +

      $this->security->sanitize_filename()

      + +

      When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

      + +$filename = $this->security->sanitize_filename($this->input->post('filename')); + + + +
      + + + + + + + \ No newline at end of file diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 059f6fbc..31b4047e 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -298,7 +298,7 @@

      Session Preferences

  • Libraries From 536558bdd4dd04abade1f7d8424de2abd88d978c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:09:54 -0600 Subject: [PATCH 1876/2544] changelog note for directory_trigger --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 2d34943c..822f394a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@

    Version 2.0.0

  • Added new special Library type: Drivers.
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
  • Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
  • +
  • Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
  • In-development code is now hosted at BitBucket.
  • Libraries From ad1171a6797dc0054381327fb26a9e9e232a639e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:18:38 -0600 Subject: [PATCH 1877/2544] added swap_pre, autoinit, and stricton database configuration explanations --- system/application/config/database.php | 4 ++++ user_guide/changelog.html | 3 +++ user_guide/database/configuration.html | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index 28dfff5c..fcdefda7 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -26,6 +26,8 @@ | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database +| ['swap_pre'] A default table prefix that should be swapped with the dbprefix +| ['autoinit'] Whether or not to automatically initialize the database. | ['stricton'] TRUE/FALSE - forces "Strict Mode" connections | - good for ensuring strict SQL while developing | @@ -51,6 +53,8 @@ $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; +$db['default']['swap_pre'] = ""; +$db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 822f394a..95b1e6cc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,6 +89,9 @@

    Version 2.0.0

  • Database
      +
    • Added swap_pre value to database configuration.
    • +
    • Added autoinit value to database configuration.
    • +
    • Added stricton value to database configuration.
    • Added database_exists() to the Database Utilities Class.
    • Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.
    • Fixed a bug where driver specific table identifier protection could lead to malformed queries in the field_data() functions.
    • diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 4ef76ed1..1844aa05 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -78,7 +78,10 @@

      Database Configuration

      $db['default']['cache_on'] = FALSE;
      $db['default']['cachedir'] = "";
      $db['default']['char_set'] = "utf8";
      -$db['default']['dbcollat'] = "utf8_general_ci";
      +$db['default']['dbcollat'] = "utf8_general_ci";
      +$db['default']['swap_pre'] = "";
      +$db['default']['autoinit'] = TRUE;
      +$db['default']['stricton'] = FALSE;

      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, production, test, etc.) @@ -96,7 +99,10 @@

      Database Configuration

      $db['test']['cache_on'] = FALSE;
      $db['test']['cachedir'] = "";
      $db['test']['char_set'] = "utf8";
      -$db['test']['dbcollat'] = "utf8_general_ci"; +$db['test']['dbcollat'] = "utf8_general_ci";
      +$db['test']['swap_pre'] = "";
      +$db['test']['autoinit'] = TRUE;
      +$db['test']['stricton'] = FALSE;

      Then, to globally tell the system to use that group you would set this variable located in the config file:

      @@ -129,7 +135,10 @@

      Explanation of Values:

    • cachedir - The absolute server path to your database query cache directory.
    • char_set - The character set used in communicating with the database.
    • dbcollat - The character collation used in communicating with the database.
    • -
    • port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    • +
    • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
    • +
    • autoinit - Whether or not to automatically initialize the database.
    • +
    • stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
    • +
    • port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;

    Note: Depending on what database platform you are using (MySQL, Postgres, etc.) From 1a19592c5dca055b857177ed35a10294dded78ee Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:22:59 -0600 Subject: [PATCH 1878/2544] added docs for convert_accented_characters() in the Text Helper --- user_guide/changelog.html | 1 + user_guide/helpers/text_helper.html | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 95b1e6cc..bd209993 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -100,6 +100,7 @@

    Version 2.0.0

  • Helpers
      +
    • Added convert_accented_characters() function to text helper.
    • Added accept-charset to the list of inserted attributes of form_open() in the Form Helper.
    • Deprecated the dohash() function in favour of do_hash() for naming consistency.
    • Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index c80300c8..9e8f8f5e 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -115,6 +115,13 @@

      entities_to_ascii()

      This function does the opposite of the previous one; it turns character entities back into ASCII.

      +

      convert_accented_characters()

      + +

      Transliterates high ASCII characters to low ASCII equivalents, useful when non-English characters need to be used where only standard ASCII characters are safely used, for instance, in URLs.

      + +$string = convert_accented_characters($string); + +

      This function uses a companion config file system/application/config/foreign_chars.php to define the to and from array for transliteration.

      word_censor()

      From 7fa0f4aa89e570d01e53b02f3e0366e3313792f4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:24:15 -0600 Subject: [PATCH 1879/2544] added docs for * filter for allowed_types of Upload class --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bd209993..14f81bc4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,7 @@

      Version 2.0.0

    • Added CSRF (Cross-site Reference Forgery) protection to the Security library.
    • Added $parse_exec_vars property to Output library.
    • Added ability to enable / disable individual sections of the Profiler
    • +
    • Added a wildcard option $config['allowed_types'] = '*' to the File Uploading Class.
    • Added "is_object" into the list of unit tests capable of being run.
    • Table library will generate an empty cell with a blank string, or NULL value.
    • Added a parse_string() method to the Parser Class.
    • From 0d69ee3cb63a1e91ff5a00d906115297f4b5a0ae Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:25:06 -0600 Subject: [PATCH 1880/2544] updated Upload class docs to be accurate with the * filter for allowed_types --- user_guide/libraries/file_uploading.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 151b95cb..60290b18 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -255,7 +255,7 @@

      Preferences

      allowed_types None None -The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. +The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. If '*' is used, all file types will be allowed. From 9dad731fe608de8585900207bbc4a91c688b15de Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:27:30 -0600 Subject: [PATCH 1881/2544] added changelog item for XML-RPC server 'object' config item --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 14f81bc4..7497f561 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

      Version 2.0.0

    • Added $parse_exec_vars property to Output library.
    • Added ability to enable / disable individual sections of the Profiler
    • Added a wildcard option $config['allowed_types'] = '*' to the File Uploading Class.
    • +
    • Added an 'object' config variable to the XML-RPC Server library so that one can specify the object to look for requested methods, instead of assuming it is in the $CI superobject.
    • Added "is_object" into the list of unit tests capable of being run.
    • Table library will generate an empty cell with a blank string, or NULL value.
    • Added a parse_string() method to the Parser Class.
    • From ec03c8f034b44eb2dd4c0eee9b7b77446da3cd46 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:30:16 -0600 Subject: [PATCH 1882/2544] changelog note for subclass prefix automatically being applied by the loader. --- user_guide/changelog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7497f561..295f8e09 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -83,6 +83,7 @@

      Version 2.0.0

    • Added an 'object' config variable to the XML-RPC Server library so that one can specify the object to look for requested methods, instead of assuming it is in the $CI superobject.
    • Added "is_object" into the list of unit tests capable of being run.
    • Table library will generate an empty cell with a blank string, or NULL value.
    • +
    • Added ability to set tag attributes for individual cells in the Table library
    • Added a parse_string() method to the Parser Class.
    • Added HTTP headers and Config information to the Profiler output.
    • Added Chrome and Flock to the list of detectable browsers by browser() in the User Agent Class.
    • @@ -115,6 +116,7 @@

      Version 2.0.0

    • Other Changes
        +
      • Updated loader to automatically apply the sub-class prefix as an option when loading classes. Class names can be prefixed with the standard "CI_" or the same prefix as the subclass prefix, or no prefix at all.
      • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
      • Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.
      • get_mime_by_extension() is now case insensitive.
      • From f991faed51a745f04b8440250502e385d1ade8e2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:30:59 -0600 Subject: [PATCH 1883/2544] changelog note for bugfix to log entries --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 295f8e09..1028442e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -131,6 +131,7 @@

        Version 2.0.0

        Bug fixes for 2.0.0

          +
        • Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.
        • Fixed assorted user guide typos or examples (#10693, #8951, #7825, #8660, #7883, #6771, #10656).
        • Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".
        • Fixed an error in the Zip library that didn't allow downloading on PHP 4 servers.
        • From f0abee3f8534d2c45c203dd270ed61dc31b5cefe Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 14:31:53 -0600 Subject: [PATCH 1884/2544] changelog note for bugfix in Profiler dealing with failed queries --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 1028442e..5b61993c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -131,6 +131,7 @@

          Version 2.0.0

          Bug fixes for 2.0.0

            +
          • Fixed a bug where a failed query would not have a saved query execution time causing errors in the Profiler
          • Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.
          • Fixed assorted user guide typos or examples (#10693, #8951, #7825, #8660, #7883, #6771, #10656).
          • Fixed a language key in the profiler: "profiler_no_memory_usage" to "profiler_no_memory".
          • From 2ede2f6e8e9f2cde7402a88906d091011f7885ec Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 10 Mar 2010 15:00:18 -0600 Subject: [PATCH 1885/2544] added docs for application Packages, added third_party folder to the application folder --- system/application/third_party/index.html | 10 +++++ user_guide/changelog.html | 1 + user_guide/libraries/loader.html | 49 +++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 system/application/third_party/index.html diff --git a/system/application/third_party/index.html b/system/application/third_party/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/system/application/third_party/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

            Directory access is forbidden.

            + + + \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5b61993c..38ccc2fc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

            Version 2.0.0

          • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
          • Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
          • Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
          • +
          • Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory. See the Loader class documentation for more details.
          • In-development code is now hosted at BitBucket.
        • Libraries diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 83b3831e..cc521023 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -190,6 +190,55 @@

          $this->load->config('file_name')

          This function is an alias of the config file loading function: $this->config->load()

          +

          Application "Packages"

          + +

          An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the system/application/third_party folder. Below is a sample map of an package directory

          + + +

          Sample Package "Foo Bar" Directory Map

          + +

          The following is an example of a directory for an application package named "Foo Bar".

          + +/system/application/third_party/foo_bar
          +
          +config/
          +helpers/
          +language/
          +libraries/
          +models/
          +
          + +

          Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

          + +

          $this->load->add_package_path()

          + +

          Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

          + +$this->load->add_package_path(APPPATH.'third_party/foo_bar/');
          +$this->load->library('foo_bar');
          + +

          $this->load->remove_package_path()

          + +

          When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

          + +

          $this->load->remove_package_path()

          + +

          Or to remove a specific package path, specify the same path previously given to add_package_path() for a package.:

          + +$this->load->remove_package_path(APPPATH.'third_party/foo_bar/'); + +

          Package view files

          + +

          @todo - package view file interface is not complete. It can be experimentally used by first saving the Loader's original view path, setting the view path to the package's view path, and when finished, setting back to the original view path.

          + +// ... save the original view path, and set to our Foo Bar package view folder
          +$orig_view_path = $this->load->_ci_view_path;
          +$this->load->_ci_view_path = APPPATH.'third_party/foo_bar/views/';
          +
          +// ... code using the package's view files
          +
          +// ... then return the view path to the application's original view path
          +$this->load->_ci_view_path = $orig_view_path;
          From cf579558fa8c1e20af748146e4fe196d7c772c34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 11 Mar 2010 09:13:34 -0600 Subject: [PATCH 1886/2544] full on scaffolding removal --- system/database/DB_active_rec.php | 4 +- user_guide/general/common_functions.html | 2 +- user_guide/general/hooks.html | 2 - user_guide/general/reserved_names.html | 3 - user_guide/general/routing.html | 7 +- user_guide/general/scaffolding.html | 147 ----------------------- user_guide/libraries/loader.html | 5 - user_guide/nav/nav.js | 1 - user_guide/overview/features.html | 1 - user_guide/toc.html | 1 - 10 files changed, 4 insertions(+), 169 deletions(-) delete mode 100644 user_guide/general/scaffolding.html diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 88690a8f..3e9923e6 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1916,7 +1916,7 @@ function _object_to_array($object) foreach (get_object_vars($object) as $key => $val) { // There are some built in keys we need to ignore for this conversion - if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table') + if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name') { $array[$key] = $val; } @@ -1950,7 +1950,7 @@ function _object_to_array_batch($object) foreach ($fields as $val) { // There are some built in keys we need to ignore for this conversion - if ($val != '_parent_name' && $val != '_ci_scaffolding' && $val != '_ci_scaff_table') + if ($val != '_parent_name') { $i = 0; diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 132287c6..c04144a5 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -111,7 +111,7 @@

          set_status_header(code, 'text');

             ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Scaffolding

          +Next Topic:  URI Routing

          CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

          diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 1cda08e6..44072380 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -143,8 +143,6 @@

          Hook Points

          use your own display methodology. Note that you will need to reference the CI superobject with $this->CI =& get_instance() and then the finalized data will be available by calling $this->CI->output->get_output()
        • cache_override
          Enables you to call your own function instead of the _display_cache() function in the output class. This permits you to use your own cache display mechanism.
        • -
        • scaffolding_override
          - Permits a scaffolding request to trigger your own script instead.
        • post_system
          Called after the final rendered page is sent to the browser, at the end of system execution after the finalized data is sent to the browser.
        diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 8abfbe6c..57373279 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -67,7 +67,6 @@

        Controller names

      • Controller
      • CI_Base
      • _ci_initialize
      • -
      • _ci_scaffolding
      • Default (PHP 5)
      • index
      @@ -85,14 +84,12 @@

      Controller names

    • language
    • library
    • model
    • -
    • scaffolding
    • script
    • view
    • vars
    • _ci_assign_to_models
    • _ci_autoloader
    • _ci_init_class
    • -
    • _ci_init_scaffolding
    • _ci_is_instance
    • _ci_load
    • _ci_load_class
    • diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 85e91af7..402e50a2 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -145,11 +145,6 @@

      Reserved Routes

      when people load your root URL. In the above example, the "welcome" class would be loaded. You are encouraged to always have a default route otherwise a 404 page will appear by default.

      -$route['scaffolding_trigger'] = 'scaffolding'; - -

      This route lets you set a secret word, which when present in the URL, triggers the scaffolding feature. -Please read the Scaffolding page for details.

      -

      Important:  The reserved routes must come before any wildcard or regular expression routes.

      @@ -158,7 +153,7 @@

      Reserved Routes

      From fc5c7e5e89d1ac8a84555b8d3971f14533abde03 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 11 Mar 2010 10:29:13 -0600 Subject: [PATCH 1888/2544] added @php4 tag to compat helper (thanks Phil) --- system/helpers/compatibility_helper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/helpers/compatibility_helper.php b/system/helpers/compatibility_helper.php index e7b21c66..4d7d466f 100644 --- a/system/helpers/compatibility_helper.php +++ b/system/helpers/compatibility_helper.php @@ -25,6 +25,7 @@ * well with CodeIgniter, so those functions have been refactored. * We cheat a little and use CI's _exception_handler() to output our own PHP errors * so that the behavior fully mimicks the PHP 5 counterparts. -- Derek Jones + * @PHP4 * * @package CodeIgniter * @subpackage Helpers From 1f25afec332193512b6fb3c364ec7387f776b1d0 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 11 Mar 2010 12:17:02 -0500 Subject: [PATCH 1889/2544] grammer fixup - we're all about grammer (yes, if you're reading this thinking "grammar" I'm trolling you). --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 38ccc2fc..69d7d4b8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -64,7 +64,7 @@

      Version 2.0.0

      • General changes
          -
        • PHP 4 support is deprecated. Features new to 2.0.0 may not be support PHP 4, and all legacy features will no longer support PHP 4 as of 2.1.0.
        • +
        • PHP 4 support is deprecated. Features new to 2.0.0 may not support PHP 4, and all legacy features will no longer support PHP 4 as of 2.1.0.
        • Scaffolding, having been deprecated for a number of versions, has been removed.
        • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
        • Added new special Library type: Drivers.
        • From 5c180887a44646fdcf4f81cc2d7b7110d13ccd43 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 11 Mar 2010 19:50:31 -0600 Subject: [PATCH 1890/2544] switching svn info on download page to hg --- user_guide/installation/downloads.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f5f6b324..271be7f6 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -82,10 +82,14 @@

          Downloading CodeIgniter

          -

          Subversion Server

          -

          Subversion is a version control system.

          -

          Public subversion access is now available via http://svn.ellislab.com/CodeIgniter/trunk please note that while every effort is made to keep this codebase functional, we cannot guarantee the functionality of code taken from the repository.

          -

          Beginning with version 1.6.1, version snapshots (tags) are also available via the Subversion server via http://svn.ellislab.com/CodeIgniter/tags.

          +

          Mercurial Server

          +

          Mercurial is a distributed version control system.

          + +

          Public Hg access is available at BitBucket. + Please note that while every effort is made to keep this code base functional, we cannot guarantee the functionality of code taken + from the tip.

          + +

          Beginning with version 1.6.1, stable tags are also available via BitBucket, simply select the version from the Tags dropdown.

          From b79de3015a7a52150c4e967fdfedb07d87de8261 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 12 Mar 2010 16:28:11 -0600 Subject: [PATCH 1891/2544] Fix #2 -- extra on docs page --- user_guide/installation/downloads.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 271be7f6..0f0243e5 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -82,7 +82,7 @@

          Downloading CodeIgniter

          -

          Mercurial Server

          +

          Mercurial Server

          Mercurial is a distributed version control system.

          Public Hg access is available at BitBucket. From 4e8d66aeea7f03b75df5a387a54fce1889834ded Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 15 Mar 2010 12:23:27 -0400 Subject: [PATCH 1892/2544] code comment typo fix --- system/helpers/html_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index d5bdd080..4afa678a 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -97,7 +97,7 @@ function ol($list, $attributes = '') * @param string * @param mixed * @param mixed - * @param intiger + * @param integer * @return string */ if ( ! function_exists('_list')) From 66a3fc0a7dc6ae84da4a1e852e4458fda7714567 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Thu, 18 Mar 2010 09:44:55 -0400 Subject: [PATCH 1893/2544] Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method. --- system/libraries/Xmlrpc.php | 9 +++++---- system/libraries/Xmlrpcs.php | 10 ++++++++++ user_guide/changelog.html | 1 + user_guide/libraries/xmlrpc.html | 2 ++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index c46d52cd..2e0df5c9 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -63,6 +63,7 @@ class CI_Xmlrpc { var $result; var $response = array(); // Response from remote server + var $xss_clean = TRUE; //------------------------------------- // VALUES THAT MULTIPLE CLASSES NEED @@ -513,7 +514,7 @@ function decode($array=FALSE) } else { - $array[$key] = $CI->security->xss_clean($array[$key]); + $array[$key] = ($this->xss_clean) ? $CI->security->xss_clean($array[$key]) : $array[$key]; } } @@ -529,7 +530,7 @@ function decode($array=FALSE) } else { - $result = $CI->security->xss_clean($result); + $result = ($this->xss_clean) ? $CI->security->xss_clean($result) : $result; } } @@ -1129,7 +1130,7 @@ function output_parameters($array=FALSE) { // 'bits' is for the MetaWeblog API image bits // @todo - this needs to be made more general purpose - $array[$key] = ($key == 'bits') ? $array[$key] : $CI->security->xss_clean($array[$key]); + $array[$key] = ($key == 'bits' OR $this->xss_clean == FALSE) ? $array[$key] : $CI->security->xss_clean($array[$key]); } } @@ -1149,7 +1150,7 @@ function output_parameters($array=FALSE) } else { - $parameters[] = $CI->security->xss_clean($a_param); + $parameters[] = ($this->xss_clean) ? $CI->security->xss_clean($a_param) : $a_param; } } } diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index fe1c99bf..c1fe649f 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -81,6 +81,11 @@ function initialize($config=array()) { $this->object = $config['object']; } + + if (isset($config['xss_clean'])) + { + $this->xss_clean = $config['xss_clean']; + } } //------------------------------------- @@ -247,6 +252,11 @@ function _execute($m) // Check to see if it is a system call $system_call = (strncmp($methName, 'system', 5) == 0) ? TRUE : FALSE; + if ($this->xss_clean == FALSE) + { + $m->xss_clean = FALSE; + } + //------------------------------------- // Valid Method //------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 69d7d4b8..5d2ca2f3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,6 +89,7 @@

          Version 2.0.0

        • Added HTTP headers and Config information to the Profiler output.
        • Added Chrome and Flock to the list of detectable browsers by browser() in the User Agent Class.
        • The Unit Test Class now has an optional "notes" field available to it, and allows for discrete display of test result items using $this->unit->set_test_items().
        • +
        • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
      • Database diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 9f163ae5..6e929f1f 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -200,6 +200,8 @@

        Creating an XML-RPC Server

        The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

        + +

        There are two additional configuration keys you may make use of when initializing the server class: debug can be set to TRUE in order to enable debugging, and xss_clean may be set to FALSE to prevent sending data through the Security library's xss_clean function.

        Processing Server Requests

        From 76b369e191f4432ceba51ba7d7993c4ea54579ae Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 19 Mar 2010 11:15:28 -0400 Subject: [PATCH 1894/2544] Changed a few strstr to strpos for consistency w performance guidelines and to mirror EE2. --- system/core/Input.php | 2 +- system/helpers/download_helper.php | 2 +- system/libraries/Email.php | 2 +- system/libraries/Trackback.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index 0760dc83..2eef8245 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -288,7 +288,7 @@ function ip_address() return $this->ip_address; } - if (strstr($this->ip_address, ',')) + if (strpos($this->ip_address, ',') !== FALSE) { $x = explode(',', $this->ip_address); $this->ip_address = trim(end($x)); diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 638ebaa8..eac024fc 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -71,7 +71,7 @@ function force_download($filename = '', $data = '') } // Generate the server headers - if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE) { header('Content-Type: "'.$mime.'"'); header('Content-Disposition: attachment; filename="'.$filename.'"'); diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 8014bd21..09d1b8fb 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1865,7 +1865,7 @@ function _get_ip() elseif ($cip) $this->_IP = $cip; elseif ($fip) $this->_IP = $fip; - if (strstr($this->_IP, ',')) + if (strpos($this->_IP, ',') !== FALSE) { $x = explode(',', $this->_IP); $this->_IP = end($x); diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index a604c0b2..a2791448 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -356,7 +356,7 @@ function get_id($url) { $tb_id = ""; - if (strstr($url, '?')) + if (strpos($url, '?') !== FALSE) { $tb_array = explode('/', $url); $tb_end = $tb_array[count($tb_array)-1]; From 5ed19b477072edb77aa4337be71551fae5d9736d Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 19 Mar 2010 12:13:14 -0500 Subject: [PATCH 1895/2544] Fixed a bug where files created with the Zip Library would result in file creation dates of 1980. Hat tip to JMous for a suggested fix on the forums. --- system/libraries/Zip.php | 60 ++++++++++++++++++++++++++++++++------- user_guide/changelog.html | 1 + 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index aae62d74..2c4bd255 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -37,10 +37,13 @@ class CI_Zip { var $entries = 0; var $file_num = 0; var $offset = 0; + var $now; function CI_Zip() { log_message('debug', "Zip Compression Class Initialized"); + + $this->now = time(); } // -------------------------------------------------------------------- @@ -63,10 +66,33 @@ function add_dir($directory) $dir .= '/'; } - $this->_add_dir($dir); + $dir_time = $this->_get_mod_time($dir); + + $this->_add_dir($dir, $dir_time['file_mtime'], $dir_time['file_mdate']); } } + // -------------------------------------------------------------------- + + /** + * Get file/directory modification time + * + * If this is a newly created file/dir, we will set the time to 'now' + * + * @param string path to file + * @return array filemtime/filemdate + */ + function _get_mod_time($dir) + { + // filemtime() will return false, but it does raise an error. + $date = (@filemtime($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']; + + return $time; + } + // -------------------------------------------------------------------- /** @@ -76,12 +102,14 @@ function add_dir($directory) * @param string the directory name * @return void */ - function _add_dir($dir) - { + function _add_dir($dir, $file_mtime, $file_mdate) + { $dir = str_replace("\\", "/", $dir); $this->zipdata .= - "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00" + .pack('v', $file_mtime) + .pack('v', $file_mdate) .pack('V', 0) // crc32 .pack('V', 0) // compressed filesize .pack('V', 0) // uncompressed filesize @@ -94,7 +122,9 @@ function _add_dir($dir) .pack('V', 0); // uncompressed filesize $this->directory .= - "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00" + .pack('v', $file_mtime) + .pack('v', $file_mdate) .pack('V',0) // crc32 .pack('V',0) // compressed filesize .pack('V',0) // uncompressed filesize @@ -126,17 +156,21 @@ function _add_dir($dir) * @return void */ function add_data($filepath, $data = NULL) - { + { if (is_array($filepath)) { foreach ($filepath as $path => $data) { - $this->_add_data($path, $data); + $file_data = $this->_get_mod_time($path); + + $this->_add_data($path, $data, $file_data['file_mtime'], $file_data['file_mdate']); } } else { - $this->_add_data($filepath, $data); + $file_data = $this->_get_mod_time($filepath); + + $this->_add_data($filepath, $data, $file_data['file_mtime'], $file_data['file_mdate']); } } @@ -150,7 +184,7 @@ function add_data($filepath, $data = NULL) * @param string the data to be encoded * @return void */ - function _add_data($filepath, $data) + function _add_data($filepath, $data, $file_mtime, $file_mdate) { $filepath = str_replace("\\", "/", $filepath); @@ -162,7 +196,9 @@ function _add_data($filepath, $data) $compressed_size = strlen($gzdata); $this->zipdata .= - "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" + "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00" + .pack('v', $file_mtime) + .pack('v', $file_mdate) .pack('V', $crc32) .pack('V', $compressed_size) .pack('V', $uncompressed_size) @@ -172,7 +208,9 @@ function _add_data($filepath, $data) .$gzdata; // "file data" segment $this->directory .= - "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00\x00\x00\x00\x00" + "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00" + .pack('v', $file_mtime) + .pack('v', $file_mdate) .pack('V', $crc32) .pack('V', $compressed_size) .pack('V', $uncompressed_size) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5d2ca2f3..9615fd2b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -148,6 +148,7 @@

        Bug fixes for 2.0.0

      • Fixed a bug were form_open_multipart() didn't accept string attribute arguments (#10930).
      • Fixed a bug (#10470) where get_mime_by_extension() was case sensitive.
      • Fixed a bug where some error messages for the SQLite and Oracle drivers would not display.
      • +
      • Fixed a bug where files created with the Zip Library would result in file creation dates of 1980.

      Version 1.7.2

      From d99e603f47e10adc015d4b804352db71f0563062 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Mar 2010 19:57:33 -0500 Subject: [PATCH 1896/2544] reordered logic in _display_cache() to eliminate a call to is_really_writable() on each page request unless it is_really_needed() --- system/core/Output.php | 20 +++++++++----------- user_guide/changelog.html | 1 + 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/system/core/Output.php b/system/core/Output.php index 0dcf2e46..ac412940 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -377,12 +377,7 @@ function _write_cache($output) function _display_cache(&$CFG, &$URI) { $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path'); - - if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path)) - { - return FALSE; - } - + // Build the file path. The file name is an MD5 hash of the full URI $uri = $CFG->item('base_url'). $CFG->item('index_page'). @@ -410,7 +405,7 @@ function _display_cache(&$CFG, &$URI) flock($fp, LOCK_UN); fclose($fp); - + // Strip out the embedded timestamp if ( ! preg_match("/(\d+TS--->)/", $cache, $match)) { @@ -419,10 +414,13 @@ function _display_cache(&$CFG, &$URI) // Has the file expired? If so we'll delete it. if (time() >= trim(str_replace('TS--->', '', $match['1']))) - { - @unlink($filepath); - log_message('debug', "Cache file has expired. File deleted"); - return FALSE; + { + if (is_really_writable($cache_path)) + { + @unlink($filepath); + log_message('debug', "Cache file has expired. File deleted"); + return FALSE; + } } // Display the cache diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9615fd2b..45c69828 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -124,6 +124,7 @@

      Version 2.0.0

    • get_mime_by_extension() is now case insensitive.
    • Added "default" to the list Reserved Names.
    • Added 'application/x-msdownload' for .exe files and ''application/x-gzip-compressed' for .tgz files to config/mimes.php.
    • +
    • Eliminated a call to is_really_writable() on each request unless it is really needed (Output caching)
    • Documented append_output() in the Output Class.
    • Documented a second argument in the decode() function for the Encryption Class.
    • Documentd db->close().
    • From 75887a6c0c19f7f901c8c65553de2aece5ba6d83 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 12 Mar 2010 00:27:51 +0000 Subject: [PATCH 1897/2544] Fixed constant SELF undefined issue when a bad system folder is set. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 0ad8fd82..f27520e7 100644 --- a/index.php +++ b/index.php @@ -113,7 +113,7 @@ // Is the sytsem path correct? if ( ! is_dir($system_path)) { - exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF); + exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME)); } /* From eba35088bd4fef3475ea57ae1b7010aa32c592bb Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 22 Mar 2010 10:43:56 -0500 Subject: [PATCH 1898/2544] fixed spelling in code comment --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index f27520e7..47f1ae9e 100644 --- a/index.php +++ b/index.php @@ -110,7 +110,7 @@ // ensure there's a trailing slash $system_path = rtrim($system_path, '/').'/'; - // Is the sytsem path correct? + // Is the system path correct? if ( ! is_dir($system_path)) { exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME)); From 3140ad543e26a0aa4e6bc57a3a85ecdb3dfcf0d5 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 12 Mar 2010 00:22:42 +0000 Subject: [PATCH 1899/2544] Will check for sub-classes in core or libraries (which the original file is in) instead of always looking in libraries. Makes more sense to have them in the same folder wether in system or application. --- system/core/Common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index 47293a11..6e2f7250 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -142,13 +142,13 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') } // Is the request a class extension? If so we load it too - if (file_exists(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT)) + if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT)) { $name = config_item('subclass_prefix').$class; if (class_exists($name) === FALSE) { - require(APPPATH.'libraries/'.config_item('subclass_prefix').$class.EXT); + require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT); } } From 726c8eb63eac6f64408536dd39b7854dfa000251 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 12 Mar 2010 11:55:51 +0000 Subject: [PATCH 1900/2544] prep_url() will now not append http:// to string if a protocol is already used. That would really mess up itunes://, spotify://, telnet://, etc. --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 90ea9207..86caa278 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -446,7 +446,7 @@ function prep_url($str = '') return ''; } - if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') + if (!preg_match('/^[a-z]{3,6}:\/\//', $str)) { $str = 'http://'.$str; } From d265871dfe205a905cd6c39e8ac4371f13848e58 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 22 Mar 2010 11:05:01 -0500 Subject: [PATCH 1901/2544] expanded philsturgeon's bugfix to parse_url() and updated docs and changelog --- system/helpers/url_helper.php | 4 ++-- user_guide/changelog.html | 1 + user_guide/helpers/url_helper.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 86caa278..7707d685 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -431,7 +431,7 @@ function auto_link($str, $type = 'both', $popup = FALSE) /** * Prep URL * - * Simply adds the http:// part if missing + * Simply adds the http:// part if no scheme is included * * @access public * @param string the URL @@ -446,7 +446,7 @@ function prep_url($str = '') return ''; } - if (!preg_match('/^[a-z]{3,6}:\/\//', $str)) + if ( ! parse_url($str, PHP_URL_SCHEME)) { $str = 'http://'.$str; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 45c69828..21e1bf14 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -114,6 +114,7 @@

      Version 2.0.0

    • Modified delete_files() in the File Helper to return FALSE on failure.
    • Added an optional second parameter to byte_format() in the Number Helper to allow for decimal precision.
    • Added alpha, and sha1 string types to random_string() in the String Helper.
    • +
    • Modified prep_url() so as to not prepend http:// if the supplied string already has a scheme.
  • Other Changes diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index dbc5969f..96da0c62 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -236,7 +236,7 @@

    url_title()

    prep_url()

    -

    This function will add http:// in the event it is missing from a URL. Pass the URL string to the function like this:

    +

    This function will add http:// in the event that a scheme is missing from a URL. Pass the URL string to the function like this:

    $url = "example.com";

    $url = prep_url($url);
    From 28b293729d2c2917c434c6296eafecd19f397303 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 12 Mar 2010 00:43:28 +0000 Subject: [PATCH 1902/2544] Added FTP::download() and the accompanying lang line. This was first proposed in 2007, can we add it now pleeeeease? --- system/language/english/ftp_lang.php | 1 + system/libraries/Ftp.php | 42 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index 42403b97..392b2b27 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -7,6 +7,7 @@ $lang['ftp_unable_to_changedir'] = "Unable to change directories."; $lang['ftp_unable_to_chmod'] = "Unable to set file permissions. Please check your path. Note: This feature is only available in PHP 5 or higher."; $lang['ftp_unable_to_upload'] = "Unable to upload the specified file. Please check your path."; +$lang['ftp_unable_to_download'] = "Unable to download the specified file. Please check your path."; $lang['ftp_no_source_file'] = "Unable to locate the source file. Please check your path."; $lang['ftp_unable_to_rename'] = "Unable to rename the file."; $lang['ftp_unable_to_delete'] = "Unable to delete the file."; diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 16ad9ad4..07f4b1ff 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -280,6 +280,48 @@ function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) // -------------------------------------------------------------------- + /** + * Download a file from a remote server to the local server + * + * @access public + * @param string + * @param string + * @param string + * @return bool + */ + function download($rempath, $locpath, $mode = 'auto') + { + if ( ! $this->_is_conn()) + { + return FALSE; + } + + // Set the mode if not specified + 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; + + $result = @ftp_get($this->conn_id, $locpath, $rempath, $mode); + + if ($result === FALSE) + { + if ($this->debug == TRUE) + { + $this->_error('ftp_unable_to_download'); + } + return FALSE; + } + + return TRUE; + } + + // -------------------------------------------------------------------- + /** * Rename (or move) a file * From 7ec3650749b2c4baf1600bf09fdf3e41f06d87d1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 22 Mar 2010 11:11:30 -0500 Subject: [PATCH 1903/2544] added documentation for philsturgeon's submission of download() for the FTP library --- user_guide/changelog.html | 3 ++- user_guide/libraries/ftp.html | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 21e1bf14..8d9653aa 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,7 +89,8 @@

    Version 2.0.0

  • Added HTTP headers and Config information to the Profiler output.
  • Added Chrome and Flock to the list of detectable browsers by browser() in the User Agent Class.
  • The Unit Test Class now has an optional "notes" field available to it, and allows for discrete display of test result items using $this->unit->set_test_items().
  • -
  • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
  • +
  • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
  • +
  • Added a download() method to the FTP library
  • Database diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 10acdcda..b5194e8a 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -188,6 +188,19 @@

    $this->ftp->upload()

    Permissions are available if you are running PHP 5 and can be passed as an octal value in the fourth parameter.

    +

    $this->ftp->download()

    + +

    Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. +Example:

    + +$this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii'); + +

    Mode options are:  ascii, binary, and auto (the default). If +auto is used it will base the mode on the file extension of the source file.

    + +

    Returns FALSE if the download does not execute successfully (including if PHP does not have permission to write the local file)

    + +

    $this->ftp->rename()

    Permits you to rename a file. Supply the source file name/path and the new file name/path.

    From fa281354b37feead98ab71cc4e6d68f9748a7b6c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 22 Mar 2010 14:41:27 -0500 Subject: [PATCH 1904/2544] Fix #10 , extending the CodeIgniter controller with MY_Controller will lead to a fatal PHP error. --- system/application/core/index.html | 10 ++++++++++ system/core/CodeIgniter.php | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 system/application/core/index.html diff --git a/system/application/core/index.html b/system/application/core/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/system/application/core/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

    Directory access is forbidden.

    + + + \ No newline at end of file diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 488f9f3c..295917c9 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -224,6 +224,11 @@ // Load the base controller class require BASEPATH.'core/Controller'.EXT; + if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT)) + { + require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT; + } + // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. From ac9e0cdecc7ec15f173e5d538a18c37ab08d455b Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 22 Mar 2010 14:43:50 -0500 Subject: [PATCH 1905/2544] Updating docs for extending core libraries to reference the application/core directory --- user_guide/general/core_classes.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index f67c0053..6ffafca5 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -89,9 +89,9 @@

    System Class List

    Replacing Core Classes

    -

    To use one of your own system classes instead of a default one simply place your version inside your local application/libraries directory:

    +

    To use one of your own system classes instead of a default one simply place your version inside your local application/core directory:

    -application/libraries/some-class.php +application/core/some-class.php

    If this directory does not exist you can create it.

    @@ -118,7 +118,7 @@

    Extending Core Class

  • Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
  • -

    For example, to extend the native Input class you'll create a file named application/libraries/MY_Input.php, and declare your class with:

    +

    For example, to extend the native Input class you'll create a file named application/core/MY_Input.php, and declare your class with:

    class MY_Input extends CI_Input {

    From 022be04a8262857e1bab9bf65e45817d398c31e6 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 22 Mar 2010 14:47:09 -0500 Subject: [PATCH 1906/2544] Updating changelog --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8d9653aa..7a6ef062 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -152,6 +152,7 @@

    Bug fixes for 2.0.0

  • Fixed a bug (#10470) where get_mime_by_extension() was case sensitive.
  • Fixed a bug where some error messages for the SQLite and Oracle drivers would not display.
  • Fixed a bug where files created with the Zip Library would result in file creation dates of 1980.
  • +
  • Fixed a bug where extending the Controller class would result in a fatal PHP error.
  • Version 1.7.2

    From f0b3994f51937c643200a0547f70b1fa7d94f88a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Mar 2010 10:08:20 -0500 Subject: [PATCH 1907/2544] moved application folder outside of the system folder --- .../config/autoload.php | 4 +- .../config/config.php | 2 +- .../config/constants.php | 2 +- .../config/database.php | 2 +- .../config/doctypes.php | 0 .../config/foreign_chars.php | 2 +- .../config/hooks.php | 2 +- .../config/index.html | 0 .../config/mimes.php | 0 .../config/profiler.php | 2 +- .../config/routes.php | 2 +- .../config/smileys.php | 2 +- .../config/user_agents.php | 2 +- .../controllers/index.html | 0 .../controllers/welcome.php | 2 +- .../core/index.html | 0 .../errors/error_404.php | 0 .../errors/error_db.php | 0 .../errors/error_general.php | 0 .../errors/error_php.php | 0 .../errors/index.html | 0 .../helpers/index.html | 0 .../hooks/index.html | 0 .../application => application}/index.html | 0 .../language/english/index.html | 0 .../libraries/index.html | 0 .../models/index.html | 0 .../third_party/index.html | 0 .../views/index.html | 0 .../views/welcome_message.php | 4 +- user_guide/general/helpers.html | 2 +- user_guide/general/managing_apps.html | 38 +++++++++---------- user_guide/general/profiling.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/installation/upgrade_154.html | 6 +-- user_guide/installation/upgrade_160.html | 6 +-- user_guide/installation/upgrade_162.html | 6 +-- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/jquery.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 4 +- 41 files changed, 50 insertions(+), 50 deletions(-) rename {system/application => application}/config/autoload.php (96%) rename {system/application => application}/config/config.php (99%) rename {system/application => application}/config/constants.php (96%) rename {system/application => application}/config/database.php (97%) rename {system/application => application}/config/doctypes.php (100%) rename {system/application => application}/config/foreign_chars.php (96%) rename {system/application => application}/config/hooks.php (89%) rename {system/application => application}/config/index.html (100%) rename {system/application => application}/config/mimes.php (100%) rename {system/application => application}/config/profiler.php (90%) rename {system/application => application}/config/routes.php (95%) rename {system/application => application}/config/smileys.php (98%) rename {system/application => application}/config/user_agents.php (98%) rename {system/application => application}/controllers/index.html (100%) rename {system/application => application}/controllers/welcome.php (76%) rename {system/application => application}/core/index.html (100%) rename {system/application => application}/errors/error_404.php (100%) rename {system/application => application}/errors/error_db.php (100%) rename {system/application => application}/errors/error_general.php (100%) rename {system/application => application}/errors/error_php.php (100%) rename {system/application => application}/errors/index.html (100%) rename {system/application => application}/helpers/index.html (100%) rename {system/application => application}/hooks/index.html (100%) rename {system/application => application}/index.html (100%) rename {system/application => application}/language/english/index.html (100%) rename {system/application => application}/libraries/index.html (100%) rename {system/application => application}/models/index.html (100%) rename {system/application => application}/third_party/index.html (100%) rename {system/application => application}/views/index.html (100%) rename {system/application => application}/views/welcome_message.php (91%) diff --git a/system/application/config/autoload.php b/application/config/autoload.php similarity index 96% rename from system/application/config/autoload.php rename to application/config/autoload.php index e7c6f0db..35ad6288 100644 --- a/system/application/config/autoload.php +++ b/application/config/autoload.php @@ -31,7 +31,7 @@ | Auto-load Libraries | ------------------------------------------------------------------- | These are the classes located in the system/libraries folder -| or in your system/application/libraries folder. +| or in your application/libraries folder. | | Prototype: | @@ -100,4 +100,4 @@ /* End of file autoload.php */ -/* Location: ./system/application/config/autoload.php */ \ No newline at end of file +/* Location: ./application/config/autoload.php */ \ No newline at end of file diff --git a/system/application/config/config.php b/application/config/config.php similarity index 99% rename from system/application/config/config.php rename to application/config/config.php index 1c961b45..bd1429a4 100644 --- a/system/application/config/config.php +++ b/application/config/config.php @@ -326,4 +326,4 @@ /* End of file config.php */ -/* Location: ./system/application/config/config.php */ \ No newline at end of file +/* Location: ./application/config/config.php */ \ No newline at end of file diff --git a/system/application/config/constants.php b/application/config/constants.php similarity index 96% rename from system/application/config/constants.php rename to application/config/constants.php index 86ebdbb2..1551cbca 100644 --- a/system/application/config/constants.php +++ b/application/config/constants.php @@ -38,4 +38,4 @@ /* End of file constants.php */ -/* Location: ./system/application/config/constants.php */ \ No newline at end of file +/* Location: ./application/config/constants.php */ \ No newline at end of file diff --git a/system/application/config/database.php b/application/config/database.php similarity index 97% rename from system/application/config/database.php rename to application/config/database.php index fcdefda7..a3226b18 100644 --- a/system/application/config/database.php +++ b/application/config/database.php @@ -59,4 +59,4 @@ /* End of file database.php */ -/* Location: ./system/application/config/database.php */ \ No newline at end of file +/* Location: ./application/config/database.php */ \ No newline at end of file diff --git a/system/application/config/doctypes.php b/application/config/doctypes.php similarity index 100% rename from system/application/config/doctypes.php rename to application/config/doctypes.php diff --git a/system/application/config/foreign_chars.php b/application/config/foreign_chars.php similarity index 96% rename from system/application/config/foreign_chars.php rename to application/config/foreign_chars.php index 8d70a2f6..59a7d234 100644 --- a/system/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -61,4 +61,4 @@ /* End of file foreign_chars.php */ -/* Location: ./system/application/config/foreign_chars.php */ \ No newline at end of file +/* Location: ./application/config/foreign_chars.php */ \ No newline at end of file diff --git a/system/application/config/hooks.php b/application/config/hooks.php similarity index 89% rename from system/application/config/hooks.php rename to application/config/hooks.php index 5e98a9b4..a4ad2be6 100644 --- a/system/application/config/hooks.php +++ b/application/config/hooks.php @@ -13,4 +13,4 @@ /* End of file hooks.php */ -/* Location: ./system/application/config/hooks.php */ \ No newline at end of file +/* Location: ./application/config/hooks.php */ \ No newline at end of file diff --git a/system/application/config/index.html b/application/config/index.html similarity index 100% rename from system/application/config/index.html rename to application/config/index.html diff --git a/system/application/config/mimes.php b/application/config/mimes.php similarity index 100% rename from system/application/config/mimes.php rename to application/config/mimes.php diff --git a/system/application/config/profiler.php b/application/config/profiler.php similarity index 90% rename from system/application/config/profiler.php rename to application/config/profiler.php index f30432d9..f8a5b1a1 100644 --- a/system/application/config/profiler.php +++ b/application/config/profiler.php @@ -14,4 +14,4 @@ /* End of file profiler.php */ -/* Location: ./system/application/config/profiler.php */ \ No newline at end of file +/* Location: ./application/config/profiler.php */ \ No newline at end of file diff --git a/system/application/config/routes.php b/application/config/routes.php similarity index 95% rename from system/application/config/routes.php rename to application/config/routes.php index 4d9f340a..57af9850 100644 --- a/system/application/config/routes.php +++ b/application/config/routes.php @@ -36,4 +36,4 @@ /* End of file routes.php */ -/* Location: ./system/application/config/routes.php */ \ No newline at end of file +/* Location: ./application/config/routes.php */ \ No newline at end of file diff --git a/system/application/config/smileys.php b/application/config/smileys.php similarity index 98% rename from system/application/config/smileys.php rename to application/config/smileys.php index 7f3aba55..31a60c65 100644 --- a/system/application/config/smileys.php +++ b/application/config/smileys.php @@ -63,4 +63,4 @@ ); /* End of file smileys.php */ -/* Location: ./system/application/config/smileys.php */ \ No newline at end of file +/* Location: ./application/config/smileys.php */ \ No newline at end of file diff --git a/system/application/config/user_agents.php b/application/config/user_agents.php similarity index 98% rename from system/application/config/user_agents.php rename to application/config/user_agents.php index a1c0b14b..3be20094 100644 --- a/system/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -174,4 +174,4 @@ ); /* End of file user_agents.php */ -/* Location: ./system/application/config/user_agents.php */ \ No newline at end of file +/* Location: ./application/config/user_agents.php */ \ No newline at end of file diff --git a/system/application/controllers/index.html b/application/controllers/index.html similarity index 100% rename from system/application/controllers/index.html rename to application/controllers/index.html diff --git a/system/application/controllers/welcome.php b/application/controllers/welcome.php similarity index 76% rename from system/application/controllers/welcome.php rename to application/controllers/welcome.php index 20d48855..bd134e7e 100644 --- a/system/application/controllers/welcome.php +++ b/application/controllers/welcome.php @@ -14,4 +14,4 @@ function index() } /* End of file welcome.php */ -/* Location: ./system/application/controllers/welcome.php */ \ No newline at end of file +/* Location: ./application/controllers/welcome.php */ \ No newline at end of file diff --git a/system/application/core/index.html b/application/core/index.html similarity index 100% rename from system/application/core/index.html rename to application/core/index.html diff --git a/system/application/errors/error_404.php b/application/errors/error_404.php similarity index 100% rename from system/application/errors/error_404.php rename to application/errors/error_404.php diff --git a/system/application/errors/error_db.php b/application/errors/error_db.php similarity index 100% rename from system/application/errors/error_db.php rename to application/errors/error_db.php diff --git a/system/application/errors/error_general.php b/application/errors/error_general.php similarity index 100% rename from system/application/errors/error_general.php rename to application/errors/error_general.php diff --git a/system/application/errors/error_php.php b/application/errors/error_php.php similarity index 100% rename from system/application/errors/error_php.php rename to application/errors/error_php.php diff --git a/system/application/errors/index.html b/application/errors/index.html similarity index 100% rename from system/application/errors/index.html rename to application/errors/index.html diff --git a/system/application/helpers/index.html b/application/helpers/index.html similarity index 100% rename from system/application/helpers/index.html rename to application/helpers/index.html diff --git a/system/application/hooks/index.html b/application/hooks/index.html similarity index 100% rename from system/application/hooks/index.html rename to application/hooks/index.html diff --git a/system/application/index.html b/application/index.html similarity index 100% rename from system/application/index.html rename to application/index.html diff --git a/system/application/language/english/index.html b/application/language/english/index.html similarity index 100% rename from system/application/language/english/index.html rename to application/language/english/index.html diff --git a/system/application/libraries/index.html b/application/libraries/index.html similarity index 100% rename from system/application/libraries/index.html rename to application/libraries/index.html diff --git a/system/application/models/index.html b/application/models/index.html similarity index 100% rename from system/application/models/index.html rename to application/models/index.html diff --git a/system/application/third_party/index.html b/application/third_party/index.html similarity index 100% rename from system/application/third_party/index.html rename to application/third_party/index.html diff --git a/system/application/views/index.html b/application/views/index.html similarity index 100% rename from system/application/views/index.html rename to application/views/index.html diff --git a/system/application/views/welcome_message.php b/application/views/welcome_message.php similarity index 91% rename from system/application/views/welcome_message.php rename to application/views/welcome_message.php index 653b62c7..b66fb3f2 100644 --- a/system/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -48,10 +48,10 @@

    The page you are looking at is being generated dynamically by CodeIgniter.

    If you would like to edit this page you'll find it located at:

    -system/application/views/welcome_message.php +application/views/welcome_message.php

    The corresponding controller for this page is found at:

    -system/application/controllers/welcome.php +application/controllers/welcome.php

    If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

    diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index ef24e8c9..5ba1674c 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -69,7 +69,7 @@

    Helper Functions

    CodeIgniter does not load Helper Files by default, so the first step in using a Helper is to load it. Once loaded, it becomes globally available in your controller and views.

    -

    Helpers are typically stored in your system/helpers, or system/application/helpers directory. CodeIgniter will look first in your system/application/helpers +

    Helpers are typically stored in your system/helpers, or application/helpers directory. CodeIgniter will look first in your application/helpers directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global system/helpers folder.

    diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index babed5f6..9f23de4b 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -58,7 +58,7 @@

    Managing your Applications

    By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your -system/application/ directory. It is possible, however, to have multiple sets of applications that share a single +application/ directory. It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application folder.

    Renaming the Application Folder

    @@ -83,29 +83,29 @@

    Running Multiple Applications with one CodeIgniter Installation

    put all of the directories located inside your application folder into their own sub-folder.

    -

    For example, let's say you want to create two applications, "foo" and "bar". You will structure your -application folder like this:

    - -system/application/foo/
    -system/application/foo/config/
    -system/application/foo/controllers/
    -system/application/foo/errors/
    -system/application/foo/libraries/
    -system/application/foo/models/
    -system/application/foo/views/
    -system/application/bar/
    -system/application/bar/config/
    -system/application/bar/controllers/
    -system/application/bar/errors/
    -system/application/bar/libraries/
    -system/application/bar/models/
    -system/application/bar/views/
    +

    For example, let's say you want to create two applications, "foo" and "bar". You could structure your +application folders like this:

    + +applications/foo/
    +applications/foo/config/
    +applications/foo/controllers/
    +applications/foo/errors/
    +applications/foo/libraries/
    +applications/foo/models/
    +applications/foo/views/
    +applications/bar/
    +applications/bar/config/
    +applications/bar/controllers/
    +applications/bar/errors/
    +applications/bar/libraries/
    +applications/bar/models/
    +applications/bar/views/

    To select a particular application for use requires that you open your main index.php file and set the $application_folder variable. For example, to select the "foo" application for use you would do this:

    -$application_folder = "application/foo"; +$application_folder = "applications/foo";

    Note:  Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want.

    diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 8622edeb..f8650314 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -87,7 +87,7 @@

    Setting Benchmark Points

    Enabling and Disabling Profiler Sections

    -

    Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to TRUE or FALSE. This can be done one of two ways. First, you can set application wide defaults with the system/application/config/profiler.php config file.

    +

    Each section of Profiler data can be enabled or disabled by setting a corresponding config variable to TRUE or FALSE. This can be done one of two ways. First, you can set application wide defaults with the application/config/profiler.php config file.

    $config['config']          = FALSE;
    $config['queries']         = FALSE;
    diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 9e8f8f5e..0e075b9d 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -121,7 +121,7 @@

    convert_accented_characters()

    $string = convert_accented_characters($string); -

    This function uses a companion config file system/application/config/foreign_chars.php to define the to and from array for transliteration.

    +

    This function uses a companion config file application/config/foreign_chars.php to define the to and from array for transliteration.

    word_censor()

    diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index 5e446866..b1bc8bb8 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -67,7 +67,7 @@

    Step 1: Update your CodeIgniter files

      -
    • system/application/config/mimes.php
    • +
    • application/config/mimes.php
    • system/codeigniter
    • system/database
    • system/helpers
    • @@ -78,7 +78,7 @@

      Step 1: Update your CodeIgniter files

      Note: If you have any custom developed files in these folders please make copies of them first.

      Step 2: Add charset to your config.php

      -

      Add the following to system/application/config/config.php

      +

      Add the following to application/config/config.php

      /*
      |--------------------------------------------------------------------------
      | Default Character Set
      @@ -91,7 +91,7 @@

      Step 2: Add charset to your config.php

      $config['charset'] = "UTF-8";

      Step 3: Autoloading language files

      -

      If you want to autoload any language files, add this line to system/application/config/autoload.php

      +

      If you want to autoload any language files, add this line to application/config/autoload.php

      $autoload['language'] = array();

      Step 4: Update your user guide

      diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index e817e245..5568f8ca 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -78,10 +78,10 @@

      Step 1: Update your CodeIgniter files

      Note: If you have any custom developed files in these folders please make copies of them first.

      Step 2: Add time_to_update to your config.php

      -

      Add the following to system/application/config/config.php with the other session configuration options

      +

      Add the following to application/config/config.php with the other session configuration options

      $config['sess_time_to_update'] = 300;

      Step 3: Add $autoload['model']

      -

      Add the following to system/application/config/autoload.php

      +

      Add the following to application/config/autoload.php

      /*
      | -------------------------------------------------------------------
      | Auto-load Model files
      @@ -94,7 +94,7 @@

      Step 3: Add $autoload['model']


      $autoload['model'] = array();

      Step 4: Add to your database.php

      -

      Make the following changes to your system/application/config/database.php file:

      +

      Make the following changes to your application/config/database.php file:

      Add the following variable above the database configuration options, with $active_group

      $active_record = TRUE;

      Remove the following from your database configuration options

      diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index fd34ab08..c9eb2bfe 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -78,12 +78,12 @@

      Step 1: Update your CodeIgniter files

      Step 2: Encryption Key

      -

      If you are using sessions, open up system/application/config/config.php and verify you've set an encryption key.

      +

      If you are using sessions, open up application/config/config.php and verify you've set an encryption key.

      Step 3: Constants File

      -

      Copy /system/application/config/constants.php to your installation, and modify if necessary.

      +

      Copy /application/config/constants.php to your installation, and modify if necessary.

      Step 4: Mimes File

      -

      Replace /system/application/config/mimes.php with the dowloaded version. If you've added custom mime types, you'll need to re-add them.

      +

      Replace /application/config/mimes.php with the dowloaded version. If you've added custom mime types, you'll need to re-add them.

      Step 5: Update your user guide

      Please also replace your local copy of the user guide with the new version.

      diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 08982fd0..ac0af840 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -79,7 +79,7 @@

      Set these variables in your view

      $library_src, is where the actual library file will be loaded, as well as any subsequent plugin script calls; $script_head is where specific events, functions and other commands will be rendered.

      Set the path to the librarys with config items

      -

      There are some configuration items in javascript library. These can either be set in system/application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function.

      +

      There are some configuration items in javascript library. These can either be set in application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function.

      An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
      $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html index 98c9a9cb..69b8389a 100644 --- a/user_guide/libraries/jquery.html +++ b/user_guide/libraries/jquery.html @@ -81,7 +81,7 @@

      Setup and Configuration

      <?php echo $jquery_script;?>
      <?php echo $script_head;?>

      -

      There are 2 configuration items in jQuery library. These can either be set in system/application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      +

      There are 2 configuration items in jQuery library. These can either be set in application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      $config['javascript_folder'] = 'js';
      $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 9e50901a..ee78c765 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -64,7 +64,7 @@

      Language Class

      your own language files as needed in order to display error and other messages in other languages.

      Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your system/application/language +your application folder and store them there. CodeIgniter will look first in your application/language directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index ce693e0b..98520e77 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -187,14 +187,14 @@

      $this->load->config('file_name')

      Application "Packages"

      -

      An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the system/application/third_party folder. Below is a sample map of an package directory

      +

      An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

      Sample Package "Foo Bar" Directory Map

      The following is an example of a directory for an application package named "Foo Bar".

      -/system/application/third_party/foo_bar
      +/application/third_party/foo_bar

      config/
      helpers/
      From 6e50b856d30037a88d878a68d1055fd37a182008 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Mar 2010 10:21:04 -0500 Subject: [PATCH 1908/2544] added .htaccess to application and system folder to help prevent public access if installed in web root --- application/.htaccess | 1 + system/.htaccess | 1 + 2 files changed, 2 insertions(+) create mode 100644 application/.htaccess create mode 100644 system/.htaccess diff --git a/application/.htaccess b/application/.htaccess new file mode 100644 index 00000000..14249c50 --- /dev/null +++ b/application/.htaccess @@ -0,0 +1 @@ +Deny from all \ No newline at end of file diff --git a/system/.htaccess b/system/.htaccess new file mode 100644 index 00000000..14249c50 --- /dev/null +++ b/system/.htaccess @@ -0,0 +1 @@ +Deny from all \ No newline at end of file From 3181ae2a93b2c46112040036267d7c1767fe5109 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Mar 2010 10:28:46 -0500 Subject: [PATCH 1909/2544] updated docs to encourage installation of application and system folders above web root --- user_guide/changelog.html | 1 + user_guide/installation/index.html | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7a6ef062..3f569abe 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@

      Version 2.0.0

    • Scaffolding, having been deprecated for a number of versions, has been removed.
    • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
    • Added new special Library type: Drivers.
    • +
    • Moved the application folder outside of the system folder.
    • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
    • Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
    • Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
    • diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 08f37ac9..a6446131 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -66,9 +66,14 @@

      Installation Instructions

    • If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
    • -

      If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system folder -to something more private. If you do rename it, you must open your main index.php file and set the $system_folder -variable at the top of the page with the new name you've chosen.

      +

      If you wish to increase security by hiding the location of your CodeIgniter files you can rename the system and application folders +to something more private. If you do rename them, you must open your main index.php file and set the $system_folder and $application_folder +variables at the top of the file with the new name you've chosen.

      + +

      For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.

      + +

      After moving them, open your main index.php file and set the $system_folder and $application_folder variables, preferably with a full path, e.g. '/www/MyUser/system'.

      +

      That's it!

      From 6c1294b5c3c98e26eaa6cb5eaa83dd3921a30348 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 25 Mar 2010 10:32:22 -0500 Subject: [PATCH 1910/2544] code comment typo --- system/core/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index 2e44500a..92f7f17f 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -75,7 +75,7 @@ function Controller() } } -// END _Controller class +// END Controller class /* End of file Controller.php */ /* Location: ./system/core/Controller.php */ \ No newline at end of file From d25e66a1824a70c5a2ebfae69b759c3b8a2d02a6 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 28 Mar 2010 01:07:09 -0500 Subject: [PATCH 1911/2544] Change in the loader and driver docs to force ucfirst() on driver directory names to ensure compatibility on case sensitive file systems. --- system/core/Loader.php | 2 +- user_guide/general/creating_drivers.html | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/system/core/Loader.php b/system/core/Loader.php index 976823f8..292fdc95 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -506,7 +506,7 @@ function driver($library = '', $params = NULL, $object_name = NULL) // and typically identically named to the library if ( ! strpos($library, '/')) { - $library = $library.'/'.$library; + $library = ucfirst($library).'/'.$library; } return $this->library($library, $params, $object_name); diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index 83bec8c5..1f213db4 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -57,6 +57,27 @@

      Creating Drivers

      +

      Driver Directory and File Structure

      + +

      Sample driver directory and file structure layout:

      + +
        +
      • /application/libraries/Driver_name +
          +
        • Driver_name.php
        • +
        • drivers +
            +
          • Driver_name_subclass_1.php
          • +
          • Driver_name_subclass_2.php
          • +
          • Driver_name_subclass_3.php
          • +
          +
        • +
        +
      • +
      + +

      NOTE: In order to maintain compatibility on case-sensitive file systems, the Driver_name directory must be ucfirst()

      + From d6d70e327b74018ab1cd59185a0dc970cd0711be Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 29 Mar 2010 10:10:27 -0500 Subject: [PATCH 1912/2544] fixed casing of EllisLab --- user_guide/changelog.html | 2 +- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 4 ++-- user_guide/doc_style/template.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_drivers.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 4 ++-- user_guide/general/drivers.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/captcha_helper.html | 2 +- user_guide/helpers/compatibility_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_170.html | 2 +- user_guide/installation/upgrade_171.html | 2 +- user_guide/installation/upgrade_172.html | 2 +- user_guide/installation/upgrade_200.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/jquery.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/security.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/validation.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/cheatsheets.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 130 files changed, 132 insertions(+), 132 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3f569abe..3006de75 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -1169,7 +1169,7 @@

      Version Beta 1.0

      User Guide Home   ·   Next Topic:  Credits

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 5703dcfe..6977302a 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -750,7 +750,7 @@

      $this->db->flush_cache()

      User Guide Home   ·   Next Topic:  Transactions

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 8064d344..d5ed5885 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -213,7 +213,7 @@

      $this->db->cache_delete_all()

      User Guide Home   ·   Next Topic:  Database manipulation with Database Forge

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 7c01a770..fe09d2b1 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -111,7 +111,7 @@

      $this->db->call_function();

      User Guide Home   ·   Next Topic:  Query Caching

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 1844aa05..7b1b7003 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -159,7 +159,7 @@

      Explanation of Values:

      User Guide Home   ·   Next Topic:  Connecting to your Database

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index bd910a41..3ce40562 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -181,7 +181,7 @@

      Manually closing the Connection

      User Guide Home   ·   Next Topic:  Queries

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 6b4b6390..41cfba0e 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -210,7 +210,7 @@

      Active Record Insert

      User Guide Home   ·   Next Topic:  Database Configuration

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index bbf2912e..30d39a42 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -156,7 +156,7 @@

      $this->db->field_data()

      User Guide Home   ·   Next Topic:  Custom Function Calls

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 6ba3702c..28b32d96 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -227,7 +227,7 @@

      $this->dbforge->modify_column()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Database Utilities Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index d60f1619..b7b8a538 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -144,7 +144,7 @@

      $this->db->update_string();

      User Guide Home   ·   Next Topic:  Active Record Pattern

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 868e00d2..45d15dba 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -92,7 +92,7 @@

      The Database Class

      User Guide Home   ·   Next Topic:  Quick Start: Usage Examples

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 0fb05c88..dbb3e5c7 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -146,7 +146,7 @@

      Query Bindings

      User Guide Home   ·   Next Topic:  Query Results

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 784ea324..9eaa1793 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -231,7 +231,7 @@

      $query->free_result()

      User Guide Home   ·   Next Topic:  Query Helper Functions

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 837e04d2..c85408fa 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -106,7 +106,7 @@

      $this->db->table_exists();

      User Guide Home   ·   Next Topic:   Field Metadata

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index 19edfb8e..c6ecac6f 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -193,7 +193,7 @@

      Running Transactions Manually

      User Guide Home   ·   Next Topic:  Table Metadata

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 3d08182a..1ce63d3a 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -307,7 +307,7 @@

      Description of Backup Preferences

      Top of Page   ·   User Guide Home   ·   Next Topic:   Email Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index e0dc9741..753b9d42 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -57,7 +57,7 @@

      Writing Documentation

      -

      To help facilitate a consistent, easy-to-read documentation style for CodeIgniter projects, Ellislab is making the markup and CSS from the CodeIgniter user guide freely available to the community for their use. For your convenience, a template file has been created that includes the primary blocks of markup used with brief samples.

      +

      To help facilitate a consistent, easy-to-read documentation style for CodeIgniter projects, EllisLab is making the markup and CSS from the CodeIgniter user guide freely available to the community for their use. For your convenience, a template file has been created that includes the primary blocks of markup used with brief samples.

      Files

      @@ -79,7 +79,7 @@

      Files

      Top of Page   ·   User Guide Home   ·  

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index 05bdafd0..26831ac0 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -121,7 +121,7 @@

      $this->foo->bar()

      User Guide Home   ·   Next Topic:  Next Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 4879076e..b9069a8b 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -140,7 +140,7 @@

      Alternative Control Structures

      User Guide Home   ·   Next Topic:  Security

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index 9e711a8c..92a8fd95 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -110,7 +110,7 @@

      get_instance()

      User Guide Home   ·   Next Topic:  Auto-loading Resources

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index d697c8a9..adcd2269 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -93,7 +93,7 @@

      Auto-loading Resources

      Top of Page   ·   User Guide Home   ·   Next Topic:  Common Functions

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 59edade3..5c1bcfd0 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -108,7 +108,7 @@

      Deleting Caches

      User Guide Home   ·   Next Topic:  Profiling Your Application

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index c04144a5..196e3777 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -112,7 +112,7 @@

      set_status_header(code, 'text');

      Top of Page   ·   User Guide Home   ·   Next Topic:  URI Routing

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index b0cbc058..9658df87 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -378,7 +378,7 @@

      That's it!

      Top of Page   ·   User Guide Home   ·   Next Topic:  Reserved Names

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 6ffafca5..a7503459 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -178,7 +178,7 @@

      Setting Your Own Prefix

      User Guide Home   ·   Next Topic:  Hooks - Extending the Core

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index 1f213db4..920cc16c 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -93,7 +93,7 @@

      Driver Directory and File Structure

      User Guide Home   ·   Next Topic:  Creating Core System Classes

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 721e60dd..0b4d642a 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -291,7 +291,7 @@

      Setting Your Own Prefix

      User Guide Home   ·   Next Topic:  Using CodeIgniter Drivers

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index 410f9598..b77528a7 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -58,7 +58,7 @@

      Credits

      CodeIgniter was originally developed by Rick Ellis (CEO of -Ellislab, Inc.). The framework was written for performance in the real +EllisLab, Inc.). The framework was written for performance in the real world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of ExpressionEngine.

      @@ -79,7 +79,7 @@

      Credits

      User Guide Home   ·   Next Topic:  Downloading CodeIgniter

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 649b6d4d..9c86f021 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -97,7 +97,7 @@

      Creating Your Own Drivers

      User Guide Home   ·   Next Topic:  Creating Drivers

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 17e21003..7c585d1b 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -131,7 +131,7 @@

      log_message('level', 'message')

      User Guide Home   ·   Next Topic:  Page Caching

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 5ba1674c..98c0dca8 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -178,7 +178,7 @@

      Now What?

      User Guide Home   ·   Next Topic:  Using Libraries

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 44072380..0d87f3b2 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -158,7 +158,7 @@

      Hook Points

      User Guide Home   ·   Next Topic:  Auto-loading Resources

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 2634b18a..cd83da74 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -87,7 +87,7 @@

      Creating Your Own Libraries

      User Guide Home   ·   Next Topic:  Creating Libraries

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 9f23de4b..04af6e6a 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -126,7 +126,7 @@

      Running Multiple Applications with one CodeIgniter Installation

      User Guide Home   ·   Next Topic:  Alternative PHP Syntax

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 91972686..e04fdf99 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -244,7 +244,7 @@

      Connecting to your Database

      User Guide Home   ·   Next Topic:  Helpers

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index f8650314..47c1a5ab 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -169,7 +169,7 @@

      Enabling and Disabling Profiler Sections

      User Guide Home   ·   Next Topic:  Managing Applications

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index 2b651756..d90e9620 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -70,7 +70,7 @@

      Quick Reference Chart

      Top of Page   ·   User Guide Home

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index c74a3c0b..2757e430 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -75,7 +75,7 @@

      Server Requirements

      User Guide Home   ·   Next Topic:  License Agreement

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 57373279..0984845f 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -145,7 +145,7 @@

      Constants

      Top of Page   ·   User Guide Home   ·   Next Topic:  Views

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 402e50a2..a423eaa8 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -159,7 +159,7 @@

      Reserved Routes

      User Guide Home   ·   Next Topic:  Error Handling

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/security.html b/user_guide/general/security.html index bc969f73..1a0ed13f 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -146,7 +146,7 @@

      Best Practices

      User Guide Home   ·   Next Topic:  PHP Style Guide

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index b523d5a1..5be636a4 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -680,7 +680,7 @@

      Overlapping Tag Parameters

      User Guide Home   ·   Next Topic:  Writing Documentation

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 7dbd7fe5..abddea83 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -144,7 +144,7 @@

      Enabling Query Strings

      Top of Page   ·   User Guide Home   ·   Next Topic:  Controllers

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 9c124d91..10744694 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -267,7 +267,7 @@

      Returning views as data

      User Guide Home   ·   Next Topic:  Models

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index ede12072..c0bdd78e 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -112,7 +112,7 @@

      random_element()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Compatibility Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index f358af19..c4aa65fa 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -188,7 +188,7 @@

      Adding a Database

      Top of Page   ·   User Guide Home

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index d43e7746..de8c49d0 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -111,7 +111,7 @@

      stripos()

      User Guide Home   ·   Next Topic:  Cookie Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index d7120d51..d0471d71 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -100,7 +100,7 @@

      delete_cookie()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Date Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index a5c46f3d..2d908705 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -401,7 +401,7 @@

      Timezone Reference

      User Guide Home   ·   Next Topic:  Directory Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index d0799c7c..2324252d 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -136,7 +136,7 @@

      directory_map('source directory')

      User Guide Home   ·   Next Topic:  Download Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index b0e7da09..4c0e2017 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -105,7 +105,7 @@

      force_download('filename', 'data')

      Top of Page   ·   User Guide Home   ·   Next Topic:  Email Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 01d3faa3..0084ada1 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -95,7 +95,7 @@

      send_email('recipient', 'subject', 'message Top of Page   ·   User Guide Home   ·   Next Topic:  File Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 4c5b4927..dd9df954 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -172,7 +172,7 @@

      octal_permissions($perms)

      Top of Page   ·   User Guide Home   ·   Next Topic:  Form Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index fa44f6b0..03a60685 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -477,7 +477,7 @@

      set_radio()

      User Guide Home   ·   Next Topic:  HTML Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index b79b92b0..a0ac8bdd 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -378,7 +378,7 @@

      doctype()

      Top of Page   ·   User Guide Home   ·   Next Topic:   Path Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 4ba6820a..9dcd1fc7 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -144,7 +144,7 @@

      humanize()

      User Guide Home   ·   Next Topic:  Number Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 4dede49c..ada6c60e 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -91,7 +91,7 @@

      lang('language line', 'element id')

      User Guide Home   ·   Next Topic:  Download Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index c2fc685b..9274e0cf 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -106,7 +106,7 @@

      byte_format()

      User Guide Home   ·   Next Topic:  Path Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index 15118674..c1d7b020 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -99,7 +99,7 @@

       

      User Guide Home   ·   Next Topic:  Security Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 351a5047..97be674a 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -119,7 +119,7 @@

      encode_php_tags()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Smiley Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 2e050b93..661330aa 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -208,7 +208,7 @@

      parse_smileys()

      User Guide Home   ·   Next Topic:  String Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 71a8ef77..2b12c2a2 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -171,7 +171,7 @@

      strip_quotes()

      User Guide Home   ·   Next Topic:  Text Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 0e075b9d..d477f53a 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -192,7 +192,7 @@

      word_wrap()

      User Guide Home   ·   Next Topic:  Typography Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index ae4ade11..96a68e9f 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -105,7 +105,7 @@

      nl2br_except_pre()

      User Guide Home   ·   Next Topic:  URL Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 96da0c62..5b478024 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -281,7 +281,7 @@

      redirect()

      User Guide Home   ·   Next Topic:  XML Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index caf8239b..50179ce4 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -98,7 +98,7 @@

      xml_convert('string')

      Top of Page   ·   User Guide Home

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/index.html b/user_guide/index.html index f6264fdb..a1d56d48 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -90,7 +90,7 @@

      Who is CodeIgniter For?

      diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 0f0243e5..f4114b7d 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -102,7 +102,7 @@

      Mercurial Server

      User Guide Home   ·   Next Topic:  Installation Instructions

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index a6446131..3d58725e 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -95,7 +95,7 @@

      Installation Instructions

      Next Topic:  Upgrading from a Previous Version

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index e6ab9a98..0c05ed60 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -83,7 +83,7 @@

      Troubleshooting

      User Guide Home   ·   Next Topic:  CodeIgniter at a Glance

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index ab09a7bc..ec947274 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -85,7 +85,7 @@

      Upgrading From Beta 1.0 to Final 1.2

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index b85d92d5..bd43dd9e 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -196,7 +196,7 @@

      Step 6: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 43fc1680..db02b481 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -95,7 +95,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index 52396dca..2caf9771 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -93,7 +93,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index f3dec87f..e3d05814 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -105,7 +105,7 @@

      Step 3: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 2d502717..1d6b7ec0 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -138,7 +138,7 @@

      Step 3: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index d400f98b..12112803 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -141,7 +141,7 @@

      Step 4: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 07ee9c21..7e9bfa8c 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -171,7 +171,7 @@

      Step 5: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index c8f1ad3e..0b386a66 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -104,7 +104,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index 042dd9ba..b32130dc 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -93,7 +93,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index b1bc8bb8..33fbef4b 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -109,7 +109,7 @@

      Step 4: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index 5568f8ca..e0e987ed 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -118,7 +118,7 @@

      Step 5: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index fcfa0a06..81d592c5 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -91,7 +91,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index c9eb2bfe..630fc3fe 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -99,7 +99,7 @@

      Step 5: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index 9f39e21b..222b7b4b 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -92,7 +92,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index d3892cf8..9db3add8 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -114,7 +114,7 @@

      Step 4: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index 32dab56d..d9cbcc00 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -91,7 +91,7 @@

      Step 2: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index fb035667..8482cb25 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -98,7 +98,7 @@

      Step 3: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 3f6bb129..f45875b3 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -104,7 +104,7 @@

      Step 3: Update your user guide

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index 52a6d84e..8604d514 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -137,7 +137,7 @@

      Step 5: Edit your config file

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 41ff226a..6df93b12 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -94,7 +94,7 @@

      Upgrading From a Previous Version

      User Guide Home   ·   Next Topic:  Troubleshooting

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index d82c3223..79f7fedb 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -191,7 +191,7 @@

      Displaying Memory Consumption

      User Guide Home   ·   Next Topic:  Calendar Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index f6a96022..74a8619b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -242,7 +242,7 @@

      Creating a Calendar Template

      User Guide Home   ·   Next Topic:  Cart Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 698f438b..4d458f57 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -339,7 +339,7 @@

      $this->cart->destroy();

      User Guide Home   ·   Next Topic:  Config Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 54462c79..bdabe8db 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -174,7 +174,7 @@

      $this->config->system_url();

      User Guide Home   ·   Next Topic:  Database Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 9fa68d79..e144826b 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -300,7 +300,7 @@

      Overriding Word Wrapping

      User Guide Home   ·   Next Topic:  Encryption Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index adcd7dc5..dac1db91 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -183,7 +183,7 @@

      $this->encrypt->sha1();

      User Guide Home   ·   Next Topic:  File Uploading Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 60290b18..d143f5b6 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -441,7 +441,7 @@

      Explanation

      User Guide Home   ·   Next Topic:  Form Validation Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index ec1357e5..2099135a 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1214,7 +1214,7 @@

      set_radio()

      User Guide Home   ·   Next Topic:  FTP Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index b5194e8a..a46b155b 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -309,7 +309,7 @@

      $this->ftp->close();

      User Guide Home   ·   Next Topic:  HTML Table Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 2e92fdf7..3dce50bf 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -660,7 +660,7 @@

      Overlay Preferences

      User Guide Home   ·   Next Topic:  Input Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 055f12bf..4c12fd7b 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -247,7 +247,7 @@

      $this->input->user_agent()

      User Guide Home   ·   Next Topic:  Loader Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index ac0af840..7f0eed9f 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -97,7 +97,7 @@

      Set the path to the librarys with config items

      Top of Page   ·   User Guide Home   ·   Next Topic:  Language Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html index 69b8389a..6dec7dda 100644 --- a/user_guide/libraries/jquery.html +++ b/user_guide/libraries/jquery.html @@ -229,7 +229,7 @@

      calendar()

      Top of Page   ·   User Guide Home   ·   Next Topic:  Language Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index ee78c765..c37f0092 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -130,7 +130,7 @@

      Auto-loading Languages

      User Guide Home   ·   Next Topic:  Output Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 98520e77..d9a3787c 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -248,7 +248,7 @@

      Package view files

      User Guide Home   ·   Next Topic:  Language Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 41104808..eeb27837 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -155,7 +155,7 @@

      Parsing Execution Variables

      User Guide Home   ·   Next Topic:  Pagination Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index d6b260be..21c7763f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -211,7 +211,7 @@

      $config['num_tag_close'] = '</div>';

      User Guide Home   ·   Next Topic:  Session Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 19ad6dec..ece61c1f 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -205,7 +205,7 @@

      Variable Pairs

      User Guide Home   ·   Next Topic:  Typography

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index d5d72538..a50d9484 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -116,7 +116,7 @@

      $this->security->sanitize_filename()

      User Guide Home   ·   Next Topic:  Session Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 31b4047e..58f2148c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -304,7 +304,7 @@

      Session Preferences

      User Guide Home   ·   Next Topic:  Trackback Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index c871d7cb..f1a46fca 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -308,7 +308,7 @@

      $this->table->function

      User Guide Home   ·   Next Topic:  Image Manipulation Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 30720601..a07b8d1f 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -239,7 +239,7 @@

      Notes:

      User Guide Home   ·   Next Topic:  Template Parser Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 9db565a1..ac53e880 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -153,7 +153,7 @@

      protect_braced_quotes

      User Guide Home   ·   Next Topic:  Unit Testing Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index ede938cd..0e7d1d69 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -219,7 +219,7 @@

      Creating a Template

      User Guide Home   ·   Next Topic:  URI Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index ae420d78..b2f5ac3d 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -245,7 +245,7 @@

      $this->uri->rsegment_array()

      User Guide Home   ·   Next Topic:  User Agent Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 6de6b6e6..944f1ed8 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -194,7 +194,7 @@

      $this->agent->accept_charset()

      User Guide Home   ·   Next Topic:  XML-RPC Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html index dc7915c6..d62ca01b 100644 --- a/user_guide/libraries/validation.html +++ b/user_guide/libraries/validation.html @@ -733,7 +733,7 @@

      set_radio()

      User Guide Home   ·   Next Topic:  XML-RPC Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 6e929f1f..939e9456 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -512,7 +512,7 @@

      Data Types

      User Guide Home   ·   Next Topic:  Zip Encoding Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index d8b3ea36..44603f2b 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -271,7 +271,7 @@

      $this->zip->clear_data()

      User Guide Home   ·   Next Topic:  Array Helper

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/license.html b/user_guide/license.html index 354c08c4..c76035d1 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -100,7 +100,7 @@

      Limitations of Liability

      User Guide Home   ·   Next Topic:  Change Log

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 4881fd74..804c81d0 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -88,7 +88,7 @@

      Application Flow Chart

      User Guide Home   ·   Next Topic:  Model-View-Controller

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index be7e5e26..f0731372 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -165,7 +165,7 @@

      CodeIgniter has a Friendly Community of Users

      User Guide Home   ·   Next Topic:  CodeIgniter Cheatsheets

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index 1232bd67..cf200e08 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -76,7 +76,7 @@

      Helpers Reference

      User Guide Home   ·   Next Topic:  CodeIgniter Features

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 5fdb4f09..375403a6 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -112,7 +112,7 @@

      CodeIgniter Features

      User Guide Home   ·   Next Topic:  Application Flow Chart

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 3bcfdcc0..88027eed 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -85,7 +85,7 @@

      Getting Started With CodeIgniter

      User Guide Home   ·   Next Topic:  CodeIgniter At a Glance

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index f6fa103e..e708753e 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -91,7 +91,7 @@

      Design and Architectural Goals

      User Guide Home   ·   Next Topic:  Getting Started

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index 5b930a48..3cb56f42 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -77,7 +77,7 @@

      CodeIgniter Overview

      diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 05e22d90..d0b1aa2e 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -93,7 +93,7 @@

      Model-View-Controller

      User Guide Home   ·   Next Topic:  Architectural Goals

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/toc.html b/user_guide/toc.html index 4f02d11b..6f222d15 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -200,7 +200,7 @@

      Additional Resources

      From 133e66626bb410571a8350376d3f81ed8bc9143f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 29 Mar 2010 11:36:42 -0500 Subject: [PATCH 1913/2544] fixed a bug where a PHP error would result when passing objects as values to the Session class --- system/libraries/Session.php | 17 +++++++++++++---- user_guide/changelog.html | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index bd942681..cf6dc96e 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -680,12 +680,18 @@ function _serialize($data) { foreach ($data as $key => $val) { - $data[$key] = str_replace('\\', '{{slash}}', $val); + if (is_string($val)) + { + $data[$key] = str_replace('\\', '{{slash}}', $val); + } } } else { - $data = str_replace('\\', '{{slash}}', $data); + if (is_string($data)) + { + $data = str_replace('\\', '{{slash}}', $data); + } } return serialize($data); @@ -711,13 +717,16 @@ function _unserialize($data) { foreach ($data as $key => $val) { - $data[$key] = str_replace('{{slash}}', '\\', $val); + if (is_string($val)) + { + $data[$key] = str_replace('{{slash}}', '\\', $val); + } } return $data; } - return str_replace('{{slash}}', '\\', $data); + return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 3006de75..dff273d9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -153,6 +153,7 @@

      Bug fixes for 2.0.0

    • Fixed a bug (#10470) where get_mime_by_extension() was case sensitive.
    • Fixed a bug where some error messages for the SQLite and Oracle drivers would not display.
    • Fixed a bug where files created with the Zip Library would result in file creation dates of 1980.
    • +
    • Fixed a bug in the Session library that would result in PHP error when attempting to store values with objects.
    • Fixed a bug where extending the Controller class would result in a fatal PHP error.
    From b7054751900fd6dfc6837d0e1fda57c416063cf6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 30 Mar 2010 08:49:37 -0500 Subject: [PATCH 1914/2544] fixed syntax error in documentation example for XML-RPC send_response() method --- user_guide/libraries/xmlrpc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 939e9456..8d1dbdf5 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -476,7 +476,7 @@

    $this->xmlrpc->send_response()

    $response = array(
                     array(
                            'flerror' => array(FALSE, 'boolean'),
    -                        'message' => "Thanks for the ping!")
    +                        'message' => "Thanks for the ping!"
                         )
                     'struct');
    return $this->xmlrpc->send_response($response);
    From 4bde110ec6769fe0fd0194be602fd3ed85c52bc7 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 30 Mar 2010 08:56:53 -0500 Subject: [PATCH 1915/2544] fixed a fatal PHP error in SQLite Forge _create_table() --- system/database/drivers/sqlite/sqlite_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index b7d25e75..53b20a3c 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -77,7 +77,7 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $sql = 'CREATE TABLE '; // IF NOT EXISTS added to SQLite in 3.3.0 - if ($if_not_exists === TRUE && version_compare($this->_version(), '3.3.0', '>=') === TRUE) + if ($if_not_exists === TRUE && version_compare($this->db->_version(), '3.3.0', '>=') === TRUE) { $sql .= 'IF NOT EXISTS '; } From a091147feb0331e758b74e7ea13f6ebcb645cd9b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 30 Mar 2010 10:33:09 -0500 Subject: [PATCH 1916/2544] moved entity_decode() to the Security library to handle an issue with HTML in input when the global XSS filter is enabled --- system/helpers/typography_helper.php | 38 ++----------------- system/libraries/Security.php | 55 ++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 712b5750..e45480e1 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -76,15 +76,6 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea * * This function is a replacement for html_entity_decode() * - * In some versions of PHP the native function does not work - * when UTF-8 is the specified character set, so this gives us - * a work-around. More info here: - * http://bugs.php.net/bug.php?id=25670 - * - * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the - * character set, and the PHP developers said they were not back porting the - * fix to versions other than PHP 5.x. - * * @access public * @param string * @return string @@ -93,32 +84,9 @@ function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebrea { function entity_decode($str, $charset='UTF-8') { - if (stristr($str, '&') === FALSE) return $str; - - // 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. - - if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR version_compare(phpversion(), '5.0.0', '>='))) - { - $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); - } - - // Numeric Entities - $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); - - // Literal Entities - Slightly slow so we do another check - if (stristr($str, '&') === FALSE) - { - $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); - } - - return $str; + $CI =& get_instance(); + $CI->load->library('security'); + return $CI->security->entity_decode($str, $charset); } } diff --git a/system/libraries/Security.php b/system/libraries/Security.php index 93da5920..60adf0a2 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -648,13 +648,62 @@ function _filter_attributes($str) */ function _decode_entity($match) { - $CI =& get_instance(); - $CI->load->helper('typography'); - return entity_decode($match[0], strtoupper($CI->config->item('charset'))); + return $this->entity_decode($match[0], strtoupper(config_item('charset'))); } // -------------------------------------------------------------------- + /** + * HTML Entities Decode + * + * This function is a replacement for html_entity_decode() + * + * In some versions of PHP the native function does not work + * when UTF-8 is the specified character set, so this gives us + * a work-around. More info here: + * http://bugs.php.net/bug.php?id=25670 + * + * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the + * character set, and the PHP developers said they were not back porting the + * fix to versions other than PHP 5.x. + * + * @access public + * @param string + * @param string + * @return string + */ + function entity_decode($str, $charset='UTF-8') + { + if (stristr($str, '&') === FALSE) return $str; + + // 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. + + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR is_php('5.0.0'))) + { + $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); + } + + // Numeric Entities + $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); + $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); + + // Literal Entities - Slightly slow so we do another check + if (stristr($str, '&') === FALSE) + { + $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); + } + + return $str; + } + + // -------------------------------------------------------------------- + /** * Filename Security * From aaa19bce2b8fb549442a679cba1382510770ddff Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 31 Mar 2010 21:43:21 -0500 Subject: [PATCH 1917/2544] Fixing Validation error in output profiler --- system/libraries/Profiler.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index b2c008fc..3285bc53 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -434,8 +434,6 @@ function _compile_http_headers() $output .= "\n"; $output .= ""; - $output .= ""; - return $output; } @@ -467,8 +465,6 @@ function _compile_config() $output .= "\n"; $output .= ""; - $output .= ""; - return $output; } From 3fff87d3c7f7374fae3c4013d4ba1c7ba10f17be Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 7 Apr 2010 14:23:01 -0500 Subject: [PATCH 1918/2544] Fixing typo in XMLRpc error message: http://codeigniter.com/bug_tracker/bug/11556/ --- system/libraries/Xmlrpc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 2e0df5c9..ee04400f 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -112,7 +112,7 @@ function CI_Xmlrpc ($config = array()) $this->xmlrpcerr['unknown_method'] = '1'; $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; $this->xmlrpcerr['invalid_return'] = '2'; - $this->xmlrpcstr['invalid_return'] = 'The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; + $this->xmlrpcstr['invalid_return'] = 'The XML data received was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.'; $this->xmlrpcerr['incorrect_params'] = '3'; $this->xmlrpcstr['incorrect_params'] = 'Incorrect parameters were passed to method'; $this->xmlrpcerr['introspect_unknown'] = '4'; From 1101602e32c32dcac3fe23b8c43892c3d41a58df Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 8 Apr 2010 11:29:40 -0500 Subject: [PATCH 1919/2544] Fix #15 - Strict Standards Error in index.php --- index.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 47f1ae9e..fa34c651 100644 --- a/index.php +++ b/index.php @@ -134,7 +134,7 @@ define('FCPATH', str_replace(SELF, '', __FILE__)); // Name of the "system folder" - define('SYSDIR', end(explode('/', trim(BASEPATH, '/')))); + define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); // The path to the "application" folder diff --git a/user_guide/changelog.html b/user_guide/changelog.html index dff273d9..12a4dc92 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -155,6 +155,7 @@

    Bug fixes for 2.0.0

  • Fixed a bug where files created with the Zip Library would result in file creation dates of 1980.
  • Fixed a bug in the Session library that would result in PHP error when attempting to store values with objects.
  • Fixed a bug where extending the Controller class would result in a fatal PHP error.
  • +
  • Fixed a PHP Strict Standards Error in the index.php file.
  • Version 1.7.2

    From 0846d746cfe30f827dd20952a6b492ec4b61de95 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 8 Apr 2010 11:47:33 -0500 Subject: [PATCH 1920/2544] Update to realpath() check of SYSDIR in index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index fa34c651..0eef7b89 100644 --- a/index.php +++ b/index.php @@ -102,7 +102,7 @@ * Resolve the system path for increased reliability * --------------------------------------------------------------- */ - if (function_exists('realpath') AND @realpath($system_path) !== FALSE) + if (realpath($system_path) !== FALSE) { $system_path = realpath($system_path).'/'; } From 73c19fc2e15bb542053bc347ee922ceb26114696 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 9 Apr 2010 11:18:26 -0400 Subject: [PATCH 1921/2544] Modified get_file_info in the file helper, changing filectime() to filemtime() for dates. --- system/helpers/file_helper.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 274c4ad3..448bf275 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -305,7 +305,7 @@ function get_file_info($file, $returned_values = array('name', 'server_path', 's $fileinfo['size'] = filesize($file); break; case 'date': - $fileinfo['date'] = filectime($file); + $fileinfo['date'] = filemtime($file); break; case 'readable': $fileinfo['readable'] = is_readable($file); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 12a4dc92..21c35d6a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -117,6 +117,7 @@

    Version 2.0.0

  • Added an optional second parameter to byte_format() in the Number Helper to allow for decimal precision.
  • Added alpha, and sha1 string types to random_string() in the String Helper.
  • Modified prep_url() so as to not prepend http:// if the supplied string already has a scheme.
  • +
  • Modified get_file_info in the file helper, changing filectime() to filemtime() for dates.
  • Other Changes From 676e1cda78b7bc4eede7cad509a8d9f015a51816 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Fri, 9 Apr 2010 21:16:16 +0200 Subject: [PATCH 1922/2544] Adding output library exceptions for servers with zlib.output_compression enabled. --- system/core/Output.php | 15 ++++++++++++++- user_guide/changelog.html | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/system/core/Output.php b/system/core/Output.php index ac412940..e25e6219 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -34,10 +34,13 @@ class CI_Output { var $enable_profiler = FALSE; var $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} + var $_zlib_oc = FALSE; var $_profiler_sections = array(); function CI_Output() { + $this->_zlib_oc = @ini_get('zlib.output_compression'); + log_message('debug', "Output Class Initialized"); } @@ -111,6 +114,16 @@ function append_output($output) */ function set_header($header, $replace = TRUE) { + // If zlib.output_compression is enabled it will compress the output, + // but it will not modify the content-length header to compensate for + // the reduction, causing the browser to hang waiting for more data. + // We'll just skip content-length in those cases. + + if ($this->_zlib_oc && strncasecmp($header, 'content-length', 14) == 0) + { + return; + } + $this->headers[] = array($header, $replace); } @@ -234,7 +247,7 @@ function _display($output = '') // -------------------------------------------------------------------- // Is compression requested? - if ($CFG->item('compress_output') === TRUE) + if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE) { if (extension_loaded('zlib')) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 21c35d6a..14d173ab 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -128,6 +128,7 @@

    Version 2.0.0

  • get_mime_by_extension() is now case insensitive.
  • Added "default" to the list Reserved Names.
  • Added 'application/x-msdownload' for .exe files and ''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 zlib.output_compression enabled.
  • Eliminated a call to is_really_writable() on each request unless it is really needed (Output caching)
  • Documented append_output() in the Output Class.
  • Documented a second argument in the decode() function for the Encryption Class.
  • From ef88a906ed8b2050f4c6e6d8fbd73cc5b6adc7a3 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 14 Apr 2010 18:22:23 -0500 Subject: [PATCH 1923/2544] Removing deprecated Validation class. Form_validation going forward! Removed references to the validation classes documentation page in the changelog as well. --- system/libraries/Validation.php | 875 --------------------------- user_guide/changelog.html | 11 +- user_guide/libraries/validation.html | 740 ---------------------- 3 files changed, 6 insertions(+), 1620 deletions(-) delete mode 100644 system/libraries/Validation.php delete mode 100644 user_guide/libraries/validation.html diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php deleted file mode 100644 index a42b7760..00000000 --- a/system/libraries/Validation.php +++ /dev/null @@ -1,875 +0,0 @@ -'; - var $_error_suffix = '

    '; - - - - /** - * Constructor - * - */ - function CI_Validation() - { - $this->CI =& get_instance(); - - if (function_exists('mb_internal_encoding')) - { - mb_internal_encoding($this->CI->config->item('charset')); - } - - log_message('debug', "Validation Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Set Fields - * - * This function takes an array of field names as input - * and generates class variables with the same name, which will - * either be blank or contain the $_POST value corresponding to it - * - * @access public - * @param string - * @param string - * @return void - */ - function set_fields($data = '', $field = '') - { - if ($data == '') - { - if (count($this->_fields) == 0) - { - return FALSE; - } - } - else - { - if ( ! is_array($data)) - { - $data = array($data => $field); - } - - if (count($data) > 0) - { - $this->_fields = $data; - } - } - - foreach($this->_fields as $key => $val) - { - $this->$key = ( ! isset($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]); - - $error = $key.'_error'; - if ( ! isset($this->$error)) - { - $this->$error = ''; - } - } - } - - // -------------------------------------------------------------------- - - /** - * Set Rules - * - * This function takes an array of field names and validation - * rules as input ad simply stores is for use later. - * - * @access public - * @param mixed - * @param string - * @return void - */ - function set_rules($data, $rules = '') - { - if ( ! is_array($data)) - { - if ($rules == '') - return; - - $data = array($data => $rules); - } - - foreach ($data as $key => $val) - { - $this->_rules[$key] = $val; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Error Message - * - * Lets users set their own error messages on the fly. Note: The key - * name has to match the function name that it corresponds to. - * - * @access public - * @param string - * @param string - * @return string - */ - function set_message($lang, $val = '') - { - if ( ! is_array($lang)) - { - $lang = array($lang => $val); - } - - $this->_error_messages = array_merge($this->_error_messages, $lang); - } - - // -------------------------------------------------------------------- - - /** - * Set The Error Delimiter - * - * Permits a prefix/suffix to be added to each error message - * - * @access public - * @param string - * @param string - * @return void - */ - function set_error_delimiters($prefix = '

    ', $suffix = '

    ') - { - $this->_error_prefix = $prefix; - $this->_error_suffix = $suffix; - } - - // -------------------------------------------------------------------- - - /** - * Run the Validator - * - * This function does all the work. - * - * @access public - * @return bool - */ - function run() - { - // Do we even have any data to process? Mm? - if (count($_POST) == 0 OR count($this->_rules) == 0) - { - return FALSE; - } - - // Load the language file containing error messages - $this->CI->lang->load('validation'); - - // Cycle through the rules and test for errors - foreach ($this->_rules as $field => $rules) - { - //Explode out the rules! - $ex = explode('|', $rules); - - // Is the field required? If not, if the field is blank we'll move on to the next test - if ( ! in_array('required', $ex, TRUE)) - { - if ( ! isset($_POST[$field]) OR $_POST[$field] == '') - { - continue; - } - } - - /* - * Are we dealing with an "isset" rule? - * - * Before going further, we'll see if one of the rules - * is to check whether the item is set (typically this - * applies only to checkboxes). If so, we'll - * test for it here since there's not reason to go - * further - */ - if ( ! isset($_POST[$field])) - { - if (in_array('isset', $ex, TRUE) OR in_array('required', $ex)) - { - if ( ! isset($this->_error_messages['isset'])) - { - if (FALSE === ($line = $this->CI->lang->line('isset'))) - { - $line = 'The field was not set'; - } - } - else - { - $line = $this->_error_messages['isset']; - } - - // Build the error message - $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $message = sprintf($line, $mfield); - - // Set the error variable. Example: $this->username_error - $error = $field.'_error'; - $this->$error = $this->_error_prefix.$message.$this->_error_suffix; - $this->_error_array[] = $message; - } - - continue; - } - - /* - * Set the current field - * - * The various prepping functions need to know the - * current field name so they can do this: - * - * $_POST[$this->_current_field] == 'bla bla'; - */ - $this->_current_field = $field; - - // Cycle through the rules! - foreach ($ex As $rule) - { - // Is the rule a callback? - $callback = FALSE; - if (substr($rule, 0, 9) == 'callback_') - { - $rule = substr($rule, 9); - $callback = TRUE; - } - - // Strip the parameter (if exists) from the rule - // Rules can contain a parameter: max_length[5] - $param = FALSE; - if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) - { - $rule = $match[1]; - $param = $match[2]; - } - - // Call the function that corresponds to the rule - if ($callback === TRUE) - { - if ( ! method_exists($this->CI, $rule)) - { - continue; - } - - $result = $this->CI->$rule($_POST[$field], $param); - - // If the field isn't required and we just processed a callback we'll move on... - if ( ! in_array('required', $ex, TRUE) AND $result !== FALSE) - { - continue 2; - } - - } - else - { - if ( ! method_exists($this, $rule)) - { - /* - * Run the native PHP function if called for - * - * If our own wrapper function doesn't exist we see - * if a native PHP function does. Users can use - * any native PHP function call that has one param. - */ - if (function_exists($rule)) - { - $_POST[$field] = $rule($_POST[$field]); - $this->$field = $_POST[$field]; - } - - continue; - } - - $result = $this->$rule($_POST[$field], $param); - } - - // Did the rule test negatively? If so, grab the error. - if ($result === FALSE) - { - if ( ! isset($this->_error_messages[$rule])) - { - if (FALSE === ($line = $this->CI->lang->line($rule))) - { - $line = 'Unable to access an error message corresponding to your field name.'; - } - } - else - { - $line = $this->_error_messages[$rule]; - } - - // Build the error message - $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param]; - $message = sprintf($line, $mfield, $mparam); - - // Set the error variable. Example: $this->username_error - $error = $field.'_error'; - $this->$error = $this->_error_prefix.$message.$this->_error_suffix; - - // Add the error to the error array - $this->_error_array[] = $message; - continue 2; - } - } - - } - - $total_errors = count($this->_error_array); - - /* - * Recompile the class variables - * - * If any prepping functions were called the $_POST data - * might now be different then the corresponding class - * variables so we'll set them anew. - */ - if ($total_errors > 0) - { - $this->_safe_form_data = TRUE; - } - - $this->set_fields(); - - // Did we end up with any errors? - if ($total_errors == 0) - { - return TRUE; - } - - // Generate the error string - foreach ($this->_error_array as $val) - { - $this->error_string .= $this->_error_prefix.$val.$this->_error_suffix."\n"; - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Required - * - * @access public - * @param string - * @return bool - */ - function required($str) - { - if ( ! is_array($str)) - { - return (trim($str) == '') ? FALSE : TRUE; - } - else - { - return ( ! empty($str)); - } - } - - // -------------------------------------------------------------------- - - /** - * Match one field to another - * - * @access public - * @param string - * @param field - * @return bool - */ - function matches($str, $field) - { - if ( ! isset($_POST[$field])) - { - return FALSE; - } - - return ($str !== $_POST[$field]) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Minimum Length - * - * @access public - * @param string - * @param value - * @return bool - */ - function min_length($str, $val) - { - if (preg_match("/[^0-9]/", $val)) - { - return FALSE; - } - - if (function_exists('mb_strlen')) - { - return (mb_strlen($str) < $val) ? FALSE : TRUE; - } - - return (strlen($str) < $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Max Length - * - * @access public - * @param string - * @param value - * @return bool - */ - function max_length($str, $val) - { - if (preg_match("/[^0-9]/", $val)) - { - return FALSE; - } - - if (function_exists('mb_strlen')) - { - return (mb_strlen($str) > $val) ? FALSE : TRUE; - } - - return (strlen($str) > $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Exact Length - * - * @access public - * @param string - * @param value - * @return bool - */ - function exact_length($str, $val) - { - if (preg_match("/[^0-9]/", $val)) - { - return FALSE; - } - - if (function_exists('mb_strlen')) - { - return (mb_strlen($str) != $val) ? FALSE : TRUE; - } - - return (strlen($str) != $val) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Valid Email - * - * @access public - * @param string - * @return bool - */ - function valid_email($str) - { - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Valid Emails - * - * @access public - * @param string - * @return bool - */ - function valid_emails($str) - { - if (strpos($str, ',') === FALSE) - { - return $this->valid_email(trim($str)); - } - - foreach(explode(',', $str) as $email) - { - if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE) - { - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Validate IP Address - * - * @access public - * @param string - * @return string - */ - function valid_ip($ip) - { - return $this->CI->input->valid_ip($ip); - } - - // -------------------------------------------------------------------- - - /** - * Alpha - * - * @access public - * @param string - * @return bool - */ - function alpha($str) - { - return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Alpha-numeric - * - * @access public - * @param string - * @return bool - */ - function alpha_numeric($str) - { - return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Alpha-numeric with underscores and dashes - * - * @access public - * @param string - * @return bool - */ - function alpha_dash($str) - { - return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Numeric - * - * @access public - * @param string - * @return bool - */ - function numeric($str) - { - return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str); - - } - - // -------------------------------------------------------------------- - - /** - * Is Numeric - * - * @access public - * @param string - * @return bool - */ - function is_numeric($str) - { - return ( ! is_numeric($str)) ? FALSE : TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Integer - * - * @access public - * @param string - * @return bool - */ - function integer($str) - { - return (bool)preg_match( '/^[\-+]?[0-9]+$/', $str); - } - - // -------------------------------------------------------------------- - - /** - * Is a Natural number (0,1,2,3, etc.) - * - * @access public - * @param string - * @return bool - */ - function is_natural($str) - { - return (bool)preg_match( '/^[0-9]+$/', $str); - } - - // -------------------------------------------------------------------- - - /** - * Is a Natural number, but not a zero (1,2,3, etc.) - * - * @access public - * @param string - * @return bool - */ - function is_natural_no_zero($str) - { - if ( ! preg_match( '/^[0-9]+$/', $str)) - { - return FALSE; - } - - if ($str == 0) - { - return FALSE; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Valid Base64 - * - * Tests a string for characters outside of the Base64 alphabet - * as defined by RFC 2045 http://www.faqs.org/rfcs/rfc2045 - * - * @access public - * @param string - * @return bool - */ - function valid_base64($str) - { - return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str); - } - - // -------------------------------------------------------------------- - - /** - * Set Select - * - * Enables pull-down lists to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_select($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' selected="selected"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Radio - * - * Enables radio buttons to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_radio($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' checked="checked"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set Checkbox - * - * Enables checkboxes to be set to the value the user - * selected in the event of an error - * - * @access public - * @param string - * @param string - * @return string - */ - function set_checkbox($field = '', $value = '') - { - if ($field == '' OR $value == '' OR ! isset($_POST[$field])) - { - return ''; - } - - if ($_POST[$field] == $value) - { - return ' checked="checked"'; - } - } - - // -------------------------------------------------------------------- - - /** - * Prep data for form - * - * This function allows HTML to be safely shown in a form. - * Special characters are converted. - * - * @access public - * @param string - * @return string - */ - function prep_for_form($data = '') - { - if (is_array($data)) - { - foreach ($data as $key => $val) - { - $data[$key] = $this->prep_for_form($val); - } - - return $data; - } - - if ($this->_safe_form_data == FALSE OR $data == '') - { - return $data; - } - - return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($data)); - } - - // -------------------------------------------------------------------- - - /** - * Prep URL - * - * @access public - * @param string - * @return string - */ - function prep_url($str = '') - { - if ($str == 'http://' OR $str == '') - { - $_POST[$this->_current_field] = ''; - return; - } - - if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') - { - $str = 'http://'.$str; - } - - $_POST[$this->_current_field] = $str; - } - - // -------------------------------------------------------------------- - - /** - * Strip Image Tags - * - * @access public - * @param string - * @return string - */ - function strip_image_tags($str) - { - $_POST[$this->_current_field] = $this->CI->input->strip_image_tags($str); - } - - // -------------------------------------------------------------------- - - /** - * XSS Clean - * - * @access public - * @param string - * @return string - */ - function xss_clean($str) - { - $_POST[$this->_current_field] = $this->CI->input->xss_clean($str); - } - - // -------------------------------------------------------------------- - - /** - * Convert PHP tags to entities - * - * @access public - * @param string - * @return string - */ - function encode_php_tags($str) - { - $_POST[$this->_current_field] = str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); - } - -} -// END Validation Class - -/* End of file Validation.php */ -/* Location: ./system/libraries/Validation.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 12a4dc92..cfb7396c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@

    Version 2.0.0

  • Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
  • Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory. See the Loader class documentation for more details.
  • In-development code is now hosted at BitBucket.
  • +
  • Removed the deprecated Validation Class.
  • Libraries
      @@ -494,7 +495,7 @@

      Version 1.6.2

    • The MySQLi forge class is now in sync with MySQL forge.
    • Added the ability to set CRLF settings via config in the Email class.
    • Unit Testing results are now colour coded, and a change was made to the default template of results.
    • -
    • Added a valid_emails rule to the Validation class.
    • +
    • Added a valid_emails rule to the Validation class.
    • The Zip class now exits within download().
    • The Zip class has undergone a substantial re-write for speed and clarity (thanks stanleyxu for the hard work and code contribution in bug report #3425!)
    @@ -680,8 +681,8 @@

    Version 1.6.0

  • Removed 'last_visit' from the Session class.
  • Added a language entry for valid_ip validation error.
  • Modified prep_for_form() in the Validation class to accept arrays, adding support for POST array validation (via callbacks only)
  • -
  • Added an "integer" rule into the Validation library.
  • -
  • Added valid_base64() to the Validation library.
  • +
  • Added an "integer" rule into the Validation library.
  • +
  • Added valid_base64() to the Validation library.
  • Documented clear() in the Image Processing library.
  • Changed the behaviour of custom callbacks so that they no longer trigger the "required" rule.
  • Modified Upload class $_FILES error messages to be more precise.
  • @@ -767,8 +768,8 @@

    Bug fixes for Version 1.6.0

  • Fixed a bug in database driver where num_rows property wasn't getting updated.
  • Fixed a bug in the upload library when allowed_files wasn't defined.
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • -
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • -
  • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
  • +
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • +
  • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
  • Fixed a bug in captcha calling an invalid PHP function.
  • Fixed a bug in the cookie helper "set_cookie" function. It was not honoring the config settings.
  • Fixed a bug that was making validation callbacks required even when not set as such.
  • diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html deleted file mode 100644 index d62ca01b..00000000 --- a/user_guide/libraries/validation.html +++ /dev/null @@ -1,740 +0,0 @@ - - - - - -Form Validation : CodeIgniter User Guide - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 2.0.0

    -
    - - - - - - - - - -
    - - -
    - - - -
    - -

    - This library has been deprecated. Use of the form_validation library is encouraged. -

    - -

    Form Validation

    - -

    Before explaining CodeIgniter's approach to data validation, let's describe the ideal scenario:

    - -
      -
    1. A form is displayed.
    2. -
    3. You fill it in and submit it.
    4. -
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data along with an error message describing the problem.
    6. -
    7. This process continues until you have submitted a valid form.
    8. -
    - -

    On the receiving end, the script must:

    - -
      -
    1. Check for required data.
    2. -
    3. Verify that the data is of the correct type, and meets the correct criteria. (For example, if a username is submitted -it must be validated to contain only permitted characters. It must be of a minimum length, -and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.)
    4. -
    5. Sanitize the data for security.
    6. -
    7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
    8. -
    9. Prep the data for insertion in the database.
    10. -
    - - -

    Although there is nothing complex about the above process, it usually requires a significant -amount of code, and to display error messages, various control structures are usually placed within the form HTML. -Form validation, while simple to create, is generally very messy and tedious to implement.

    - -CodeIgniter provides a comprehensive validation framework that truly minimizes the amount of code you'll write. -It also removes all control structures from your form HTML, permitting it to be clean and free of code. - -

    Overview

    - -

    In order to implement CodeIgniter's form validation you'll need three things:

    - -
      -
    1. A View file containing the form.
    2. -
    3. A View file containing a "success" message to be displayed upon successful submission.
    4. -
    5. A controller function to receive and process the submitted data.
    6. -
    - -

    Let's create those three things, using a member sign-up form as the example.

    - -

    The Form

    - -

    Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - -

    The Success Page

    - - -

    Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ -folder:

    - - - - - -

    The Controller

    - -

    Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ -folder:

    - - - - - -

    Try it!

    - -

    To try your form, visit your site using a URL similar to this one:

    - -example.com/index.php/form/ - -

    If you submit the form you should simply see the form reload. That's because you haven't set up any validation -rules yet, which we'll get to in a moment.

    - - -

    Explanation

    - -

    You'll notice several things about the above pages:

    - -

    The form (myform.php) is a standard web form with a couple exceptions:

    - -
      -
    1. It uses a form helper to create the form opening. -Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper -is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable -and flexible in the event your URLs change.
    2. - -
    3. At the top of the form you'll notice the following variable: -<?php echo $this->validation->error_string; ?> - -

      This variable will display any error messages sent back by the validator. If there are no messages it returns nothing.

      -
    4. -
    - -

    The controller (form.php) has one function: index(). This function initializes the validation class and -loads the form helper and URL helper used by your view files. It also runs -the validation routine. Based on -whether the validation was successful it either presents the form or the success page.

    - -

    Since you haven't told the validation class to validate anything yet, it returns "false" (boolean false) by default. The run() -function only returns "true" if it has successfully applied your rules without any of them failing.

    - - -

    Setting Validation Rules

    - -

    CodeIgniter lets you set as many validation rules as you need for a given field, cascading them in order, and it even lets you prep and pre-process the field data -at the same time. Let's see it in action, we'll explain it afterwards.

    - -

    In your controller (form.php), add this code just below the validation initialization function:

    - -$rules['username'] = "required";
    -$rules['password'] = "required";
    -$rules['passconf'] = "required";
    -$rules['email'] = "required";
    -
    -$this->validation->set_rules($rules);
    - -

    Your controller should now look like this:

    - - - -

    Now submit the form with the fields blank and you should see the error message. -If you submit the form with all the fields populated you'll see your success page.

    - -

    Note: The form fields are not yet being re-populated with the data when -there is an error. We'll get to that shortly, once we're through explaining the validation rules.

    - - -

    Changing the Error Delimiters

    - -

    By default, the system adds a paragraph tag (<p>) around each error message shown. You can easily change these delimiters with -this code, placed in your controller:

    - -$this->validation->set_error_delimiters('<div class="error">', '</div>'); - -

    In this example, we've switched to using div tags.

    - -

    Cascading Rules

    - -

    CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules array like this:

    - - -$rules['username'] = "required|min_length[5]|max_length[12]";
    -$rules['password'] = "required|matches[passconf]";
    -$rules['passconf'] = "required";
    -$rules['email'] = "required|valid_email";
    - -

    The above code requires that:

    - -
      -
    1. The username field be no shorter than 5 characters and no longer than 12.
    2. -
    3. The password field must match the password confirmation field.
    4. -
    5. The email field must contain a valid email address.
    6. -
    - -

    Give it a try!

    - -

    Note: There are numerous rules available which you can read about in the validation reference.

    - - -

    Prepping Data

    - -

    In addition to the validation functions like the ones we used above, you can also prep your data in various ways. -For example, you can set up rules like this:

    - -$rules['username'] = "trim|required|min_length[5]|max_length[12]|xss_clean";
    -$rules['password'] = "trim|required|matches[passconf]|md5";
    -$rules['passconf'] = "trim|required";
    -$rules['email'] = "trim|required|valid_email";
    - -

    In the above example, we are "trimming" the fields, converting the password to MD5, and running the username through -the "xss_clean" function, which removes malicious data.

    - -

    Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, -trim, MD5, etc.

    - -

    Note: You will generally want to use the prepping functions after -the validation rules so if there is an error, the original data will be shown in the form.

    - -

    Callbacks: Your own Validation Functions

    - -

    The validation system supports callbacks to your own validation functions. This permits you to extend the validation class -to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can -create a callback function that does that. Let's create a simple example.

    - -

    In your controller, change the "username" rule to this:

    - -$rules['username'] = "callback_username_check"; - -

    Then add a new function called username_check to your controller. Here's how your controller should look:

    - - - - -

    Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your -callback function for you to process.

    - -

    To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

    - -

    The error message was set using the $this->validation->set_message function. -Just remember that the message key (the first parameter) must match your function name.

    - -

    Note: You can apply your own custom error messages to any rule, just by setting the -message similarly. For example, to change the message for the "required" rule you will do this:

    - -$this->validation->set_message('required', 'Your custom message here'); - -

    Re-populating the form

    - -

    Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. -This is done similarly to your rules. Add the following code to your controller, just below your rules:

    - -$fields['username'] = 'Username';
    -$fields['password'] = 'Password';
    -$fields['passconf'] = 'Password Confirmation';
    -$fields['email'] = 'Email Address';
    -
    -$this->validation->set_fields($fields);
    - -

    The array keys are the actual names of the form fields, the value represents the full name that you want shown in the -error message.

    - -

    The index function of your controller should now look like this:

    - - - - - -

    Now open your myform.php view file and update the value in each field so that it has an attribute corresponding to its name:

    - - - - - -

    Now reload your page and submit the form so that it triggers an error. Your form fields should be populated -and the error messages will contain a more relevant field name.

    - - - -

    Showing Errors Individually

    - -

    If you prefer to show an error message next to each form field, rather than as a list, you can change your form so that it looks like this:

    - - - - -

    If there are no errors, nothing will be shown. If there is an error, the message will appear, wrapped in the delimiters you -have set (<p> tags by default).

    - -

    Note: To display errors this way you must remember to set your fields using the $this->validation->set_fields -function described earlier. The errors will be turned into variables that have "_error" after your field name. -For example, your "username" error will be available at:
    $this->validation->username_error.

    - - -

    Rule Reference

    - -

    The following is a list of all the native rules that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    RuleParameterDescriptionExample
    requiredNoReturns FALSE if the form element is empty. 
    matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
    min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
    max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
    exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
    alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
    alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
    alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
    numericNoReturns FALSE if the form element contains anything other than numeric characters. 
    integerNoReturns FALSE if the form element contains anything other than an integer. 
    valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
    valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
    valid_ipNoReturns FALSE if the supplied IP is not valid. 
    valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
    - -

    Note: These rules can also be called as discrete functions. For example:

    - -$this->validation->required($string); - -

    Note: You can also use any native PHP functions that permit one parameter.

    - - - -

    Prepping Reference

    - -

    The following is a list of all the prepping functions that are available to use:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameParameterDescription
    xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
    prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
    prep_urlNoAdds "http://" to URLs if missing.
    strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
    encode_php_tagsNoConverts PHP tags to entities.
    - -

    Note: You can also use any native PHP functions that permit one parameter, -like trim, htmlspecialchars, urldecode, etc.

    - - -

    Setting Custom Error Messages

    - -

    All of the native error messages are located in the following language file: language/english/validation_lang.php

    - -

    To set your own custom message you can either edit that file, or use the following function:

    - -$this->validation->set_message('rule', 'Error Message'); - -

    Where rule corresponds to the name of a particular rule, and Error Message is the text you would like displayed.

    - - -

    Dealing with Select Menus, Radio Buttons, and Checkboxes

    - -

    If you use select menus, radio buttons or checkboxes, you will want the state of -these items to be retained in the event of an error. The Validation class has three functions that help you do this:

    - -

    set_select()

    - -

    Permits you to display the menu item that was selected. The first parameter -must contain the name of the select menu, the second parameter must contain the value of -each item. Example:

    - - -<select name="myselect">
    -<option value="one" <?php echo $this->validation->set_select('myselect', 'one'); ?> >One</option>
    -<option value="two" <?php echo $this->validation->set_select('myselect', 'two'); ?> >Two</option>
    -<option value="three" <?php echo $this->validation->set_select('myselect', 'three'); ?> >Three</option>
    -</select> -
    - - -

    set_checkbox()

    - -

    Permits you to display a checkbox in the state it was submitted. The first parameter -must contain the name of the checkbox, the second parameter must contain its value. Example:

    - -<input type="checkbox" name="mycheck" value="1" <?php echo $this->validation->set_checkbox('mycheck', '1'); ?> /> - - -

    set_radio()

    - -

    Permits you to display radio buttons in the state they were submitted. The first parameter -must contain the name of the radio button, the second parameter must contain its value. Example:

    - -<input type="radio" name="myradio" value="1" <?php echo $this->validation->set_radio('myradio', '1'); ?> /> - - - - - -
    - - - - - - - \ No newline at end of file From 757dda61aa0556aca8172dc2a8175596afe28ce2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 14 Apr 2010 19:06:19 -0500 Subject: [PATCH 1924/2544] Fixing a bug where odbc/mssql/oci8 db drivers would encounter a PHP error due to a function being moved from the input to security class. Moving remove_invisible_characters() to Common.php so the entire class does not need to be instantiated in those database drivers. --- system/core/Common.php | 37 ++++++++++++++++ .../database/drivers/mssql/mssql_driver.php | 5 +-- system/database/drivers/oci8/oci8_driver.php | 5 +-- system/database/drivers/odbc/odbc_driver.php | 5 +-- system/libraries/Security.php | 42 +------------------ user_guide/changelog.html | 3 +- user_guide/general/common_functions.html | 6 +++ 7 files changed, 50 insertions(+), 53 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index 6e2f7250..9dee591e 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -479,6 +479,43 @@ function _exception_handler($severity, $message, $filepath, $line) $_error->log_exception($severity, $message, $filepath, $line); } + // -------------------------------------------------------------------- + + /** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ + function remove_invisible_characters($str) + { + static $non_displayables; + + if ( ! isset($non_displayables)) + { + // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', '/\x0c/', // 11, 12 + '/[\x0e-\x1f]/' // 14-31 + ); + } + + do + { + $cleaned = $str; + $str = preg_replace($non_displayables, '', $str); + } + while ($cleaned != $str); + + return $str; + } /* End of file Common.php */ diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 0c74726a..40900e83 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -260,12 +260,9 @@ function escape_str($str, $like = FALSE) return $str; } - - // Access the CI object - $CI =& get_instance(); // Escape single quotes - $str = str_replace("'", "''", $CI->input->_remove_invisible_characters($str)); + $str = str_replace("'", "''", remove_invisible_characters($str)); // escape LIKE condition wildcards if ($like === TRUE) diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index cd0e0957..6f317d2e 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -403,10 +403,7 @@ function escape_str($str, $like = FALSE) return $str; } - // Access the CI object - $CI =& get_instance(); - - $str = $CI->input->_remove_invisible_characters($str); + $str = remove_invisible_characters($str); // escape LIKE condition wildcards if ($like === TRUE) diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index d5df8ef8..6e682313 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -271,12 +271,9 @@ function escape_str($str, $like = FALSE) return $str; } - - // Access the CI object - $CI =& get_instance(); // ODBC doesn't require escaping - $str = $CI->input->_remove_invisible_characters($str); + $str = remove_invisible_characters($str); // escape LIKE condition wildcards if ($like === TRUE) diff --git a/system/libraries/Security.php b/system/libraries/Security.php index 60adf0a2..cdae5016 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -198,7 +198,7 @@ function xss_clean($str, $is_image = FALSE) /* * Remove Invisible Characters */ - $str = $this->_remove_invisible_characters($str); + $str = remove_invisible_characters($str); /* * Protect GET variables in URLs @@ -258,7 +258,7 @@ function xss_clean($str, $is_image = FALSE) /* * Remove Invisible Characters Again! */ - $str = $this->_remove_invisible_characters($str); + $str = remove_invisible_characters($str); /* * Convert all tabs to spaces @@ -480,44 +480,6 @@ function xss_hash() // -------------------------------------------------------------------- - /** - * Remove Invisible Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - * @access public - * @param string - * @return string - */ - function _remove_invisible_characters($str) - { - static $non_displayables; - - if ( ! isset($non_displayables)) - { - // every control character except newline (dec 10), carriage return (dec 13), and horizontal tab (dec 09), - $non_displayables = array( - '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 - '/%1[0-9a-f]/', // url encoded 16-31 - '/[\x00-\x08]/', // 00-08 - '/\x0b/', '/\x0c/', // 11, 12 - '/[\x0e-\x1f]/' // 14-31 - ); - } - - do - { - $cleaned = $str; - $str = preg_replace($non_displayables, '', $str); - } - while ($cleaned != $str); - - return $str; - } - - // -------------------------------------------------------------------- - /** * Compact Exploded Words * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 02cf6d06..5e0f5ae0 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -133,7 +133,8 @@

    Version 2.0.0

  • Eliminated a call to is_really_writable() on each request unless it is really needed (Output caching)
  • Documented append_output() in the Output Class.
  • Documented a second argument in the decode() function for the Encryption Class.
  • -
  • Documentd db->close().
  • +
  • Documented db->close().
  • +
  • Moved _remove_invisible_characters() function from the Security Library to common functions.
  • diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 196e3777..0e68d111 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -99,6 +99,12 @@

    set_status_header(code, 'text');

    See here for a full list of headers.

    + +

    remove_invisible_characters($str)

    +

    This function prevents inserting null characters between ascii characters, like Java\0script.

    + + + From f82e51cd8f46b112c3c400d43db9044854a8e805 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 14 Apr 2010 19:33:50 -0500 Subject: [PATCH 1925/2544] Update to File Upload library to return boolean on do_xss_clean(). --- system/libraries/Upload.php | 61 +++++++++++++++++++----- user_guide/changelog.html | 1 + user_guide/libraries/file_uploading.html | 6 +++ 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index ac9323c0..3131469d 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -276,9 +276,13 @@ function do_upload($field = 'userfile') * embedded within a file. Scripts can easily * be disguised as images or other file types. */ - if ($this->xss_clean == TRUE) + if ($this->xss_clean) { - $this->do_xss_clean(); + if ($this->do_xss_clean() === FALSE) + { + $this->set_error('upload_unable_to_write_file'); + return FALSE; + } } /* @@ -803,24 +807,55 @@ function do_xss_clean() { return FALSE; } + + if (function_exists('memory_get_usage') && memory_get_usage() && ini_get('memory_limit') != '') + { + $current = ini_get('memory_limit') * 1024 * 1024; + + // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output + // into scientific notation. number_format() ensures this number is an integer + // http://bugs.php.net/bug.php?id=43053 + + $new_memory = number_format(ceil(filesize($this->new_name) + $current), 0, '.', ''); + + ini_set('memory_limit', $new_memory); // When an integer is used, the value is measured in bytes. - PHP.net + } - if (($data = @file_get_contents($file)) === FALSE) + // If the file being uploaded is an image, then we should have no problem with XSS attacks (in theory), but + // IE can be fooled into mime-type detecting a malformed image as an html file, thus executing an XSS attack on anyone + // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this + // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of + // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an + // attempted XSS attack. + + if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) { - return FALSE; + if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary + { + return FALSE; // Couldn't open the file, return FALSE + } + + $opening_bytes = fread($file, 256); + fclose($file); + + // These are known to throw IE into mime-type detection chaos + // ]/i', $opening_bytes)) + { + return TRUE; // its an image, no "triggers" detected in the first 256 bytes, we're good + } } - - if ( ! $fp = @fopen($file, FOPEN_READ_WRITE)) + + if (($data = @file_get_contents($file)) === FALSE) { return FALSE; } - $CI =& get_instance(); - $data = $CI->security->xss_clean($data); - - flock($fp, LOCK_EX); - fwrite($fp, $data); - flock($fp, LOCK_UN); - fclose($fp); + $CI =& get_instance(); + + return $CI->security->xss_clean($data, TRUE); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5e0f5ae0..25b3b174 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -93,6 +93,7 @@

    Version 2.0.0

  • The Unit Test Class now has an optional "notes" field available to it, and allows for discrete display of test result items using $this->unit->set_test_items().
  • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
  • Added a download() method to the FTP library
  • +
  • Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
  • Database diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index d143f5b6..061d5562 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -318,6 +318,12 @@

    Preferences

    TRUE/FALSE (boolean) If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended. + +xss_clean +FALSE +TRUE/FALSE (boolean) +If set to TRUE, the files will be tested for XSS vulnerabilities. + From ff3ecaede7e7154d1897307a390919b655b15096 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 16 Apr 2010 16:13:23 -0400 Subject: [PATCH 1926/2544] Added class var xss_clean to the XML_RPC_Response class to prevent php error. Not noted in changelog, as I figure it's covered by the original note about adding xss clean at all. --- system/libraries/Xmlrpc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index ee04400f..e2b149b7 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -434,6 +434,7 @@ class XML_RPC_Response var $errno = 0; var $errstr = ''; var $headers = array(); + var $xss_clean = TRUE; function XML_RPC_Response($val, $code = 0, $fstr = '') { From 60e78c75f9cb332dcd5a387bf4262c1566f32b8e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 20 Apr 2010 12:45:14 -0500 Subject: [PATCH 1927/2544] Modifying smiley_js() in the smiley helper to add optional third parameter to return only the javascript with no script tags. --- system/helpers/smiley_helper.php | 11 +++++++++-- user_guide/changelog.html | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 775cc1b9..b9eb0a23 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -40,7 +40,7 @@ */ if ( ! function_exists('smiley_js')) { - function smiley_js($alias = '', $field_id = '') + function smiley_js($alias = '', $field_id = '', $inline = TRUE) { static $do_setup = TRUE; @@ -108,7 +108,14 @@ function insert_smiley(smiley, field_id) { } } - return ''; + if ($inline) + { + return ''; + } + else + { + return $r; + } } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 25b3b174..53bf395d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -120,6 +120,7 @@

    Version 2.0.0

  • Added alpha, and sha1 string types to random_string() in the String Helper.
  • Modified prep_url() so as to not prepend http:// if the supplied string already has a scheme.
  • Modified get_file_info in the file helper, changing filectime() to filemtime() for dates.
  • +
  • Modified smiley_js() to add optional third parameter to return only the javascript with no script tags.
  • Other Changes From 47cd452c91a3dc7dab4a8285136bee2048fc7bba Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 22 Apr 2010 12:34:13 +0100 Subject: [PATCH 1928/2544] Fixed Upload bug that would break when files and images were both included on an allowed filetype list in the wrong order: http://codeigniter.com/bug_tracker/bug/11552/ --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 3131469d..0e71aee6 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -578,7 +578,7 @@ function is_allowed_filetype() $mime = $this->mimes_types(strtolower($val)); // Images get some additional checks - if (in_array($val, $image_types)) + if ($this->file_ext == '.' . $val && in_array($val, $image_types)) { if (getimagesize($this->file_temp) === FALSE) { From 52c592bb08ad5fbc4ded7aedaa81e2f3fb329b8c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 22 Apr 2010 16:36:40 -0500 Subject: [PATCH 1929/2544] tiny modification to whitespace from philsturgeon's bugfix to match CI style guidelines --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 0e71aee6..b85663bc 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -578,7 +578,7 @@ function is_allowed_filetype() $mime = $this->mimes_types(strtolower($val)); // Images get some additional checks - if ($this->file_ext == '.' . $val && in_array($val, $image_types)) + if ($this->file_ext == '.'.$val && in_array($val, $image_types)) { if (getimagesize($this->file_temp) === FALSE) { From e4f6ee9b971d440d1f8cfee44e8860592475da0a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 22 Apr 2010 16:44:41 -0500 Subject: [PATCH 1930/2544] added changelog note for changesets 4ce5f465478a and 20a016307847 --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 53bf395d..21b60ace 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -162,6 +162,7 @@

    Bug fixes for 2.0.0

  • Fixed a bug in the Session library that would result in PHP error when attempting to store values with objects.
  • Fixed a bug where extending the Controller class would result in a fatal PHP error.
  • Fixed a PHP Strict Standards Error in the index.php file.
  • +
  • Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().
  • Version 1.7.2

    From dcae4490998dc111d265da11507c0dad660eb1b4 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 22 Apr 2010 13:34:09 +0100 Subject: [PATCH 1931/2544] Some mime types are wrapped with " which breaks file type checking. This will remove any wrapping \ and " --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index b85663bc..75104496 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -190,7 +190,7 @@ function do_upload($field = 'userfile') $this->file_name = $this->_prep_filename($_FILES[$field]['name']); $this->file_size = $_FILES[$field]['size']; $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); - $this->file_type = strtolower($this->file_type); + $this->file_type = trim(stripslashes($this->file_type), '"'); $this->file_ext = $this->get_extension($_FILES[$field]['name']); // Convert the file size to kilobytes From 616fb0281ba4bd2339accc47c0a94f7034c61a1a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 22 Apr 2010 16:52:18 -0500 Subject: [PATCH 1932/2544] reapplied strtolower() to ->file_type from philsturgeon's changeset 5fe3b04bdf44 to standardize input --- system/libraries/Upload.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 75104496..3227c374 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -190,7 +190,7 @@ function do_upload($field = 'userfile') $this->file_name = $this->_prep_filename($_FILES[$field]['name']); $this->file_size = $_FILES[$field]['size']; $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); - $this->file_type = trim(stripslashes($this->file_type), '"'); + $this->file_type = strtolower(trim(stripslashes($this->file_type), '"')); $this->file_ext = $this->get_extension($_FILES[$field]['name']); // Convert the file size to kilobytes diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 21b60ace..6eb03609 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,6 +94,7 @@

    Version 2.0.0

  • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
  • Added a download() method to the FTP library
  • Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
  • +
  • Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input.
  • Database From 68c685ec6ed077e0ba4e5628963ef3183bb0a4fa Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 22 Apr 2010 17:18:46 -0500 Subject: [PATCH 1933/2544] clarifying a changelog item --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6eb03609..ae63b1f5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,7 +94,7 @@

    Version 2.0.0

  • Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
  • Added a download() method to the FTP library
  • Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
  • -
  • Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input.
  • +
  • Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.
  • Database From 5640a7158559f4521911444b50798a6a9536f38b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 23 Apr 2010 11:22:40 -0500 Subject: [PATCH 1934/2544] ensured the security lib was loaded in a few calls to xss_clean() in other libraries. Fixes #35 --- system/libraries/Form_validation.php | 7 ++++++- system/libraries/Upload.php | 7 ++++++- system/libraries/Xmlrpc.php | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index bb70f0f7..73cb6b85 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1254,7 +1254,12 @@ function strip_image_tags($str) */ function xss_clean($str) { - return $this->CI->input->xss_clean($str); + if ( ! is_object($this->CI->security)) + { + $this->CI->load('security'); + } + + return $this->CI->security->xss_clean($str); } // -------------------------------------------------------------------- diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 3227c374..d7cf236f 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -854,7 +854,12 @@ function do_xss_clean() } $CI =& get_instance(); - + + if ( ! is_object($CI->security)) + { + $CI->load('security'); + } + return $CI->security->xss_clean($data, TRUE); } diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index e2b149b7..ee65398e 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -505,6 +505,11 @@ function decode($array=FALSE) { $CI =& get_instance(); + if ($this->xss_clean && ! is_object($CI->security)) + { + $CI->load('security'); + } + if ($array !== FALSE && is_array($array)) { while (list($key) = each($array)) @@ -1119,6 +1124,11 @@ function output_parameters($array=FALSE) { $CI =& get_instance(); + if ($this->xss_clean && ! is_object($CI->security)) + { + $CI->load('security'); + } + if ($array !== FALSE && is_array($array)) { while (list($key) = each($array)) From 78a1cf24831e067aae04531718a167e8ec144fda Mon Sep 17 00:00:00 2001 From: Roger Simms Date: Sun, 25 Apr 2010 12:50:53 +0100 Subject: [PATCH 1935/2544] Simple change to comment line 21: the=>that. --- system/core/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index 92f7f17f..c9d797ca 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -18,7 +18,7 @@ /** * CodeIgniter Application Controller Class * - * This class object is the super class the every library in + * This class object is the super class that every library in * CodeIgniter will be assigned to. * * @package CodeIgniter From 30841679f57da9de8053c8291a665043f8f92c03 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 26 Apr 2010 09:09:21 -0500 Subject: [PATCH 1936/2544] fixed errant syntax in changeset 53ace78c4b45, fixes #37 --- system/libraries/Form_validation.php | 6 +++--- system/libraries/Upload.php | 2 +- system/libraries/Xmlrpc.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 73cb6b85..64baaef2 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1254,11 +1254,11 @@ function strip_image_tags($str) */ function xss_clean($str) { - if ( ! is_object($this->CI->security)) + if ( ! isset($this->CI->security)) { - $this->CI->load('security'); + $this->CI->load->library('security'); } - + return $this->CI->security->xss_clean($str); } diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index d7cf236f..b3c625eb 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -855,7 +855,7 @@ function do_xss_clean() $CI =& get_instance(); - if ( ! is_object($CI->security)) + if ( ! isset($CI->security)) { $CI->load('security'); } diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index ee65398e..ff03a503 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -505,9 +505,9 @@ function decode($array=FALSE) { $CI =& get_instance(); - if ($this->xss_clean && ! is_object($CI->security)) + if ($this->xss_clean && ! isset($CI->security)) { - $CI->load('security'); + $CI->load->library('security'); } if ($array !== FALSE && is_array($array)) @@ -1124,9 +1124,9 @@ function output_parameters($array=FALSE) { $CI =& get_instance(); - if ($this->xss_clean && ! is_object($CI->security)) + if ($this->xss_clean && ! isset($CI->security)) { - $CI->load('security'); + $CI->load->library('security'); } if ($array !== FALSE && is_array($array)) From 247f02925e04a8a45f2e6e9acbf72ccd6848fd32 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 26 Apr 2010 09:10:21 -0500 Subject: [PATCH 1937/2544] fixed errant syntax in changeset 53ace78c4b45, fixes #37 --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index b3c625eb..7a5eef0f 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -857,7 +857,7 @@ function do_xss_clean() if ( ! isset($CI->security)) { - $CI->load('security'); + $CI->load->library('security'); } return $CI->security->xss_clean($data, TRUE); From 42526cf74a61a350ff26904c52b4315229e077f2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 28 Apr 2010 08:22:44 -0500 Subject: [PATCH 1938/2544] corrected references to Input class since the Security methods are now their own library. Fixes #31 --- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/jquery.html | 2 +- user_guide/nav/nav.js | 2 +- user_guide/toc.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 7f0eed9f..2b25fb2d 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -42,7 +42,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Input and Security Class +Input Class
    Search User Guide   
    diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html index 6dec7dda..a7ab94f4 100644 --- a/user_guide/libraries/jquery.html +++ b/user_guide/libraries/jquery.html @@ -42,7 +42,7 @@ CodeIgniter Home  ›  User Guide Home  ›  -Input and Security Class +Input Class
    Search User Guide   
    diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ce87f48b..909a0dd9 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -83,7 +83,7 @@ function create_menu(basepath) '
  • FTP Class
  • ' + '
  • HTML Table Class
  • ' + '
  • Image Manipulation Class
  • ' + - '
  • Input and Security Class
  • ' + + '
  • Input Class
  • ' + '
  • Loader Class
  • ' + '
  • Language Class
  • ' + '
  • Output Class
  • ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 6f222d15..f7fd5e0a 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -136,7 +136,7 @@

    Class Reference

  • FTP Class
  • HTML Table Class
  • Image Manipulation Class
  • -
  • Input and Security Class
  • +
  • Input Class
  • Loader Class
  • Language Class
  • Output Class
  • From e602683aa6362e2efeb03408cea749cfeaaeef4f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 29 Apr 2010 13:41:39 -0500 Subject: [PATCH 1939/2544] Changing order of available sections in the output profiler. --- system/libraries/Profiler.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 3285bc53..49a6774c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -36,14 +36,14 @@ class CI_Profiler { var $_available_sections = array( 'benchmarks', - 'config', - 'controller_info', 'get', - 'http_headers', 'memory_usage', 'post', + 'uri_string', + 'controller_info', 'queries', - 'uri_string' + 'http_headers', + 'config' ); function CI_Profiler($config = array()) @@ -459,6 +459,11 @@ function _compile_config() foreach($this->CI->config->config as $config=>$val) { + if (is_array($val)) + { + $val = print_r($val, TRUE); + } + $output .= "".$config."  ".$val."\n"; } From 26872de184e4aa2ae92bae645782089e9656115d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 11 May 2010 11:41:59 +0100 Subject: [PATCH 1940/2544] Added an option to remove the preceding trail of empty folders when creating a Zip archive. --- system/libraries/Zip.php | 49 +++++++++++++++++++++++++---------- user_guide/changelog.html | 1 + user_guide/libraries/zip.html | 12 ++++++++- 3 files changed, 47 insertions(+), 15 deletions(-) diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 2c4bd255..3ba3ddc8 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -270,27 +270,48 @@ function read_file($path, $preserve_filepath = FALSE) * @access public * @param string path to source * @return bool - */ - function read_dir($path) - { - if ($fp = @opendir($path)) + */ + function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) + { + if (!$fp = @opendir($path)) + { + return FALSE; + } + + // Set the original directory root for child dir's to use as relative + if ($root_path === NULL) + { + $root_path = dirname($path).'/'; + } + + while (FALSE !== ($file = readdir($fp))) { - while (FALSE !== ($file = readdir($fp))) + if(substr($file, 0, 1) == '.') { - if (@is_dir($path.$file) && substr($file, 0, 1) != '.') - { - $this->read_dir($path.$file."/"); - } - elseif (substr($file, 0, 1) != ".") + continue; + } + + if (@is_dir($path.$file)) + { + $this->read_dir($path.$file."/", $preserve_filepath, $root_path); + } + + else + { + if (FALSE !== ($data = file_get_contents($path.$file))) { - if (FALSE !== ($data = file_get_contents($path.$file))) - { - $this->add_data(str_replace("\\", "/", $path).$file, $data); + $name = str_replace("\\", "/", $path); + + if ($preserve_filepath === FALSE) + { + $name = str_replace($root_path, '', $name); } + + $this->add_data($name.$file, $data); } } - return TRUE; } + return TRUE; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ae63b1f5..08c98157 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -95,6 +95,7 @@

    Version 2.0.0

  • Added a download() method to the FTP library
  • Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
  • Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.
  • +
  • Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
  • Database diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 44603f2b..844023b9 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -177,7 +177,7 @@

    $this->zip->read_file()

    $this->zip->read_dir()

    -

    Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +

    Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the supplied path will be encoded, as will any sub-folders contained within it. Example:

    @@ -189,6 +189,16 @@

    $this->zip->read_dir()

    $this->zip->download('my_backup.zip');
    +

    By default the Zip archive will place all directories listed in the first parameter inside the zip. If you only want the end folder to be in the zip +you can pass FALSE (boolean) in the second parameter. Example:

    + + +$path = '/path/to/your/directory/';

    +$this->zip->read_dir($path, FALSE); +
    + +

    This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that.

    + From 2735b3eeb3403ba813aac56ed6f10be536839ff6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 11 May 2010 08:58:21 -0500 Subject: [PATCH 1941/2544] fixed whitespace, massaged Zip read_dir() docs --- system/libraries/Zip.php | 4 ++-- user_guide/libraries/zip.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 3ba3ddc8..92dfc814 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -273,7 +273,7 @@ function read_file($path, $preserve_filepath = FALSE) */ function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) { - if (!$fp = @opendir($path)) + if ( ! $fp = @opendir($path)) { return FALSE; } @@ -295,7 +295,6 @@ function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) { $this->read_dir($path.$file."/", $preserve_filepath, $root_path); } - else { if (FALSE !== ($data = file_get_contents($path.$file))) @@ -311,6 +310,7 @@ function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) } } } + return TRUE; } diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 844023b9..d57dd48a 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -189,7 +189,7 @@

    $this->zip->read_dir()

    $this->zip->download('my_backup.zip');
    -

    By default the Zip archive will place all directories listed in the first parameter inside the zip. If you only want the end folder to be in the zip +

    By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored you can pass FALSE (boolean) in the second parameter. Example:

    @@ -197,7 +197,7 @@

    $this->zip->read_dir()

    $this->zip->read_dir($path, FALSE);
    -

    This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that.

    +

    This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that, but will not include the folders /path/to/your.

    From 511e3d72b875401b5cc61a28df45fb65acfd689a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 13 May 2010 09:03:30 -0500 Subject: [PATCH 1942/2544] added htmlspecialchars to config item output, fixes #41 --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 49a6774c..0900a300 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -303,7 +303,7 @@ function _compile_post() $output .= "$_POST[".$key."]   "; if (is_array($val)) { - $output .= "
    " . htmlspecialchars(stripslashes(print_r($val, true))) . "
    "; + $output .= "
    " . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "
    "; } else { @@ -464,7 +464,7 @@ function _compile_config() $val = print_r($val, TRUE); } - $output .= "".$config."  ".$val."\n"; + $output .= "".$config."  ".htmlspecialchars($val)."\n"; } $output .= "\n"; From 23e796f7561832a929c1a78c1fb60667563b0756 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 21 May 2010 12:45:25 -0500 Subject: [PATCH 1943/2544] fixed a bug in the Parser where the regex would not correctly match pair variables, fixes #42 --- system/libraries/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 9387f1a9..41a438ba 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -197,7 +197,7 @@ function _parse_pair($variable, $data, $string) */ 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)) + 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)) { return FALSE; } From 2a6c1da49b38abb8767192a064b8c6b01d1e421e Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Mon, 24 May 2010 12:20:03 -0400 Subject: [PATCH 1944/2544] Added $prefix, $suffix and $first_url properties to Pagination library. --- system/libraries/Pagination.php | 36 +++++++++++++++++++++++++++------ user_guide/changelog.html | 1 + 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index d6321f41..ccd3e826 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -27,6 +27,9 @@ 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 = ''; // 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 @@ -42,6 +45,7 @@ class CI_Pagination { 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 = ' '; var $cur_tag_close = ''; var $next_tag_open = ' '; @@ -185,15 +189,25 @@ function create_links() // Render the "First" link if ($this->cur_page > ($this->num_links + 1)) { - $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; + $first_url = ($this->first_url == '') ? $this->base_url : $this->first_url; + $output .= $this->first_tag_open.''.$this->first_link.''.$this->first_tag_close; } // Render the "previous" link if ($this->cur_page != 1) { $i = $uri_page_number - $this->per_page; - if ($i == 0) $i = ''; - $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; + + if ($i == 0 && $this->first_url != '') + { + $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; + } + else + { + $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix; + $output .= $this->prev_tag_open.''.$this->prev_link.''.$this->prev_tag_close; + } + } // Write the digit links @@ -210,7 +224,17 @@ function create_links() else { $n = ($i == 0) ? '' : $i; - $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; + + if ($n == '' && $this->first_url != '') + { + $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; + } + else + { + $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; + + $output .= $this->num_tag_open.''.$loop.''.$this->num_tag_close; + } } } } @@ -218,14 +242,14 @@ function create_links() // Render the "next" link if ($this->cur_page < $num_pages) { - $output .= $this->next_tag_open.''.$this->next_link.''.$this->next_tag_close; + $output .= $this->next_tag_open.''.$this->next_link.''.$this->next_tag_close; } // Render the "Last" link if (($this->cur_page + $this->num_links) < $num_pages) { $i = (($num_pages * $this->per_page) - $this->per_page); - $output .= $this->last_tag_open.''.$this->last_link.''.$this->last_tag_close; + $output .= $this->last_tag_open.''.$this->last_link.''.$this->last_tag_close; } // Kill double slashes. Note: Sometimes we can end up with a double slash diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 08c98157..1aa06d38 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -78,6 +78,7 @@

    Version 2.0.0

  • Libraries
      +
    • Added $prefix, $suffix and $first_url properties to Pagination library.
    • Added Security library, which now contains the xss_clean function, filename_security function and other security related functions.
    • Added CSRF (Cross-site Reference Forgery) protection to the Security library.
    • Added $parse_exec_vars property to Output library.
    • From c78a259b4af7430f237636b5f93d6eb59443a1e2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 9 Jun 2010 11:45:32 -0500 Subject: [PATCH 1945/2544] Fixed an undefined variable PHP error in the do_xss_clean() method of the Upload library. --- system/libraries/Upload.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 7a5eef0f..8bdb4be1 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -812,13 +812,13 @@ function do_xss_clean() { $current = ini_get('memory_limit') * 1024 * 1024; - // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output - // into scientific notation. number_format() ensures this number is an integer - // http://bugs.php.net/bug.php?id=43053 - - $new_memory = number_format(ceil(filesize($this->new_name) + $current), 0, '.', ''); - - ini_set('memory_limit', $new_memory); // When an integer is used, the value is measured in bytes. - PHP.net + // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output + // into scientific notation. number_format() ensures this number is an integer + // http://bugs.php.net/bug.php?id=43053 + + $new_memory = number_format(ceil(filesize($file) + $current), 0, '.', ''); + + ini_set('memory_limit', $new_memory); // When an integer is used, the value is measured in bytes. - PHP.net } // If the file being uploaded is an image, then we should have no problem with XSS attacks (in theory), but From 7c708ca4da0e0848c15ed78f9a14aa637a5ba14c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:25:11 -0400 Subject: [PATCH 1946/2544] Fixed an example typo --- user_guide/database/active_record.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 6977302a..bc7cd3d1 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -228,7 +228,7 @@

      $this->db->where();

      $this->db->where('name', $name);
      $this->db->where('title', $title);
      $this->db->where('status', $status); -

      // WHERE name 'Joe' AND title = 'boss' AND status = 'active'
      +

      // WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
    • Custom key/value method: From 13fbacda9f846c997f4745d341a7b75098d79bcf Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:31:17 -0400 Subject: [PATCH 1947/2544] guide clarification --- user_guide/general/reserved_names.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 0984845f..7ab518d2 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -62,7 +62,7 @@

      Controller names

      Since your controller classes will extend the main application controller you must be careful not to name your functions identically to the ones used by that class, otherwise your local functions will override them. The following -is a list of reserved names. Do not name your controller functions any of these:

      +is a list of reserved names. Do not name your controller any of these:

      • Controller
      • CI_Base
      • From 34312bb46c1d60e9e944139ded10e1fecb847ed9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:36:31 -0400 Subject: [PATCH 1948/2544] added a file to be replaced when updating from 1.71 to 1.72 --- user_guide/installation/upgrade_172.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index 8482cb25..0f95a815 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -72,6 +72,7 @@

        Step 1: Update your CodeIgniter files

      • system/helpers
      • system/language
      • system/libraries
      • +
      • index.php

      Note: If you have any custom developed files in these folders please make copies of them first.

      @@ -83,7 +84,10 @@

      Step 2: Remove header() from 404 error template

      404 status headers are now properly handled in the show_404() method itself.

      -

      Step 3: Update your user guide

      +

      Step 3: Confirm your system_path

      +

      In your updated index.php file, confirm that the $system_path variable is set to your application's system folder.

      + +

      Step 4: Update your user guide

      Please replace your local copy of the user guide with the new version, including the image files.

      From 2f304d6119e022abd5bd29e6a9980b7c81a27586 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:40:26 -0400 Subject: [PATCH 1949/2544] altering a few examples to be more CI driven then EE driven in styleguide --- user_guide/general/styleguide.html | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 5be636a4..1200a2c1 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -88,7 +88,7 @@

      Table of Contents

    • Line Breaks
    • Code Indenting
    • Bracket and Parenthetic Spacing
    • -
    • Localized Text in Control Panel
    • +
    • Localized Text
    • Private Methods and Variables
    • PHP Errors
    • Short Open Tags
    • @@ -96,7 +96,6 @@

      Table of Contents

    • Strings
    • SQL Queries
    • Default Function Arguments
    • -
    • Overlapping Tag Parameters
  • @@ -535,15 +534,15 @@

    Bracket and Parenthetic Spacing

    -

    Localized Text in Control Panel

    +

    Localized Text

    -

    Any text that is output in the control panel should use language variables in your module's lang file to allow localization.

    +

    Any text that is output in the control panel should use language variables in your lang file to allow localization.

    INCORRECT: return "Invalid Selection"; CORRECT: -return $LANG->line('invalid_selection'); +return $this->lang->line('invalid_selection');
    @@ -657,12 +656,6 @@

    Default Function Arguments

    - -

    Overlapping Tag Parameters

    -
    -

    Avoid multiple tag parameters that have effect on the same thing. For instance, instead of include= and exclude=, perhaps allow include= to handle the parameter alone, with the addition of "not", e.g. include="not bar". This will prevent problems of parameters overlapping or having to worry about which parameter has priority over another.

    -
    - From f597dd19ef20e4bff70ad10bf794aab3915d693d Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:43:46 -0400 Subject: [PATCH 1950/2544] fixed a missing
  • in guide --- user_guide/database/queries.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index dbb3e5c7..7a6734c4 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -113,7 +113,7 @@

    Escaping Queries

    conditions so that LIKE wildcards ('%', '_') in the string are also properly escaped. $search = '20% raise';
    -$sql = "SELECT id FROM table WHERE column LIKE '%".$this->db->escape_like_str($search)."%'";
    +$sql = "SELECT id FROM table WHERE column LIKE '%".$this->db->escape_like_str($search)."%'"; From 8d027fad2fe50fa05b6bb967883a9ddfa673c746 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:47:38 -0400 Subject: [PATCH 1951/2544] fixed missing

    in guide --- user_guide/installation/upgrade_170.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/typography.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 9db3add8..7f3cec61 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -80,7 +80,7 @@

    Step 1: Update your CodeIgniter files

    Step 2: Update your Session Table

    If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. -Here is an example of what this column might look like for MySQL: +Here is an example of what this column might look like for MySQL:

    user_data text NOT NULL diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index d9a3787c..1d5a47f4 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -76,7 +76,7 @@

    $this->load->library('class_name', $config, 'ob $this->load->library('email'); -

    Once loaded, the library will be ready for use, using $this->email->some_function(). +

    Once loaded, the library will be ready for use, using $this->email->some_function().

    Library files can be stored in subdirectories within the main "libraries" folder, or within your personal application/libraries folder. To load a file located in a subdirectory, simply include the path, relative to the "libraries" folder. diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index ac53e880..2675fa75 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -91,7 +91,7 @@

    auto_typography()

    Parameters

    -

    There is one optional parameters that determines whether the parser should reduce more then two consecutive line breaks down to two. Use boolean TRUE or FALSE. +

    There is one optional parameters that determines whether the parser should reduce more then two consecutive line breaks down to two. Use boolean TRUE or FALSE.

    By default the parser does not reduce line breaks. In other words, if no parameters are submitted, it is the same as doing this:

    @@ -133,7 +133,7 @@

    nl2br_except_pre()

    protect_braced_quotes

    When using the Typography library in conjunction with the Template Parser library it can often be desirable to protect single - and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE. + and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE.

    Usage example:

    From bb6a687bc5aeafa20da8ef7422476e8307739694 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:49:14 -0400 Subject: [PATCH 1952/2544] minor capitalization --- user_guide/libraries/benchmark.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 79f7fedb..d0ba3294 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -83,7 +83,7 @@

    Table of Contents

    Using the Benchmark Class

    -

    The Benchmark class can be used within your controllers, views, or your Models. The process for usage is this:

    +

    The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:

    1. Mark a start point
    2. From c778e79cca825ea3a9d8399c7fb7a7aa4e3a3147 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 07:52:36 -0400 Subject: [PATCH 1953/2544] userguide links --- user_guide/doc_style/index.html | 1 + user_guide/libraries/benchmark.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index 753b9d42..22637d38 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -78,6 +78,7 @@

      Files

         ·   Top of Page   ·   User Guide Home   ·   +Next Topic:  Benchmarking Class

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index d0ba3294..05f7cc0e 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -185,7 +185,7 @@

      Displaying Memory Consumption

      From e01fd0fc3b694d12dc6b968727bd7f21f8c1a0fb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 Jul 2010 11:06:07 -0400 Subject: [PATCH 1958/2544] suppress page list --- system/libraries/Pagination.php | 37 ++++++++++++++++------------ user_guide/changelog.html | 2 +- user_guide/libraries/pagination.html | 9 +++++++ 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 68c35a57..3a0632d0 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -56,6 +56,7 @@ class CI_Pagination { var $num_tag_close = ''; var $page_query_string = FALSE; var $query_string_segment = 'per_page'; + var $display_pages = TRUE; var $anchor_class = ''; /** @@ -216,30 +217,34 @@ function create_links() } - // Write the digit links - for ($loop = $start -1; $loop <= $end; $loop++) + // Render the pages + if ($this->display_pages !== FALSE) { - $i = ($loop * $this->per_page) - $this->per_page; - - if ($i >= 0) + // Write the digit links + for ($loop = $start -1; $loop <= $end; $loop++) { - if ($this->cur_page == $loop) - { - $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page - } - else + $i = ($loop * $this->per_page) - $this->per_page; + + if ($i >= 0) { - $n = ($i == 0) ? '' : $i; - - if ($n == '' && $this->first_url != '') + if ($this->cur_page == $loop) { - $output .= $this->num_tag_open.'anchor_class.'href="'.$this->first_url.'">'.$loop.''.$this->num_tag_close; + $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page } else { - $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; + $n = ($i == 0) ? '' : $i; + + if ($n == '' && $this->first_url != '') + { + $output .= $this->num_tag_open.'anchor_class.'href="'.$this->first_url.'">'.$loop.''.$this->num_tag_close; + } + else + { + $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; - $output .= $this->num_tag_open.'anchor_class.'href="'.$this->base_url.$n.'">'.$loop.''.$this->num_tag_close; + $output .= $this->num_tag_open.'anchor_class.'href="'.$this->base_url.$n.'">'.$loop.''.$this->num_tag_close; + } } } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4f86c1e9..94eff05b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,7 +79,7 @@

      Version 2.0.0

    3. Libraries
      • Added $prefix, $suffix and $first_url properties to Pagination library.
      • -
      • Added the ability to suppress first, previous, next and last links by setting their values to FALSE in the Pagination library.
      • +
      • Added the ability to suppress first, previous, next, last, and page links by setting their values to FALSE in the Pagination library.
      • Added Security library, which now contains the xss_clean function, filename_security function and other security related functions.
      • Added CSRF (Cross-site Reference Forgery) protection to the Security library.
      • Added $parse_exec_vars property to Output library.
      • diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 33c87107..521b708b 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -197,6 +197,15 @@

        $config['num_tag_open'] = '<div>';

        $config['num_tag_close'] = '</div>';

        The closing tag for the "digit" link.

        +

        Hiding the Pages

        + +

        If you wanted to not list the specific pages (for example, you only want "next" and "previous" links), you can suppress their rendering by adding:

        + + +$config['display_pages'] = FALSE; + + +

        Adding a class to every anchor

        If you want to add a class attribute to every link rendered by the pagination class, you can set the config "anchor_class" equal to the classname you want.

        From f1a02f9784a8e4b4ee65705f6524d8c1bff20a80 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 8 Jul 2010 09:36:34 -0500 Subject: [PATCH 1959/2544] fixed a file location in an EOF comment --- application/config/doctypes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/doctypes.php b/application/config/doctypes.php index 9d510abc..f7e1d19a 100644 --- a/application/config/doctypes.php +++ b/application/config/doctypes.php @@ -12,4 +12,4 @@ ); /* End of file doctypes.php */ -/* Location: application/config/doctypes.php */ \ No newline at end of file +/* Location: ./application/config/doctypes.php */ \ No newline at end of file From 90295819cd17a7b18fadb69b5d146bace3f90182 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 12 Jul 2010 10:05:26 -0500 Subject: [PATCH 1960/2544] Removed tag v1.7.2 From e9d723fb2c13585fa8a502fde7dd83dc334874ff Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 12 Jul 2010 10:10:59 -0500 Subject: [PATCH 1961/2544] 201007 file upload bug fix --- system/libraries/Upload.php | 194 +++++++++++++---------- user_guide/libraries/file_uploading.html | 21 ++- 2 files changed, 118 insertions(+), 97 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 8bdb4be1..c94e4d44 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -26,31 +26,34 @@ */ class CI_Upload { - var $max_size = 0; - var $max_width = 0; - var $max_height = 0; - var $max_filename = 0; - var $allowed_types = ""; - var $file_temp = ""; - var $file_name = ""; - var $orig_name = ""; - var $file_type = ""; - var $file_size = ""; - var $file_ext = ""; - var $upload_path = ""; - var $overwrite = FALSE; - var $encrypt_name = FALSE; - var $is_image = FALSE; - var $image_width = ''; - var $image_height = ''; - var $image_type = ''; - var $image_size_str = ''; - var $error_msg = array(); - var $mimes = array(); - var $remove_spaces = TRUE; - var $xss_clean = FALSE; - var $temp_prefix = "temp_file_"; - + var $max_size = 0; + var $max_width = 0; + var $max_height = 0; + var $max_filename = 0; + var $allowed_types = ""; + var $file_temp = ""; + var $file_name = ""; + var $orig_name = ""; + var $file_type = ""; + var $file_size = ""; + var $file_ext = ""; + var $upload_path = ""; + var $overwrite = FALSE; + var $encrypt_name = FALSE; + var $is_image = FALSE; + var $image_width = ''; + var $image_height = ''; + var $image_type = ''; + var $image_size_str = ''; + var $error_msg = array(); + var $mimes = array(); + var $remove_spaces = TRUE; + var $xss_clean = FALSE; + var $temp_prefix = "temp_file_"; + var $client_name = ''; + + var $_file_name_override = ''; //@PHP4 (should be private) + /** * Constructor * @@ -75,6 +78,7 @@ function CI_Upload($props = array()) * @param array * @return void */ + function initialize($config = array()) { $defaults = array( @@ -101,7 +105,8 @@ function initialize($config = array()) 'mimes' => array(), 'remove_spaces' => TRUE, 'xss_clean' => FALSE, - 'temp_prefix' => "temp_file_" + 'temp_prefix' => "temp_file_", + 'client_name' => '' ); @@ -124,6 +129,10 @@ function initialize($config = array()) $this->$key = $val; } } + + // if a file_name was provided in the config, use it instead of the user input + // supplied file name for all uploads until initialized again + $this->_file_name_override = $this->file_name; } // -------------------------------------------------------------------- @@ -185,20 +194,16 @@ function do_upload($field = 'userfile') return FALSE; } + // Set the uploaded data as class variables $this->file_temp = $_FILES[$field]['tmp_name']; - $this->file_name = $this->_prep_filename($_FILES[$field]['name']); - $this->file_size = $_FILES[$field]['size']; + $this->file_size = $_FILES[$field]['size']; $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); $this->file_type = strtolower(trim(stripslashes($this->file_type), '"')); - $this->file_ext = $this->get_extension($_FILES[$field]['name']); + $this->file_name = $this->_prep_filename($_FILES[$field]['name']); + $this->file_ext = $this->get_extension($this->file_name); + $this->client_name = $this->file_name; - // Convert the file size to kilobytes - if ($this->file_size > 0) - { - $this->file_size = round($this->file_size/1024, 2); - } - // Is the file type allowed to be uploaded? if ( ! $this->is_allowed_filetype()) { @@ -206,6 +211,25 @@ function do_upload($field = 'userfile') return FALSE; } + // if we're overriding, let's now make sure the new name and type is allowed + if ($this->_file_name_override != '') + { + $this->file_name = $this->_prep_filename($this->_file_name_override); + $this->file_ext = $this->get_extension($this->file_name); + + if ( ! $this->is_allowed_filetype(TRUE)) + { + $this->set_error('upload_invalid_filetype'); + return FALSE; + } + } + + // Convert the file size to kilobytes + if ($this->file_size > 0) + { + $this->file_size = round($this->file_size/1024, 2); + } + // Is the file size within the allowed maximum? if ( ! $this->is_allowed_filesize()) { @@ -254,6 +278,21 @@ function do_upload($field = 'userfile') } } + /* + * Run the file through the XSS hacking filter + * This helps prevent malicious code from being + * embedded within a file. Scripts can easily + * be disguised as images or other file types. + */ + if ($this->xss_clean) + { + if ($this->do_xss_clean() === FALSE) + { + $this->set_error('upload_unable_to_write_file'); + return FALSE; + } + } + /* * Move the file to the final destination * To deal with different server configurations @@ -269,21 +308,6 @@ function do_upload($field = 'userfile') return FALSE; } } - - /* - * Run the file through the XSS hacking filter - * This helps prevent malicious code from being - * embedded within a file. Scripts can easily - * be disguised as images or other file types. - */ - if ($this->xss_clean) - { - if ($this->do_xss_clean() === FALSE) - { - $this->set_error('upload_unable_to_write_file'); - return FALSE; - } - } /* * Set the finalized image dimensions @@ -316,6 +340,7 @@ function data() 'full_path' => $this->upload_path.$this->file_name, 'raw_name' => str_replace($this->file_ext, '', $this->file_name), 'orig_name' => $this->orig_name, + 'client_name' => $this->client_name, 'file_ext' => $this->file_ext, 'file_size' => $this->file_size, 'is_image' => $this->is_image(), @@ -558,7 +583,7 @@ function is_image() * @access public * @return bool */ - function is_allowed_filetype() + function is_allowed_filetype($ignore_mime = FALSE) { if ($this->allowed_types == '*') { @@ -570,36 +595,42 @@ function is_allowed_filetype() $this->set_error('upload_no_file_types'); return FALSE; } + + $ext = strtolower(ltrim($this->file_ext, '.')); + + if ( ! in_array($ext, $this->allowed_types)) + { + return FALSE; + } + // Images get some additional checks $image_types = array('gif', 'jpg', 'jpeg', 'png', 'jpe'); - - foreach ($this->allowed_types as $val) + + if (in_array($ext, $image_types)) { - $mime = $this->mimes_types(strtolower($val)); - - // Images get some additional checks - if ($this->file_ext == '.'.$val && in_array($val, $image_types)) + if (getimagesize($this->file_temp) === FALSE) { - if (getimagesize($this->file_temp) === FALSE) - { - return FALSE; - } - } - - if (is_array($mime)) - { - if (in_array($this->file_type, $mime, TRUE)) - { - return TRUE; - } - } - else + return FALSE; + } + } + + if ($ignore_mime === TRUE) + { + return TRUE; + } + + $mime = $this->mimes_types($ext); + + if (is_array($mime)) + { + if (in_array($this->file_type, $mime, TRUE)) { - if ($mime == $this->file_type) - { - return TRUE; - } - } + return TRUE; + } + } + elseif ($mime == $this->file_type) + { + return TRUE; } return FALSE; @@ -801,7 +832,7 @@ function limit_filename_length($filename, $length) */ function do_xss_clean() { - $file = $this->upload_path.$this->file_name; + $file = $this->file_temp; if (filesize($file) == 0) { @@ -968,7 +999,7 @@ function _prep_filename($filename) foreach ($parts as $part) { - if ($this->mimes_types(strtolower($part)) === FALSE) + if ( ! in_array(strtolower($part), $this->allowed_types) OR $this->mimes_types(strtolower($part)) === FALSE) { $filename .= '.'.$part.'_'; } @@ -978,13 +1009,6 @@ function _prep_filename($filename) } } - // file name override, since the exact name is provided, no need to - // run it through a $this->mimes check. - if ($this->file_name != '') - { - $filename = $this->file_name; - } - $filename .= '.'.$ext; return $filename; diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 061d5562..28cf8de3 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.0

        CodeIgniter User Guide Version 1.7.2

        @@ -74,7 +74,7 @@

        The Process

      • Once uploaded, the user will be shown a success message.
      -

      To demonstrate this process here is a brief tutorial. Afterward you'll find reference information.

      +

      To demonstrate this process here is brief tutorial. Afterward you'll find reference information.

      Creating the Upload Form

      @@ -255,7 +255,7 @@

      Preferences

      allowed_types None None -The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. If '*' is used, all file types will be allowed. +The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe. @@ -264,8 +264,7 @@

      Preferences

      None Desired file name -

      If set CodeIgniter will rename the uploaded file to this name.

      -

      Note:The filename should not include a file extension.

      +

      If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.

      @@ -318,12 +317,6 @@

      Preferences

      TRUE/FALSE (boolean) If set to TRUE, any spaces in the file name will be converted to underscores. This is recommended. - -xss_clean -FALSE -TRUE/FALSE (boolean) -If set to TRUE, the files will be tested for XSS vulnerabilities. - @@ -377,6 +370,7 @@

      $this->upload->data()

          [full_path]    => /path/to/your/upload/jpg.jpg
          [raw_name]     => mypic
          [orig_name]    => mypic.jpg
      +    [client_name]  => mypic.jpg
          [file_ext]     => .jpg
          [file_size]    => 22.2
          [is_image]     => 1
      @@ -411,6 +405,9 @@

      Explanation

      orig_name The original file name. This is only useful if you use the encrypted name option. +client_name +The file name as supplied by the client user agent, prior to any file name preparation or incrementing. + file_ext The file extension with period @@ -447,7 +444,7 @@

      Explanation

      User Guide Home   ·   Next Topic:  Form Validation Class

      -

      CodeIgniter  ·  Copyright © 2006-2010  ·  EllisLab, Inc.

      +

      CodeIgniter  ·  Copyright © 2006-2010  ·  Ellislab, Inc.

      From 9a42f58bdafb4f1558ad25f81c66c03ca4d6e9d9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 13 Jul 2010 09:41:11 -0400 Subject: [PATCH 1962/2544] example fix --- user_guide/libraries/sessions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 58f2148c..78049d22 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -216,7 +216,7 @@

      Saving Session Data to a Database

      Make sure you've specified the table name in your config file as well:

      -$config['sess_table_name'] = 'ci_sessions"; +$config['sess_table_name'] = 'ci_sessions';

      Note: The Session class has built-in garbage collection which clears out expired sessions so you do not need to write your own routine to do it.

      From 32cada7d98174673deadb0ad52d56f4b627d6c34 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 16 Jul 2010 08:53:04 -0400 Subject: [PATCH 1963/2544] example fix --- user_guide/libraries/sessions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 78049d22..9a2ca939 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -202,7 +202,7 @@

      Saving Session Data to a Database

      ip_address varchar(16) DEFAULT '0' NOT NULL, user_agent varchar(50) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, -user_data text NOT NULL, +user_data text DEFAULT '' NOT NULL, PRIMARY KEY (session_id) ); From ce3129d277d2235f0584a937114d0e636349ee9c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 16 Jul 2010 10:01:48 -0500 Subject: [PATCH 1964/2544] Removing validation_lang.php file that was missed when removing the Validation library. --- system/language/english/validation_lang.php | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 system/language/english/validation_lang.php diff --git a/system/language/english/validation_lang.php b/system/language/english/validation_lang.php deleted file mode 100644 index 345341fe..00000000 --- a/system/language/english/validation_lang.php +++ /dev/null @@ -1,21 +0,0 @@ - Date: Thu, 22 Jul 2010 11:04:58 -0500 Subject: [PATCH 1965/2544] Fixed a bug in the Upload class where a PHP error could occur when wildcards were used as the allowed_types. --- system/libraries/Upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index c94e4d44..c18c178d 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -988,7 +988,7 @@ function mimes_types($mime) */ function _prep_filename($filename) { - if (strpos($filename, '.') === FALSE) + if (strpos($filename, '.') === FALSE OR $this->allowed_types == '*') { return $filename; } @@ -1020,4 +1020,4 @@ function _prep_filename($filename) // END Upload Class /* End of file Upload.php */ -/* Location: ./system/libraries/Upload.php */ \ No newline at end of file +/* Location: ./system/libraries/Upload.php */ From 958543a38c2c97b0ec4c10fc9faf4f0753143880 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 22 Jul 2010 14:10:26 -0400 Subject: [PATCH 1966/2544] Adding CSRF into config Adding CSRF token into form open() --- application/config/config.php | 11 +++++++++++ system/helpers/form_helper.php | 6 ++++++ system/libraries/Security.php | 16 +++++++++++----- user_guide/changelog.html | 1 + 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index bd1429a4..6e52bcc1 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -265,6 +265,17 @@ */ $config['global_xss_filtering'] = FALSE; +/* +|-------------------------------------------------------------------------- +| Cross Site Forgery Request +|-------------------------------------------------------------------------- +| Enables a CSFR cookie token to be set. When set to TRUE, token will be +| checked on a submitted form. If you are accepting user data, it is strongly +| recommended CSRF protection be enabled. +*/ +$config['csrf_protection'] = FALSE; + + /* |-------------------------------------------------------------------------- | Output Compression diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 5feb3ce6..632f9450 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -62,6 +62,12 @@ function form_open($action = '', $attributes = '', $hidden = array()) $form .= form_hidden($hidden); } + // CSRF + if ($CI->config->item('csrf_protection') === TRUE) + { + $form .= form_hidden($CI->security->csrf_token_name, $CI->security->csrf_hash); + } + return $form; } } diff --git a/system/libraries/Security.php b/system/libraries/Security.php index cdae5016..c8d43504 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -54,7 +54,7 @@ function CI_Security() { // Set the CSRF hash $this->_csrf_set_hash(); - + log_message('debug', "Security Class Initialized"); } @@ -67,21 +67,24 @@ function CI_Security() * @return null */ function csrf_verify() - { + { // If no POST data exists we will set the CSRF cookie if (count($_POST) == 0) { return $this->csrf_set_cookie(); } + // Append application specific cookie prefix to token name + $csrf_token_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; + // Do the tokens exist in both the _POST and _COOKIE arrays? - if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csrf_token_name])) + if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$csrf_token_name])) { $this->csrf_show_error(); } // Do the tokens match? - if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csrf_token_name]) + if ($_POST[$this->csrf_token_name] != $_COOKIE[$csrf_token_name]) { $this->csrf_show_error(); } @@ -134,7 +137,10 @@ function _csrf_set_hash() $this->csrf_hash = md5(uniqid(rand(), TRUE)); } } - + + // Create the cookie before we finish up + $this->csrf_set_cookie(); + return $this->csrf_hash; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 94eff05b..fb39d606 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -126,6 +126,7 @@

      Version 2.0.0

    4. Modified get_file_info in the file helper, changing filectime() to filemtime() for dates.
    5. Modified smiley_js() to add optional third parameter to return only the javascript with no script tags.
    6. The img() function of the HTML helper will now generate an empty string as an alt attribute if one is not provided.
    7. +
    8. If CSRF is enabled in the application config file, form_open() will automatically insert it as a hidden field.
    9. Other Changes From 4433f424d7a0dd7e5863ddd5393c13be377ed6ce Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 23 Jul 2010 08:47:34 -0400 Subject: [PATCH 1967/2544] adding sanitize_filename() into the security helper --- system/helpers/security_helper.php | 18 ++++++++++++++++++ user_guide/changelog.html | 1 + user_guide/helpers/security_helper.html | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 654cfd10..63f0e9cd 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -44,6 +44,24 @@ function xss_clean($str, $is_image = FALSE) } } +// ------------------------------------------------------------------------ + +/** + * Sanitize Filename + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('sanitize_filename')) +{ + function sanitize_filename($filename) + { + $CI =& get_instance(); + return $CI->security->sanitize_filename($filename); + } +} + // -------------------------------------------------------------------- /** diff --git a/user_guide/changelog.html b/user_guide/changelog.html index fb39d606..714e9e86 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -127,6 +127,7 @@

      Version 2.0.0

    10. Modified smiley_js() to add optional third parameter to return only the javascript with no script tags.
    11. The img() function of the HTML helper will now generate an empty string as an alt attribute if one is not provided.
    12. If CSRF is enabled in the application config file, form_open() will automatically insert it as a hidden field.
    13. +
    14. Added sanitize_filename() into the Security helper.
    15. Other Changes diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 97be674a..f74a7766 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -75,6 +75,12 @@

      xss_clean()

      Input class. More info can be found there.

      +

      sanitize_filename()

      + +

      Provides protection against directory traversal. This function is an alias to the one in the +Security class. More info can be found there.

      + +

      do_hash()

      Permits you to create SHA1 or MD5 one way hashes suitable for encrypting passwords. Will create SHA1 by default. Examples:

      From b3f10a23e4eb51f9236af0647eee4607776fee23 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 25 Jul 2010 19:11:26 -0500 Subject: [PATCH 1968/2544] separated the CSRF cookie name from the token, forced new token on successful POST --- system/libraries/Security.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/system/libraries/Security.php b/system/libraries/Security.php index c8d43504..29ac2612 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -29,7 +29,8 @@ class CI_Security { var $csrf_hash = ''; var $csrf_expire = 7200; // Two hours (in seconds) var $csrf_token_name = 'ci_csrf_token'; - + var $csfr_cookie_name = 'ci_csrf_token'; + /* never allowed, string replacement */ var $never_allowed_str = array( 'document.cookie' => '[removed]', @@ -52,6 +53,9 @@ class CI_Security { function CI_Security() { + // Append application specific cookie prefix to token name + $this->csfr_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; + // Set the CSRF hash $this->_csrf_set_hash(); @@ -74,23 +78,25 @@ function csrf_verify() return $this->csrf_set_cookie(); } - // Append application specific cookie prefix to token name - $csrf_token_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; - // Do the tokens exist in both the _POST and _COOKIE arrays? - if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$csrf_token_name])) + if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csfr_cookie_name])) { $this->csrf_show_error(); } // Do the tokens match? - if ($_POST[$this->csrf_token_name] != $_COOKIE[$csrf_token_name]) + if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csfr_cookie_name]) { $this->csrf_show_error(); } // We kill this since we're done and we don't want to polute the _POST array unset($_POST[$this->csrf_token_name]); + + // Nothing should last forever + unset($_COOKIE[$this->csfr_cookie_name]); + $this->_csrf_set_hash(); + $this->csrf_set_cookie(); log_message('debug', "CSRF token verified "); } @@ -105,11 +111,9 @@ function csrf_verify() */ function csrf_set_cookie() { - $prefix = ( ! is_string(config_item('cookie_prefix'))) ? '' : config_item('cookie_prefix'); - $expire = time() + $this->csrf_expire; - setcookie($prefix.$this->csrf_token_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); + setcookie($this->csfr_cookie_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); log_message('debug', "CRSF cookie Set"); } @@ -128,9 +132,9 @@ function _csrf_set_hash() { // If the cookie exists we will use it's value. We don't necessarily want to regenerate it with // each page load since a page could contain embedded sub-pages causing this feature to fail - if (isset($_COOKIE[$this->csrf_token_name]) AND $_COOKIE[$this->csrf_token_name] != '') + if (isset($_COOKIE[$this->csfr_cookie_name]) AND $_COOKIE[$this->csfr_cookie_name] != '') { - $this->csrf_hash = $_COOKIE[$this->csrf_token_name]; + $this->csrf_hash = $_COOKIE[$this->csfr_cookie_name]; } else { @@ -138,9 +142,6 @@ function _csrf_set_hash() } } - // Create the cookie before we finish up - $this->csrf_set_cookie(); - return $this->csrf_hash; } From 6dba102f71958f1a39f63fd0cc4885327354f752 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 25 Jul 2010 23:24:26 -0400 Subject: [PATCH 1969/2544] guide typo --- user_guide/libraries/file_uploading.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 28cf8de3..31041341 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -420,7 +420,7 @@

      Explanation

      image_width Image width. -image_heigth +image_height Image height image_type From 2ddc9496e9403a59a87b644d1c2b9a106b773e46 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 5 Aug 2010 10:08:33 -0400 Subject: [PATCH 1970/2544] Added an optional second parameter to show_404() to disable logging. --- system/core/Common.php | 4 ++-- system/core/Exceptions.php | 9 +++++++-- user_guide/changelog.html | 1 + user_guide/general/errors.html | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index 9dee591e..2b8ad26b 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -317,10 +317,10 @@ function show_error($message, $status_code = 500, $heading = 'An Error Was Encou * @access public * @return void */ - function show_404($page = '') + function show_404($page = '', $log_error = TRUE) { $_error =& load_class('Exceptions', 'core'); - $_error->show_404($page); + $_error->show_404($page, $log_error); exit; } diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 503015df..419ea2b6 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -88,12 +88,17 @@ function log_exception($severity, $message, $filepath, $line) * @param string * @return string */ - function show_404($page = '') + function show_404($page = '', $log_error = TRUE) { $heading = "404 Page Not Found"; $message = "The page you requested was not found."; - log_message('error', '404 Page Not Found --> '.$page); + // By default we log this, but allow a dev to skip it + if ($log_error) + { + log_message('error', '404 Page Not Found --> '.$page); + } + echo $this->show_error($heading, $message, 'error_404', 404); exit; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 714e9e86..ce017c9f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -132,6 +132,7 @@

      Version 2.0.0

    16. Other Changes
        +
      • Added an optional second parameter to show_404() to disable logging.
      • Updated loader to automatically apply the sub-class prefix as an option when loading classes. Class names can be prefixed with the standard "CI_" or the same prefix as the subclass prefix, or no prefix at all.
      • Increased randomness with is_really_writable() to avoid file collisions when hundreds or thousands of requests occur at once.
      • Switched some DIR_WRITE_MODE constant uses to FILE_WRITE_MODE where files and not directories are being operated on.
      • diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index 7c585d1b..5bd5011a 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -76,13 +76,15 @@

        show_error('message' [, int $status_code= 500 ] )

        application/errors/error_general.php

        The optional parameter $status_code determines what HTTP status code should be sent with the error.

        -

        show_404('page')

        +

        show_404('page' [, 'log_error'])

        This function will display the 404 error message supplied to it using the following error template:

        application/errors/error_404.php

        The function expects the string passed to it to be the file path to the page that isn't found. Note that CodeIgniter automatically shows 404 messages if controllers are not found.

        +

        CodeIgniter automatically logs any show_404() calls. Setting the optional second parameter to FALSE will skip logging.

        +

        log_message('level', 'message')

        From cbe3247819be75c34231ea200874044735bd853b Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 5 Aug 2010 14:09:20 -0500 Subject: [PATCH 1971/2544] Adding an ellipsize function to the text helper, and associated documentation to the user guide. --- system/helpers/text_helper.php | 42 +++++++++++++++++++++++++++++ user_guide/changelog.html | 1 + user_guide/helpers/text_helper.html | 12 +++++++++ 3 files changed, 55 insertions(+) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 47726021..b7ade7a8 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -495,6 +495,48 @@ function word_wrap($str, $charlim = '76') } } +// ------------------------------------------------------------------------ + +if ( ! function_exists('ellipsize')) +{ + /** + * Ellipsize String + * + * This function will strip tags from a string, split it at its max_length and ellipsize + * + * @param string string to ellipsize + * @param integer max length of string + * @param mixed int (1|0) or float, .5, .2, etc for position to split + * @param string ellipsis ; Default '...' + * @return string ellipsized string + */ + function ellipsize($str, $max_length, $position = 1, $ellipsis = '…') + { + // Strip tags + $str = trim(strip_tags($str)); + + // Is the string long enough to ellipsize? + if (strlen($str) <= $max_length) + { + return $str; + } + + $beg = substr($str, 0, floor($max_length * $position)); + + $position = ($position > 1) ? 1 : $position; + + if ($position === 1) + { + $end = substr($str, 0, -($max_length - strlen($beg))); + } + else + { + $end = substr($str, -($max_length - strlen($beg))); + } + + return $beg.$ellipsis.$end; + } +} /* End of file text_helper.php */ /* Location: ./system/helpers/text_helper.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ce017c9f..f32ee58b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -128,6 +128,7 @@

        Version 2.0.0

      • The img() function of the HTML helper will now generate an empty string as an alt attribute if one is not provided.
      • If CSRF is enabled in the application config file, form_open() will automatically insert it as a hidden field.
      • Added sanitize_filename() into the Security helper.
      • +
      • Added ellipsize() to the Text Helper
    17. Other Changes diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index d477f53a..438eaec4 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -177,7 +177,19 @@

      word_wrap()

      us demonstrate this
      function
      +

      ellipsize()

      +

      This function will strip tags from a string, split it at a defined maximum length, and insert an ellipsis.

      +

      The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.

      +

      An optional forth parameter is the kind of ellipsis. By default, &hellip; will be inserted.

      + +$str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';
      +
      +echo ellipsize($str, 32, .5);
      + +Produces: + +this_string_is_e…ak_my_design.jpg From 0f6b7c1ce0f0122ba162dc579a34a73438d4955a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 5 Aug 2010 14:11:14 -0500 Subject: [PATCH 1972/2544] moving code comment in text helper --- system/helpers/text_helper.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index b7ade7a8..b85e2aae 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -497,19 +497,19 @@ function word_wrap($str, $charlim = '76') // ------------------------------------------------------------------------ +/** + * Ellipsize String + * + * This function will strip tags from a string, split it at its max_length and ellipsize + * + * @param string string to ellipsize + * @param integer max length of string + * @param mixed int (1|0) or float, .5, .2, etc for position to split + * @param string ellipsis ; Default '...' + * @return string ellipsized string + */ if ( ! function_exists('ellipsize')) { - /** - * Ellipsize String - * - * This function will strip tags from a string, split it at its max_length and ellipsize - * - * @param string string to ellipsize - * @param integer max length of string - * @param mixed int (1|0) or float, .5, .2, etc for position to split - * @param string ellipsis ; Default '...' - * @return string ellipsized string - */ function ellipsize($str, $max_length, $position = 1, $ellipsis = '…') { // Strip tags From 88f8d9f4c9d590cc14e71cd77f34e5e2abe57e21 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 6 Aug 2010 13:01:38 -0500 Subject: [PATCH 1973/2544] Removing the following deprecated database methods: orwhere, orlike, groupby, orhaving, orderby, getwhere. --- system/database/DB_active_rec.php | 74 +------------------------- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 10 ++-- 3 files changed, 7 insertions(+), 78 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 3e9923e6..953cc954 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -398,18 +398,6 @@ function or_where($key, $value = NULL, $escape = TRUE) // -------------------------------------------------------------------- - /** - * orwhere() is an alias of or_where() - * this function is here for backwards compatibility, as - * orwhere() has been deprecated - */ - function orwhere($key, $value = NULL, $escape = TRUE) - { - return $this->or_where($key, $value, $escape); - } - - // -------------------------------------------------------------------- - /** * Where * @@ -671,18 +659,6 @@ function or_not_like($field, $match = '', $side = 'both') // -------------------------------------------------------------------- - /** - * orlike() is an alias of or_like() - * this function is here for backwards compatibility, as - * orlike() has been deprecated - */ - function orlike($field, $match = '', $side = 'both') - { - return $this->or_like($field, $match, $side); - } - - // -------------------------------------------------------------------- - /** * Like * @@ -775,18 +751,6 @@ function group_by($by) // -------------------------------------------------------------------- - /** - * groupby() is an alias of group_by() - * this function is here for backwards compatibility, as - * groupby() has been deprecated - */ - function groupby($by) - { - return $this->group_by($by); - } - - // -------------------------------------------------------------------- - /** * Sets the HAVING value * @@ -801,19 +765,7 @@ function having($key, $value = '', $escape = TRUE) { return $this->_having($key, $value, 'AND ', $escape); } - - // -------------------------------------------------------------------- - - /** - * orhaving() is an alias of or_having() - * this function is here for backwards compatibility, as - * orhaving() has been deprecated - */ - - function orhaving($key, $value = '', $escape = TRUE) - { - return $this->or_having($key, $value, $escape); - } + // -------------------------------------------------------------------- /** @@ -938,18 +890,6 @@ function order_by($orderby, $direction = '') // -------------------------------------------------------------------- - /** - * orderby() is an alias of order_by() - * this function is here for backwards compatibility, as - * orderby() has been deprecated - */ - function orderby($orderby, $direction = '') - { - return $this->order_by($orderby, $direction); - } - - // -------------------------------------------------------------------- - /** * Sets the LIMIT value * @@ -1125,18 +1065,6 @@ function get_where($table = '', $where = null, $limit = null, $offset = null) // -------------------------------------------------------------------- - /** - * getwhere() is an alias of get_where() - * this function is here for backwards compatibility, as - * getwhere() has been deprecated - */ - function getwhere($table = '', $where = null, $limit = null, $offset = null) - { - return $this->get_where($table, $where, $limit, $offset); - } - - // -------------------------------------------------------------------- - /** * Insert_Batch * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f32ee58b..7e86ba4e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -109,6 +109,7 @@

      Version 2.0.0

    18. Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.
    19. Fixed a bug where driver specific table identifier protection could lead to malformed queries in the field_data() functions.
    20. Fixed a bug where an undefined class variable was referenced in database drivers.
    21. +
    22. Removed the following deprecated functions: orwhere, orlike, groupby, orhaving, orderby, getwhere.
    23. Helpers diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 2c12d628..482115cc 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -116,7 +116,7 @@

      $this->db->get_where();

      $query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset);

      Please read the about the where function below for more information.

      -

      Note: get_where() was formerly known as getwhere(), which has been deprecated

      +

      Note: get_where() was formerly known as getwhere(), which has been removed

      $this->db->select();

      Permits you to write the SELECT portion of your query:

      @@ -274,7 +274,7 @@

      $this->db->or_where();



      // Produces: WHERE name != 'Joe' OR id > 50 -

      Note: or_where() was formerly known as orwhere(), which has been deprecated.

      +

      Note: or_where() was formerly known as orwhere(), which has been removed.

      $this->db->where_in();

      @@ -356,7 +356,7 @@

      $this->db->or_like();

      -

      Note: or_like() was formerly known as orlike(), which has been deprecated.

      +

      Note: or_like() was formerly known as orlike(), which has been removed.

      $this->db->not_like();

      This function is identical to like(), except that it generates NOT LIKE statements:

      $this->db->not_like('title', 'match');
      @@ -381,7 +381,7 @@

      $this->db->group_by();



      // Produces: GROUP BY title, date
      -

      Note: group_by() was formerly known as groupby(), which has been deprecated.

      +

      Note: group_by() was formerly known as groupby(), which has been removed.

      $this->db->distinct();

      @@ -439,7 +439,7 @@

      $this->db->order_by();


      // Produces: ORDER BY title DESC, name ASC

      -

      Note: order_by() was formerly known as orderby(), which has been deprecated.

      +

      Note: order_by() was formerly known as orderby(), which has been removed.

      Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.

      $this->db->limit();

      Lets you limit the number of rows you would like returned by the query:

      From c5b044b739234c1e1635d4a4647b3440c44f4fa3 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 6 Aug 2010 13:06:32 -0500 Subject: [PATCH 1974/2544] Removed deprecated _drop_database() and _create_database() functions from db utility drivers. --- .../database/drivers/mssql/mssql_utility.php | 35 --------------- .../database/drivers/mysql/mysql_utility.php | 35 --------------- .../drivers/mysqli/mysqli_utility.php | 36 --------------- system/database/drivers/oci8/oci8_utility.php | 35 --------------- system/database/drivers/odbc/odbc_utility.php | 45 ------------------- .../drivers/postgre/postgre_utility.php | 36 --------------- .../drivers/sqlite/sqlite_utility.php | 45 ------------------- user_guide/changelog.html | 1 + 8 files changed, 1 insertion(+), 267 deletions(-) diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index da887b81..751be146 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -82,42 +82,7 @@ function _backup($params = array()) return $this->db->display_error('db_unsuported_feature'); } - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - } - /* End of file mssql_utility.php */ /* Location: ./system/database/drivers/mssql/mssql_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 3277b0ff..c4a970cf 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -204,41 +204,6 @@ function _backup($params = array()) return $output; } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - } /* End of file mysql_utility.php */ diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 44fd0f7a..3ba14d25 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -81,42 +81,6 @@ function _backup($params = array()) // Currently unsupported return $this->db->display_error('db_unsuported_feature'); } - - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - } /* End of file mysqli_utility.php */ diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 74670eaa..cc179353 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -81,41 +81,6 @@ function _backup($params = array()) // Currently unsupported return $this->db->display_error('db_unsuported_feature'); } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return FALSE; - } - } /* End of file oci8_utility.php */ diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index 4e6848e8..5b874d88 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -96,52 +96,7 @@ function _backup($params = array()) // Currently unsupported return $this->db->display_error('db_unsuported_feature'); } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database() - { - // ODBC has no "create database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - // ODBC has no "drop database" command since it's - // designed to connect to an existing database - if ($this->db->db_debug) - { - return $this->db->display_error('db_unsuported_feature'); - } - return FALSE; - } } /* End of file odbc_utility.php */ diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index dda22ddb..84b089af 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -81,42 +81,6 @@ function _backup($params = array()) // Currently unsupported return $this->db->display_error('db_unsuported_feature'); } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - - } diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index fe63362e..956d2130 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -90,51 +90,6 @@ function _backup($params = array()) // Currently unsupported return $this->db->display_error('db_unsuported_feature'); } - - /** - * - * The functions below have been deprecated as of 1.6, and are only here for backwards - * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation - * is STRONGLY discouraged in favour if using dbforge. - * - */ - - /** - * Create database - * - * @access public - * @param string the database name - * @return bool - */ - function _create_database() - { - // In SQLite, a database is created when you connect to the database. - // We'll return TRUE so that an error isn't generated - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) - { - if ($this->db->db_debug) - { - return $this->db->display_error('db_unable_to_drop'); - } - return FALSE; - } - return TRUE; - } - } /* End of file sqlite_utility.php */ diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7e86ba4e..171392f4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -110,6 +110,7 @@

      Version 2.0.0

    24. Fixed a bug where driver specific table identifier protection could lead to malformed queries in the field_data() functions.
    25. Fixed a bug where an undefined class variable was referenced in database drivers.
    26. Removed the following deprecated functions: orwhere, orlike, groupby, orhaving, orderby, getwhere.
    27. +
    28. Removed deprecated _drop_database() and _create_database() functions from the db utility drivers.
    29. Helpers From 4062d48ca89736c952e9be17bb395d36140f4668 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 10 Aug 2010 20:30:34 -0500 Subject: [PATCH 1975/2544] removed redundant upload lang file, after lang name changs, it was blocking the CI lang file from loading. Fixes #473 --- system/libraries/Upload.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index c18c178d..0aa6d4c2 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -937,9 +937,12 @@ function set_error($msg) */ function display_errors($open = '

      ', $close = '

      ') { + $CI =& get_instance(); + $CI->lang->load('upload'); $str = ''; foreach ($this->error_msg as $val) { + $str .= '
      '.print_r($CI->lang->line($msg), TRUE).'
      '; $str .= $open.$val.$close; } From 23b7776accc6ebfa377c9b54bd04baaaf0c00132 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 10 Aug 2010 20:38:43 -0500 Subject: [PATCH 1976/2544] undoing mistaken changes in rev 8c54b3b0402f --- system/libraries/Upload.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 0aa6d4c2..c18c178d 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -937,12 +937,9 @@ function set_error($msg) */ function display_errors($open = '

      ', $close = '

      ') { - $CI =& get_instance(); - $CI->lang->load('upload'); $str = ''; foreach ($this->error_msg as $val) { - $str .= '
      '.print_r($CI->lang->line($msg), TRUE).'
      '; $str .= $open.$val.$close; } From b76fedd3b07549b926b18148793c8f50373942bb Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 12 Aug 2010 16:14:10 -0400 Subject: [PATCH 1977/2544] single quotes instead of double quotes by default to prevent PHP from trying to parse a $ in a password as a variable. --- application/config/database.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/config/database.php b/application/config/database.php index a3226b18..24d611ac 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -5,7 +5,7 @@ | ------------------------------------------------------------------- | This file will contain the settings needed to access your database. | -| For complete instructions please consult the "Database Connection" +| For complete instructions please consult the 'Database Connection' | page of the User Guide. | | ------------------------------------------------------------------- @@ -28,32 +28,32 @@ | ['dbcollat'] The character collation used in communicating with the database | ['swap_pre'] A default table prefix that should be swapped with the dbprefix | ['autoinit'] Whether or not to automatically initialize the database. -| ['stricton'] TRUE/FALSE - forces "Strict Mode" connections +| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections | - good for ensuring strict SQL while developing | | The $active_group variable lets you choose which connection group to -| make active. By default there is only one group (the "default" group). +| make active. By default there is only one group (the 'default' group). | | The $active_record variables lets you determine whether or not to load | the active record class */ -$active_group = "default"; +$active_group = 'default'; $active_record = TRUE; -$db['default']['hostname'] = "localhost"; -$db['default']['username'] = ""; -$db['default']['password'] = ""; -$db['default']['database'] = ""; -$db['default']['dbdriver'] = "mysql"; -$db['default']['dbprefix'] = ""; +$db['default']['hostname'] = 'localhost'; +$db['default']['username'] = ''; +$db['default']['password'] = ''; +$db['default']['database'] = ''; +$db['default']['dbdriver'] = 'mysql'; +$db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; -$db['default']['cachedir'] = ""; -$db['default']['char_set'] = "utf8"; -$db['default']['dbcollat'] = "utf8_general_ci"; -$db['default']['swap_pre'] = ""; +$db['default']['cachedir'] = ''; +$db['default']['char_set'] = 'utf8'; +$db['default']['dbcollat'] = 'utf8_general_ci'; +$db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; From d8153f502f2e553e6169b6245c36d26b7a2d027a Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 16 Aug 2010 08:57:45 -0400 Subject: [PATCH 1978/2544] guide typo --- user_guide/libraries/cart.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 4d458f57..0dcf04ac 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -68,7 +68,7 @@

      Initializing the Shopping Cart Class

      Important: The Cart class utilizes CodeIgniter's Session Class to save the cart information to a database, so before using the Cart class you must set up a database table -as indicated in the Session Documentation , and set the session preferences in your appliction/config/config.php file to utilize a database.

      +as indicated in the Session Documentation , and set the session preferences in your application/config/config.php file to utilize a database.

      To initialize the Shopping Cart Class in your controller constructor, use the $this->load->library function:

      From 5eb964f7bcda04c13cc484cfdef7138e887a75f3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 19 Aug 2010 09:31:52 -0400 Subject: [PATCH 1979/2544] Adding CAPTCHA helper to toc --- user_guide/nav/nav.js | 28 +++++++++++++--------------- user_guide/toc.html | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index 909a0dd9..bad23d20 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -7,9 +7,9 @@ function create_menu(basepath) '' + '' + + '' + '

      Basic Info

      ' + '' + - + '' + + '

      Installation

      ' + '' + - + '

      Introduction

      ' + '' + + '' + - '' + '

      General Topics

      ' + @@ -65,10 +64,9 @@ function create_menu(basepath) '
    30. PHP Style Guide
    31. ' + '
    32. Writing Documentation
    33. ' + '' + - + '' + - '

      Class Reference

      ' + '' + '

      Additional Resources

      ' + '' + - + '' + + ''); } \ No newline at end of file diff --git a/user_guide/toc.html b/user_guide/toc.html index f7fd5e0a..db9e9a82 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -121,7 +121,6 @@

      General Topics

      -

      Class Reference

      • Benchmarking Class
      • @@ -160,6 +159,7 @@

        Class Reference

        Helper Reference

        • Array Helper
        • +
        • CAPTCHA Helper
        • Compatibility Helper
        • Cookie Helper
        • Date Helper
        • From 595bfd1484ecc8212d6c3c028210b4d1ae78baba Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 Aug 2010 10:28:22 -0500 Subject: [PATCH 1980/2544] Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib. --- system/libraries/Image_lib.php | 7 +++++++ user_guide/changelog.html | 1 + 2 files changed, 8 insertions(+) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 21e0a709..806d942b 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -513,6 +513,13 @@ function image_process_gd($action = 'resize') } $dst_img = $create($this->width, $this->height); + + if ($this->image_type == 3) // png we can actually preserve transparency + { + imagealphablending($dst_img, FALSE); + imagesavealpha($dst_img, TRUE); + } + $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); // Show the image diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 171392f4..48d4309a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -98,6 +98,7 @@

          Version 2.0.0

        • Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
        • Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.
        • Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
        • +
        • Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.

      • Database From 60f8c395f24ba6db80d510892bcc53ce5bf9f4eb Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Wed, 25 Aug 2010 18:03:28 +0200 Subject: [PATCH 1981/2544] Modified the database driver's display_error() method to show the filename and line number of the failed query. --- system/database/DB_driver.php | 18 ++++++++++++++++++ user_guide/changelog.html | 1 + 2 files changed, 19 insertions(+) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index dfef4275..8e6f8880 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1169,6 +1169,24 @@ function display_error($error = '', $swap = '', $native = FALSE) $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error; } + // Find the most likely culprit of the error by going through + // the backtrace until the source file is no longer in the + // database folder. + + $trace = debug_backtrace(); + + foreach($trace as $call) + { + if (isset($call['file']) && strpos($call['file'], BASEPATH.'database') === FALSE) + { + // Found it - use a relative path for safety + $message[] = 'Filename: '.str_replace(array(BASEPATH, APPPATH), '', $call['file']); + $message[] = 'Line Number: '.$call['line']; + + break; + } + } + $error =& load_class('Exceptions', 'core'); echo $error->show_error($heading, $message, 'error_db'); exit; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 48d4309a..38f84112 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -110,6 +110,7 @@

        Version 2.0.0

      • Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.
      • Fixed a bug where driver specific table identifier protection could lead to malformed queries in the field_data() functions.
      • Fixed a bug where an undefined class variable was referenced in database drivers.
      • +
      • Modified the database errors to show the filename and line number of the problematic query.
      • Removed the following deprecated functions: orwhere, orlike, groupby, orhaving, orderby, getwhere.
      • Removed deprecated _drop_database() and _create_database() functions from the db utility drivers.
      From 5485db50775d4e2f76a593ef8b3425f6a1b90666 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 30 Aug 2010 21:31:08 -0500 Subject: [PATCH 1982/2544] Added fatal error to Session class when no encryption key is set in the config file, for additional assurance that session manipulation can be prevented --- application/config/config.php | 4 ++-- system/libraries/Session.php | 5 +++++ user_guide/libraries/sessions.html | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 6e52bcc1..c5eae8f5 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -213,8 +213,8 @@ | Encryption Key |-------------------------------------------------------------------------- | -| If you use the Encryption class or the Sessions class with encryption -| enabled you MUST set an encryption key. See the user guide for info. +| If you use the Encryption class or the Session class you +| MUST set an encryption key. See the user guide for info. | */ $config['encryption_key'] = ""; diff --git a/system/libraries/Session.php b/system/libraries/Session.php index cf6dc96e..f413c0d1 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -65,6 +65,11 @@ function CI_Session($params = array()) $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key); } + if ($this->encryption_key == '') + { + show_error('In order to use the Session class you are required to set an encryption key in your config file.'); + } + // Load the string helper so we can use the strip_slashes() function $this->CI->load->helper('string'); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 9a2ca939..7dc386fd 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -68,6 +68,9 @@

      Session Class

      Note: The Session class does not utilize native PHP sessions. It generates its own session data, offering more flexibility for developers.

      +

      Note: Even if you are not using encrypted sessions, you must set +an encryption key in your config file which is used to aid in preventing session data manipulation.

      +

      Initializing a Session

      Sessions will typically run globally with each page load, so the session class must either be From 52ace4322b6ff02b8d0212197355ac9ee25e63f2 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 30 Aug 2010 21:33:38 -0500 Subject: [PATCH 1983/2544] added link for encryption key in Session class to the explanation in the Encryption lib --- user_guide/libraries/sessions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 7dc386fd..a8e3b349 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -69,7 +69,7 @@

      Session Class

      generates its own session data, offering more flexibility for developers.

      Note: Even if you are not using encrypted sessions, you must set -an encryption key in your config file which is used to aid in preventing session data manipulation.

      +an encryption key in your config file which is used to aid in preventing session data manipulation.

      Initializing a Session

      From ac01acc5d786226f6372c2dc2bab81c7d8f3bd06 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 30 Aug 2010 21:45:06 -0500 Subject: [PATCH 1984/2544] changelog note for Session class change in rev f2660eeaab8d --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 38f84112..18e4df7a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -98,7 +98,8 @@

      Version 2.0.0

    34. Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
    35. Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.
    36. Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
    37. -
    38. Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.

      +
    39. Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.
    40. +
    41. Modified the Session class to prevent use if no encryption key is set in the config file.
    42. Database From 7284f06585a689702ea86684893c999065621460 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 31 Aug 2010 00:30:21 -0500 Subject: [PATCH 1985/2544] changed key comparison to be loosely typed, so an error would be triggered when an empty string is attempted to be used as an encryption key --- system/libraries/Encrypt.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index c893fbf9..44fdce03 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -72,7 +72,7 @@ function get_key($key = '') $CI =& get_instance(); $key = $CI->config->item('encryption_key'); - if ($key === FALSE) + if ($key == FALSE) { show_error('In order to use the encryption class requires that you set an encryption key in your config file.'); } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 18e4df7a..d9c17ab7 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -177,6 +177,7 @@

      Bug fixes for 2.0.0

    43. Fixed a bug where extending the Controller class would result in a fatal PHP error.
    44. Fixed a PHP Strict Standards Error in the index.php file.
    45. Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().
    46. +
    47. Fixed a bug in the Encryption library where an empty key was not triggering an error.
    48. Version 1.7.2

      From 95b183addfb1683583d401e04f2684ceb86f8b96 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 31 Aug 2010 09:42:39 -0500 Subject: [PATCH 1986/2544] fixed spelling error in Security class property for the CSRF cookie --- system/libraries/Security.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system/libraries/Security.php b/system/libraries/Security.php index 29ac2612..9a1590b5 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -29,7 +29,7 @@ class CI_Security { var $csrf_hash = ''; var $csrf_expire = 7200; // Two hours (in seconds) var $csrf_token_name = 'ci_csrf_token'; - var $csfr_cookie_name = 'ci_csrf_token'; + var $csrf_cookie_name = 'ci_csrf_token'; /* never allowed, string replacement */ var $never_allowed_str = array( @@ -54,7 +54,7 @@ class CI_Security { function CI_Security() { // Append application specific cookie prefix to token name - $this->csfr_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; + $this->csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; // Set the CSRF hash $this->_csrf_set_hash(); @@ -79,13 +79,13 @@ function csrf_verify() } // Do the tokens exist in both the _POST and _COOKIE arrays? - if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csfr_cookie_name])) + if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csrf_cookie_name])) { $this->csrf_show_error(); } // Do the tokens match? - if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csfr_cookie_name]) + if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csrf_cookie_name]) { $this->csrf_show_error(); } @@ -94,7 +94,7 @@ function csrf_verify() unset($_POST[$this->csrf_token_name]); // Nothing should last forever - unset($_COOKIE[$this->csfr_cookie_name]); + unset($_COOKIE[$this->csrf_cookie_name]); $this->_csrf_set_hash(); $this->csrf_set_cookie(); @@ -113,7 +113,7 @@ function csrf_set_cookie() { $expire = time() + $this->csrf_expire; - setcookie($this->csfr_cookie_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); + setcookie($this->csrf_cookie_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); log_message('debug', "CRSF cookie Set"); } @@ -132,9 +132,9 @@ function _csrf_set_hash() { // If the cookie exists we will use it's value. We don't necessarily want to regenerate it with // each page load since a page could contain embedded sub-pages causing this feature to fail - if (isset($_COOKIE[$this->csfr_cookie_name]) AND $_COOKIE[$this->csfr_cookie_name] != '') + if (isset($_COOKIE[$this->csrf_cookie_name]) AND $_COOKIE[$this->csrf_cookie_name] != '') { - $this->csrf_hash = $_COOKIE[$this->csfr_cookie_name]; + $this->csrf_hash = $_COOKIE[$this->csrf_cookie_name]; } else { From 09c7793b23ae77c54e25d12b63d8ca9c9232efeb Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 31 Aug 2010 13:17:10 -0500 Subject: [PATCH 1987/2544] Significant changes to the Encryption library - Removed double-encoding with XOR scheme when Mcrypt is available. Additional obfuscation was not significantly aiding security, and came at a very high performance cost. - Changed the default encryption mode from ECB to CBC for much improved security - Added an encode_from_legacy() method to allow re-encoding of permanent data that was originally encoded with the older methods. --- system/libraries/Encrypt.php | 75 ++++++++++++++++++++++-- user_guide/changelog.html | 4 ++ user_guide/installation/upgrade_200.html | 15 ++++- user_guide/libraries/encryption.html | 44 ++++++++++++-- 4 files changed, 126 insertions(+), 12 deletions(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 44fdce03..8beff75d 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -116,12 +116,16 @@ function set_key($key = '') function encode($string, $key = '') { $key = $this->get_key($key); - $enc = $this->_xor_encode($string, $key); - + if ($this->_mcrypt_exists === TRUE) { - $enc = $this->mcrypt_encode($enc, $key); + $enc = $this->mcrypt_encode($string, $key); + } + else + { + $enc = $this->_xor_encode($string, $key); } + return base64_encode($enc); } @@ -155,12 +159,71 @@ function decode($string, $key = '') return FALSE; } } - - return $this->_xor_decode($dec, $key); + else + { + $dec = $this->_xor_decode($dec, $key); + } + + return $dec; } // -------------------------------------------------------------------- + + /** + * Encode from Legacy + * + * Takes an encoded string from the original Encryption class algorithms and + * returns a newly encoded string using the improved method added in 2.0.0 + * This allows for backwards compatibility and a method to transition to the + * new encryption algorithms. + * + * For more details, see http://codeigniter.com/user_guide/installation/upgrade_200.html#encryption + * + * @access public + * @param string + * @param int (mcrypt mode constant) + * @param string + * @return string + */ + function encode_from_legacy($string, $legacy_mode = MCRYPT_MODE_ECB, $key = '') + { + if ($this->_mcrypt_exists === FALSE) + { + log_message('error', 'Encoding from legacy is available only when Mcrypt is in use.'); + return FALSE; + } + + // decode it first + // set mode temporarily to what it was when string was encoded with the legacy + // algorithm - typically MCRYPT_MODE_ECB + $current_mode = $this->_get_mode(); + $this->set_mode($legacy_mode); + + $key = $this->get_key($key); + + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) + { + return FALSE; + } + + $dec = base64_decode($string); + + if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE) + { + return FALSE; + } + + $dec = $this->_xor_decode($dec, $key); + // set the mcrypt mode back to what it should be, typically MCRYPT_MODE_CBC + $this->set_mode(MCRYPT_MODE_CBC); + + // and re-encode + return base64_encode($this->mcrypt_encode($dec, $key)); + } + + // -------------------------------------------------------------------- + /** * XOR Encode * @@ -412,7 +475,7 @@ function _get_mode() { if ($this->_mcrypt_mode == '') { - $this->_mcrypt_mode = MCRYPT_MODE_ECB; + $this->_mcrypt_mode = MCRYPT_MODE_CBC; } return $this->_mcrypt_mode; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d9c17ab7..c42bde01 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -100,6 +100,10 @@

      Version 2.0.0

    49. Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
    50. Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.
    51. Modified the Session class to prevent use if no encryption key is set in the config file.
    52. +
    53. Improved performance of the Encryption library on servers where Mcrypt is available.
    54. +
    55. Changed the default encryption mode in the Encryption library to CBC.
    56. +
    57. Added an encode_from_legacy() method to provide a way to transition encrypted data from CodeIgniter 1.x to CodeIgniter 2.x. + Please see the upgrade instructions for details.
    58. Database diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index f45875b3..155df90d 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -89,7 +89,20 @@

      Step 3: Convert your Plugins to Helpers

      -

      Step 3: Update your user guide

      +

      Step 4: Update stored encrypted data

      + +

      Note: If your application does not use the Encryption library, does not store Encrypted data permanently, or is on an environment that does not support Mcrypt, you may skip this step.

      + +

      The Encryption library has had a number of improvements, some for encryption strength and some for performance, that has an unavoidable consequence of + making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has + been added, encode_from_legacy() that will decode the data with the original algorithm and return a re-encoded string using the improved methods. + This will enable you to easily replace stale encrypted data with fresh in your applications, either on the fly or en masse.

      + +

      Please read how to use this method in the Encryption library documentation.

      + +

      + +

      Step 5: Update your user guide

      Please replace your local copy of the user guide with the new version, including the image files.

      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index dac1db91..fbffd63c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -58,12 +58,11 @@

      Encryption Class

      -

      The Encryption Class provides two-way data encryption. It uses a scheme that pre-compiles -the message using a randomly hashed bitwise XOR encoding scheme, which is then encrypted using +

      The Encryption Class provides two-way data encryption. It uses a scheme that either compiles +the message using a randomly hashed bitwise XOR encoding scheme, or is encrypted using the Mcrypt library. If Mcrypt is not available on your server the encoded message will still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. -If Mcrypt is available, you'll effectively end up with a double-encrypted message string, which should -provide a very high degree of security.

      +If Mcrypt is available, you'll be provided with a high degree of security appropriate for storage.

      Setting your Key

      @@ -153,7 +152,7 @@

      $this->encrypt->set_cipher();

      $this->encrypt->set_mode();

      -

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_ECB. Example:

      +

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:

      $this->encrypt->set_mode(MCRYPT_MODE_CFB);

      Please visit php.net for a list of available modes.

      @@ -169,7 +168,42 @@

      $this->encrypt->sha1();

      If your server does not support SHA1 you can use the provided function.

      +

      $this->encrypt->encode_from_legacy($orig_data, $legacy_mode = MCRYPT_MODE_ECB, $key = '');

      +

      Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only + necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption + such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be + destroyed since data encrypted prior to 2.x will not be decoded.

      +

      Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in + the Encryption library have improved in CodeIgniter 2.x both for performance and security, and we do not wish to encourage continued use of the older methods. + You can of course extend the Encryption library if you wish and replace the new methods with the old and retain seamless compatibility with CodeIgniter 1.x + encrypted data, but this a decision that a developer should make cautiously and deliberately, if at all.

      + +$new_data = $this->encrypt->encode_from_legacy($old_encrypted_string); + + + + + + + + + + + + + + + + + + + + + + +
      ParameterDefaultDescription
      $orig_datan/aThe original encrypted data from CodeIgniter 1.x's Encryption library
      $legacy_modeMCRYPT_MODE_ECBThe Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will + assume that to be the case unless overridden by this parameter.
      $keyn/aThe encryption key. This it typically specified in your config file as outlined above.
      From d1606358ba51261150bc2f99bb9cb2b9117718e7 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 1 Sep 2010 11:16:07 -0500 Subject: [PATCH 1988/2544] fixes issue #109 where cc and bcc recipients were not reset when using the clear() method in the Email lib --- system/libraries/Email.php | 2 ++ user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 09d1b8fb..af48757b 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -146,6 +146,8 @@ function clear($clear_attachments = FALSE) $this->_header_str = ""; $this->_replyto_flag = FALSE; $this->_recipients = array(); + $this->_cc_array = array(); + $this->_bcc_array = array(); $this->_headers = array(); $this->_debug_msg = array(); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c42bde01..25633b63 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -182,6 +182,7 @@

      Bug fixes for 2.0.0

    59. Fixed a PHP Strict Standards Error in the index.php file.
    60. Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().
    61. Fixed a bug in the Encryption library where an empty key was not triggering an error.
    62. +
    63. Fixed a bug in the Email library where CC and BCC recipients were not reset when using the clear() method (#109).
    64. Version 1.7.2

      From 95e05a0d51c034523fab629357e5fc9c065ecd58 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 2 Sep 2010 10:20:54 -0500 Subject: [PATCH 1989/2544] added a teeny bit stronger wording to encourage use of database for sessions where validation is necessary or undesirable actions could occur by a user manipulating their cookies --- user_guide/libraries/sessions.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index a8e3b349..3bd170d6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -190,12 +190,14 @@

      Flashdata

      Saving Session Data to a Database

      While the session data array stored in the user's cookie contains a Session ID, unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory.

      +security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session +could be restored by a user modifying their cookies.

      When session data is available in a database, every time a valid session is found in the user's cookie, a database query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never be updated, they can only be generated when a new session is created.

      +

      In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

      From eaa71ba1c19538af5416dceec288aa37cad2b7e6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 2 Sep 2010 10:32:07 -0500 Subject: [PATCH 1990/2544] Added a new config item to the Session class (sess_expire_on_close) to allow sessions to auto-expire when the browser window is closed. --- system/libraries/Session.php | 7 +++++-- user_guide/changelog.html | 1 + user_guide/libraries/sessions.html | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index f413c0d1..fc3ee054 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -30,6 +30,7 @@ class CI_Session { var $sess_use_database = FALSE; var $sess_table_name = ''; var $sess_expiration = 7200; + var $sess_expire_on_close = FALSE; var $sess_match_ip = FALSE; var $sess_match_useragent = TRUE; var $sess_cookie_name = 'ci_session'; @@ -655,12 +656,14 @@ function _set_cookie($cookie_data = NULL) // if encryption is not used, we provide an md5 hash to prevent userside tampering $cookie_data = $cookie_data.md5($cookie_data.$this->encryption_key); } - + + $expire = ($this->sess_expire_on_close === TRUE) ? 0 : $this->sess_expiration + time(); + // Set the cookie setcookie( $this->sess_cookie_name, $cookie_data, - $this->sess_expiration + time(), + $expire, $this->cookie_path, $this->cookie_domain, 0 diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 25633b63..5740f739 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -100,6 +100,7 @@

      Version 2.0.0

    65. Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
    66. Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.
    67. Modified the Session class to prevent use if no encryption key is set in the config file.
    68. +
    69. Added a new config item to the Session class sess_expire_on_close to allow sessions to auto-expire when the browser window is closed.
    70. Improved performance of the Encryption library on servers where Mcrypt is available.
    71. Changed the default encryption mode in the Encryption library to CBC.
    72. Added an encode_from_legacy() method to provide a way to transition encrypted data from CodeIgniter 1.x to CodeIgniter 2.x. diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 3bd170d6..2d295d72 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -257,6 +257,12 @@

      Session Preferences

      None The number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0 + + sess_expire_on_close + FALSE + TRUE/FALSE (boolean) + Whether to cause the session to expire automatically when the browser window is closed. + sess_encrypt_cookie FALSE From 092103e4d6a4a2bcd14274055f774e4eb01ecaa3 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 2 Sep 2010 11:11:58 -0500 Subject: [PATCH 1991/2544] fixed a spot where the encryption mode was still a hard coded constant instead of the fetched variable --- system/libraries/Encrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 8beff75d..b27847a5 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -216,7 +216,7 @@ function encode_from_legacy($string, $legacy_mode = MCRYPT_MODE_ECB, $key = '') $dec = $this->_xor_decode($dec, $key); // set the mcrypt mode back to what it should be, typically MCRYPT_MODE_CBC - $this->set_mode(MCRYPT_MODE_CBC); + $this->set_mode($current_mode); // and re-encode return base64_encode($this->mcrypt_encode($dec, $key)); From a33b93cdc442ea756ba7329404a9fe89d8ec660f Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 3 Sep 2010 09:16:10 -0500 Subject: [PATCH 1992/2544] user guide typo fixes #128 --- user_guide/libraries/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index bdabe8db..6367e2e8 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -144,7 +144,7 @@

      Fetching Config Items

      Setting a Config Item

      -

      If you would like to dynamically set a config item or change an existing one, you can so using:

      +

      If you would like to dynamically set a config item or change an existing one, you can do so using:

      $this->config->set_item('item_name', 'item_value'); From 34cf0a8bd4a185c85b84900324386e89eeca2b97 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 7 Sep 2010 08:35:47 -0400 Subject: [PATCH 1993/2544] typo fix --- user_guide/libraries/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 6367e2e8..bfb67945 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -66,7 +66,7 @@

      Config Class

      Anatomy of a Config File

      -

      By default, CodeIgniter has a one primary config file, located at application/config/config.php. If you open the file using +

      By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using your text editor you'll see that config items are stored in an array called $config.

      You can add your own config items to From 59aa935e9214401822ade8f476546fbed5e222c8 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 14 Sep 2010 00:37:16 -0500 Subject: [PATCH 1994/2544] Fixed a bug #129 where Model documentation referenced parent::Model instead of parent::CI_Model. --- user_guide/general/models.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/user_guide/general/models.html b/user_guide/general/models.html index e04fdf99..e405dd1b 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -77,7 +77,7 @@

      What is a Model?

      retrieve your blog data. Here is an example of what such a model class might look like:

      -class Blogmodel extends Model {
      +class Blogmodel extends CI_Model {

          var $title   = '';
          var $content = '';
      @@ -86,7 +86,7 @@

      What is a Model?

          function Blogmodel()
          {
              // Call the Model constructor
      -        parent::Model();
      +        parent::CI_Model();
          }
          
          function get_last_ten_entries()
      @@ -126,11 +126,11 @@

      Anatomy of a Model

      -class Model_name extends Model {
      +class Model_name extends CI_Model {

          function Model_name()
          {
      -        parent::Model();
      +        parent::CI_Model();
          }
      }
      @@ -140,11 +140,11 @@

      Anatomy of a Model

      The file name will be a lower case version of your class name. For example, if your class is this:

      -class User_model extends Model {
      +class User_model extends CI_Model {

          function User_model()
          {
      -        parent::Model();
      +        parent::CI_Model();
          }
      }
      From d2167a01ec5bd134a4138b50d76487caa72245c6 Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Tue, 14 Sep 2010 15:05:42 -0400 Subject: [PATCH 1995/2544] Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions < 5.1.2. --- system/helpers/url_helper.php | 4 +++- user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 7707d685..dad76114 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -446,7 +446,9 @@ function prep_url($str = '') return ''; } - if ( ! parse_url($str, PHP_URL_SCHEME)) + $url = parse_url($str); + + if ( ! $url OR ! isset($url['scheme'])) { $str = 'http://'.$str; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 5740f739..9bb4a4e8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -184,6 +184,7 @@

      Bug fixes for 2.0.0

    73. Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().
    74. Fixed a bug in the Encryption library where an empty key was not triggering an error.
    75. Fixed a bug in the Email library where CC and BCC recipients were not reset when using the clear() method (#109).
    76. +
    77. Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions < 5.1.2.
    78. Version 1.7.2

      From a7f5a94d9ecc371a1ee9fb3b5ffe4bfdd90b5e2d Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 14 Sep 2010 17:20:53 -0500 Subject: [PATCH 1996/2544] Added a log message in core/output if the cache directory config value was not found. --- system/core/Output.php | 1 + user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+) diff --git a/system/core/Output.php b/system/core/Output.php index e25e6219..7d3e2e18 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -346,6 +346,7 @@ function _write_cache($output) if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path)) { + log_message('error', "Unable to write cache file: ".$cache_path); return; } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9bb4a4e8..fb533b08 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -185,6 +185,7 @@

      Bug fixes for 2.0.0

    79. Fixed a bug in the Encryption library where an empty key was not triggering an error.
    80. Fixed a bug in the Email library where CC and BCC recipients were not reset when using the clear() method (#109).
    81. Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions < 5.1.2.
    82. +
    83. Added a log message in core/output if the cache directory config value was not found.
    84. Version 1.7.2

      From c2950704d0cf8b7ae4d71900259b1c8ef3584c68 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 14 Sep 2010 17:52:26 -0500 Subject: [PATCH 1997/2544] Updates to output profiler html validation. http://bitbucket.org/ellislab/codeigniter/issue/111/profiler-output-does-not-validate --- system/libraries/Profiler.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 0900a300..6bc3c879 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -128,7 +128,7 @@ function _compile_benchmarks() foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "".$key."  ".$val."\n"; + $output .= "".$key."  ".$val."\n"; } $output .= "\n"; @@ -165,8 +165,8 @@ function _compile_queries() $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; $output .= "\n"; - $output .= "\n\n\n"; - $output .="\n"; + $output .= "\n\n
      ".$this->CI->lang->line('profiler_no_db')."
      \n"; + $output .="\n"; $output .= "
      ".$this->CI->lang->line('profiler_no_db')."
      \n"; $output .= ""; @@ -187,11 +187,11 @@ function _compile_queries() $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'   '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
      \n"; if (count($db->queries) == 0) { - $output .= "\n"; + $output .= "\n"; } else { @@ -206,7 +206,7 @@ function _compile_queries() $val = str_replace($bold, ''.$bold.'', $val); } - $output .= "\n"; + $output .= "\n"; } } From 3424bf77ce638a2fd8e64ea76e874d3b9ead7414 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 14 Sep 2010 17:53:10 -0500 Subject: [PATCH 1998/2544] Fixed http://bitbucket.org/ellislab/codeigniter/issue/38/slight-bug-with-profilerphp Slight tweak to SQL query display in output profiler. --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 6bc3c879..db179976 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -177,7 +177,7 @@ function _compile_queries() $this->CI->load->helper('text'); // Key words we want bolded - $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); + $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); $output = "\n\n"; From fd2ba8836d74ded06cfe14f728387698c0532148 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 14 Sep 2010 18:45:42 -0500 Subject: [PATCH 1999/2544] Fix #96 html validation failure on csrf hidden input on form_open() in the form helper. Added
      ".$this->CI->lang->line('profiler_no_queries')."
      ".$this->CI->lang->line('profiler_no_queries')."
      ".$time."  ".$val."
      ".$time."  ".$val."
      ', - 'heading_row_start' => '', + 'table_open' => '
      ', + 'heading_row_start' => '', 'heading_previous_cell' => '', - 'heading_title_cell' => '', - 'heading_next_cell' => '', - 'heading_row_end' => '', - 'week_row_start' => '', - 'week_day_cell' => '', - 'week_row_end' => '', - 'cal_row_start' => '', - 'cal_cell_start' => '', + 'heading_next_cell' => '', + 'heading_row_end' => '', + 'week_row_start' => '', + 'week_day_cell' => '', + 'week_row_end' => '', + 'cal_row_start' => '', + 'cal_cell_start' => '', 'cal_row_end' => '', 'table_close' => '
      <<{heading}>>
      {week_day}
      ', + 'heading_title_cell' => '{heading}>>
      {week_day}
      ', 'cal_cell_start_today' => '', 'cal_cell_content' => '{day}', 'cal_cell_content_today' => '{day}', @@ -428,9 +428,9 @@ function default_template() 'cal_cell_end_today' => '
      ' - ); + ); } - + // -------------------------------------------------------------------- /** @@ -442,17 +442,17 @@ function default_template() * @access public * @return void */ - function parse_template() - { + function parse_template() + { $this->temp = $this->default_template(); - - if ($this->template == '') - { - return; - } - + + if ($this->template == '') + { + return; + } + $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); - + foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today') as $val) { if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) @@ -466,8 +466,8 @@ function parse_template() $this->temp[$val] = $this->temp[str_replace('_today', '', $val)]; } } - } - } + } + } } diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 643d2eca..f3969ef2 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -29,7 +29,7 @@ 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 - + // Private variables. Do not change! var $CI; var $_cart_contents = array(); @@ -39,12 +39,12 @@ class CI_Cart { * Shopping Class Constructor * * The constructor loads the Session class, used to store the shopping cart contents. - */ + */ function CI_Cart($params = array()) - { + { // Set the super object to a local variable for use later $this->CI =& get_instance(); - + // Are any config settings being passed manually? If so, set them $config = array(); if (count($params) > 0) @@ -54,10 +54,10 @@ function CI_Cart($params = array()) $config[$key] = $val; } } - + // 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) { @@ -66,15 +66,15 @@ function CI_Cart($params = array()) else { // 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['cart_total'] = 0; + $this->_cart_contents['total_items'] = 0; } - + log_message('debug', "Cart Class Initialized"); } // -------------------------------------------------------------------- - + /** * Insert items into the cart and save it to the session table * @@ -90,15 +90,15 @@ function insert($items = array()) log_message('error', 'The insert method must be passed an array containing data.'); return FALSE; } - - // You can either insert a single product using a one-dimensional array, + + // You can either insert a single product using a one-dimensional array, // or multiple products using a multi-dimensional one. The way we // determine the array type is by looking for a required array key named "id" // at the top level. If it's not found, we will assume it's a multi-dimensional array. - - $save_cart = FALSE; + + $save_cart = FALSE; if (isset($items['id'])) - { + { if ($this->_insert($items) == TRUE) { $save_cart = TRUE; @@ -114,7 +114,7 @@ function insert($items = array()) { $save_cart = TRUE; } - } + } } } @@ -129,7 +129,7 @@ function insert($items = array()) } // -------------------------------------------------------------------- - + /** * Insert * @@ -145,9 +145,9 @@ function _insert($items = array()) log_message('error', 'The insert method must be passed an array containing data.'); return FALSE; } - + // -------------------------------------------------------------------- - + // Does the $items array contain an id, quantity, price, and name? These are required if ( ! isset($items['id']) OR ! isset($items['qty']) OR ! isset($items['price']) OR ! isset($items['name'])) { @@ -156,7 +156,7 @@ function _insert($items = array()) } // -------------------------------------------------------------------- - + // Prep the quantity. It can only be a number. Duh... $items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty'])); // Trim any leading zeros @@ -167,9 +167,9 @@ function _insert($items = array()) { return FALSE; } - + // -------------------------------------------------------------------- - + // 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. @@ -180,7 +180,7 @@ function _insert($items = array()) } // -------------------------------------------------------------------- - + // 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'])) @@ -195,7 +195,7 @@ function _insert($items = array()) $items['price'] = trim(preg_replace('/([^0-9\.])/i', '', $items['price'])); // Trim any leading zeros $items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price'])); - + // Is the price a valid number? if ( ! is_numeric($items['price'])) { @@ -204,13 +204,13 @@ function _insert($items = array()) } // -------------------------------------------------------------------- - + // We now need to create a unique identifier for the item being inserted into the cart. - // Every time something is added to the cart it is stored in the master cart array. - // Each row in the cart array, however, must have a unique index that identifies not only - // a particular product, but makes it possible to store identical products with different options. - // For example, what if someone buys two identical t-shirts (same product ID), but in - // different sizes? The product ID (and other attributes, like the name) will be identical for + // Every time something is added to the cart it is stored in the master cart array. + // Each row in the cart array, however, must have a unique index that identifies not only + // a particular product, but makes it possible to store identical products with different options. + // For example, what if someone buys two identical t-shirts (same product ID), but in + // different sizes? The product ID (and other attributes, like the name) will be identical for // both sizes because it's the same shirt. The only difference will be the size. // Internally, we need to treat identical submissions, but with different options, as a unique product. // Our solution is to convert the options array to a string and MD5 it along with the product ID. @@ -225,19 +225,19 @@ function _insert($items = array()) // Technically, we don't need to MD5 the ID in this case, but it makes // sense to standardize the format of array indexes for both conditions $rowid = md5($items['id']); - } + } // -------------------------------------------------------------------- // Now that we have our unique "row ID", we'll add our cart items to the master array - + // let's unset this first, just to make sure our index contains only the data from this submission - unset($this->_cart_contents[$rowid]); - + unset($this->_cart_contents[$rowid]); + // Create a new index with our new row ID $this->_cart_contents[$rowid]['rowid'] = $rowid; - - // And add the new items to the cart array + + // And add the new items to the cart array foreach ($items as $key => $val) { $this->_cart_contents[$rowid][$key] = $val; @@ -248,11 +248,11 @@ function _insert($items = array()) } // -------------------------------------------------------------------- - + /** * Update the cart * - * This function permits the quantity of a given item to be changed. + * This function permits the quantity of a given item to be changed. * Typically it is called from the "view cart" page if a user makes * changes to the quantity before checkout. That array must contain the * product ID and quantity for each item. @@ -269,8 +269,8 @@ function update($items = array()) { return FALSE; } - - // You can either update a single product using a one-dimensional array, + + // You can either update a single product using a one-dimensional array, // or multiple products using a multi-dimensional one. The way we // 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 @@ -292,7 +292,7 @@ function update($items = array()) { $save_cart = TRUE; } - } + } } } @@ -307,11 +307,11 @@ function update($items = array()) } // -------------------------------------------------------------------- - + /** * Update the cart * - * This function permits the quantity of a given item to be changed. + * This function permits the quantity of a given item to be changed. * Typically it is called from the "view cart" page if a user makes * changes to the quantity before checkout. That array must contain the * product ID and quantity for each item. @@ -319,7 +319,7 @@ function update($items = array()) * @access private * @param array * @return bool - */ + */ function _update($items = array()) { // Without these array indexes there is nothing we can do @@ -327,7 +327,7 @@ function _update($items = array()) { return FALSE; } - + // Prep the quantity $items['qty'] = preg_replace('/([^0-9])/i', '', $items['qty']); @@ -336,7 +336,7 @@ function _update($items = array()) { return FALSE; } - + // Is the new quantity different than what is already saved in the cart? // If it's the same there's nothing to do if ($this->_cart_contents[$items['rowid']]['qty'] == $items['qty']) @@ -348,18 +348,18 @@ function _update($items = array()) // If the quantity is greater than zero we are updating if ($items['qty'] == 0) { - unset($this->_cart_contents[$items['rowid']]); + unset($this->_cart_contents[$items['rowid']]); } else { $this->_cart_contents[$items['rowid']]['qty'] = $items['qty']; } - + return TRUE; } // -------------------------------------------------------------------- - + /** * Save the cart array to the session DB * @@ -383,20 +383,20 @@ function _save_cart() } $total += ($val['price'] * $val['qty']); - + // Set the subtotal $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'] = count($this->_cart_contents); + $this->_cart_contents['total_items'] = count($this->_cart_contents); $this->_cart_contents['cart_total'] = $total; - + // Is our cart empty? If so we delete it from the session if (count($this->_cart_contents) <= 2) { $this->CI->session->unset_userdata('cart_contents'); - + // Nothing more to do... coffee time! return FALSE; } @@ -406,11 +406,11 @@ function _save_cart() $this->CI->session->set_userdata(array('cart_contents' => $this->_cart_contents)); // Woot! - return TRUE; + return TRUE; } // -------------------------------------------------------------------- - + /** * Cart Total * @@ -423,7 +423,7 @@ function total() } // -------------------------------------------------------------------- - + /** * Total Items * @@ -438,7 +438,7 @@ function total_items() } // -------------------------------------------------------------------- - + /** * Cart Contents * @@ -450,16 +450,16 @@ function total_items() function contents() { $cart = $this->_cart_contents; - + // Remove these so they don't create a problem when showing the cart table unset($cart['total_items']); unset($cart['cart_total']); - + return $cart; } // -------------------------------------------------------------------- - + /** * Has options * @@ -475,12 +475,12 @@ function has_options($rowid = '') { return FALSE; } - + return TRUE; } // -------------------------------------------------------------------- - + /** * Product options * @@ -500,7 +500,7 @@ function product_options($rowid = '') } // -------------------------------------------------------------------- - + /** * Format Number * @@ -515,15 +515,15 @@ function format_number($n = '') { return ''; } - + // Remove anything that isn't a number or decimal point. $n = trim(preg_replace('/([^0-9\.])/i', '', $n)); - + return number_format($n, 2, '.', ','); } - + // -------------------------------------------------------------------- - + /** * Destroy the cart * @@ -535,9 +535,9 @@ function format_number($n = '') function destroy() { unset($this->_cart_contents); - - $this->_cart_contents['cart_total'] = 0; - $this->_cart_contents['total_items'] = 0; + + $this->_cart_contents['cart_total'] = 0; + $this->_cart_contents['total_items'] = 0; $this->CI->session->unset_userdata('cart_contents'); } diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 07ef2e72..1261b4c7 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -25,25 +25,25 @@ * @subpackage Libraries * @category Libraries * @author EllisLab Dev Team - * @link + * @link */ class CI_Driver_Library { protected $valid_drivers = array(); protected static $lib_name; - + // 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) { if (! isset($this->lib_name)) { - $this->lib_name = get_class($this); + $this->lib_name = get_class($this); } // The class will be prefixed with the parent lib $child_class = $this->lib_name.'_'.$child; - + if (in_array(strtolower($child_class), array_map('strtolower', $this->valid_drivers))) { // check and see if the driver is in a separate file @@ -64,11 +64,11 @@ function __get($child) { include_once $filepath; break; - } + } } } } - + // it's a valid driver, but the file simply can't be found if ( ! class_exists($child_class)) { @@ -82,14 +82,14 @@ function __get($child) $this->$child = $obj; return $this->$child; } - + // The requested driver isn't valid! log_message('error', "Invalid driver requested: ".$child_class); show_error("Invalid driver requested: ".$child_class); } - + // -------------------------------------------------------------------- - + } // END CI_Driver_Library CLASS @@ -104,11 +104,11 @@ function __get($child) * @subpackage Libraries * @category Libraries * @author EllisLab Dev Team - * @link + * @link */ class CI_Driver { protected $parent; - + private $methods = array(); private $properties = array(); @@ -126,16 +126,16 @@ class CI_Driver { function decorate($parent) { $this->parent = $parent; - + // Lock down attributes to what is defined in the class // and speed up references in magic methods - + $class_name = get_class($parent); - + if ( ! isset(self::$reflections[$class_name])) { $r = new ReflectionObject($parent); - + foreach ($r->getMethods() as $method) { if ($method->isPublic()) @@ -151,7 +151,7 @@ function decorate($parent) $this->properties[] = $prop->getName(); } } - + self::$reflections[$class_name] = array($this->methods, $this->properties); } else @@ -159,9 +159,9 @@ function decorate($parent) list($this->methods, $this->properties) = self::$reflections[$class_name]; } } - + // -------------------------------------------------------------------- - + /** * __call magic method * @@ -185,7 +185,7 @@ public function __call($method, $args = array()) } // -------------------------------------------------------------------- - + /** * __get magic method * @@ -204,7 +204,7 @@ function __get($var) } // -------------------------------------------------------------------- - + /** * __set magic method * @@ -222,9 +222,9 @@ function __set($var, $val) $this->parent->$var = $val; } } - + // -------------------------------------------------------------------- - + } // END CI_Driver CLASS diff --git a/system/libraries/Email.php b/system/libraries/Email.php index af48757b..6c0309b0 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -129,7 +129,7 @@ function initialize($config = array()) $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- /** @@ -161,7 +161,7 @@ function clear($clear_attachments = FALSE) $this->_attach_disp = array(); } } - + // -------------------------------------------------------------------- /** @@ -202,7 +202,7 @@ function from($from, $name = '') $this->_set_header('From', $name.' <'.$from.'>'); $this->_set_header('Return-Path', '<'.$from.'>'); } - + // -------------------------------------------------------------------- /** @@ -238,7 +238,7 @@ function reply_to($replyto, $name = '') $this->_set_header('Reply-To', $name.' <'.$replyto.'>'); $this->_replyto_flag = TRUE; } - + // -------------------------------------------------------------------- /** @@ -273,7 +273,7 @@ function to($to) break; } } - + // -------------------------------------------------------------------- /** @@ -300,7 +300,7 @@ function cc($cc) $this->_cc_array = $cc; } } - + // -------------------------------------------------------------------- /** @@ -336,7 +336,7 @@ function bcc($bcc, $limit = '') $this->_set_header('Bcc', implode(", ", $bcc)); } } - + // -------------------------------------------------------------------- /** @@ -351,7 +351,7 @@ function subject($subject) $subject = $this->_prep_q_encoding($subject); $this->_set_header('Subject', $subject); } - + // -------------------------------------------------------------------- /** @@ -365,7 +365,7 @@ function message($body) { $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); } - + // -------------------------------------------------------------------- /** @@ -396,7 +396,7 @@ function _set_header($header, $value) { $this->_headers[$header] = $value; } - + // -------------------------------------------------------------------- /** @@ -422,7 +422,7 @@ function _str_to_array($email) } return $email; } - + // -------------------------------------------------------------------- /** @@ -436,7 +436,7 @@ function set_alt_message($str = '') { $this->alt_message = ($str == '') ? '' : $str; } - + // -------------------------------------------------------------------- /** @@ -450,7 +450,7 @@ function set_mailtype($type = 'text') { $this->mailtype = ($type == 'html') ? 'html' : 'text'; } - + // -------------------------------------------------------------------- /** @@ -464,7 +464,7 @@ function set_wordwrap($wordwrap = TRUE) { $this->wordwrap = ($wordwrap === FALSE) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- /** @@ -478,7 +478,7 @@ function set_protocol($protocol = 'mail') { $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol); } - + // -------------------------------------------------------------------- /** @@ -504,7 +504,7 @@ function set_priority($n = 3) $this->priority = $n; } - + // -------------------------------------------------------------------- /** @@ -524,7 +524,7 @@ function set_newline($newline = "\n") $this->newline = $newline; } - + // -------------------------------------------------------------------- /** @@ -544,7 +544,7 @@ function set_crlf($crlf = "\n") $this->crlf = $crlf; } - + // -------------------------------------------------------------------- /** @@ -558,7 +558,7 @@ function _set_boundaries() $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary } - + // -------------------------------------------------------------------- /** @@ -575,7 +575,7 @@ function _get_message_id() return "<".uniqid('').strstr($from, '@').">"; } - + // -------------------------------------------------------------------- /** @@ -595,7 +595,7 @@ function _get_protocol($return = TRUE) return $this->protocol; } } - + // -------------------------------------------------------------------- /** @@ -650,7 +650,7 @@ function _get_content_type() return 'plain'; } } - + // -------------------------------------------------------------------- /** @@ -668,7 +668,7 @@ function _set_date() return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); } - + // -------------------------------------------------------------------- /** @@ -681,7 +681,7 @@ function _get_mime_message() { return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; } - + // -------------------------------------------------------------------- /** @@ -710,7 +710,7 @@ function validate_email($email) return TRUE; } - + // -------------------------------------------------------------------- /** @@ -724,7 +724,7 @@ function valid_email($address) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- /** @@ -740,11 +740,11 @@ function clean_email($email) { if (preg_match('/\<(.*)\>/', $email, $match)) { - return $match['1']; + return $match['1']; } - else + else { - return $email; + return $email; } } @@ -754,17 +754,17 @@ function clean_email($email) { if (preg_match( '/\<(.*)\>/', $addy, $match)) { - $clean_email[] = $match['1']; + $clean_email[] = $match['1']; } - else + else { - $clean_email[] = $addy; + $clean_email[] = $addy; } } return $clean_email; } - + // -------------------------------------------------------------------- /** @@ -804,7 +804,7 @@ function _get_alt_message() for ($x = 1; $x <= $i; $x ++) { - $n .= "\n"; + $n .= "\n"; } $body = str_replace($n, "\n\n", $body); @@ -812,7 +812,7 @@ function _get_alt_message() return $this->word_wrap($body, '76'); } - + // -------------------------------------------------------------------- /** @@ -908,7 +908,7 @@ function word_wrap($str, $charlim = '') return $output; } - + // -------------------------------------------------------------------- /** @@ -926,7 +926,7 @@ function _build_headers() $this->_set_header('Message-ID', $this->_get_message_id()); $this->_set_header('Mime-Version', '1.0'); } - + // -------------------------------------------------------------------- /** @@ -961,7 +961,7 @@ function _write_headers() $this->_header_str = rtrim($this->_header_str); } } - + // -------------------------------------------------------------------- /** @@ -1150,7 +1150,7 @@ function _build_message() return; } - + // -------------------------------------------------------------------- /** @@ -1245,7 +1245,7 @@ function _prep_quoted_printable($str, $charlim = '') } // -------------------------------------------------------------------- - + /** * Prep Q Encoding * @@ -1317,7 +1317,7 @@ function _prep_q_encoding($str, $from = FALSE) } // -------------------------------------------------------------------- - + /** * Send Email * @@ -1358,7 +1358,7 @@ function send() return TRUE; } } - + // -------------------------------------------------------------------- /** @@ -1416,7 +1416,7 @@ function batch_bcc_send() $this->_spool_email(); } } - + // -------------------------------------------------------------------- /** @@ -1429,7 +1429,7 @@ function _unwrap_specials() { $this->_finalbody = preg_replace_callback("/\{unwrap\}(.*?)\{\/unwrap\}/si", array($this, '_remove_nl_callback'), $this->_finalbody); } - + // -------------------------------------------------------------------- /** @@ -1447,7 +1447,7 @@ function _remove_nl_callback($matches) return $matches[1]; } - + // -------------------------------------------------------------------- /** @@ -1492,7 +1492,7 @@ function _spool_email() $this->_set_error_message('email_sent', $this->_get_protocol()); return TRUE; } - + // -------------------------------------------------------------------- /** @@ -1528,7 +1528,7 @@ function _send_with_mail() } } } - + // -------------------------------------------------------------------- /** @@ -1550,12 +1550,12 @@ function _send_with_sendmail() fputs($fp, $this->_header_str); fputs($fp, $this->_finalbody); - $status = pclose($fp); - + $status = pclose($fp); + if (version_compare(PHP_VERSION, '4.2.3') == -1) { $status = $status >> 8 & 0xFF; - } + } if ($status != 0) { @@ -1566,7 +1566,7 @@ function _send_with_sendmail() return TRUE; } - + // -------------------------------------------------------------------- /** @@ -1635,7 +1635,7 @@ function _send_with_smtp() $this->_send_command('quit'); return TRUE; } - + // -------------------------------------------------------------------- /** @@ -1662,7 +1662,7 @@ function _smtp_connect() $this->_set_error_message($this->_get_smtp_data()); return $this->_send_command('hello'); } - + // -------------------------------------------------------------------- /** @@ -1729,7 +1729,7 @@ function _send_command($cmd, $data = '') return TRUE; } - + // -------------------------------------------------------------------- /** @@ -1783,7 +1783,7 @@ function _smtp_authenticate() return TRUE; } - + // -------------------------------------------------------------------- /** @@ -1804,7 +1804,7 @@ function _send_data($data) return TRUE; } } - + // -------------------------------------------------------------------- /** @@ -1829,7 +1829,7 @@ function _get_smtp_data() return $data; } - + // -------------------------------------------------------------------- /** @@ -1842,7 +1842,7 @@ function _get_hostname() { return (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain'; } - + // -------------------------------------------------------------------- /** @@ -1862,7 +1862,7 @@ function _get_ip() $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; + if ($cip && $rip) $this->_IP = $cip; elseif ($rip) $this->_IP = $rip; elseif ($cip) $this->_IP = $cip; elseif ($fip) $this->_IP = $fip; @@ -1884,7 +1884,7 @@ function _get_ip() return $this->_IP; } - + // -------------------------------------------------------------------- /** @@ -1908,7 +1908,7 @@ function print_debugger() $msg .= "
      ".$this->_header_str."\n".htmlspecialchars($this->_subject)."\n".htmlspecialchars($this->_finalbody).'
      '; return $msg; } - + // -------------------------------------------------------------------- /** @@ -1932,7 +1932,7 @@ function _set_error_message($msg, $val = '') $this->_debug_msg[] = str_replace('%s', $val, $line)."
      "; } } - + // -------------------------------------------------------------------- /** diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index b27847a5..b95dd999 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -144,7 +144,7 @@ function encode($string, $key = '') function decode($string, $key = '') { $key = $this->get_key($key); - + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) { return FALSE; @@ -163,12 +163,12 @@ function decode($string, $key = '') { $dec = $this->_xor_decode($dec, $key); } - + return $dec; } // -------------------------------------------------------------------- - + /** * Encode from Legacy * @@ -176,7 +176,7 @@ function decode($string, $key = '') * returns a newly encoded string using the improved method added in 2.0.0 * This allows for backwards compatibility and a method to transition to the * new encryption algorithms. - * + * * For more details, see http://codeigniter.com/user_guide/installation/upgrade_200.html#encryption * * @access public @@ -192,22 +192,22 @@ function encode_from_legacy($string, $legacy_mode = MCRYPT_MODE_ECB, $key = '') log_message('error', 'Encoding from legacy is available only when Mcrypt is in use.'); return FALSE; } - + // decode it first // set mode temporarily to what it was when string was encoded with the legacy - // algorithm - typically MCRYPT_MODE_ECB + // algorithm - typically MCRYPT_MODE_ECB $current_mode = $this->_get_mode(); $this->set_mode($legacy_mode); - + $key = $this->get_key($key); - + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) { return FALSE; } $dec = base64_decode($string); - + if (($dec = $this->mcrypt_decode($dec, $key)) === FALSE) { return FALSE; @@ -223,7 +223,7 @@ function encode_from_legacy($string, $legacy_mode = MCRYPT_MODE_ECB, $key = '') } // -------------------------------------------------------------------- - + /** * XOR Encode * @@ -247,7 +247,7 @@ function _xor_encode($string, $key) $enc = ''; for ($i = 0; $i < strlen($string); $i++) - { + { $enc .= substr($rand, ($i % strlen($rand)), 1).(substr($rand, ($i % strlen($rand)), 1) ^ substr($string, $i, 1)); } @@ -410,7 +410,7 @@ function _remove_cipher_noise($data, $key) { $temp = $temp + 256; } - + $str .= chr($temp); } @@ -418,7 +418,7 @@ function _remove_cipher_noise($data, $key) } // -------------------------------------------------------------------- - + /** * Set the Mcrypt Cipher * @@ -477,7 +477,7 @@ function _get_mode() { $this->_mcrypt_mode = MCRYPT_MODE_CBC; } - + return $this->_mcrypt_mode; } @@ -503,7 +503,7 @@ function set_hash($type = 'sha1') * @access public * @param string * @return string - */ + */ function hash($str) { return ($this->_hash_type == 'sha1') ? $this->sha1($str) : md5($str); diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 64baaef2..566655b1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -25,29 +25,29 @@ * @link http://codeigniter.com/user_guide/libraries/form_validation.html */ class CI_Form_validation { - + var $CI; - var $_field_data = array(); + var $_field_data = array(); var $_config_rules = array(); var $_error_array = array(); - var $_error_messages = array(); + var $_error_messages = array(); var $_error_prefix = '

      '; var $_error_suffix = '

      '; var $error_string = ''; - var $_safe_form_data = FALSE; + var $_safe_form_data = FALSE; /** * Constructor * - */ + */ function CI_Form_validation($rules = array()) - { + { $this->CI =& get_instance(); - + // Validation rules can be stored in a config file. $this->_config_rules = $rules; - + // Automatically load the form helper $this->CI->load->helper('form'); @@ -56,12 +56,12 @@ function CI_Form_validation($rules = array()) { mb_internal_encoding($this->CI->config->item('charset')); } - + log_message('debug', "Form Validation Class Initialized"); } - + // -------------------------------------------------------------------- - + /** * Set Rules * @@ -80,7 +80,7 @@ function set_rules($field, $label = '', $rules = '') { return; } - + // If an array was passed via the first parameter instead of indidual string // values we cycle through it and recursively call this function. if (is_array($field)) @@ -101,7 +101,7 @@ function set_rules($field, $label = '', $rules = '') } return; } - + // No fields? Nothing to do... if ( ! is_string($field) OR ! is_string($rules) OR $field == '') { @@ -113,9 +113,9 @@ function set_rules($field, $label = '', $rules = '') // Is the field name an array? We test for the existence of a bracket "[" in // the field name to determine this. If it is an array, we break it apart - // into its components so that we can fetch the corresponding POST data later + // into its components so that we can fetch the corresponding POST data later if (strpos($field, '[') !== FALSE AND preg_match_all('/\[(.*?)\]/', $field, $matches)) - { + { // Note: Due to a bug in current() that affects some versions // of PHP we can not pass function call directly into it $x = explode('[', $field); @@ -128,19 +128,19 @@ function set_rules($field, $label = '', $rules = '') $indexes[] = $matches['1'][$i]; } } - + $is_array = TRUE; } else { - $indexes = array(); - $is_array = FALSE; + $indexes = array(); + $is_array = FALSE; } - - // Build our master array + + // Build our master array $this->_field_data[$field] = array( - 'field' => $field, - 'label' => $label, + 'field' => $field, + 'label' => $label, 'rules' => $rules, 'is_array' => $is_array, 'keys' => $indexes, @@ -150,7 +150,7 @@ function set_rules($field, $label = '', $rules = '') } // -------------------------------------------------------------------- - + /** * Set Error Message * @@ -168,12 +168,12 @@ function set_message($lang, $val = '') { $lang = array($lang => $val); } - + $this->_error_messages = array_merge($this->_error_messages, $lang); } - + // -------------------------------------------------------------------- - + /** * Set The Error Delimiter * @@ -183,7 +183,7 @@ function set_message($lang, $val = '') * @param string * @param string * @return void - */ + */ function set_error_delimiters($prefix = '

      ', $suffix = '

      ') { $this->_error_prefix = $prefix; @@ -191,7 +191,7 @@ function set_error_delimiters($prefix = '

      ', $suffix = '

      ') } // -------------------------------------------------------------------- - + /** * Get Error Message * @@ -200,14 +200,14 @@ function set_error_delimiters($prefix = '

      ', $suffix = '

      ') * @access public * @param string the field name * @return void - */ + */ function error($field = '', $prefix = '', $suffix = '') - { + { if ( ! isset($this->_field_data[$field]['error']) OR $this->_field_data[$field]['error'] == '') { return ''; } - + if ($prefix == '') { $prefix = $this->_error_prefix; @@ -222,7 +222,7 @@ function error($field = '', $prefix = '', $suffix = '') } // -------------------------------------------------------------------- - + /** * Error String * @@ -232,7 +232,7 @@ function error($field = '', $prefix = '', $suffix = '') * @param string * @param string * @return str - */ + */ function error_string($prefix = '', $suffix = '') { // No errrors, validation passes! @@ -240,7 +240,7 @@ function error_string($prefix = '', $suffix = '') { return ''; } - + if ($prefix == '') { $prefix = $this->_error_prefix; @@ -250,7 +250,7 @@ function error_string($prefix = '', $suffix = '') { $suffix = $this->_error_suffix; } - + // Generate the error string $str = ''; foreach ($this->_error_array as $val) @@ -260,12 +260,12 @@ function error_string($prefix = '', $suffix = '') $str .= $prefix.$val.$suffix."\n"; } } - + return $str; } // -------------------------------------------------------------------- - + /** * Run the Validator * @@ -273,7 +273,7 @@ function error_string($prefix = '', $suffix = '') * * @access public * @return bool - */ + */ function run($group = '') { // Do we even have any data to process? Mm? @@ -281,7 +281,7 @@ function run($group = '') { return FALSE; } - + // Does the _field_data array containing the validation rules exist? // If not, we look to see if they were assigned via a config file if (count($this->_field_data) == 0) @@ -291,10 +291,10 @@ function run($group = '') { return FALSE; } - + // Is there a validation rule for the particular URI being accessed? $uri = ($group == '') ? trim($this->CI->uri->ruri_string(), '/') : $group; - + if ($uri != '' AND isset($this->_config_rules[$uri])) { $this->set_rules($this->_config_rules[$uri]); @@ -303,7 +303,7 @@ function run($group = '') { $this->set_rules($this->_config_rules); } - + // We're we able to set the rules correctly? if (count($this->_field_data) == 0) { @@ -311,17 +311,17 @@ function run($group = '') return FALSE; } } - + // Load the language file containing error messages $this->CI->lang->load('form_validation'); - - // Cycle through the rules for each field, match the + + // Cycle through the rules for each field, match the // corresponding $_POST item and test for errors foreach ($this->_field_data as $field => $row) - { + { // Fetch the data from the corresponding $_POST array and cache it in the _field_data array. // Depending on whether the field name is an array or a string will determine where we get it from. - + if ($row['is_array'] == TRUE) { $this->_field_data[$field]['postdata'] = $this->_reduce_array($_POST, $row['keys']); @@ -333,8 +333,8 @@ function run($group = '') $this->_field_data[$field]['postdata'] = $_POST[$field]; } } - - $this->_execute($row, explode('|', $row['rules']), $this->_field_data[$field]['postdata']); + + $this->_execute($row, explode('|', $row['rules']), $this->_field_data[$field]['postdata']); } // Did we end up with any errors? @@ -347,7 +347,7 @@ function run($group = '') // Now we need to re-set the POST data with the new, processed data $this->_reset_post_array(); - + // No errors, validation passes! if ($total_errors == 0) { @@ -359,7 +359,7 @@ function run($group = '') } // -------------------------------------------------------------------- - + /** * Traverse a multidimensional $_POST array index until the data is found * @@ -368,7 +368,7 @@ function run($group = '') * @param array * @param integer * @return mixed - */ + */ function _reduce_array($array, $keys, $i = 0) { if (is_array($array)) @@ -389,18 +389,18 @@ function _reduce_array($array, $keys, $i = 0) return $array; } } - + return $array; } // -------------------------------------------------------------------- - + /** * Re-populate the _POST array with our finalized and processed data * * @access private * @return null - */ + */ function _reset_post_array() { foreach ($this->_field_data as $field => $row) @@ -418,7 +418,7 @@ function _reset_post_array() { // start with a reference $post_ref =& $_POST; - + // before we assign values, make a reference to the right POST key if (count($row['keys']) == 1) { @@ -452,7 +452,7 @@ function _reset_post_array() } // -------------------------------------------------------------------- - + /** * Executes the Validation routines * @@ -462,21 +462,21 @@ function _reset_post_array() * @param mixed * @param integer * @return mixed - */ + */ function _execute($row, $rules, $postdata = NULL, $cycles = 0) { // If the $_POST data is an array we will run a recursive call if (is_array($postdata)) - { + { foreach ($postdata as $key => $val) { $this->_execute($row, $rules, $val, $cycles); $cycles++; } - + return; } - + // -------------------------------------------------------------------- // If the field is blank, but NOT required, no further tests are necessary @@ -496,7 +496,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } // -------------------------------------------------------------------- - + // Isset Test. Typically this rule will only apply to checkboxes. if (is_null($postdata) AND $callback == FALSE) { @@ -504,31 +504,31 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) { // Set the message type $type = (in_array('required', $rules)) ? 'required' : 'isset'; - + if ( ! isset($this->_error_messages[$type])) { if (FALSE === ($line = $this->CI->lang->line($type))) { $line = 'The field was not set'; - } + } } else { $line = $this->_error_messages[$type]; } - + // Build the error message $message = sprintf($line, $this->_translate_fieldname($row['label'])); // Save the error message $this->_field_data[$row['field']]['error'] = $message; - + if ( ! isset($this->_error_array[$row['field']])) { $this->_error_array[$row['field']] = $message; } } - + return; } @@ -538,7 +538,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) foreach ($rules As $rule) { $_in_array = FALSE; - + // We set the $postdata variable with the current data in our master array so that // each cycle of the loop is dealing with the processed data from the last cycle if ($row['is_array'] == TRUE AND is_array($this->_field_data[$row['field']]['postdata'])) @@ -549,7 +549,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) { continue; } - + $postdata = $this->_field_data[$row['field']]['postdata'][$cycles]; $_in_array = TRUE; } @@ -559,15 +559,15 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } // -------------------------------------------------------------------- - - // Is the rule a callback? + + // Is the rule a callback? $callback = FALSE; if (substr($rule, 0, 9) == 'callback_') { $rule = substr($rule, 9); $callback = TRUE; } - + // Strip the parameter (if exists) from the rule // Rules can contain a parameter: max_length[5] $param = FALSE; @@ -576,15 +576,15 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) $rule = $match[1]; $param = $match[2]; } - + // Call the function that corresponds to the rule if ($callback === TRUE) { if ( ! method_exists($this->CI, $rule)) - { + { continue; } - + // Run the function and grab the result $result = $this->CI->$rule($postdata, $param); @@ -597,7 +597,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) { $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; } - + // If the field isn't required and we just processed a callback we'll move on... if ( ! in_array('required', $rules, TRUE) AND $result !== FALSE) { @@ -605,15 +605,15 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) } } else - { + { if ( ! method_exists($this, $rule)) { - // If our own wrapper function doesn't exist we see if a native PHP function does. + // If our own wrapper function doesn't exist we see if a native PHP function does. // Users can use any native PHP function call that has one param. if (function_exists($rule)) { $result = $rule($postdata); - + if ($_in_array == TRUE) { $this->_field_data[$row['field']]['postdata'][$cycles] = (is_bool($result)) ? $postdata : $result; @@ -623,7 +623,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; } } - + continue; } @@ -638,54 +638,54 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; } } - + // Did the rule test negatively? If so, grab the error. if ($result === FALSE) - { + { if ( ! isset($this->_error_messages[$rule])) { if (FALSE === ($line = $this->CI->lang->line($rule))) { $line = 'Unable to access an error message corresponding to your field name.'; - } + } } else { $line = $this->_error_messages[$rule]; } - + // Is the parameter we are inserting into the error message the name // of another field? If so we need to grab its "field label" if (isset($this->_field_data[$param]) AND isset($this->_field_data[$param]['label'])) { $param = $this->_translate_fieldname($this->_field_data[$param]['label']); } - + // Build the error message $message = sprintf($line, $this->_translate_fieldname($row['label']), $param); // Save the error message $this->_field_data[$row['field']]['error'] = $message; - + if ( ! isset($this->_error_array[$row['field']])) { $this->_error_array[$row['field']] = $message; } - + return; } } } // -------------------------------------------------------------------- - + /** * Translate a field name * * @access private * @param string the field name * @return string - */ + */ function _translate_fieldname($fieldname) { // Do we need to translate the field name? @@ -693,8 +693,8 @@ function _translate_fieldname($fieldname) if (substr($fieldname, 0, 5) == 'lang:') { // Grab the variable - $line = substr($fieldname, 5); - + $line = substr($fieldname, 5); + // Were we able to translate the field name? If not we use $line if (FALSE === ($fieldname = $this->CI->lang->line($line))) { @@ -706,7 +706,7 @@ function _translate_fieldname($fieldname) } // -------------------------------------------------------------------- - + /** * Get the value from a form * @@ -717,19 +717,19 @@ function _translate_fieldname($fieldname) * @param string the field name * @param string * @return void - */ + */ function set_value($field = '', $default = '') { if ( ! isset($this->_field_data[$field])) { return $default; } - + return $this->_field_data[$field]['postdata']; } - + // -------------------------------------------------------------------- - + /** * Set Select * @@ -740,9 +740,9 @@ function set_value($field = '', $default = '') * @param string * @param string * @return string - */ + */ function set_select($field = '', $value = '', $default = FALSE) - { + { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) { if ($default === TRUE AND count($this->_field_data) === 0) @@ -751,9 +751,9 @@ function set_select($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $this->_field_data[$field]['postdata']; - + if (is_array($field)) { if ( ! in_array($value, $field)) @@ -768,12 +768,12 @@ function set_select($field = '', $value = '', $default = FALSE) return ''; } } - + return ' selected="selected"'; } - + // -------------------------------------------------------------------- - + /** * Set Radio * @@ -784,7 +784,7 @@ function set_select($field = '', $value = '', $default = FALSE) * @param string * @param string * @return string - */ + */ function set_radio($field = '', $value = '', $default = FALSE) { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) @@ -795,9 +795,9 @@ function set_radio($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $this->_field_data[$field]['postdata']; - + if (is_array($field)) { if ( ! in_array($value, $field)) @@ -812,12 +812,12 @@ function set_radio($field = '', $value = '', $default = FALSE) return ''; } } - + return ' checked="checked"'; } - + // -------------------------------------------------------------------- - + /** * Set Checkbox * @@ -828,7 +828,7 @@ function set_radio($field = '', $value = '', $default = FALSE) * @param string * @param string * @return string - */ + */ function set_checkbox($field = '', $value = '', $default = FALSE) { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) @@ -839,9 +839,9 @@ function set_checkbox($field = '', $value = '', $default = FALSE) } return ''; } - + $field = $this->_field_data[$field]['postdata']; - + if (is_array($field)) { if ( ! in_array($value, $field)) @@ -856,12 +856,12 @@ function set_checkbox($field = '', $value = '', $default = FALSE) return ''; } } - + return ' checked="checked"'; } - + // -------------------------------------------------------------------- - + /** * Required * @@ -880,9 +880,9 @@ function required($str) return ( ! empty($str)); } } - + // -------------------------------------------------------------------- - + /** * Match one field to another * @@ -895,16 +895,16 @@ function matches($str, $field) { if ( ! isset($_POST[$field])) { - return FALSE; + return FALSE; } - + $field = $_POST[$field]; return ($str !== $field) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Minimum Length * @@ -912,7 +912,7 @@ function matches($str, $field) * @param string * @param value * @return bool - */ + */ function min_length($str, $val) { if (preg_match("/[^0-9]/", $val)) @@ -922,14 +922,14 @@ function min_length($str, $val) if (function_exists('mb_strlen')) { - return (mb_strlen($str) < $val) ? FALSE : TRUE; + return (mb_strlen($str) < $val) ? FALSE : TRUE; } - + return (strlen($str) < $val) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Max Length * @@ -937,7 +937,7 @@ function min_length($str, $val) * @param string * @param value * @return bool - */ + */ function max_length($str, $val) { if (preg_match("/[^0-9]/", $val)) @@ -947,14 +947,14 @@ function max_length($str, $val) if (function_exists('mb_strlen')) { - return (mb_strlen($str) > $val) ? FALSE : TRUE; + return (mb_strlen($str) > $val) ? FALSE : TRUE; } - + return (strlen($str) > $val) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Exact Length * @@ -962,7 +962,7 @@ function max_length($str, $val) * @param string * @param value * @return bool - */ + */ function exact_length($str, $val) { if (preg_match("/[^0-9]/", $val)) @@ -972,42 +972,42 @@ function exact_length($str, $val) if (function_exists('mb_strlen')) { - return (mb_strlen($str) != $val) ? FALSE : TRUE; + return (mb_strlen($str) != $val) ? FALSE : TRUE; } - + return (strlen($str) != $val) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Valid Email * * @access public * @param string * @return bool - */ + */ function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } // -------------------------------------------------------------------- - + /** * Valid Emails * * @access public * @param string * @return bool - */ + */ function valid_emails($str) { if (strpos($str, ',') === FALSE) { return $this->valid_email(trim($str)); } - + foreach(explode(',', $str) as $email) { if (trim($email) != '' && $this->valid_email(trim($email)) === FALSE) @@ -1015,12 +1015,12 @@ function valid_emails($str) return FALSE; } } - + return TRUE; } // -------------------------------------------------------------------- - + /** * Validate IP Address * @@ -1034,56 +1034,56 @@ function valid_ip($ip) } // -------------------------------------------------------------------- - + /** * Alpha * * @access public * @param string * @return bool - */ + */ function alpha($str) { return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Alpha-numeric * * @access public * @param string * @return bool - */ + */ function alpha_numeric($str) { return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Alpha-numeric with underscores and dashes * * @access public * @param string * @return bool - */ + */ function alpha_dash($str) { return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Numeric * * @access public * @param string * @return bool - */ + */ function numeric($str) { return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str); @@ -1092,72 +1092,72 @@ function numeric($str) // -------------------------------------------------------------------- - /** - * Is Numeric - * - * @access public - * @param string - * @return bool - */ - function is_numeric($str) - { - return ( ! is_numeric($str)) ? FALSE : TRUE; - } + /** + * Is Numeric + * + * @access public + * @param string + * @return bool + */ + function is_numeric($str) + { + return ( ! is_numeric($str)) ? FALSE : TRUE; + } // -------------------------------------------------------------------- - + /** * Integer * * @access public * @param string * @return bool - */ + */ function integer($str) { return (bool)preg_match( '/^[\-+]?[0-9]+$/', $str); } - + // -------------------------------------------------------------------- - /** - * Is a Natural number (0,1,2,3, etc.) - * - * @access public - * @param string - * @return bool - */ - function is_natural($str) - { - return (bool)preg_match( '/^[0-9]+$/', $str); - } + /** + * Is a Natural number (0,1,2,3, etc.) + * + * @access public + * @param string + * @return bool + */ + function is_natural($str) + { + return (bool)preg_match( '/^[0-9]+$/', $str); + } // -------------------------------------------------------------------- - /** - * Is a Natural number, but not a zero (1,2,3, etc.) - * - * @access public - * @param string - * @return bool - */ + /** + * Is a Natural number, but not a zero (1,2,3, etc.) + * + * @access public + * @param string + * @return bool + */ function is_natural_no_zero($str) - { - if ( ! preg_match( '/^[0-9]+$/', $str)) - { - return FALSE; - } - - if ($str == 0) - { - return FALSE; - } - - return TRUE; - } - + { + if ( ! preg_match( '/^[0-9]+$/', $str)) + { + return FALSE; + } + + if ($str == 0) + { + return FALSE; + } + + return TRUE; + } + // -------------------------------------------------------------------- - + /** * Valid Base64 * @@ -1172,9 +1172,9 @@ function valid_base64($str) { return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str); } - + // -------------------------------------------------------------------- - + /** * Prep data for form * @@ -1193,10 +1193,10 @@ function prep_for_form($data = '') { $data[$key] = $this->prep_for_form($val); } - + return $data; } - + if ($this->_safe_form_data == FALSE OR $data === '') { return $data; @@ -1204,54 +1204,54 @@ function prep_for_form($data = '') return str_replace(array("'", '"', '<', '>'), array("'", """, '<', '>'), stripslashes($data)); } - + // -------------------------------------------------------------------- - + /** * Prep URL * * @access public * @param string * @return string - */ + */ function prep_url($str = '') { if ($str == 'http://' OR $str == '') { return ''; } - + if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://') { $str = 'http://'.$str; } - + return $str; } - + // -------------------------------------------------------------------- - + /** * Strip Image Tags * * @access public * @param string * @return string - */ + */ function strip_image_tags($str) { return $this->CI->input->strip_image_tags($str); } - + // -------------------------------------------------------------------- - + /** * XSS Clean * * @access public * @param string * @return string - */ + */ function xss_clean($str) { if ( ! isset($this->CI->security)) @@ -1261,16 +1261,16 @@ function xss_clean($str) return $this->CI->security->xss_clean($str); } - + // -------------------------------------------------------------------- - + /** * Convert PHP tags to entities * * @access public * @param string * @return string - */ + */ function encode_php_tags($str) { return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 07f4b1ff..fa2d3770 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -295,7 +295,7 @@ function download($rempath, $locpath, $mode = 'auto') { return FALSE; } - + // Set the mode if not specified if ($mode == 'auto') { @@ -303,9 +303,9 @@ function download($rempath, $locpath, $mode = 'auto') $ext = $this->_getext($rempath); $mode = $this->_settype($ext); } - + $mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY; - + $result = @ftp_get($this->conn_id, $locpath, $rempath, $mode); if ($result === FALSE) @@ -314,11 +314,11 @@ function download($rempath, $locpath, $mode = 'auto') { $this->_error('ftp_unable_to_download'); } - return FALSE; + return FALSE; } - + return TRUE; - } + } // -------------------------------------------------------------------- @@ -454,7 +454,7 @@ function delete_dir($filepath) * Set file permissions * * @access public - * @param string the file path + * @param string the file path * @param string the permissions * @return bool */ diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 806d942b..99225600 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -26,7 +26,7 @@ */ class CI_Image_lib { - var $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2 + 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 = ''; @@ -36,7 +36,7 @@ class CI_Image_lib { 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 $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 = ''; @@ -54,11 +54,11 @@ class CI_Image_lib { 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_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 + var $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image // Private Vars var $source_folder = ''; @@ -147,7 +147,7 @@ function initialize($props = array()) if ($this->source_image == '') { $this->set_error('imglib_source_image_required'); - return FALSE; + return FALSE; } /* @@ -190,7 +190,7 @@ function initialize($props = array()) // Set the Image Properties if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) { - return FALSE; + return FALSE; } /* @@ -400,7 +400,7 @@ function rotate() 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 @@ -455,8 +455,8 @@ function image_process_gd($action = 'resize') { if ($this->orig_width == $this->width AND $this->orig_height == $this->height) { - if ($this->source_image != $this->new_image) - { + if ($this->source_image != $this->new_image) + { if (@copy($this->full_src_path, $this->full_dst_path)) { @chmod($this->full_dst_path, FILE_WRITE_MODE); @@ -494,14 +494,14 @@ function image_process_gd($action = 'resize') return FALSE; } - // Create The Image + // Create The Image // // old conditional which users report cause problems with shared GD libs who report themselves as "2.0 or greater" // it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment // below should that ever prove inaccurate. // // if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor') AND $v2_override == FALSE) - if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor')) + if ($this->image_library == 'gd2' AND function_exists('imagecreatetruecolor')) { $create = 'imagecreatetruecolor'; $copy = 'imagecopyresampled'; @@ -519,7 +519,7 @@ function image_process_gd($action = 'resize') imagealphablending($dst_img, FALSE); imagesavealpha($dst_img, TRUE); } - + $copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height); // Show the image @@ -584,9 +584,9 @@ function image_process_imagemagick($action = 'resize') { switch ($this->rotation_angle) { - case 'hor' : $angle = '-flop'; + case 'hor' : $angle = '-flop'; break; - case 'vrt' : $angle = '-flip'; + case 'vrt' : $angle = '-flip'; break; default : $angle = '-rotate '.$this->rotation_angle; break; @@ -664,7 +664,7 @@ function image_process_netpbm($action = 'resize') break; case 180 : $angle = 'r180'; break; - case 270 : $angle = 'r90'; + case 270 : $angle = 'r90'; break; case 'vrt' : $angle = 'tb'; break; @@ -889,7 +889,7 @@ function overlay_watermark() $this->get_image_properties(); // Fetch watermark image properties - $props = $this->get_image_properties($this->wm_overlay_path, TRUE); + $props = $this->get_image_properties($this->wm_overlay_path, TRUE); $wm_img_type = $props['image_type']; $wm_width = $props['width']; $wm_height = $props['height']; @@ -944,7 +944,7 @@ function overlay_watermark() if ($wm_img_type == 3 AND function_exists('imagealphablending')) { @imagealphablending($src_img, TRUE); - } + } // Set RGB values for text and shadow $rgba = imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp); @@ -1266,7 +1266,7 @@ function image_display_gd($resource) switch ($this->image_type) { - case 1 : imagegif($resource); + case 1 : imagegif($resource); break; case 2 : imagejpeg($resource, '', $this->quality); break; @@ -1384,8 +1384,8 @@ function get_image_properties($path = '', $return = FALSE) * new variable needs to be known * * $props = array( - * 'width' => $width, - * 'height' => $height, + * 'width' => $width, + * 'height' => $height, * 'new_width' => 40, * 'new_height' => '' * ); @@ -1446,7 +1446,7 @@ function explode_name($source_image) { $ext = strrchr($source_image, '.'); $name = ($ext === FALSE) ? $source_image : substr($source_image, 0, -strlen($ext)); - + return array('ext' => $ext, 'name' => $name); } diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index efaaab4b..b4f33e30 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -29,9 +29,9 @@ class CI_Javascript { var $_javascript_location = 'js'; function CI_Javascript($params = array()) - { + { $defaults = array('js_library_driver' => 'jquery', 'autoload' => TRUE); - + foreach ($defaults as $key => $val) { if (isset($params[$key]) && $params[$key] !== "") @@ -39,7 +39,7 @@ function CI_Javascript($params = array()) $defaults[$key] = $params[$key]; } } - + extract($defaults); $this->CI =& get_instance(); @@ -48,13 +48,13 @@ function CI_Javascript($params = array()) $this->CI->load->library('javascript/'.$js_library_driver, array('autoload' => $autoload)); // make js to refer to current library $this->js =& $this->CI->$js_library_driver; - + log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); } - // -------------------------------------------------------------------- - // Event Code // -------------------------------------------------------------------- + // Event Code + // -------------------------------------------------------------------- /** * Blur @@ -70,9 +70,9 @@ function blur($element = 'this', $js = '') { return $this->js->_blur($element, $js); } - + // -------------------------------------------------------------------- - + /** * Change * @@ -87,9 +87,9 @@ function change($element = 'this', $js = '') { return $this->js->_change($element, $js); } - + // -------------------------------------------------------------------- - + /** * Click * @@ -107,7 +107,7 @@ function click($element = 'this', $js = '', $ret_false = TRUE) } // -------------------------------------------------------------------- - + /** * Double Click * @@ -124,7 +124,7 @@ function dblclick($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Error * @@ -141,7 +141,7 @@ function error($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Focus * @@ -158,7 +158,7 @@ function focus($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Hover * @@ -168,7 +168,7 @@ function focus($element = 'this', $js = '') * @param string - element * @param string - Javascript code for mouse over * @param string - Javascript code for mouse out - * @return string + * @return string */ function hover($element = 'this', $over, $out) { @@ -176,7 +176,7 @@ function hover($element = 'this', $over, $out) } // -------------------------------------------------------------------- - + /** * Keydown * @@ -193,7 +193,7 @@ function keydown($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Keyup * @@ -207,10 +207,10 @@ function keydown($element = 'this', $js = '') function keyup($element = 'this', $js = '') { return $this->js->_keyup($element, $js); - } + } // -------------------------------------------------------------------- - + /** * Load * @@ -224,10 +224,10 @@ function keyup($element = 'this', $js = '') function load($element = 'this', $js = '') { return $this->js->_load($element, $js); - } - + } + // -------------------------------------------------------------------- - + /** * Mousedown * @@ -244,7 +244,7 @@ function mousedown($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Mouse Out * @@ -261,7 +261,7 @@ function mouseout($element = 'this', $js = '') } // -------------------------------------------------------------------- - + /** * Mouse Over * @@ -360,7 +360,7 @@ function scroll($element = 'this', $js = '') { return $this->js->_scroll($element, $js); } - + // -------------------------------------------------------------------- /** @@ -378,9 +378,9 @@ function unload($element = 'this', $js = '') return $this->js->_unload($element, $js); } - // -------------------------------------------------------------------- - // Effects // -------------------------------------------------------------------- + // Effects + // -------------------------------------------------------------------- /** @@ -391,14 +391,14 @@ function unload($element = 'this', $js = '') * @access public * @param string - element * @param string - Class to add - * @return string + * @return string */ function addClass($element = 'this', $class = '') { return $this->js->_addClass($element, $class); } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- /** * Animate @@ -409,7 +409,7 @@ function addClass($element = 'this', $class = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function animate($element = 'this', $params = array(), $speed = '', $extra = '') { @@ -417,7 +417,7 @@ function animate($element = 'this', $params = array(), $speed = '', $extra = '') } // -------------------------------------------------------------------- - + /** * Fade In * @@ -427,15 +427,15 @@ function animate($element = 'this', $params = array(), $speed = '', $extra = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function fadeIn($element = 'this', $speed = '', $callback = '') { return $this->js->_fadeIn($element, $speed, $callback); } - + // -------------------------------------------------------------------- - + /** * Fade Out * @@ -445,14 +445,14 @@ function fadeIn($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function fadeOut($element = 'this', $speed = '', $callback = '') { return $this->js->_fadeOut($element, $speed, $callback); } // -------------------------------------------------------------------- - + /** * Slide Up * @@ -462,14 +462,14 @@ function fadeOut($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function slideUp($element = 'this', $speed = '', $callback = '') { return $this->js->_slideUp($element, $speed, $callback); } - + // -------------------------------------------------------------------- /** @@ -480,15 +480,15 @@ function slideUp($element = 'this', $speed = '', $callback = '') * @access public * @param string - element * @param string - Class to add - * @return string + * @return string */ function removeClass($element = 'this', $class = '') { return $this->js->_removeClass($element, $class); } - // -------------------------------------------------------------------- - + // -------------------------------------------------------------------- + /** * Slide Down * @@ -498,7 +498,7 @@ function removeClass($element = 'this', $class = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function slideDown($element = 'this', $speed = '', $callback = '') { @@ -506,7 +506,7 @@ function slideDown($element = 'this', $speed = '', $callback = '') } // -------------------------------------------------------------------- - + /** * Slide Toggle * @@ -516,14 +516,14 @@ function slideDown($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function slideToggle($element = 'this', $speed = '', $callback = '') { return $this->js->_slideToggle($element, $speed, $callback); } - + // -------------------------------------------------------------------- /** @@ -535,15 +535,15 @@ function slideToggle($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function hide($element = 'this', $speed = '', $callback = '') { return $this->js->_hide($element, $speed, $callback); } - + // -------------------------------------------------------------------- - + /** * Toggle * @@ -551,16 +551,16 @@ function hide($element = 'this', $speed = '', $callback = '') * * @access public * @param string - element - * @return string + * @return string */ function toggle($element = 'this') { return $this->js->_toggle($element); } - + // -------------------------------------------------------------------- - + /** * Toggle Class * @@ -568,15 +568,15 @@ function toggle($element = 'this') * * @access public * @param string - element - * @return string + * @return string */ function toggleClass($element = 'this', $class='') { return $this->js->_toggleClass($element, $class); } - + // -------------------------------------------------------------------- - + /** * Show * @@ -586,7 +586,7 @@ function toggleClass($element = 'this', $class='') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function show($element = 'this', $speed = '', $callback = '') { @@ -604,12 +604,12 @@ function show($element = 'this', $speed = '', $callback = '') * @access public * @param string The element to attach the event to * @return string - */ + */ function compile($view_var = 'script_foot', $script_tags = TRUE) { $this->js->_compile($view_var, $script_tags); } - + /** * Clear Compile * @@ -624,7 +624,7 @@ function clear_compile() } // -------------------------------------------------------------------- - + /** * External * @@ -645,16 +645,16 @@ function external($external_file = '', $relative = FALSE) if ($this->CI->config->item('javascript_location') != '') { $this->_javascript_location = $this->CI->config->item('javascript_location'); - } + } } - + if ($relative === TRUE OR strncmp($external_file, 'http://', 7) == 0 OR strncmp($external_file, 'https://', 8) == 0) { - $str = $this->_open_script($external_file); + $str = $this->_open_script($external_file); } elseif (strpos($this->_javascript_location, 'http://') !== FALSE) { - $str = $this->_open_script($this->_javascript_location.$external_file); + $str = $this->_open_script($this->_javascript_location.$external_file); } else { @@ -664,13 +664,13 @@ function external($external_file = '', $relative = FALSE) $str .= $this->_close_script(); return $str; } - + // -------------------------------------------------------------------- - + /** * Inline * - * Outputs a + * Outputs an closing * * @access private - * @param string + * @param string * @return string */ function _close_script($extra = "\n") { return "$extra"; } - - + + // -------------------------------------------------------------------- // -------------------------------------------------------------------- // AJAX-Y STUFF - still a testbed @@ -736,15 +736,15 @@ function _close_script($extra = "\n") * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function update($element = 'this', $speed = '', $callback = '') { return $this->js->_updater($element, $speed, $callback); } - + // -------------------------------------------------------------------- - + /** * Generate JSON * @@ -780,7 +780,7 @@ function generate_json($result = NULL, $match_array_type = FALSE) $json = array(); $_is_assoc = TRUE; - + if ( ! is_array($json_result) AND empty($json_result)) { show_error("Generate JSON Failed - Illegal key, value pair."); @@ -805,11 +805,11 @@ function generate_json($result = NULL, $match_array_type = FALSE) $json = implode(',', $json); return $_is_assoc ? "{".$json."}" : "[".$json."]"; - + } - + // -------------------------------------------------------------------- - + /** * Is associative array * @@ -828,12 +828,12 @@ function _is_associative_array($arr) return TRUE; } } - + return FALSE; } - + // -------------------------------------------------------------------- - + /** * Prep Args * @@ -862,7 +862,7 @@ function _prep_args($result, $is_key = FALSE) return $result; } } - + // -------------------------------------------------------------------- } // END Javascript Class diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 4e6b3bc3..99ed126f 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -40,27 +40,27 @@ class CI_Log { function CI_Log() { $config =& get_config(); - + $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; - + if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path)) { $this->_enabled = FALSE; } - + if (is_numeric($config['log_threshold'])) { $this->_threshold = $config['log_threshold']; } - + if ($config['log_date_format'] != '') { $this->_date_fmt = $config['log_date_format']; } } - + // -------------------------------------------------------------------- - + /** * Write Log File * @@ -71,42 +71,42 @@ function CI_Log() * @param string the error message * @param bool whether the error is a native PHP error * @return bool - */ + */ function write_log($level = 'error', $msg, $php_error = FALSE) - { + { if ($this->_enabled === FALSE) { return FALSE; } - + $level = strtoupper($level); - + if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) { return FALSE; } - + $filepath = $this->log_path.'log-'.date('Y-m-d').EXT; $message = ''; - + if ( ! file_exists($filepath)) { $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; } - + if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) { return FALSE; } $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; - - flock($fp, LOCK_EX); + + flock($fp, LOCK_EX); fwrite($fp, $message); flock($fp, LOCK_UN); fclose($fp); - - @chmod($filepath, FILE_WRITE_MODE); + + @chmod($filepath, FILE_WRITE_MODE); return TRUE; } diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 3a0632d0..b3175f99 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -30,11 +30,11 @@ class CI_Pagination { var $prefix = ''; // A custom prefix added to the path. var $suffix = ''; // A custom suffix added to the path. - var $total_rows = ''; // Total number of items (database results) - var $per_page = 10; // Max number of items you want shown per page + var $total_rows = ''; // 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 $first_link = '‹ First'; + var $cur_page = 0; // The current page being viewed + var $first_link = '‹ First'; var $next_link = '>'; var $prev_link = '<'; var $last_link = 'Last ›'; @@ -190,7 +190,7 @@ function create_links() $this->base_url = rtrim($this->base_url, '/') .'/'; } - // And here we go... + // And here we go... $output = ''; // Render the "First" link @@ -204,17 +204,17 @@ function create_links() if ($this->prev_link !== FALSE AND $this->cur_page != 1) { $i = $uri_page_number - $this->per_page; - + if ($i == 0 && $this->first_url != '') { - $output .= $this->prev_tag_open.'
      anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.''.$this->prev_tag_close; + $output .= $this->prev_tag_open.'anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.''.$this->prev_tag_close; } else { $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix; $output .= $this->prev_tag_open.'anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.''.$this->prev_tag_close; } - + } // Render the pages @@ -234,7 +234,7 @@ function create_links() else { $n = ($i == 0) ? '' : $i; - + if ($n == '' && $this->first_url != '') { $output .= $this->num_tag_open.'anchor_class.'href="'.$this->first_url.'">'.$loop.''.$this->num_tag_close; @@ -242,7 +242,7 @@ function create_links() else { $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; - + $output .= $this->num_tag_open.'anchor_class.'href="'.$this->base_url.$n.'">'.$loop.''.$this->num_tag_close; } } diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 41a438ba..b969ce4d 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -94,7 +94,7 @@ function _parse($template, $data, $return = FALSE) { if (is_array($val)) { - $template = $this->_parse_pair($key, $val, $template); + $template = $this->_parse_pair($key, $val, $template); } else { @@ -110,9 +110,9 @@ function _parse($template, $data, $return = FALSE) return $template; } - + // -------------------------------------------------------------------- - + /** * Set the left/right variable delimiters * @@ -126,9 +126,9 @@ function set_delimiters($l = '{', $r = '}') $this->l_delim = $l; $this->r_delim = $r; } - + // -------------------------------------------------------------------- - + /** * Parse a single key/value * @@ -142,9 +142,9 @@ function _parse_single($key, $val, $string) { return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); } - + // -------------------------------------------------------------------- - + /** * Parse a tag pair * @@ -157,7 +157,7 @@ function _parse_single($key, $val, $string) * @return string */ function _parse_pair($variable, $data, $string) - { + { if (FALSE === ($match = $this->_match_pair($string, $variable))) { return $string; @@ -178,15 +178,15 @@ function _parse_pair($variable, $data, $string) $temp = $this->_parse_pair($key, $val, $temp); } } - + $str .= $temp; } - + return str_replace($match['0'], $str, $string); } - + // -------------------------------------------------------------------- - + /** * Matches a variable pair * @@ -201,7 +201,7 @@ function _match_pair($string, $variable) { return FALSE; } - + return $match; } diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index db179976..796db2d6 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -33,7 +33,7 @@ class CI_Profiler { var $CI; - + var $_available_sections = array( 'benchmarks', 'get', @@ -46,11 +46,11 @@ class CI_Profiler { 'config' ); - function CI_Profiler($config = array()) - { - $this->CI =& get_instance(); - $this->CI->load->language('profiler'); - + function CI_Profiler($config = array()) + { + $this->CI =& get_instance(); + $this->CI->load->language('profiler'); + // default all sections to display foreach ($this->_available_sections as $section) { @@ -59,10 +59,10 @@ function CI_Profiler($config = array()) $this->_compile_{$section} = TRUE; } } - + $this->set_sections($config); - } - + } + // -------------------------------------------------------------------- /** @@ -80,13 +80,13 @@ function set_sections($config) { if (in_array($method, $this->_available_sections)) { - $this->_compile_{$method} = ($enable !== FALSE) ? TRUE : FALSE; + $this->_compile_{$method} = ($enable !== FALSE) ? TRUE : FALSE; } } } // -------------------------------------------------------------------- - + /** * Auto Profiler * @@ -98,45 +98,45 @@ function set_sections($config) * @access private * @return array */ - function _compile_benchmarks() - { - $profile = array(); - foreach ($this->CI->benchmark->marker as $key => $val) - { - // We match the "end" marker so that the list ends - // up in the order that it was defined - if (preg_match("/(.+?)_end/i", $key, $match)) - { - if (isset($this->CI->benchmark->marker[$match[1].'_end']) AND isset($this->CI->benchmark->marker[$match[1].'_start'])) - { - $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); - } - } - } + function _compile_benchmarks() + { + $profile = array(); + foreach ($this->CI->benchmark->marker as $key => $val) + { + // We match the "end" marker so that the list ends + // up in the order that it was defined + if (preg_match("/(.+?)_end/i", $key, $match)) + { + if (isset($this->CI->benchmark->marker[$match[1].'_end']) AND isset($this->CI->benchmark->marker[$match[1].'_start'])) + { + $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); + } + } + } // Build a table containing the profile data. // Note: At some point we should turn this into a template that can // be modified. We also might want to make this data available to be logged - + $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; - $output .= "\n"; + $output .= "\n"; $output .= "\n\n\n"; - + foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); $output .= "\n"; } - + $output .= "
      ".$key."  ".$val."
      \n"; $output .= "
      "; - - return $output; - } - + + return $output; + } + // -------------------------------------------------------------------- /** @@ -144,7 +144,7 @@ function _compile_benchmarks() * * @access private * @return string - */ + */ function _compile_queries() { $dbs = array(); @@ -157,22 +157,22 @@ function _compile_queries() $dbs[] = $CI_object; } } - + if (count($dbs) == 0) { $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; - $output .= "\n"; + $output .= "\n"; $output .= "\n\n\n"; $output .="\n"; $output .= "
      ".$this->CI->lang->line('profiler_no_db')."
      \n"; $output .= "
      "; - + return $output; } - + // Load the text helper so we can highlight the SQL $this->CI->load->helper('text'); @@ -180,45 +180,45 @@ function _compile_queries() $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); $output = "\n\n"; - + foreach ($dbs as $db) { $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'   '; - $output .= "\n"; + $output .= "\n"; $output .= "\n\n\n"; - + if (count($db->queries) == 0) { $output .= "\n"; } else - { + { foreach ($db->queries as $key => $val) - { + { $time = number_format($db->query_times[$key], 4); $val = highlight_code($val, ENT_QUOTES); - + foreach ($highlight as $bold) { - $val = str_replace($bold, ''.$bold.'', $val); + $val = str_replace($bold, ''.$bold.'', $val); } - + $output .= "\n"; } } - + $output .= "
      ".$this->CI->lang->line('profiler_no_queries')."
      ".$time."  ".$val."
      \n"; $output .= "
      "; - + } - + return $output; } - + // -------------------------------------------------------------------- /** @@ -226,15 +226,15 @@ function _compile_queries() * * @access private * @return string - */ + */ function _compile_get() - { + { $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_get_data').'  '; $output .= "\n"; - + if (count($_GET) == 0) { $output .= "
      ".$this->CI->lang->line('profiler_no_get')."
      "; @@ -242,14 +242,14 @@ function _compile_get() else { $output .= "\n\n\n"; - + foreach ($_GET as $key => $val) { if ( ! is_numeric($key)) { $key = "'".$key."'"; } - + $output .= "\n"; } - + $output .= "
      $_GET[".$key."]   "; if (is_array($val)) { @@ -261,30 +261,30 @@ function _compile_get() } $output .= "
      \n"; } $output .= "
      "; - return $output; + return $output; } - + // -------------------------------------------------------------------- - + /** * Compile $_POST Data * * @access private * @return string - */ + */ function _compile_post() - { + { $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; $output .= "\n"; - + if (count($_POST) == 0) { $output .= "
      ".$this->CI->lang->line('profiler_no_post')."
      "; @@ -292,14 +292,14 @@ function _compile_post() else { $output .= "\n\n\n"; - + foreach ($_POST as $key => $val) { if ( ! is_numeric($key)) { $key = "'".$key."'"; } - + $output .= "\n"; } - + $output .= "
      $_POST[".$key."]   "; if (is_array($val)) { @@ -311,70 +311,70 @@ function _compile_post() } $output .= "
      \n"; } $output .= "
      "; - return $output; + return $output; } - + // -------------------------------------------------------------------- - + /** * Show query string * * @access private * @return string - */ + */ function _compile_uri_string() - { + { $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_uri_string').'  '; $output .= "\n"; - + if ($this->CI->uri->uri_string == '') { $output .= "
      ".$this->CI->lang->line('profiler_no_uri')."
      "; } else { - $output .= "
      ".$this->CI->uri->uri_string."
      "; + $output .= "
      ".$this->CI->uri->uri_string."
      "; } - + $output .= "
      "; - return $output; + return $output; } // -------------------------------------------------------------------- - + /** * Show the controller and function that were called * * @access private * @return string - */ + */ function _compile_controller_info() - { + { $output = "\n\n"; $output .= '
      '; $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_controller_info').'  '; $output .= "\n"; - - $output .= "
      ".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."
      "; - + $output .= "
      ".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."
      "; + + $output .= "
      "; - return $output; + return $output; } // -------------------------------------------------------------------- - + /** * Compile memory usage * @@ -390,23 +390,23 @@ function _compile_memory_usage() $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; $output .= "\n"; - + if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') { $output .= "
      ".number_format($usage).' bytes
      '; } else { - $output .= "
      ".$this->CI->lang->line('profiler_no_memory_usage')."
      "; + $output .= "
      ".$this->CI->lang->line('profiler_no_memory_usage')."
      "; } - + $output .= ""; return $output; } // -------------------------------------------------------------------- - + /** * Compile header information * @@ -463,7 +463,7 @@ function _compile_config() { $val = print_r($val, TRUE); } - + $output .= "".$config."  ".htmlspecialchars($val)."\n"; } @@ -474,18 +474,18 @@ function _compile_config() } // -------------------------------------------------------------------- - + /** * Run the Profiler * * @access private * @return string - */ + */ function run() { $output = "
      "; $fields_displayed = 0; - + foreach ($this->_available_sections as $section) { if ($this->_compile_{$section} !== FALSE) @@ -500,7 +500,7 @@ function run() { $output .= '

      '.$this->CI->lang->line('profiler_no_profiles').'

      '; } - + $output .= '
      '; return $output; diff --git a/system/libraries/Security.php b/system/libraries/Security.php index 9a1590b5..2db8ee9b 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -25,12 +25,12 @@ * @link http://codeigniter.com/user_guide/libraries/sessions.html */ class CI_Security { - var $xss_hash = ''; - var $csrf_hash = ''; + var $xss_hash = ''; + var $csrf_hash = ''; var $csrf_expire = 7200; // Two hours (in seconds) var $csrf_token_name = 'ci_csrf_token'; var $csrf_cookie_name = 'ci_csrf_token'; - + /* never allowed, string replacement */ var $never_allowed_str = array( 'document.cookie' => '[removed]', @@ -63,7 +63,7 @@ function CI_Security() } // -------------------------------------------------------------------- - + /** * Verify Cross Site Request Forgery Protection * @@ -92,7 +92,7 @@ function csrf_verify() // We kill this since we're done and we don't want to polute the _POST array unset($_POST[$this->csrf_token_name]); - + // Nothing should last forever unset($_COOKIE[$this->csrf_cookie_name]); $this->_csrf_set_hash(); @@ -100,9 +100,9 @@ function csrf_verify() log_message('debug', "CSRF token verified "); } - + // -------------------------------------------------------------------- - + /** * Set Cross Site Request Forgery Protection Cookie * @@ -114,12 +114,12 @@ function csrf_set_cookie() $expire = time() + $this->csrf_expire; setcookie($this->csrf_cookie_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), 0); - - log_message('debug', "CRSF cookie Set"); + + log_message('debug', "CRSF cookie Set"); } - + // -------------------------------------------------------------------- - + /** * Set Cross Site Request Forgery Protection Cookie * @@ -146,7 +146,7 @@ function _csrf_set_hash() } // -------------------------------------------------------------------- - + /** * Show CSRF Error * @@ -159,7 +159,7 @@ function csrf_show_error() } // -------------------------------------------------------------------- - + /** * XSS Clean * @@ -198,7 +198,7 @@ function xss_clean($str, $is_image = FALSE) { $str[$key] = $this->xss_clean($str[$key]); } - + return $str; } @@ -210,9 +210,9 @@ function xss_clean($str, $is_image = FALSE) /* * Protect GET variables in URLs */ - + // 901119URL5918AMP18930PROTECT8198 - + $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str); /* @@ -225,7 +225,7 @@ function xss_clean($str, $is_image = FALSE) $str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str); /* - * Validate UTF16 two byte encoding (x00) + * Validate UTF16 two byte encoding (x00) * * Just as above, adds a semicolon if missing. * @@ -248,9 +248,9 @@ function xss_clean($str, $is_image = FALSE) * */ $str = rawurldecode($str); - + /* - * Convert character entities to ASCII + * Convert character entities to ASCII * * This permits our tests below to work reliably. * We only convert entities that are within tags since @@ -259,14 +259,14 @@ function xss_clean($str, $is_image = FALSE) */ $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); /* * Remove Invisible Characters Again! */ $str = remove_invisible_characters($str); - + /* * Convert all tabs to spaces * @@ -276,29 +276,29 @@ function xss_clean($str, $is_image = FALSE) * so we use str_replace. * */ - + if (strpos($str, "\t") !== FALSE) { $str = str_replace("\t", ' ', $str); } - + /* * Capture converted string for later comparison */ $converted_string = $str; - + /* * Not Allowed Under Any Conditions */ - + foreach ($this->never_allowed_str as $key => $val) { - $str = str_replace($key, $val, $str); + $str = str_replace($key, $val, $str); } - + foreach ($this->never_allowed_regex as $key => $val) { - $str = preg_replace("#".$key."#i", $val, $str); + $str = preg_replace("#".$key."#i", $val, $str); } /* @@ -321,7 +321,7 @@ function xss_clean($str, $is_image = FALSE) { $str = str_replace(array(''), array('<?', '?>'), $str); } - + /* * Compact any exploded words * @@ -333,7 +333,7 @@ function xss_clean($str, $is_image = FALSE) foreach ($words as $word) { $temp = ''; - + for ($i = 0, $wordlen = strlen($word); $i < $wordlen; $i++) { $temp .= substr($word, $i, 1)."\s*"; @@ -343,7 +343,7 @@ function xss_clean($str, $is_image = FALSE) // That way valid stuff like "dealer to" does not become "dealerto" $str = preg_replace_callback('#('.substr($temp, 0, -3).')(\W)#is', array($this, '_compact_exploded_words'), $str); } - + /* * Remove disallowed Javascript in links or img tags * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared @@ -352,17 +352,17 @@ function xss_clean($str, $is_image = FALSE) do { $original = $str; - + if (preg_match("/]*?)(>|$)#si", array($this, '_js_link_removal'), $str); } - + if (preg_match("/]*?)(\s?/?>|$)#si", array($this, '_js_img_removal'), $str); } - + if (preg_match("/script/i", $str) OR preg_match("/xss/i", $str)) { $str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str); @@ -385,14 +385,14 @@ function xss_clean($str, $is_image = FALSE) if ($is_image === TRUE) { /* - * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, + * Adobe Photoshop puts XML metadata into JFIF images, including namespacing, * so we have to allow this for images. -Paul */ unset($event_handlers[array_search('xmlns', $event_handlers)]); } $str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str); - + /* * Sanitize naughty HTML elements * @@ -420,7 +420,7 @@ function xss_clean($str, $is_image = FALSE) * */ $str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2(\\3)", $str); - + /* * Final clean up * @@ -430,9 +430,9 @@ function xss_clean($str, $is_image = FALSE) */ foreach ($this->never_allowed_str as $key => $val) { - $str = str_replace($key, $val, $str); + $str = str_replace($key, $val, $str); } - + foreach ($this->never_allowed_regex as $key => $val) { $str = preg_replace("#".$key."#i", $val, $str); @@ -457,13 +457,13 @@ function xss_clean($str, $is_image = FALSE) return FALSE; } } - + log_message('debug', "XSS Filtering completed"); return $str; } // -------------------------------------------------------------------- - + /** * Random Hash for protecting URLs * @@ -471,22 +471,22 @@ function xss_clean($str, $is_image = FALSE) * @return string */ function xss_hash() - { + { if ($this->xss_hash == '') { if (phpversion() >= 4.2) mt_srand(); else mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); - + $this->xss_hash = md5(time() + mt_rand(0, 1999999999)); } - + return $this->xss_hash; } // -------------------------------------------------------------------- - + /** * Compact Exploded Words * @@ -501,9 +501,9 @@ function _compact_exploded_words($matches) { return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; } - + // -------------------------------------------------------------------- - + /** * Sanitize Naughty HTML * @@ -517,15 +517,15 @@ function _sanitize_naughty_html($matches) { // encode opening brace $str = '<'.$matches[1].$matches[2].$matches[3]; - + // encode captured opening or closing brace to prevent recursive vectors $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); - + return $str; } - + // -------------------------------------------------------------------- - + /** * JS Link Removal * @@ -543,7 +543,7 @@ function _js_link_removal($match) $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<', '\\'), array('>', '<', '\\\\'), $match[0]); } - + // -------------------------------------------------------------------- /** @@ -644,35 +644,35 @@ function _decode_entity($match) function entity_decode($str, $charset='UTF-8') { if (stristr($str, '&') === FALSE) return $str; - + // 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. - + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR is_php('5.0.0'))) { $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); } - + // Numeric Entities $str = preg_replace('~&#x(0*[0-9a-f]{2,5});{0,1}~ei', 'chr(hexdec("\\1"))', $str); $str = preg_replace('~&#([0-9]{2,4});{0,1}~e', 'chr(\\1)', $str); - + // Literal Entities - Slightly slow so we do another check if (stristr($str, '&') === FALSE) { $str = strtr($str, array_flip(get_html_translation_table(HTML_ENTITIES))); } - + return $str; } - + // -------------------------------------------------------------------- - + /** * Filename Security * @@ -705,16 +705,16 @@ function sanitize_filename($str) "%20", "%22", "%3c", // < - "%253c", // < - "%3e", // > - "%0e", // > - "%28", // ( - "%29", // ) - "%2528", // ( - "%26", // & - "%24", // $ - "%3f", // ? - "%3b", // ; + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; "%3d" // = ); diff --git a/system/libraries/Session.php b/system/libraries/Session.php index fc3ee054..342c301e 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -39,7 +39,7 @@ class CI_Session { var $cookie_domain = ''; var $sess_time_to_update = 300; var $encryption_key = ''; - var $flashdata_key = 'flash'; + var $flashdata_key = 'flash'; var $time_reference = 'time'; var $gc_probability = 5; var $userdata = array(); @@ -96,7 +96,7 @@ function CI_Session($params = array()) { $this->sess_expiration = (60*60*24*365*2); } - + // Set the cookie name $this->sess_cookie_name = $this->cookie_prefix.$this->sess_cookie_name; @@ -112,10 +112,10 @@ function CI_Session($params = array()) } // Delete 'old' flashdata (from last request) - $this->_flashdata_sweep(); + $this->_flashdata_sweep(); // Mark all new flashdata as old (data will be deleted before next request) - $this->_flashdata_mark(); + $this->_flashdata_mark(); // Delete expired sessions if necessary $this->_sess_gc(); @@ -313,9 +313,9 @@ function sess_create() $sessid .= $this->CI->input->ip_address(); $this->userdata = array( - 'session_id' => md5(uniqid($sessid, TRUE)), - 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'session_id' => md5(uniqid($sessid, TRUE)), + 'ip_address' => $this->CI->input->ip_address(), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), 'last_activity' => $this->now ); @@ -656,9 +656,9 @@ function _set_cookie($cookie_data = NULL) // if encryption is not used, we provide an md5 hash to prevent userside tampering $cookie_data = $cookie_data.md5($cookie_data.$this->encryption_key); } - + $expire = ($this->sess_expire_on_close === TRUE) ? 0 : $this->sess_expiration + time(); - + // Set the cookie setcookie( $this->sess_cookie_name, @@ -690,7 +690,7 @@ function _serialize($data) { if (is_string($val)) { - $data[$key] = str_replace('\\', '{{slash}}', $val); + $data[$key] = str_replace('\\', '{{slash}}', $val); } } } @@ -698,7 +698,7 @@ function _serialize($data) { if (is_string($data)) { - $data = str_replace('\\', '{{slash}}', $data); + $data = str_replace('\\', '{{slash}}', $data); } } @@ -727,7 +727,7 @@ function _unserialize($data) { if (is_string($val)) { - $data[$key] = str_replace('{{slash}}', '\\', $val); + $data[$key] = str_replace('{{slash}}', '\\', $val); } } diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index f9611a8a..ff7e7203 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -55,7 +55,7 @@ function CI_SHA() * @access public * @param string * @return string - */ + */ function generate($str) { $n = ((strlen($str) + 8) >> 6) + 1; @@ -117,7 +117,7 @@ function generate($str) return $this->_hex($a).$this->_hex($b).$this->_hex($c).$this->_hex($d).$this->_hex($e); } - + // -------------------------------------------------------------------- /** @@ -126,7 +126,7 @@ function generate($str) * @access private * @param string * @return string - */ + */ function _hex($str) { $str = dechex($str); @@ -138,7 +138,7 @@ function _hex($str) return $str; } - + // -------------------------------------------------------------------- /** @@ -146,7 +146,7 @@ function _hex($str) * * @access private * @return string - */ + */ function _ft($t, $b, $c, $d) { if ($t < 20) @@ -166,7 +166,7 @@ function _ft($t, $b, $c, $d) * * @access private * @return string - */ + */ function _kt($t) { if ($t < 20) @@ -186,7 +186,7 @@ function _kt($t) return -899497514; } } - + // -------------------------------------------------------------------- /** @@ -194,7 +194,7 @@ function _kt($t) * * @access private * @return string - */ + */ function _safe_add($x, $y) { $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); @@ -202,7 +202,7 @@ function _safe_add($x, $y) return ($msw << 16) | ($lsw & 0xFFFF); } - + // -------------------------------------------------------------------- /** @@ -210,7 +210,7 @@ function _safe_add($x, $y) * * @access private * @return integer - */ + */ function _rol($num, $cnt) { return ($num << $cnt) | $this->_zero_fill($num, 32 - $cnt); @@ -223,7 +223,7 @@ function _rol($num, $cnt) * * @access private * @return string - */ + */ function _zero_fill($a, $b) { $bin = decbin($a); diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 1f920ea9..2fc1b634 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -30,13 +30,13 @@ class CI_Table { var $rows = array(); var $heading = array(); - var $auto_heading = TRUE; - var $caption = NULL; - var $template = NULL; + var $auto_heading = TRUE; + var $caption = NULL; + var $template = NULL; var $newline = "\n"; var $empty_cells = ""; var $function = FALSE; - + function CI_Table() { log_message('debug', "Table Class Initialized"); @@ -57,7 +57,7 @@ function set_template($template) { return FALSE; } - + $this->template = $template; } @@ -97,21 +97,21 @@ function make_columns($array = array(), $col_limit = 0) { return FALSE; } - - // Turn off the auto-heading feature since it's doubtful we + + // Turn off the auto-heading feature since it's doubtful we // will want headings from a one-dimensional array $this->auto_heading = FALSE; - + if ($col_limit == 0) { return $array; } - + $new = array(); while(count($array) > 0) - { - $temp = array_splice($array, 0, $col_limit); - + { + $temp = array_splice($array, 0, $col_limit); + if (count($temp) < $col_limit) { for ($i = count($temp); $i < $col_limit; $i++) @@ -119,10 +119,10 @@ function make_columns($array = array(), $col_limit = 0) $temp[] = ' '; } } - + $new[] = $temp; } - + return $new; } @@ -141,7 +141,7 @@ function set_empty($value) { $this->empty_cells = $value; } - + // -------------------------------------------------------------------- /** @@ -160,7 +160,7 @@ function add_row() } // -------------------------------------------------------------------- - + /** * Prep Args * @@ -188,9 +188,9 @@ function _prep_args($args) } else { - $args[$key] = array('data' => $val); + $args[$key] = array('data' => $val); } - } + } } } else @@ -203,12 +203,12 @@ function _prep_args($args) } } } - + return $args; } // -------------------------------------------------------------------- - + /** * Add a table caption * @@ -219,7 +219,7 @@ function _prep_args($args) function set_caption($caption) { $this->caption = $caption; - } + } // -------------------------------------------------------------------- @@ -246,23 +246,23 @@ function generate($table_data = NULL) $this->_set_from_array($table_data, $set_heading); } } - + // Is there anything to display? No? Smite them! if (count($this->heading) == 0 AND count($this->rows) == 0) { return 'Undefined table data'; } - + // Compile and validate the template date $this->_compile_template(); - + // set a custom cell manipulation function to a locally scoped variable so its callable $function = $this->function; - + // Build the table! - + $out = $this->template['table_open']; - $out .= $this->newline; + $out .= $this->newline; // Add any caption here if ($this->caption) @@ -283,16 +283,16 @@ function generate($table_data = NULL) foreach($this->heading as $heading) { $temp = $this->template['heading_cell_start']; - + foreach ($heading as $key => $val) { if ($key != 'data') { $temp = str_replace('template['heading_cell_end']; } @@ -302,13 +302,13 @@ function generate($table_data = NULL) $out .= $this->template['thead_close']; $out .= $this->newline; } - + // Build the table rows if (count($this->rows) > 0) { $out .= $this->template['tbody_open']; $out .= $this->newline; - + $i = 1; foreach($this->rows as $row) { @@ -316,25 +316,25 @@ function generate($table_data = NULL) { break; } - + // We use modulus to alternate the row colors $name = (fmod($i++, 2)) ? '' : 'alt_'; - + $out .= $this->template['row_'.$name.'start']; - $out .= $this->newline; - + $out .= $this->newline; + foreach($row as $cell) { $temp = $this->template['cell_'.$name.'start']; - + foreach ($cell as $key => $val) { if ($key != 'data') { $temp = str_replace('template['cell_'.$name.'end']; } - + $out .= $this->template['row_'.$name.'end']; - $out .= $this->newline; + $out .= $this->newline; } - + $out .= $this->template['tbody_close']; $out .= $this->newline; } $out .= $this->template['table_close']; - + return $out; } - + // -------------------------------------------------------------------- /** @@ -382,9 +382,9 @@ function clear() { $this->rows = array(); $this->heading = array(); - $this->auto_heading = TRUE; + $this->auto_heading = TRUE; } - + // -------------------------------------------------------------------- /** @@ -400,7 +400,7 @@ function _set_from_object($query) { return FALSE; } - + // First generate the headings from the table column names if (count($this->heading) == 0) { @@ -408,12 +408,12 @@ function _set_from_object($query) { return FALSE; } - + $this->heading = $this->_prep_args($query->list_fields()); } - + // Next blast through the result array and build out the rows - + if ($query->num_rows() > 0) { foreach ($query->result_array() as $row) @@ -438,10 +438,10 @@ function _set_from_array($data, $set_heading = TRUE) { return FALSE; } - + $i = 0; foreach ($data as $row) - { + { // If a heading hasn't already been set we'll use the first row of the array as the heading if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE) { @@ -451,7 +451,7 @@ function _set_from_array($data, $set_heading = TRUE) { $this->rows[] = $this->_prep_args($row); } - + $i++; } } @@ -464,14 +464,14 @@ function _set_from_array($data, $set_heading = TRUE) * @access private * @return void */ - function _compile_template() - { - if ($this->template == NULL) - { - $this->template = $this->_default_template(); - return; - } - + function _compile_template() + { + if ($this->template == NULL) + { + $this->template = $this->_default_template(); + return; + } + $this->temp = $this->_default_template(); foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val) { @@ -479,9 +479,9 @@ function _compile_template() { $this->template[$val] = $this->temp[$val]; } - } - } - + } + } + // -------------------------------------------------------------------- /** @@ -493,33 +493,33 @@ function _compile_template() function _default_template() { return array ( - 'table_open' => '', - + 'table_open' => '
      ', + 'thead_open' => '', 'thead_close' => '', - - 'heading_row_start' => '', - 'heading_row_end' => '', + + 'heading_row_start' => '', + 'heading_row_end' => '', 'heading_cell_start' => '', 'tbody_open' => '', 'tbody_close' => '', - - 'row_start' => '', - 'row_end' => '', + + 'row_start' => '', + 'row_end' => '', 'cell_start' => '', - 'row_alt_start' => '', - 'row_alt_end' => '', + 'row_alt_start' => '', + 'row_alt_end' => '', 'cell_alt_start' => '', - 'table_close' => '
      ', 'heading_cell_end' => '
      ', 'cell_end' => '
      ', 'cell_alt_end' => '
      ' - ); + 'table_close' => '' + ); } - + } diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index a2791448..a8be8a87 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -27,7 +27,7 @@ * @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' => ''); @@ -44,24 +44,24 @@ function CI_Trackback() { log_message('debug', "Trackback Class Initialized"); } - + // -------------------------------------------------------------------- - + /** * Send Trackback * * @access public * @param array * @return bool - */ + */ function send($tb_data) - { + { if ( ! is_array($tb_data)) { $this->set_error('The send() method must be passed an array'); return FALSE; } - + // Pre-process the Trackback Data foreach (array('url', 'title', 'excerpt', 'blog_name', 'ping_url') as $item) { @@ -70,14 +70,14 @@ function send($tb_data) $this->set_error('Required item missing: '.$item); return FALSE; } - + switch ($item) { case 'ping_url' : $$item = $this->extract_urls($tb_data[$item]); break; case 'excerpt' : $$item = $this->limit_characters($this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); break; - case 'url' : $$item = str_replace('-', '-', $this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); + case 'url' : $$item = str_replace('-', '-', $this->convert_xml(strip_tags(stripslashes($tb_data[$item])))); break; default : $$item = $this->convert_xml(strip_tags(stripslashes($tb_data[$item]))); break; @@ -103,9 +103,9 @@ function send($tb_data) // Build the Trackback data string $charset = ( ! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset']; - + $data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt)."&charset=".rawurlencode($charset); - + // Send Trackback(s) $return = TRUE; if (count($ping_url) > 0) @@ -116,14 +116,14 @@ function send($tb_data) { $return = FALSE; } - } + } } return $return; } - + // -------------------------------------------------------------------- - + /** * Receive Trackback Data * @@ -134,9 +134,9 @@ function send($tb_data) * * @access public * @return bool - */ + */ function receive() - { + { foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) { if ( ! isset($_POST[$val]) OR $_POST[$val] == '') @@ -144,29 +144,29 @@ function receive() $this->set_error('The following required POST variable is missing: '.$val); return FALSE; } - + $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset'])); - + if ($val != 'url' && function_exists('mb_convert_encoding')) { $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']); } - + $_POST[$val] = ($val != 'url') ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]); - + if ($val == 'excerpt') { $_POST['excerpt'] = $this->limit_characters($_POST['excerpt']); } - + $this->data[$val] = $_POST[$val]; } return TRUE; - } - + } + // -------------------------------------------------------------------- - + /** * Send Trackback Error Message * @@ -177,15 +177,15 @@ function receive() * @access public * @param string * @return void - */ + */ function send_error($message = 'Incomplete Information') { echo "\n\n1\n".$message."\n"; exit; } - + // -------------------------------------------------------------------- - + /** * Send Trackback Success Message * @@ -194,29 +194,29 @@ function send_error($message = 'Incomplete Information') * * @access public * @return void - */ + */ function send_success() { echo "\n\n0\n"; exit; } - + // -------------------------------------------------------------------- - + /** * Fetch a particular item * * @access public * @param string * @return string - */ + */ function data($item) { return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; } // -------------------------------------------------------------------- - + /** * Process Trackback * @@ -227,11 +227,11 @@ function data($item) * @param string * @param string * @return bool - */ + */ function process($url, $data) { $target = parse_url($url); - + // Open the socket if ( ! $fp = @fsockopen($target['host'], 80)) { @@ -241,7 +241,7 @@ function process($url, $data) // Build the path $ppath = ( ! isset($target['path'])) ? $url : $target['path']; - + $path = (isset($target['query']) && $target['query'] != "") ? $ppath.'?'.$target['query'] : $ppath; // Add the Trackback ID to the data string @@ -260,32 +260,32 @@ function process($url, $data) // Was it successful? $this->response = ""; - + while( ! feof($fp)) { $this->response .= fgets($fp, 128); } @fclose($fp); - - + + if (stristr($this->response, '0') === FALSE) { $message = 'An unknown error was encountered'; - + if (preg_match("/(.*?)<\/message>/is", $this->response, $match)) { $message = trim($match['1']); } - + $this->set_error($message); return FALSE; } return TRUE; } - + // -------------------------------------------------------------------- - + /** * Extract Trackback URLs * @@ -296,34 +296,34 @@ function process($url, $data) * @access public * @param string * @return string - */ + */ function extract_urls($urls) - { + { // Remove the pesky white space and replace with a comma. $urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls); - + // If they use commas get rid of the doubles. $urls = str_replace(",,", ",", $urls); - + // Remove any comma that might be at the end if (substr($urls, -1) == ",") { $urls = substr($urls, 0, -1); } - + // Break into an array via commas $urls = preg_split('/[,]/', $urls); - + // Removes duplicates $urls = array_unique($urls); - + array_walk($urls, array($this, 'validate_url')); - + return $urls; } - + // -------------------------------------------------------------------- - + /** * Validate URL * @@ -332,7 +332,7 @@ function extract_urls($urls) * @access public * @param string * @return string - */ + */ function validate_url($url) { $url = trim($url); @@ -342,46 +342,46 @@ function validate_url($url) $url = "http://".$url; } } - + // -------------------------------------------------------------------- - + /** * Find the Trackback URL's ID * * @access public * @param string * @return string - */ + */ function get_id($url) - { + { $tb_id = ""; - + if (strpos($url, '?') !== FALSE) { $tb_array = explode('/', $url); $tb_end = $tb_array[count($tb_array)-1]; - + if ( ! is_numeric($tb_end)) { $tb_end = $tb_array[count($tb_array)-2]; } - + $tb_array = explode('=', $tb_end); $tb_id = $tb_array[count($tb_array)-1]; } else { $url = rtrim($url, '/'); - + $tb_array = explode('/', $url); $tb_id = $tb_array[count($tb_array)-1]; - + if ( ! is_numeric($tb_id)) { $tb_id = $tb_array[count($tb_array)-2]; } - } - + } + if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) { return FALSE; @@ -389,11 +389,11 @@ function get_id($url) else { return $tb_id; - } + } } - + // -------------------------------------------------------------------- - + /** * Convert Reserved XML characters to Entities * @@ -404,22 +404,22 @@ function get_id($url) function convert_xml($str) { $temp = '__TEMP_AMPERSANDS__'; - + $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str); $str = preg_replace("/&(\w+);/", "$temp\\1;", $str); - + $str = str_replace(array("&","<",">","\"", "'", "-"), - array("&", "<", ">", """, "'", "-"), - $str); - + array("&", "<", ">", """, "'", "-"), + $str); + $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); $str = preg_replace("/$temp(\w+);/","&\\1;", $str); - + return $str; - } - + } + // -------------------------------------------------------------------- - + /** * Character limiter * @@ -437,27 +437,27 @@ function limit_characters($str, $n = 500, $end_char = '…') { return $str; } - + $str = preg_replace("/\s+/", ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str)); - + if (strlen($str) <= $n) { return $str; } - + $out = ""; foreach (explode(' ', trim($str)) as $val) { - $out .= $val.' '; + $out .= $val.' '; if (strlen($out) >= $n) { return trim($out).$end_char; - } + } } } - + // -------------------------------------------------------------------- - + /** * High ASCII to Entities * @@ -470,58 +470,58 @@ function limit_characters($str, $n = 500, $end_char = '…') */ function convert_ascii($str) { - $count = 1; - $out = ''; - $temp = array(); - - for ($i = 0, $s = strlen($str); $i < $s; $i++) - { - $ordinal = ord($str[$i]); - - if ($ordinal < 128) - { - $out .= $str[$i]; - } - else - { - if (count($temp) == 0) - { - $count = ($ordinal < 224) ? 2 : 3; - } - - $temp[] = $ordinal; - - if (count($temp) == $count) - { - $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); - - $out .= '&#'.$number.';'; - $count = 1; - $temp = array(); - } - } - } - - return $out; + $count = 1; + $out = ''; + $temp = array(); + + for ($i = 0, $s = strlen($str); $i < $s; $i++) + { + $ordinal = ord($str[$i]); + + if ($ordinal < 128) + { + $out .= $str[$i]; + } + else + { + if (count($temp) == 0) + { + $count = ($ordinal < 224) ? 2 : 3; + } + + $temp[] = $ordinal; + + if (count($temp) == $count) + { + $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64); + + $out .= '&#'.$number.';'; + $count = 1; + $temp = array(); + } + } + } + + return $out; } - + // -------------------------------------------------------------------- - + /** * Set error message * * @access public * @param string * @return void - */ + */ function set_error($msg) { log_message('error', $msg); $this->error_msg[] = $msg; } - + // -------------------------------------------------------------------- - + /** * Show error messages * @@ -529,15 +529,15 @@ function set_error($msg) * @param string * @param string * @return string - */ + */ function display_errors($open = '

      ', $close = '

      ') - { + { $str = ''; foreach ($this->error_msg as $val) { $str .= $open.$val.$close; } - + return $str; } diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index f058769e..d8b295e7 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -28,22 +28,22 @@ class CI_Typography { // Block level elements that should not be wrapped inside

      tags var $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'; - + // Elements that should not have

      and
      tags within them. var $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; - + // Tags we want the parser to completely ignore when splitting the string. var $inline_elements = 'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'; - + // array of block level elements that require inner content to be within another block level element var $inner_block_required = array('blockquote'); - + // the last block element parsed var $last_block_element = ''; - + // whether or not to protect quotes within { curly braces } var $protect_braced_quotes = FALSE; - + /** * Nothing to do here... * @@ -56,11 +56,11 @@ function CI_Typography() * Auto Typography * * This function converts text, making it typographically correct: - * - Converts double spaces into paragraphs. - * - Converts single line breaks into
      tags - * - Converts single and double quotes into correctly facing curly quote entities. - * - Converts three dots into ellipsis. - * - Converts double dashes into em-dashes. + * - Converts double spaces into paragraphs. + * - Converts single line breaks into
      tags + * - Converts single and double quotes into correctly facing curly quote entities. + * - Converts three dots into ellipsis. + * - Converts double dashes into em-dashes. * - Converts two spaces into entities * * @access public @@ -78,15 +78,15 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // Standardize Newlines to make matching easier if (strpos($str, "\r") !== FALSE) { - $str = str_replace(array("\r\n", "\r"), "\n", $str); + $str = str_replace(array("\r\n", "\r"), "\n", $str); } - + // Reduce line breaks. If there are more than two consecutive linebreaks // we'll compress them down to a maximum of two since there's no benefit to more. if ($reduce_linebreaks === TRUE) { $str = preg_replace("/\n\n+/", "\n\n", $str); - } + } // HTML comment tags don't conform to patterns of normal tags, so pull them out separately, only if needed $html_comments = array(); @@ -101,50 +101,50 @@ function auto_typography($str, $reduce_linebreaks = FALSE) } } } - + // match and yank

       tags if they exist.  It's cheaper to do this separately since most content will
       		// not contain 
       tags, and it keeps the PCRE patterns below simpler and faster
       		if (strpos($str, '.*?
      #si", array($this, '_protect_characters'), $str); } - + // Convert quotes within tags to temporary markers. $str = preg_replace_callback("#<.+?>#si", array($this, '_protect_characters'), $str); // Do the same with braces if necessary if ($this->protect_braced_quotes === TRUE) { - $str = preg_replace_callback("#\{.+?\}#si", array($this, '_protect_characters'), $str); + $str = preg_replace_callback("#\{.+?\}#si", array($this, '_protect_characters'), $str); } - - // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag - // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be + + // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag + // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} $str = preg_replace("#<(/*)(".$this->inline_elements.")([ >])#i", "{@TAG}\\1\\2\\3", $str); // Split the string at every tag. This expression creates an array with this prototype: - // - // [array] - // { - // [0] = - // [1] = Content... - // [2] = - // Etc... - // } + // + // [array] + // { + // [0] = + // [1] = Content... + // [2] = + // Etc... + // } $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); - - // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text + + // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text $str = ''; $process = TRUE; $paragraph = FALSE; $current_chunk = 0; $total_chunks = count($chunks); - + foreach ($chunks as $chunk) - { + { $current_chunk++; - + // Are we dealing with a tag? If so, we'll skip the processing for this cycle. // Well also set the "process" flag which allows us to skip
       tags and a few other things.
       			if (preg_match("#<(/*)(".$this->block_elements.").*?>#", $chunk, $match))
      @@ -153,7 +153,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE)
       				{
       					$process =  ($match[1] == '/') ? TRUE : FALSE;
       				}
      -				
      +
       				if ($match[1] == '')
       				{
       					$this->last_block_element = $match[2];
      @@ -162,32 +162,32 @@ function auto_typography($str, $reduce_linebreaks = FALSE)
       				$str .= $chunk;
       				continue;
       			}
      -			
      +
       			if ($process == FALSE)
       			{
       				$str .= $chunk;
       				continue;
       			}
      -			
      +
       			//  Force a newline to make sure end tags get processed by _format_newlines()
       			if ($current_chunk == $total_chunks)
       			{
      -				$chunk .= "\n";  
      +				$chunk .= "\n";
       			}
      -			
      +
       			//  Convert Newlines into 

      and
      tags $str .= $this->_format_newlines($chunk); } - + // No opening block level tag? Add it if needed. if ( ! preg_match("/^\s*<(?:".$this->block_elements.")/i", $str)) { $str = preg_replace("/^(.*?)<(".$this->block_elements.")/i", '

      $1

      <$2', $str); } - + // Convert quotes, elipsis, em-dashes, non-breaking spaces, and ampersands $str = $this->format_characters($str); - + // restore HTML comments for ($i = 0, $total = count($html_comments); $i < $total; $i++) { @@ -196,18 +196,18 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // if '

      {@HC1}' then replace

      {@HC1}

      with the comment, else replace only {@HC1} with the comment $str = preg_replace('#(?(?=

      \{@HC'.$i.'\})

      \{@HC'.$i.'\}(\s*

      )|\{@HC'.$i.'\})#s', $html_comments[$i], $str); } - + // Final clean up $table = array( - + // If the user submitted their own paragraph tags within the text // we will retain them instead of using our tags. '/(*?]>)

      /' => '$1', // )+#' => '

      ', '/(

      \W*

      )+/' => '

      ', - + // Clean up stray paragraph tags that appear before block level elements '#

      <('.$this->block_elements.')#' => '<$1', @@ -223,15 +223,15 @@ function auto_typography($str, $reduce_linebreaks = FALSE) // An unintended consequence of the _format_newlines function is that // some of the newlines get truncated, resulting in

      tags - // starting immediately after tags on the same line. + // starting immediately after tags on the same line. // This forces a newline after such occurrences, which looks much nicer. "/>

      \n/" => ">\n

      ", - + // Similarly, there might be cases where a closing will follow // a closing

      tag, so we'll correct it by adding a newline in between "#

      "

      \n

      #'] = '

       

      '; } - + return preg_replace(array_keys($table), $table, $str); } - + // -------------------------------------------------------------------- - + /** * Format Characters * @@ -264,10 +264,10 @@ function auto_typography($str, $reduce_linebreaks = FALSE) function format_characters($str) { static $table; - + if ( ! isset($table)) { - $table = array( + $table = array( // nested smart quotes, opening and closing // note that rules for grammar (English) allow only for two levels deep // and that single quotes are _supposed_ to always be on the outside @@ -313,7 +313,7 @@ function format_characters($str) return preg_replace(array_keys($table), $table, $str); } - + // -------------------------------------------------------------------- /** @@ -324,25 +324,25 @@ function format_characters($str) * @access public * @param string * @return string - */ + */ function _format_newlines($str) { if ($str == '') { return $str; } - + if (strpos($str, "\n") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)) { return $str; } - + // Convert two consecutive newlines to paragraphs $str = str_replace("\n\n", "

      \n\n

      ", $str); - + // Convert single spaces to
      tags $str = preg_replace("/([^\n])(\n)([^\n])/", "\\1
      \\2\\3", $str); - + // Wrap the whole enchilada in enclosing paragraphs if ($str != "\n") { @@ -355,19 +355,19 @@ function _format_newlines($str) // Remove empty paragraphs if they are on the first line, as this // is a potential unintended consequence of the previous code $str = preg_replace("/

      <\/p>(.*)/", "\\1", $str, 1); - + return $str; } - + // ------------------------------------------------------------------------ - + /** * Protect Characters * * Protects special characters from being formatted later * We don't want quotes converted within tags so we'll temporarily convert them to {@DQ} and {@SQ} - * and we don't want double dashes converted to emdash entities, so they are marked with {@DD} - * likewise double spaces are converted to {@NBS} to prevent entity conversion + * and we don't want double dashes converted to emdash entities, so they are marked with {@DD} + * likewise double spaces are converted to {@NBS} to prevent entity conversion * * @access public * @param array @@ -379,19 +379,19 @@ function _protect_characters($match) } // -------------------------------------------------------------------- - + /** * Convert newlines to HTML line breaks except within PRE tags * * @access public * @param string * @return string - */ + */ function nl2br_except_pre($str) { $ex = explode("pre>",$str); $ct = count($ex); - + $newstr = ""; for ($i = 0; $i < $ct; $i++) { @@ -403,14 +403,14 @@ function nl2br_except_pre($str) { $newstr .= $ex[$i]; } - + if ($ct - 1 != $i) $newstr .= "pre>"; } - + return $newstr; } - + } // END Typography Class diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index c4714363..9a90cb47 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -29,9 +29,9 @@ class CI_Unit_test { var $active = TRUE; - var $results = array(); + var $results = array(); var $strict = FALSE; - var $_template = NULL; + var $_template = NULL; var $_template_rows = NULL; var $_test_items_visible = array(); @@ -82,32 +82,32 @@ function set_test_items($items = array()) * @param mixed * @param string * @return string - */ + */ function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '') { if ($this->active == FALSE) { return FALSE; } - + if (in_array($expected, array('is_object', 'is_string', 'is_bool', 'is_true', 'is_false', 'is_int', 'is_numeric', 'is_float', 'is_double', 'is_array', 'is_null'), TRUE)) { $expected = str_replace('is_float', 'is_double', $expected); - $result = ($expected($test)) ? TRUE : FALSE; + $result = ($expected($test)) ? TRUE : FALSE; $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); } else { if ($this->strict == TRUE) - $result = ($test === $expected) ? TRUE : FALSE; + $result = ($test === $expected) ? TRUE : FALSE; else - $result = ($test == $expected) ? TRUE : FALSE; - + $result = ($test == $expected) ? TRUE : FALSE; + $extype = gettype($expected); } - + $back = $this->_backtrace(); - + $report[] = array ( 'test_name' => $test_name, 'test_datatype' => gettype($test), @@ -124,7 +124,7 @@ function run($test, $expected = TRUE, $test_name = 'undefined', $notes = '') } // -------------------------------------------------------------------- - + /** * Generate a report * @@ -175,9 +175,9 @@ function report($result = array()) return $r; } - + // -------------------------------------------------------------------- - + /** * Use strict comparison * @@ -191,9 +191,9 @@ function use_strict($state = TRUE) { $this->strict = ($state == FALSE) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Make Unit testing active * @@ -207,9 +207,9 @@ function active($state = TRUE) { $this->active = ($state == FALSE) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- - + /** * Result Array * @@ -219,15 +219,15 @@ function active($state = TRUE) * @return array */ function result($results = array()) - { + { $CI =& get_instance(); $CI->load->language('unit_test'); - + if (count($results) == 0) { $results = $this->results; } - + $retval = array(); foreach ($results as $result) { @@ -246,8 +246,8 @@ function result($results = array()) if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$v)))) { $v = $line; - } - $temp[$CI->lang->line('ut_'.$k)] = $v; + } + $temp[$CI->lang->line('ut_'.$k)] = $v; } } else @@ -255,19 +255,19 @@ function result($results = array()) if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) { $val = $line; - } + } $temp[$CI->lang->line('ut_'.$key)] = $val; } } - + $retval[] = $temp; } - + return $retval; } - + // -------------------------------------------------------------------- - + /** * Set the template * @@ -276,14 +276,14 @@ function result($results = array()) * @access public * @param string * @return void - */ + */ function set_template($template) { $this->_template = $template; } - + // -------------------------------------------------------------------- - + /** * Generate a backtrace * @@ -297,17 +297,17 @@ function _backtrace() if (function_exists('debug_backtrace')) { $back = debug_backtrace(); - + $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file']; $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line']; - + return array('file' => $file, 'line' => $line); } return array('file' => 'Unknown', 'line' => 'Unknown'); } // -------------------------------------------------------------------- - + /** * Get Default Template * @@ -315,17 +315,17 @@ function _backtrace() * @return string */ function _default_template() - { + { $this->_template = "\n".''; $this->_template .= '{rows}'; $this->_template .= "\n".'
      '; - + $this->_template_rows = "\n\t".''; $this->_template_rows .= "\n\t\t".'{item}'; $this->_template_rows .= "\n\t\t".'{result}'; - $this->_template_rows .= "\n\t".''; + $this->_template_rows .= "\n\t".''; } - + // -------------------------------------------------------------------- /** @@ -336,29 +336,29 @@ function _default_template() * @access private * @return void */ - function _parse_template() - { - if ( ! is_null($this->_template_rows)) - { - return; - } - - if (is_null($this->_template)) - { - $this->_default_template(); - return; - } - + function _parse_template() + { + if ( ! is_null($this->_template_rows)) + { + return; + } + + if (is_null($this->_template)) + { + $this->_default_template(); + return; + } + if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match)) { - $this->_default_template(); - return; + $this->_default_template(); + return; } $this->_template_rows = $match['1']; - $this->_template = str_replace($match['0'], '{rows}', $this->_template); - } - + $this->_template = str_replace($match['0'], '{rows}', $this->_template); + } + } // END Unit_test Class diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index c18c178d..c83d0aea 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -25,7 +25,7 @@ * @link http://codeigniter.com/user_guide/libraries/file_uploading.html */ class CI_Upload { - + var $max_size = 0; var $max_width = 0; var $max_height = 0; @@ -51,9 +51,9 @@ class CI_Upload { var $xss_clean = FALSE; var $temp_prefix = "temp_file_"; var $client_name = ''; - + var $_file_name_override = ''; //@PHP4 (should be private) - + /** * Constructor * @@ -65,19 +65,19 @@ function CI_Upload($props = array()) { $this->initialize($props); } - + log_message('debug', "Upload Class Initialized"); } - + // -------------------------------------------------------------------- - + /** * Initialize preferences * * @access public * @param array * @return void - */ + */ function initialize($config = array()) { @@ -107,9 +107,9 @@ function initialize($config = array()) 'xss_clean' => FALSE, 'temp_prefix' => "temp_file_", 'client_name' => '' - ); - - + ); + + foreach ($defaults as $key => $val) { if (isset($config[$key])) @@ -122,27 +122,27 @@ function initialize($config = array()) else { $this->$key = $config[$key]; - } + } } else { $this->$key = $val; } } - + // if a file_name was provided in the config, use it instead of the user input // supplied file name for all uploads until initialized again $this->_file_name_override = $this->file_name; } - + // -------------------------------------------------------------------- - + /** * Perform the file upload * * @access public * @return bool - */ + */ function do_upload($field = 'userfile') { // Is $_FILES[$field] set? If not, no reason to continue. @@ -151,7 +151,7 @@ function do_upload($field = 'userfile') $this->set_error('upload_no_file_selected'); return FALSE; } - + // Is the upload path valid? if ( ! $this->validate_upload_path()) { @@ -173,10 +173,10 @@ function do_upload($field = 'userfile') $this->set_error('upload_file_exceeds_form_limit'); break; case 3: // UPLOAD_ERR_PARTIAL - $this->set_error('upload_file_partial'); + $this->set_error('upload_file_partial'); break; case 4: // UPLOAD_ERR_NO_FILE - $this->set_error('upload_no_file_selected'); + $this->set_error('upload_no_file_selected'); break; case 6: // UPLOAD_ERR_NO_TMP_DIR $this->set_error('upload_no_temp_directory'); @@ -196,14 +196,14 @@ function do_upload($field = 'userfile') // Set the uploaded data as class variables - $this->file_temp = $_FILES[$field]['tmp_name']; - $this->file_size = $_FILES[$field]['size']; + $this->file_temp = $_FILES[$field]['tmp_name']; + $this->file_size = $_FILES[$field]['size']; $this->file_type = preg_replace("/^(.+?);.*$/", "\\1", $_FILES[$field]['type']); $this->file_type = strtolower(trim(stripslashes($this->file_type), '"')); $this->file_name = $this->_prep_filename($_FILES[$field]['name']); $this->file_ext = $this->get_extension($this->file_name); $this->client_name = $this->file_name; - + // Is the file type allowed to be uploaded? if ( ! $this->is_allowed_filetype()) { @@ -220,10 +220,10 @@ function do_upload($field = 'userfile') if ( ! $this->is_allowed_filetype(TRUE)) { $this->set_error('upload_invalid_filetype'); - return FALSE; + return FALSE; } } - + // Convert the file size to kilobytes if ($this->file_size > 0) { @@ -247,7 +247,7 @@ function do_upload($field = 'userfile') // Sanitize the file name for security $this->file_name = $this->clean_file_name($this->file_name); - + // Truncate the file name if it's too long if ($this->max_filename > 0) { @@ -271,7 +271,7 @@ function do_upload($field = 'userfile') if ($this->overwrite == FALSE) { $this->file_name = $this->set_filename($this->upload_path, $this->file_name); - + if ($this->file_name === FALSE) { return FALSE; @@ -304,8 +304,8 @@ function do_upload($field = 'userfile') { if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) { - $this->set_error('upload_destination_error'); - return FALSE; + $this->set_error('upload_destination_error'); + return FALSE; } } @@ -319,18 +319,18 @@ function do_upload($field = 'userfile') return TRUE; } - + // -------------------------------------------------------------------- - + /** * Finalized Data Array - * + * * Returns an associative array containing all of the information * related to the upload, allowing the developer easy access in one array. * * @access public * @return array - */ + */ function data() { return array ( @@ -350,24 +350,24 @@ function data() 'image_size_str' => $this->image_size_str, ); } - + // -------------------------------------------------------------------- - + /** * Set Upload Path * * @access public * @param string * @return void - */ + */ function set_upload_path($path) { // Make sure it has a trailing slash $this->upload_path = rtrim($path, '/').'/'; } - + // -------------------------------------------------------------------- - + /** * Set the file name * @@ -379,25 +379,25 @@ function set_upload_path($path) * @param string * @param string * @return string - */ + */ function set_filename($path, $filename) { if ($this->encrypt_name == TRUE) - { + { mt_srand(); - $filename = md5(uniqid(mt_rand())).$this->file_ext; + $filename = md5(uniqid(mt_rand())).$this->file_ext; } - + if ( ! file_exists($path.$filename)) { return $filename; } - + $filename = str_replace($this->file_ext, '', $filename); - + $new_filename = ''; for ($i = 1; $i < 100; $i++) - { + { if ( ! file_exists($path.$filename.$i.$this->file_ext)) { $new_filename = $filename.$i.$this->file_ext; @@ -415,72 +415,72 @@ function set_filename($path, $filename) return $new_filename; } } - + // -------------------------------------------------------------------- - + /** * Set Maximum File Size * * @access public * @param integer * @return void - */ + */ function set_max_filesize($n) { $this->max_size = ((int) $n < 0) ? 0: (int) $n; } - + // -------------------------------------------------------------------- - + /** * Set Maximum File Name Length * * @access public * @param integer * @return void - */ + */ function set_max_filename($n) { $this->max_filename = ((int) $n < 0) ? 0: (int) $n; } // -------------------------------------------------------------------- - + /** * Set Maximum Image Width * * @access public * @param integer * @return void - */ + */ function set_max_width($n) { $this->max_width = ((int) $n < 0) ? 0: (int) $n; } - + // -------------------------------------------------------------------- - + /** * Set Maximum Image Height * * @access public * @param integer * @return void - */ + */ function set_max_height($n) { $this->max_height = ((int) $n < 0) ? 0: (int) $n; } - + // -------------------------------------------------------------------- - + /** * Set Allowed File Types * * @access public * @param string * @return void - */ + */ function set_allowed_types($types) { if ( ! is_array($types) && $types == '*') @@ -490,9 +490,9 @@ function set_allowed_types($types) } $this->allowed_types = explode('|', $types); } - + // -------------------------------------------------------------------- - + /** * Set Image Properties * @@ -501,7 +501,7 @@ function set_allowed_types($types) * @access public * @param string * @return void - */ + */ function set_image_properties($path = '') { if ( ! $this->is_image()) @@ -512,7 +512,7 @@ function set_image_properties($path = '') if (function_exists('getimagesize')) { if (FALSE !== ($D = @getimagesize($path))) - { + { $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); $this->image_width = $D['0']; @@ -522,9 +522,9 @@ function set_image_properties($path = '') } } } - + // -------------------------------------------------------------------- - + /** * Set XSS Clean * @@ -539,15 +539,15 @@ function set_xss_clean($flag = FALSE) { $this->xss_clean = ($flag == TRUE) ? TRUE : FALSE; } - + // -------------------------------------------------------------------- - + /** * Validate the image * * @access public * @return bool - */ + */ function is_image() { // IE will sometimes return odd mime-types during upload, so here we just standardize all @@ -555,12 +555,12 @@ function is_image() $png_mimes = array('image/x-png'); $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg'); - + if (in_array($this->file_type, $png_mimes)) { $this->file_type = 'image/png'; } - + if (in_array($this->file_type, $jpeg_mimes)) { $this->file_type = 'image/jpeg'; @@ -570,80 +570,80 @@ function is_image() 'image/gif', 'image/jpeg', 'image/png', - ); + ); return (in_array($this->file_type, $img_mimes, TRUE)) ? TRUE : FALSE; } - + // -------------------------------------------------------------------- - + /** * Verify that the filetype is allowed * * @access public * @return bool - */ + */ function is_allowed_filetype($ignore_mime = FALSE) { if ($this->allowed_types == '*') { return TRUE; } - + if (count($this->allowed_types) == 0 OR ! is_array($this->allowed_types)) { $this->set_error('upload_no_file_types'); return FALSE; } - + $ext = strtolower(ltrim($this->file_ext, '.')); - + if ( ! in_array($ext, $this->allowed_types)) { return FALSE; } - // Images get some additional checks + // Images get some additional checks $image_types = array('gif', 'jpg', 'jpeg', 'png', 'jpe'); - + if (in_array($ext, $image_types)) { if (getimagesize($this->file_temp) === FALSE) { return FALSE; - } + } } - + if ($ignore_mime === TRUE) { return TRUE; } - + $mime = $this->mimes_types($ext); - + if (is_array($mime)) { if (in_array($this->file_type, $mime, TRUE)) { return TRUE; - } + } } elseif ($mime == $this->file_type) { return TRUE; } - + return FALSE; } - + // -------------------------------------------------------------------- - + /** * Verify that the file is within the allowed size * * @access public * @return bool - */ + */ function is_allowed_filesize() { if ($this->max_size != 0 AND $this->file_size > $this->max_size) @@ -655,15 +655,15 @@ function is_allowed_filesize() return TRUE; } } - + // -------------------------------------------------------------------- - + /** * Verify that the image is within the allowed width/height * * @access public * @return bool - */ + */ function is_allowed_dimensions() { if ( ! $this->is_image()) @@ -690,9 +690,9 @@ function is_allowed_dimensions() return TRUE; } - + // -------------------------------------------------------------------- - + /** * Validate Upload Path * @@ -701,7 +701,7 @@ function is_allowed_dimensions() * * @access public * @return bool - */ + */ function validate_upload_path() { if ($this->upload_path == '') @@ -709,7 +709,7 @@ function validate_upload_path() $this->set_error('upload_no_filepath'); return FALSE; } - + if (function_exists('realpath') AND @realpath($this->upload_path) !== FALSE) { $this->upload_path = str_replace("\\", "/", realpath($this->upload_path)); @@ -730,31 +730,31 @@ function validate_upload_path() $this->upload_path = preg_replace("/(.+?)\/*$/", "\\1/", $this->upload_path); return TRUE; } - + // -------------------------------------------------------------------- - + /** * Extract the file extension * * @access public * @param string * @return string - */ + */ function get_extension($filename) { $x = explode('.', $filename); return '.'.end($x); - } - + } + // -------------------------------------------------------------------- - + /** * Clean the file name for security * * @access public * @param string * @return string - */ + */ function clean_file_name($filename) { $bad = array( @@ -773,40 +773,40 @@ function clean_file_name($filename) "%20", "%22", "%3c", // < - "%253c", // < - "%3e", // > - "%0e", // > - "%28", // ( - "%29", // ) - "%2528", // ( - "%26", // & - "%24", // $ - "%3f", // ? - "%3b", // ; + "%253c", // < + "%3e", // > + "%0e", // > + "%28", // ( + "%29", // ) + "%2528", // ( + "%26", // & + "%24", // $ + "%3f", // ? + "%3b", // ; "%3d" // = ); - + $filename = str_replace($bad, '', $filename); return stripslashes($filename); } // -------------------------------------------------------------------- - + /** * Limit the File Name Length * * @access public * @param string * @return string - */ + */ function limit_filename_length($filename, $length) { if (strlen($filename) < $length) { return $filename; } - + $ext = ''; if (strpos($filename, '.') !== FALSE) { @@ -814,12 +814,12 @@ function limit_filename_length($filename, $length) $ext = '.'.array_pop($parts); $filename = implode('.', $parts); } - + return substr($filename, 0, ($length - strlen($ext))).$ext; } // -------------------------------------------------------------------- - + /** * Runs the file through the XSS clean function * @@ -829,26 +829,26 @@ function limit_filename_length($filename, $length) * * @access public * @return void - */ + */ function do_xss_clean() - { + { $file = $this->file_temp; - + if (filesize($file) == 0) { return FALSE; } - + if (function_exists('memory_get_usage') && memory_get_usage() && ini_get('memory_limit') != '') { $current = ini_get('memory_limit') * 1024 * 1024; - + // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output // into scientific notation. number_format() ensures this number is an integer // http://bugs.php.net/bug.php?id=43053 - + $new_memory = number_format(ceil(filesize($file) + $current), 0, '.', ''); - + ini_set('memory_limit', $new_memory); // When an integer is used, the value is measured in bytes. - PHP.net } @@ -856,18 +856,18 @@ function do_xss_clean() // IE can be fooled into mime-type detecting a malformed image as an html file, thus executing an XSS attack on anyone // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of - // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an + // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an // attempted XSS attack. if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) { - if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary - { + if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary + { return FALSE; // Couldn't open the file, return FALSE - } + } - $opening_bytes = fread($file, 256); - fclose($file); + $opening_bytes = fread($file, 256); + fclose($file); // These are known to throw IE into mime-type detection chaos // security)) { $CI->load->library('security'); } - + return $CI->security->xss_clean($data, TRUE); } - + // -------------------------------------------------------------------- - + /** * Set an error message * * @access public * @param string * @return void - */ + */ function set_error($msg) { - $CI =& get_instance(); + $CI =& get_instance(); $CI->lang->load('upload'); - + if (is_array($msg)) { foreach ($msg as $val) { - $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); + $msg = ($CI->lang->line($val) == FALSE) ? $val : $CI->lang->line($val); $this->error_msg[] = $msg; log_message('error', $msg); - } + } } else { @@ -924,9 +924,9 @@ function set_error($msg) log_message('error', $msg); } } - + // -------------------------------------------------------------------- - + /** * Display the error message * @@ -934,7 +934,7 @@ function set_error($msg) * @param string * @param string * @return string - */ + */ function display_errors($open = '

      ', $close = '

      ') { $str = ''; @@ -942,12 +942,12 @@ function display_errors($open = '

      ', $close = '

      ') { $str .= $open.$val.$close; } - + return $str; } - + // -------------------------------------------------------------------- - + /** * List of Mime Types * @@ -957,11 +957,11 @@ function display_errors($open = '

      ', $close = '

      ') * @access public * @param string * @return string - */ + */ function mimes_types($mime) { global $mimes; - + if (count($this->mimes) == 0) { if (@require_once(APPPATH.'config/mimes'.EXT)) @@ -970,12 +970,12 @@ function mimes_types($mime) unset($mimes); } } - + return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime]; } // -------------------------------------------------------------------- - + /** * Prep Filename * @@ -1010,7 +1010,7 @@ function _prep_filename($filename) } $filename .= '.'.$ext; - + return $filename; } diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index a7c7a760..00cbf696 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -29,25 +29,25 @@ class CI_User_agent { var $agent = NULL; - + var $is_browser = FALSE; var $is_robot = FALSE; var $is_mobile = FALSE; var $languages = array(); var $charsets = array(); - + var $platforms = array(); var $browsers = array(); var $mobiles = array(); var $robots = array(); - + var $platform = ''; var $browser = ''; var $version = ''; var $mobile = ''; var $robot = ''; - + /** * Constructor * @@ -55,14 +55,14 @@ class CI_User_agent { * * @access public * @return void - */ + */ function CI_User_agent() { if (isset($_SERVER['HTTP_USER_AGENT'])) { $this->agent = trim($_SERVER['HTTP_USER_AGENT']); } - + if ( ! is_null($this->agent)) { if ($this->_load_agent_file()) @@ -70,27 +70,27 @@ function CI_User_agent() $this->_compile_data(); } } - + log_message('debug', "User Agent Class Initialized"); } - + // -------------------------------------------------------------------- - + /** * Compile the User Agent Data * * @access private * @return bool - */ + */ function _load_agent_file() { if ( ! @include(APPPATH.'config/user_agents'.EXT)) { return FALSE; } - + $return = FALSE; - + if (isset($platforms)) { $this->platforms = $platforms; @@ -111,7 +111,7 @@ function _load_agent_file() unset($mobiles); $return = TRUE; } - + if (isset($robots)) { $this->robots = $robots; @@ -121,36 +121,36 @@ function _load_agent_file() return $return; } - + // -------------------------------------------------------------------- - + /** * Compile the User Agent Data * * @access private * @return bool - */ + */ function _compile_data() { $this->_set_platform(); - + foreach (array('_set_browser', '_set_robot', '_set_mobile') as $function) { if ($this->$function() === TRUE) { break; } - } + } } - + // -------------------------------------------------------------------- - + /** * Set the Platform * * @access private * @return mixed - */ + */ function _set_platform() { if (is_array($this->platforms) AND count($this->platforms) > 0) @@ -168,19 +168,19 @@ function _set_platform() } // -------------------------------------------------------------------- - + /** * Set the Browser * * @access private * @return bool - */ + */ function _set_browser() { if (is_array($this->browsers) AND count($this->browsers) > 0) { foreach ($this->browsers as $key => $val) - { + { if (preg_match("|".preg_quote($key).".*?([0-9\.]+)|i", $this->agent, $match)) { $this->is_browser = TRUE; @@ -193,19 +193,19 @@ function _set_browser() } return FALSE; } - + // -------------------------------------------------------------------- - + /** * Set the Robot * * @access private * @return bool - */ + */ function _set_robot() { if (is_array($this->robots) AND count($this->robots) > 0) - { + { foreach ($this->robots as $key => $val) { if (preg_match("|".preg_quote($key)."|i", $this->agent)) @@ -220,17 +220,17 @@ function _set_robot() } // -------------------------------------------------------------------- - + /** * Set the Mobile Device * * @access private * @return bool - */ + */ function _set_mobile() { if (is_array($this->mobiles) AND count($this->mobiles) > 0) - { + { foreach ($this->mobiles as $key => $val) { if (FALSE !== (strpos(strtolower($this->agent), $key))) @@ -240,261 +240,261 @@ function _set_mobile() return TRUE; } } - } + } return FALSE; } - + // -------------------------------------------------------------------- - + /** * Set the accepted languages * * @access private * @return void - */ + */ function _set_languages() { if ((count($this->languages) == 0) AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) AND $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') { $languages = preg_replace('/(;q=[0-9\.]+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE']))); - + $this->languages = explode(',', $languages); } - + if (count($this->languages) == 0) { $this->languages = array('Undefined'); - } + } } - + // -------------------------------------------------------------------- - + /** * Set the accepted character sets * * @access private * @return void - */ + */ function _set_charsets() - { + { if ((count($this->charsets) == 0) AND isset($_SERVER['HTTP_ACCEPT_CHARSET']) AND $_SERVER['HTTP_ACCEPT_CHARSET'] != '') { $charsets = preg_replace('/(;q=.+)/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_CHARSET']))); - + $this->charsets = explode(',', $charsets); } - + if (count($this->charsets) == 0) { $this->charsets = array('Undefined'); - } + } } // -------------------------------------------------------------------- - + /** * Is Browser * * @access public * @return bool - */ + */ function is_browser() { return $this->is_browser; } // -------------------------------------------------------------------- - + /** * Is Robot * * @access public * @return bool - */ + */ function is_robot() { return $this->is_robot; } // -------------------------------------------------------------------- - + /** * Is Mobile * * @access public * @return bool - */ + */ function is_mobile() { return $this->is_mobile; - } + } // -------------------------------------------------------------------- - + /** * Is this a referral from another site? * * @access public * @return bool - */ + */ function is_referral() { return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE; } // -------------------------------------------------------------------- - + /** * Agent String * * @access public * @return string - */ + */ function agent_string() { return $this->agent; } // -------------------------------------------------------------------- - + /** * Get Platform * * @access public * @return string - */ + */ function platform() { return $this->platform; } // -------------------------------------------------------------------- - + /** * Get Browser Name * * @access public * @return string - */ + */ function browser() { return $this->browser; } // -------------------------------------------------------------------- - + /** * Get the Browser Version * * @access public * @return string - */ + */ function version() { return $this->version; } // -------------------------------------------------------------------- - + /** * Get The Robot Name * * @access public * @return string - */ + */ function robot() { return $this->robot; } // -------------------------------------------------------------------- - + /** * Get the Mobile Device * * @access public * @return string - */ + */ function mobile() { return $this->mobile; } - + // -------------------------------------------------------------------- - + /** * Get the referrer * * @access public * @return bool - */ + */ function referrer() { return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']); } // -------------------------------------------------------------------- - + /** * Get the accepted languages * * @access public * @return array - */ + */ function languages() { if (count($this->languages) == 0) { $this->_set_languages(); } - + return $this->languages; } // -------------------------------------------------------------------- - + /** * Get the accepted Character Sets * * @access public * @return array - */ + */ function charsets() { if (count($this->charsets) == 0) { $this->_set_charsets(); } - + return $this->charsets; } - + // -------------------------------------------------------------------- - + /** * Test for a particular language * * @access public * @return bool - */ + */ function accept_lang($lang = 'en') { return (in_array(strtolower($lang), $this->languages(), TRUE)) ? TRUE : FALSE; } - + // -------------------------------------------------------------------- - + /** * Test for a particular character set * * @access public * @return bool - */ + */ function accept_charset($charset = 'utf-8') { return (in_array(strtolower($charset), $this->charsets(), TRUE)) ? TRUE : FALSE; } - - + + } diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index ff03a503..54ee7077 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -14,7 +14,7 @@ */ if ( ! function_exists('xml_parser_create')) -{ +{ show_error('Your PHP installation does not support XML'); } @@ -32,34 +32,34 @@ */ class CI_Xmlrpc { - var $debug = FALSE; // Debugging on or off + var $debug = FALSE; // Debugging on or off var $xmlrpcI4 = 'i4'; var $xmlrpcInt = 'int'; var $xmlrpcBoolean = 'boolean'; - var $xmlrpcDouble = 'double'; + var $xmlrpcDouble = 'double'; var $xmlrpcString = 'string'; var $xmlrpcDateTime = 'dateTime.iso8601'; var $xmlrpcBase64 = 'base64'; var $xmlrpcArray = 'array'; var $xmlrpcStruct = 'struct'; - + var $xmlrpcTypes = array(); var $valid_parents = array(); var $xmlrpcerr = array(); // Response numbers var $xmlrpcstr = array(); // Response strings - + var $xmlrpc_defencoding = 'UTF-8'; var $xmlrpcName = 'XML-RPC for CodeIgniter'; var $xmlrpcVersion = '1.1'; var $xmlrpcerruser = 800; // Start of user errors var $xmlrpcerrxml = 100; // Start of XML Parse errors var $xmlrpc_backslash = ''; // formulate backslashes for escaping regexp - + var $client; var $method; var $data; var $message = ''; - var $error = ''; // Error string for request + var $error = ''; // Error string for request var $result; var $response = array(); // Response from remote server @@ -71,22 +71,22 @@ class CI_Xmlrpc { function CI_Xmlrpc ($config = array()) { - $this->xmlrpcName = $this->xmlrpcName; + $this->xmlrpcName = $this->xmlrpcName; $this->xmlrpc_backslash = chr(92).chr(92); - + // Types for info sent back and forth $this->xmlrpcTypes = array( - $this->xmlrpcI4 => '1', - $this->xmlrpcInt => '1', - $this->xmlrpcBoolean => '1', - $this->xmlrpcString => '1', - $this->xmlrpcDouble => '1', - $this->xmlrpcDateTime => '1', - $this->xmlrpcBase64 => '1', - $this->xmlrpcArray => '2', - $this->xmlrpcStruct => '3' + $this->xmlrpcI4 => '1', + $this->xmlrpcInt => '1', + $this->xmlrpcBoolean => '1', + $this->xmlrpcString => '1', + $this->xmlrpcDouble => '1', + $this->xmlrpcDateTime => '1', + $this->xmlrpcBase64 => '1', + $this->xmlrpcArray => '2', + $this->xmlrpcStruct => '3' ); - + // Array of Valid Parents for Various XML-RPC elements $this->valid_parents = array('BOOLEAN' => array('VALUE'), 'I4' => array('VALUE'), @@ -106,8 +106,8 @@ function CI_Xmlrpc ($config = array()) 'FAULT' => array('METHODRESPONSE'), 'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT') ); - - + + // XML-RPC Responses $this->xmlrpcerr['unknown_method'] = '1'; $this->xmlrpcstr['unknown_method'] = 'This is not a known method for this XML-RPC Server'; @@ -121,13 +121,13 @@ function CI_Xmlrpc ($config = array()) $this->xmlrpcstr['http_error'] = "Did not receive a '200 OK' response from remote server."; $this->xmlrpcerr['no_data'] = '6'; $this->xmlrpcstr['no_data'] ='No data received from server.'; - + $this->initialize($config); - + log_message('debug', "XML-RPC Class Initialized"); } - - + + //------------------------------------- // Initialize Prefs //------------------------------------- @@ -140,13 +140,13 @@ function initialize($config = array()) { if (isset($this->$key)) { - $this->$key = $val; + $this->$key = $val; } } } } // END - + //------------------------------------- // Take URL and parse it //------------------------------------- @@ -157,20 +157,20 @@ function server($url, $port=80) { $url = "http://".$url; } - + $parts = parse_url($url); - + $path = ( ! isset($parts['path'])) ? '/' : $parts['path']; - + if (isset($parts['query']) && $parts['query'] != '') { $path .= '?'.$parts['query']; - } - + } + $this->client = new XML_RPC_Client($path, $parts['host'], $port); } // END - + //------------------------------------- // Set Timeout //------------------------------------- @@ -183,7 +183,7 @@ function timeout($seconds=5) } } // END - + //------------------------------------- // Set Methods //------------------------------------- @@ -193,7 +193,7 @@ function method($function) $this->method = $function; } // END - + //------------------------------------- // Take Array of Data and Create Objects //------------------------------------- @@ -204,17 +204,17 @@ function request($incoming) { // Send Error } - + $this->data = array(); - + foreach($incoming as $key => $value) { $this->data[$key] = $this->values_parsing($value); } } // END - - + + //------------------------------------- // Set Debug //------------------------------------- @@ -223,7 +223,7 @@ function set_debug($flag = TRUE) { $this->debug = ($flag == TRUE) ? TRUE : FALSE; } - + //------------------------------------- // Values Parsing //------------------------------------- @@ -249,7 +249,7 @@ function values_parsing($value, $return = FALSE) { $value['0'][$k] = $this->values_parsing($value['0'][$k], TRUE); } - + $temp = new XML_RPC_Values($value['0'], $value['1']); } else @@ -275,7 +275,7 @@ function send_request() { $this->message = new XML_RPC_Message($this->method,$this->data); $this->message->debug = $this->debug; - + if ( ! $this->result = $this->client->send($this->message)) { $this->error = $this->result->errstr; @@ -286,13 +286,13 @@ function send_request() $this->error = $this->result->errstr; return FALSE; } - + $this->response = $this->result->decode(); - + return TRUE; } // END - + //------------------------------------- // Returns Error //------------------------------------- @@ -302,7 +302,7 @@ function display_error() return $this->error; } // END - + //------------------------------------- // Returns Remote Server Response //------------------------------------- @@ -312,37 +312,37 @@ function display_response() return $this->response; } // END - + //------------------------------------- // Sends an Error Message for Server Request //------------------------------------- - + function send_error_message($number, $message) { return new XML_RPC_Response('0',$number, $message); } // END - - + + //------------------------------------- // Send Response for Server Request //------------------------------------- - + function send_response($response) { // $response should be array of values, which will be parsed // based on their data and type into a valid group of XML-RPC values - + $response = $this->values_parsing($response); - + return new XML_RPC_Response($response); } // END - + } // END XML_RPC Class - - + + /** * XML-RPC Client class * @@ -363,12 +363,12 @@ class XML_RPC_Client extends CI_Xmlrpc function XML_RPC_Client($path, $server, $port=80) { parent::CI_Xmlrpc(); - + $this->port = $port; $this->server = $server; $this->path = $path; } - + function send($msg) { if (is_array($msg)) @@ -382,22 +382,22 @@ function send($msg) } function sendPayload($msg) - { + { $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout); - + if ( ! is_resource($fp)) { error_log($this->xmlrpcstr['http_error']); $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']); return $r; } - + if(empty($msg->payload)) { // $msg = XML_RPC_Messages $msg->createPayload(); } - + $r = "\r\n"; $op = "POST {$this->path} HTTP/1.0$r"; $op .= "Host: {$this->server}$r"; @@ -405,7 +405,7 @@ function sendPayload($msg) $op .= "User-Agent: {$this->xmlrpcName}$r"; $op .= "Content-Length: ".strlen($msg->payload). "$r$r"; $op .= $msg->payload; - + if ( ! fputs($fp, $op, strlen($op))) { @@ -437,7 +437,7 @@ class XML_RPC_Response var $xss_clean = TRUE; function XML_RPC_Response($val, $code = 0, $fstr = '') - { + { if ($code != 0) { // error @@ -470,7 +470,7 @@ function value() { return $this->val; } - + function prepare_response() { $result = "\n"; @@ -500,7 +500,7 @@ function prepare_response() $result .= "\n"; return $result; } - + function decode($array=FALSE) { $CI =& get_instance(); @@ -523,13 +523,13 @@ function decode($array=FALSE) $array[$key] = ($this->xss_clean) ? $CI->security->xss_clean($array[$key]) : $array[$key]; } } - + $result = $array; } else { $result = $this->xmlrpc_decoder($this->val); - + if (is_array($result)) { $result = $this->decode($result); @@ -539,12 +539,12 @@ function decode($array=FALSE) $result = ($this->xss_clean) ? $CI->security->xss_clean($result) : $result; } } - + return $result; } - - + + //------------------------------------- // XML-RPC Object to PHP Types //------------------------------------- @@ -562,7 +562,7 @@ function xmlrpc_decoder($xmlrpc_val) reset($xmlrpc_val->me); list($a,$b) = each($xmlrpc_val->me); $size = count($b); - + $arr = array(); for($i = 0; $i < $size; $i++) @@ -583,8 +583,8 @@ function xmlrpc_decoder($xmlrpc_val) return $arr; } } - - + + //------------------------------------- // ISO-8601 time to server or UTC time //------------------------------------- @@ -602,7 +602,7 @@ function iso8601_decode($time, $utc=0) } return $t; } - + } // End Response Class @@ -619,12 +619,12 @@ class XML_RPC_Message extends CI_Xmlrpc var $payload; var $method_name; var $params = array(); - var $xh = array(); + var $xh = array(); function XML_RPC_Message($method, $pars=0) { parent::CI_Xmlrpc(); - + $this->method_name = $method; if (is_array($pars) && count($pars) > 0) { @@ -635,51 +635,51 @@ function XML_RPC_Message($method, $pars=0) } } } - + //------------------------------------- // Create Payload to Send //------------------------------------- - + function createPayload() { $this->payload = "\r\n\r\n"; $this->payload .= '' . $this->method_name . "\r\n"; $this->payload .= "\r\n"; - + for($i=0; $iparams); $i++) { // $p = XML_RPC_Values $p = $this->params[$i]; $this->payload .= "\r\n".$p->serialize_class()."\r\n"; } - + $this->payload .= "\r\n\r\n"; } - + //------------------------------------- // Parse External XML-RPC Server's Response //------------------------------------- - + function parseResponse($fp) { $data = ''; - + while($datum = fread($fp, 4096)) { $data .= $datum; } - + //------------------------------------- // DISPLAY HTTP CONTENT for DEBUGGING //------------------------------------- - + if ($this->debug === TRUE) { echo "
      ";
       			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
       			echo "
      "; } - + //------------------------------------- // Check for data //------------------------------------- @@ -690,32 +690,32 @@ function parseResponse($fp) $r = new XML_RPC_Response(0, $this->xmlrpcerr['no_data'], $this->xmlrpcstr['no_data']); return $r; } - - + + //------------------------------------- // Check for HTTP 200 Response //------------------------------------- - + if (strncmp($data, 'HTTP', 4) == 0 && ! preg_match('/^HTTP\/[0-9\.]+ 200 /', $data)) { $errstr= substr($data, 0, strpos($data, "\n")-1); $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')'); return $r; } - + //------------------------------------- // Create and Set Up XML Parser //------------------------------------- - + $parser = xml_parser_create($this->xmlrpc_defencoding); - $this->xh[$parser] = array(); - $this->xh[$parser]['isf'] = 0; - $this->xh[$parser]['ac'] = ''; - $this->xh[$parser]['headers'] = array(); - $this->xh[$parser]['stack'] = array(); - $this->xh[$parser]['valuestack'] = array(); - $this->xh[$parser]['isf_reason'] = 0; + $this->xh[$parser] = array(); + $this->xh[$parser]['isf'] = 0; + $this->xh[$parser]['ac'] = ''; + $this->xh[$parser]['headers'] = array(); + $this->xh[$parser]['stack'] = array(); + $this->xh[$parser]['valuestack'] = array(); + $this->xh[$parser]['isf_reason'] = 0; xml_set_object($parser, $this); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true); @@ -727,7 +727,7 @@ function parseResponse($fp) //------------------------------------- // GET HEADERS //------------------------------------- - + $lines = explode("\r\n", $data); while (($line = array_shift($lines))) { @@ -738,11 +738,11 @@ function parseResponse($fp) $this->xh[$parser]['headers'][] = $line; } $data = implode("\r\n", $lines); - - + + //------------------------------------- // PARSE XML DATA - //------------------------------------- + //------------------------------------- if ( ! xml_parse($parser, $data, count($data))) { @@ -755,11 +755,11 @@ function parseResponse($fp) return $r; } xml_parser_free($parser); - + // --------------------------------------- // Got Ourselves Some Badness, It Seems // --------------------------------------- - + if ($this->xh[$parser]['isf'] > 1) { if ($this->debug === TRUE) @@ -768,7 +768,7 @@ function parseResponse($fp) echo $this->xh[$parser]['isf_reason']; echo "---Invalid Return---\n\n"; } - + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); return $r; } @@ -777,15 +777,15 @@ function parseResponse($fp) $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); return $r; } - + //------------------------------------- // DISPLAY XML CONTENT for DEBUGGING - //------------------------------------- - + //------------------------------------- + if ($this->debug === TRUE) { echo "
      ";
      -			
      +
       			if (count($this->xh[$parser]['headers'] > 0))
       			{
       				echo "---HEADERS---\n";
      @@ -795,20 +795,20 @@ function parseResponse($fp)
       				}
       				echo "---END HEADERS---\n\n";
       			}
      -			
      +
       			echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n";
      -			
      +
       			echo "---PARSED---\n" ;
       			var_dump($this->xh[$parser]['value']);
       			echo "\n---END PARSED---
      "; } - + //------------------------------------- // SEND RESPONSE //------------------------------------- - + $v = $this->xh[$parser]['value']; - + if ($this->xh[$parser]['isf']) { $errno_v = $v->me['struct']['faultCode']; @@ -831,11 +831,11 @@ function parseResponse($fp) $r->headers = $this->xh[$parser]['headers']; return $r; } - + // ------------------------------------ // Begin Return Message Parsing section // ------------------------------------ - + // quick explanation of components: // ac - used to accumulate values // isf - used to indicate a fault @@ -854,9 +854,9 @@ function open_tag($the_parser, $name, $attrs) { // If invalid nesting, then return if ($this->xh[$the_parser]['isf'] > 1) return; - + // Evaluate and check for correct nesting of XML elements - + if (count($this->xh[$the_parser]['stack']) == 0) { if ($name != 'METHODRESPONSE' && $name != 'METHODCALL') @@ -876,16 +876,16 @@ function open_tag($the_parser, $name, $attrs) return; } } - + switch($name) { case 'STRUCT': case 'ARRAY': // Creates array for child elements - + $cur_val = array('value' => array(), 'type' => $name); - + array_unshift($this->xh[$the_parser]['valuestack'], $cur_val); break; case 'METHODNAME': @@ -917,13 +917,13 @@ function open_tag($the_parser, $name, $attrs) $this->xh[$the_parser]['isf_reason'] = "'Twas a $name element following a ".$this->xh[$the_parser]['vt']." element inside a single value"; return; } - + $this->xh[$the_parser]['ac'] = ''; break; case 'MEMBER': // Set name of to nothing to prevent errors later if no is found $this->xh[$the_parser]['valuestack'][0]['name'] = ''; - + // Set NULL value to check to see if value passed for this param/member $this->xh[$the_parser]['value'] = null; break; @@ -939,7 +939,7 @@ function open_tag($the_parser, $name, $attrs) $this->xh[$the_parser]['isf_reason'] = "Invalid XML-RPC element found: $name"; break; } - + // Add current element name to stack, to allow validation of nesting array_unshift($this->xh[$the_parser]['stack'], $name); @@ -955,14 +955,14 @@ function open_tag($the_parser, $name, $attrs) function closing_tag($the_parser, $name) { if ($this->xh[$the_parser]['isf'] > 1) return; - + // Remove current element from stack and set variable // NOTE: If the XML validates, then we do not have to worry about // the opening and closing of elements. Nesting is checked on the opening // tag so we be safe there as well. - + $curr_elem = array_shift($this->xh[$the_parser]['stack']); - + switch($name) { case 'STRUCT': @@ -982,7 +982,7 @@ function closing_tag($the_parser, $name) case 'DATETIME.ISO8601': case 'BASE64': $this->xh[$the_parser]['vt'] = strtolower($name); - + if ($name == 'STRING') { $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; @@ -1044,10 +1044,10 @@ function closing_tag($the_parser, $name) $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; $this->xh[$the_parser]['vt'] = $this->xmlrpcString; } - + // build the XML-RPC value out of the data received, and substitute it $temp = new XML_RPC_Values($this->xh[$the_parser]['value'], $this->xh[$the_parser]['vt']); - + if (count($this->xh[$the_parser]['valuestack']) && $this->xh[$the_parser]['valuestack'][0]['type'] == 'ARRAY') { // Array @@ -1061,7 +1061,7 @@ function closing_tag($the_parser, $name) break; case 'MEMBER': $this->xh[$the_parser]['ac']=''; - + // If value add to array in the stack for the last element built if ($this->xh[$the_parser]['value']) { @@ -1099,7 +1099,7 @@ function closing_tag($the_parser, $name) function character_data($the_parser, $data) { if ($this->xh[$the_parser]['isf'] > 1) return; // XML Fault found already - + // If a value has not been found if ($this->xh[$the_parser]['lv'] != 3) { @@ -1107,28 +1107,28 @@ function character_data($the_parser, $data) { $this->xh[$the_parser]['lv'] = 2; // Found a value } - + if( ! @isset($this->xh[$the_parser]['ac'])) { $this->xh[$the_parser]['ac'] = ''; } - + $this->xh[$the_parser]['ac'] .= $data; } } - - + + function addParam($par) { $this->params[]=$par; } - + function output_parameters($array=FALSE) { - $CI =& get_instance(); + $CI =& get_instance(); if ($this->xss_clean && ! isset($CI->security)) { $CI->load->library('security'); } - + if ($array !== FALSE && is_array($array)) { while (list($key) = each($array)) @@ -1144,17 +1144,17 @@ function output_parameters($array=FALSE) $array[$key] = ($key == 'bits' OR $this->xss_clean == FALSE) ? $array[$key] : $CI->security->xss_clean($array[$key]); } } - + $parameters = $array; } else { $parameters = array(); - + for ($i = 0; $i < count($this->params); $i++) { $a_param = $this->decode_message($this->params[$i]); - + if (is_array($a_param)) { $parameters[] = $this->output_parameters($a_param); @@ -1163,13 +1163,13 @@ function output_parameters($array=FALSE) { $parameters[] = ($this->xss_clean) ? $CI->security->xss_clean($a_param) : $a_param; } - } + } } - + return $parameters; } - - + + function decode_message($param) { $kind = $param->kindOf(); @@ -1182,31 +1182,31 @@ function decode_message($param) { reset($param->me); list($a,$b) = each($param->me); - + $arr = array(); for($i = 0; $i < count($b); $i++) { $arr[] = $this->decode_message($param->me['array'][$i]); } - + return $arr; } elseif($kind == 'struct') { reset($param->me['struct']); - + $arr = array(); while(list($key,$value) = each($param->me['struct'])) { $arr[$key] = $this->decode_message($value); } - + return $arr; } } - + } // End XML_RPC_Messages class @@ -1220,17 +1220,17 @@ function decode_message($param) */ class XML_RPC_Values extends CI_Xmlrpc { - var $me = array(); + var $me = array(); var $mytype = 0; function XML_RPC_Values($val=-1, $type='') - { + { parent::CI_Xmlrpc(); - + if ($val != -1 OR $type != '') { $type = $type == '' ? 'string' : $type; - + if ($this->xmlrpcTypes[$type] == 1) { $this->addScalar($val,$type); @@ -1249,13 +1249,13 @@ function XML_RPC_Values($val=-1, $type='') function addScalar($val, $type='string') { $typeof = $this->xmlrpcTypes[$type]; - + if ($this->mytype==1) { echo 'XML_RPC_Values: scalar can have only one value
      '; return 0; } - + if ($typeof != 1) { echo 'XML_RPC_Values: not a scalar type (${typeof})
      '; @@ -1392,12 +1392,12 @@ function serializeval($o) { $ar = $o->me; reset($ar); - + list($typ, $val) = each($ar); $rs = "\n".$this->serializedata($typ, $val)."\n"; return $rs; } - + function scalarval() { reset($this->me); @@ -1409,11 +1409,11 @@ function scalarval() //------------------------------------- // Encode time in ISO-8601 form. //------------------------------------- - + // Useful for sending time in XML-RPC function iso8601_encode($time, $utc=0) - { + { if ($utc == 1) { $t = strftime("%Y%m%dT%H:%M:%S", $time); @@ -1427,7 +1427,7 @@ function iso8601_encode($time, $utc=0) } return $t; } - + } // END XML_RPC_Values Class diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index c1fe649f..56fd655d 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -14,7 +14,7 @@ */ if ( ! function_exists('xml_parser_create')) -{ +{ show_error('Your PHP installation does not support XML'); } @@ -36,11 +36,11 @@ */ class CI_Xmlrpcs extends CI_Xmlrpc { - var $methods = array(); //array of methods mapped to function names and signatures + var $methods = array(); //array of methods mapped to function names and signatures var $debug_msg = ''; // Debug Message - var $system_methods = array(); // XML RPC Server methods + var $system_methods = array(); // XML RPC Server methods var $controller_obj; - + var $object = FALSE; @@ -49,49 +49,49 @@ class CI_Xmlrpcs extends CI_Xmlrpc //------------------------------------- function CI_Xmlrpcs($config=array()) - { + { parent::CI_Xmlrpc(); $this->set_system_methods(); - + if (isset($config['functions']) && is_array($config['functions'])) { $this->methods = array_merge($this->methods, $config['functions']); } - + log_message('debug', "XML-RPC Server Class Initialized"); } - + //------------------------------------- // Initialize Prefs and Serve //------------------------------------- - + function initialize($config=array()) - { + { if (isset($config['functions']) && is_array($config['functions'])) { $this->methods = array_merge($this->methods, $config['functions']); } - + if (isset($config['debug'])) { $this->debug = $config['debug']; } - + if (isset($config['object']) && is_object($config['object'])) { $this->object = $config['object']; } - + if (isset($config['xss_clean'])) { $this->xss_clean = $config['xss_clean']; } } - + //------------------------------------- // Setting of System Methods //------------------------------------- - + function set_system_methods () { $this->methods = array( @@ -118,14 +118,14 @@ function set_system_methods () //------------------------------------- // Main Server Function //------------------------------------- - + function serve() { $r = $this->parseRequest(); $payload = 'xmlrpc_defencoding.'"?'.'>'."\n"; $payload .= $this->debug_msg; $payload .= $r->prepare_response(); - + header("Content-Type: text/xml"); header("Content-Length: ".strlen($payload)); exit($payload); @@ -134,7 +134,7 @@ function serve() //------------------------------------- // Add Method to Class //------------------------------------- - + function add_to_map($methodname,$function,$sig,$doc) { $this->methods[$methodname] = array( @@ -148,11 +148,11 @@ function add_to_map($methodname,$function,$sig,$doc) //------------------------------------- // Parse Server Request //------------------------------------- - + function parseRequest($data='') { global $HTTP_RAW_POST_DATA; - + //------------------------------------- // Get Data //------------------------------------- @@ -165,10 +165,10 @@ function parseRequest($data='') //------------------------------------- // Set up XML Parser //------------------------------------- - + $parser = xml_parser_create($this->xmlrpc_defencoding); $parser_object = new XML_RPC_Message("filler"); - + $parser_object->xh[$parser] = array(); $parser_object->xh[$parser]['isf'] = 0; $parser_object->xh[$parser]['isf_reason'] = ''; @@ -182,12 +182,12 @@ function parseRequest($data='') xml_set_element_handler($parser, 'open_tag', 'closing_tag'); xml_set_character_data_handler($parser, 'character_data'); //xml_set_default_handler($parser, 'default_handler'); - - + + //------------------------------------- // PARSE + PROCESS XML DATA - //------------------------------------- - + //------------------------------------- + if ( ! xml_parse($parser, $data, 1)) { // return XML error as a faultCode @@ -205,53 +205,53 @@ function parseRequest($data='') else { xml_parser_free($parser); - + $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); $plist=''; - + for($i=0; $i < count($parser_object->xh[$parser]['params']); $i++) { if ($this->debug === TRUE) { $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; } - + $m->addParam($parser_object->xh[$parser]['params'][$i]); } - + if ($this->debug === TRUE) { echo "
      ";
       				echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n";
       				echo "
      "; } - + $r = $this->_execute($m); } - + //------------------------------------- // SET DEBUGGING MESSAGE - //------------------------------------- - + //------------------------------------- + if ($this->debug === TRUE) { $this->debug_msg = "\n"; } - + return $r; } //------------------------------------- // Executes the Method //------------------------------------- - + function _execute($m) { $methName = $m->method_name; - + // Check to see if it is a system call $system_call = (strncmp($methName, 'system', 5) == 0) ? TRUE : FALSE; - + if ($this->xss_clean == FALSE) { $m->xss_clean = FALSE; @@ -260,19 +260,19 @@ function _execute($m) //------------------------------------- // Valid Method //------------------------------------- - + if ( ! isset($this->methods[$methName]['function'])) { return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } - + //------------------------------------- // Check for Method (and Object) //------------------------------------- - + $method_parts = explode(".", $this->methods[$methName]['function']); $objectCall = (isset($method_parts['1']) && $method_parts['1'] != "") ? TRUE : FALSE; - + if ($system_call === TRUE) { if ( ! is_callable(array($this,$method_parts['1']))) @@ -291,30 +291,30 @@ function _execute($m) return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); } } - + //------------------------------------- // Checking Methods Signature //------------------------------------- - + if (isset($this->methods[$methName]['signature'])) { $sig = $this->methods[$methName]['signature']; for($i=0; $iparams)+1) { for($n=0; $n < count($m->params); $n++) { $p = $m->params[$n]; $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); - + if ($pt != $current_sig[$n+1]) { $pno = $n+1; $wanted = $current_sig[$n+1]; - + return new XML_RPC_Response(0, $this->xmlrpcerr['incorrect_params'], $this->xmlrpcstr['incorrect_params'] . @@ -354,22 +354,22 @@ function _execute($m) return call_user_func($this->methods[$methName]['function'], $m); } } - - + + //------------------------------------- // Server Function: List Methods //------------------------------------- - + function listMethods($m) { $v = new XML_RPC_Values(); $output = array(); - + foreach($this->methods as $key => $value) { $output[] = new XML_RPC_Values($key, 'string'); } - + foreach($this->system_methods as $key => $value) { $output[]= new XML_RPC_Values($key, 'string'); @@ -378,23 +378,23 @@ function listMethods($m) $v->addArray($output); return new XML_RPC_Response($v); } - + //------------------------------------- // Server Function: Return Signature for Method //------------------------------------- - + function methodSignature($m) { $parameters = $m->output_parameters(); $method_name = $parameters[0]; - + if (isset($this->methods[$method_name])) { if ($this->methods[$method_name]['signature']) { $sigs = array(); $signature = $this->methods[$method_name]['signature']; - + for($i=0; $i < count($signature); $i++) { $cursig = array(); @@ -418,20 +418,20 @@ function methodSignature($m) } return $r; } - + //------------------------------------- // Server Function: Doc String for Method //------------------------------------- - + function methodHelp($m) { $parameters = $m->output_parameters(); $method_name = $parameters[0]; - + if (isset($this->methods[$method_name])) { $docstring = isset($this->methods[$method_name]['docstring']) ? $this->methods[$method_name]['docstring'] : ''; - + return new XML_RPC_Response(new XML_RPC_Values($docstring, 'string')); } else @@ -448,7 +448,7 @@ function multicall($m) { // Disabled return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - + $parameters = $m->output_parameters(); $calls = $parameters[0]; @@ -457,15 +457,15 @@ function multicall($m) foreach ($calls as $value) { //$attempt = $this->_execute(new XML_RPC_Message($value[0], $value[1])); - + $m = new XML_RPC_Message($value[0]); $plist=''; - + for($i=0; $i < count($value[1]); $i++) { $m->addParam(new XML_RPC_Values($value[1][$i], 'string')); } - + $attempt = $this->_execute($m); if ($attempt->faultCode() != 0) @@ -478,8 +478,8 @@ function multicall($m) return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); } - - + + //------------------------------------- // Multi-call Function: Error Handling //------------------------------------- @@ -488,28 +488,28 @@ function multicall_error($err) { $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); - + $struct['faultCode'] = new XML_RPC_Values($code, 'int'); $struct['faultString'] = new XML_RPC_Values($str, 'string'); - + return new XML_RPC_Values($struct, 'struct'); } - - + + //------------------------------------- // Multi-call Function: Processes method //------------------------------------- - + function do_multicall($call) { if ($call->kindOf() != 'struct') return $this->multicall_error('notstruct'); elseif ( ! $methName = $call->me['struct']['methodName']) return $this->multicall_error('nomethod'); - + list($scalar_type,$scalar_value)=each($methName->me); $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; - + if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string') return $this->multicall_error('notstring'); elseif ($scalar_value == 'system.multicall') @@ -518,7 +518,7 @@ function do_multicall($call) return $this->multicall_error('noparams'); elseif ($params->kindOf() != 'array') return $this->multicall_error('notarray'); - + list($a,$b)=each($params->me); $numParams = count($b); @@ -536,8 +536,8 @@ function do_multicall($call) } return new XML_RPC_Values(array($result->value()), 'array'); - } - + } + } // END XML_RPC_Server class diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 92dfc814..da3e5eb6 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -32,17 +32,17 @@ */ class CI_Zip { - var $zipdata = ''; - var $directory = ''; - var $entries = 0; - var $file_num = 0; + var $zipdata = ''; + var $directory = ''; + var $entries = 0; + var $file_num = 0; var $offset = 0; var $now; function CI_Zip() { log_message('debug', "Zip Compression Class Initialized"); - + $this->now = time(); } @@ -72,24 +72,24 @@ function add_dir($directory) } } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------- /** * Get file/directory modification time - * + * * If this is a newly created file/dir, we will set the time to 'now' * * @param string path to file - * @return array filemtime/filemdate + * @return array filemtime/filemdate */ function _get_mod_time($dir) { // filemtime() will return false, but it does raise an error. - $date = (@filemtime($dir)) ? filemtime($dir) : getdate($this->now); + $date = (@filemtime($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']; - + return $time; } @@ -103,7 +103,7 @@ function _get_mod_time($dir) * @return void */ function _add_dir($dir, $file_mtime, $file_mdate) - { + { $dir = str_replace("\\", "/", $dir); $this->zipdata .= @@ -140,7 +140,7 @@ function _add_dir($dir, $file_mtime, $file_mdate) $this->offset = strlen($this->zipdata); $this->entries++; } - + // -------------------------------------------------------------------- /** @@ -154,14 +154,14 @@ function _add_dir($dir, $file_mtime, $file_mdate) * @param mixed * @param string * @return void - */ + */ function add_data($filepath, $data = NULL) - { + { if (is_array($filepath)) { foreach ($filepath as $path => $data) { - $file_data = $this->_get_mod_time($path); + $file_data = $this->_get_mod_time($path); $this->_add_data($path, $data, $file_data['file_mtime'], $file_data['file_mdate']); } @@ -169,7 +169,7 @@ function add_data($filepath, $data = NULL) else { $file_data = $this->_get_mod_time($filepath); - + $this->_add_data($filepath, $data, $file_data['file_mtime'], $file_data['file_mdate']); } } @@ -183,7 +183,7 @@ function add_data($filepath, $data = NULL) * @param string the file name/path * @param string the data to be encoded * @return void - */ + */ function _add_data($filepath, $data, $file_mtime, $file_mdate) { $filepath = str_replace("\\", "/", $filepath); @@ -227,7 +227,7 @@ function _add_data($filepath, $data, $file_mtime, $file_mdate) $this->entries++; $this->file_num++; } - + // -------------------------------------------------------------------- /** @@ -235,7 +235,7 @@ function _add_data($filepath, $data, $file_mtime, $file_mdate) * * @access public * @return bool - */ + */ function read_file($path, $preserve_filepath = FALSE) { if ( ! file_exists($path)) @@ -246,7 +246,7 @@ function read_file($path, $preserve_filepath = FALSE) if (FALSE !== ($data = file_get_contents($path))) { $name = str_replace("\\", "/", $path); - + if ($preserve_filepath === FALSE) { $name = preg_replace("|.*/(.+)|", "\\1", $name); @@ -259,7 +259,7 @@ function read_file($path, $preserve_filepath = FALSE) } // ------------------------------------------------------------------------ - + /** * Read a directory and add it to the zip. * @@ -321,7 +321,7 @@ function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) * * @access public * @return binary string - */ + */ function get_zip() { // Is there any data to return? @@ -340,7 +340,7 @@ function get_zip() return $zip_data; } - + // -------------------------------------------------------------------- /** @@ -351,7 +351,7 @@ function get_zip() * @access public * @param string the file name * @return bool - */ + */ function archive($filepath) { if ( ! ($fp = @fopen($filepath, FOPEN_WRITE_CREATE_DESTRUCTIVE))) @@ -359,12 +359,12 @@ function archive($filepath) return FALSE; } - flock($fp, LOCK_EX); + flock($fp, LOCK_EX); fwrite($fp, $this->get_zip()); flock($fp, LOCK_UN); fclose($fp); - return TRUE; + return TRUE; } // -------------------------------------------------------------------- @@ -404,7 +404,7 @@ function download($filename = 'backup.zip') * * @access public * @return void - */ + */ function clear_data() { $this->zipdata = ''; @@ -413,7 +413,7 @@ function clear_data() $this->file_num = 0; $this->offset = 0; } - + } /* End of file Zip.php */ diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php index f6b8dce6..db80c142 100644 --- a/system/libraries/javascript/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -173,7 +173,7 @@ function _focus($element = 'this', $js = '') * @param string - element * @param string - Javascript code for mouse over * @param string - Javascript code for mouse out - * @return string + * @return string */ function _hover($element = 'this', $over, $out) { @@ -390,7 +390,7 @@ function _unload($element = 'this', $js = '') * * @access private * @param string - element - * @return string + * @return string */ function _addClass($element = 'this', $class='') { @@ -410,7 +410,7 @@ function _addClass($element = 'this', $class='') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _animate($element = 'this', $params = array(), $speed = '', $extra = '') { @@ -452,7 +452,7 @@ function _animate($element = 'this', $params = array(), $speed = '', $extra = '' * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _fadeIn($element = 'this', $speed = '', $callback = '') { @@ -480,7 +480,7 @@ function _fadeIn($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _fadeOut($element = 'this', $speed = '', $callback = '') { @@ -508,7 +508,7 @@ function _fadeOut($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _hide($element = 'this', $speed = '', $callback = '') { @@ -534,7 +534,7 @@ function _hide($element = 'this', $speed = '', $callback = '') * * @access private * @param string - element - * @return string + * @return string */ function _removeClass($element = 'this', $class='') { @@ -554,7 +554,7 @@ function _removeClass($element = 'this', $class='') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _slideUp($element = 'this', $speed = '', $callback = '') { @@ -582,7 +582,7 @@ function _slideUp($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _slideDown($element = 'this', $speed = '', $callback = '') { @@ -610,7 +610,7 @@ function _slideDown($element = 'this', $speed = '', $callback = '') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _slideToggle($element = 'this', $speed = '', $callback = '') { @@ -636,7 +636,7 @@ function _slideToggle($element = 'this', $speed = '', $callback = '') * * @access private * @param string - element - * @return string + * @return string */ function _toggle($element = 'this') { @@ -654,7 +654,7 @@ function _toggle($element = 'this') * * @access private * @param string - element - * @return string + * @return string */ function _toggleClass($element = 'this', $class='') { @@ -674,7 +674,7 @@ function _toggleClass($element = 'this', $class='') * @param string - element * @param string - One of 'slow', 'normal', 'fast', or time in milliseconds * @param string - Javascript callback function - * @return string + * @return string */ function _show($element = 'this', $speed = '', $callback = '') { @@ -884,7 +884,7 @@ function sortable($element, $options = array()) } // -------------------------------------------------------------------- - + /** * Table Sorter Plugin * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 58fd7800..8a275dda 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -95,7 +95,7 @@

      Version 2.0.0

    85. The Unit Test Class now has an optional "notes" field available to it, and allows for discrete display of test result items using $this->unit->set_test_items().
    86. Added a $xss_clean class variable to the XMLRPC library, enabling control over the use of the Security library's xss_clean() method.
    87. Added a download() method to the FTP library
    88. -
    89. Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
    90. +
    91. Changed do_xss_clean() to return FALSE if the uploaded file fails XSS checks.
    92. Added stripslashes() and trim()ing of double quotes from $_FILES type value to standardize input in Upload library.
    93. Added a second parameter (boolean) to $this->zip->read_dir('/path/to/directory', FALSE) to remove the preceding trail of empty folders when creating a Zip archive. This example would contain a zip with "directory" and all of its contents.
    94. Added ability in the Image Library to handle PNG transparency for resize operations when using the GD lib.
    95. @@ -129,7 +129,7 @@

      Version 2.0.0

    96. Non-backwards compatible change made to get_dir_file_info() in the File Helper. No longer recurses by default so as to encourage responsible use (this function can cause server performance issues when used without caution).
    97. Modified the second parameter of directory_map() in the Directory Helper to accept an integer to specify recursion depth.
    98. -
    99. Modified delete_files() in the File Helper to return FALSE on failure.
    100. +
    101. Modified delete_files() in the File Helper to return FALSE on failure.
    102. Added an optional second parameter to byte_format() in the Number Helper to allow for decimal precision.
    103. Added alpha, and sha1 string types to random_string() in the String Helper.
    104. Modified prep_url() so as to not prepend http:// if the supplied string already has a scheme.
    105. @@ -227,7 +227,7 @@

      Version 1.7.2

    106. Modified show_error() to allow sending of HTTP server response codes.
    107. Modified show_404() to send 404 status code, removing non-CGI compatible header() statement from error_404.php template.
    108. Added set_status_header() to the Common functions to allow use when the Output class is unavailable.
    109. -
    110. Added is_php() to Common functions to facilitate PHP version comparisons.

      +
    111. Added is_php() to Common functions to facilitate PHP version comparisons.

    112. Added 2 CodeIgniter "cheatsheets" (thanks to DesignFellow.com for this contribution).
    113. @@ -252,7 +252,7 @@

      Bug fixes for 1.7.2

    114. Fixed a bug in form_textarea() where form data was not prepped correctly.
    115. Fixed a bug in form_prep() causing it to not preserve entities in the user's original input when called back into a form element
    116. Fixed a bug in _protect_identifiers() where the swap prefix ($swap_pre) was not being observed.
    117. -
    118. Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
    119. +
    120. Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
    121. Fixed a bug in the typography class where heading tags could have paragraph tags inserted when using auto_typography().
    122. @@ -363,7 +363,7 @@

      Version 1.7

    123. Database
        -
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • +
      • Improved Active Record class to allow full path column and table names: hostname.database.table.column. Also improved the alias handling.
      • Improved how table and column names are escaped and prefixed. It now honors full path names when adding prefixes and escaping.
      • Added Active Record caching feature to "update" and "delete" functions.
      • Added removal of non-printing control characters in escape_str() of DB drivers that do not have native PHP escaping mechanisms (mssql, oci8, odbc), to avoid potential SQL errors, and possible sources of SQL injection.
      • @@ -553,7 +553,7 @@

        Version 1.6.2

        • Added ability for xss_clean() to accept arrays.
        • Removed closing PHP tags from all PHP files to avoid accidental output and potential 'cannot modify headers' errors.
        • -
        • Removed "scripts" from the auto-load search path. Scripts were deprecated +
        • Removed "scripts" from the auto-load search path. Scripts were deprecated in Version 1.4.1 (September 21, 2006). If you still need to use them for legacy reasons, they must now be manually loaded in each Controller.
        • Added a Reserved Names page to the userguide, and migrated reserved controller names into it.
        • Added a Common Functions page to the userguide for globally available functions.
        • @@ -599,7 +599,7 @@

          Version 1.6.1

          Release Date: February 12, 2008
          Hg Tag: 1.6.1

            -
          • Active Record +
          • Active Record
            • Added Active Record Caching.
            • Made Active Record fully database-prefix aware.
            • @@ -674,7 +674,7 @@

              Version 1.6.0

            • Changed the behaviour of variables submitted to the where() clause with no values to auto set "IS NULL"
          • - +
          • Other Database Related
            • MySQL driver now requires MySQL 4.1+
            • @@ -690,19 +690,19 @@

              Version 1.6.0

              in harmony with the global nature of the behavior (#1834).
          • - +
          • Core changes
            • Added ability to load multiple views, whose content will be appended to the output in the order loaded.
            • Added the ability to auto-load Models.
            • Reorganized the URI and Routes classes for better clarity.
            • -
            • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
            • +
            • Added Compat.php to allow function overrides for older versions of PHP or PHP environments missing certain extensions / libraries
            • Added memory usage, GET, URI string data, and individual query execution time to Profiler output.
            • Deprecated Scaffolding.
            • Added is_really_writable() to Common.php to provide a cross-platform reliable method of testing file/folder writability.
          • - +
          • Libraries
            • Changed the load protocol of Models to allow for extension.
            • @@ -722,7 +722,7 @@

              Version 1.6.0

            • Enabled the 'system' methods for the XML-RPC Server library, except for 'system.multicall' which is still disabled.
          • - +
          • Helpers & Plugins
            • Added link_tag() to the HTML helper.
            • @@ -738,8 +738,8 @@

              Version 1.6.0

            • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it.
          • + -
          • Documentation Changes
            • Added Writing Documentation section for the community to use in writing their own documentation.
            • @@ -756,7 +756,7 @@

              Version 1.6.0

            Bug fixes for Version 1.6.0

            - +
            • Fixed a bug (#1813) preventing using $CI->db in the same application with returned database objects.
            • Fixed a bug (#1842) where the $this->uri->rsegments array would not include the 'index' method if routed to the controller without an implicit method.
            • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 482115cc..065db491 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -220,20 +220,20 @@

              $this->db->where();

              $this->db->where('name', $name);

              // Produces: WHERE name = 'Joe'
              - +

              Notice that the equal sign is added for you.

              - +

              If you use multiple function calls they will be chained together with AND between them:

              - + $this->db->where('name', $name);
              $this->db->where('title', $title);
              $this->db->where('status', $status);

              // WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
              - +
            • Custom key/value method: - +

              You can include an operator in the first parameter in order to control the comparison:

              - + $this->db->where('name !=', $name);
              $this->db->where('id <', $id);

              // Produces: WHERE name != 'Joe' AND id < 45
            • @@ -242,7 +242,7 @@

              $this->db->where();

              $array = array('name' => $name, 'title' => $title, 'status' => $status);

              - + $this->db->where($array);

              // Produces: WHERE name = 'Joe' AND title = 'boss' AND status = 'active'
              @@ -250,10 +250,10 @@

              $this->db->where();

              $array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);

              - + $this->db->where($array);
            • Custom string: - +

              You can write your own clauses manually:

              @@ -263,7 +263,7 @@

              $this->db->where();

              $this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks.

              -

              $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE);
              +

              $this->db->where('MATCH (field) AGAINST ("value")', NULL, FALSE);

              $this->db->or_where();

              This function is identical to the one above, except that multiple instances are joined by OR:

              @@ -290,7 +290,7 @@

              $this->db->or_where_in();

              $names = array('Frank', 'Todd', 'James');
              $this->db->or_where_in('username', $names);
              // Produces: OR username IN ('Frank', 'Todd', 'James')

              - +

              $this->db->where_not_in();

              Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate

              @@ -316,14 +316,14 @@

              $this->db->like();

              $this->db->like('title', 'match');

              // Produces: WHERE title LIKE '%match%'
              - +

              If you use multiple function calls they will be chained together with AND between them:

              - + $this->db->like('title', 'match');
              $this->db->like('body', 'match');

              // WHERE title LIKE '%match%' AND body LIKE '%match%
              - If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). + If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are 'before', 'after' and 'both' (which is the default). $this->db->like('title', 'match', 'before');
              // Produces: WHERE title LIKE '%match'
              @@ -333,17 +333,17 @@

              $this->db->like();


              $this->db->like('title', 'match', 'both');
              // Produces: WHERE title LIKE '%match%'
            • - +
            • Associative array method: $array = array('title' => $match, 'page1' => $match, 'page2' => $match);

              - + $this->db->like($array);

              // WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'
    - - + +

    $this->db->or_like();

    This function is identical to the one above, except that multiple instances are joined by OR:

    @@ -355,7 +355,7 @@

    $this->db->or_like();

    - +

    Note: or_like() was formerly known as orlike(), which has been removed.

    $this->db->not_like();

    This function is identical to like(), except that it generates NOT LIKE statements:

    @@ -370,17 +370,17 @@

    $this->db->or_not_like();

    // WHERE title LIKE '%match% OR body NOT LIKE '%match%'

    $this->db->group_by();

    Permits you to write the GROUP BY portion of your query:

    - + $this->db->group_by("title");

    // Produces: GROUP BY title

    You can also pass an array of multiple values as well:

    - + $this->db->group_by(array("title", "date"));

    // Produces: GROUP BY title, date
    - +

    Note: group_by() was formerly known as groupby(), which has been removed.

    $this->db->distinct();
    @@ -392,7 +392,7 @@

    $this->db->distinct();
    // Produces: SELECT DISTINCT * FROM table

    $this->db->having();

    Permits you to write the HAVING portion of your query. There are 2 possible syntaxes, 1 argument or 2:

    - + $this->db->having('user_id = 45');
    // Produces: HAVING user_id = 45
    @@ -401,7 +401,7 @@

    $this->db->having();

    // Produces: HAVING user_id = 45

    - +

    You can also pass an array of multiple values as well:

    @@ -419,14 +419,14 @@

    $this->db->or_having();

    $this->db->order_by();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are asc or desc, or random.

    - + $this->db->order_by("title", "desc");

    // Produces: ORDER BY title DESC

    You can also pass your own string in the first parameter:

    - + $this->db->order_by('title desc, name asc');

    // Produces: ORDER BY title DESC, name ASC @@ -479,10 +479,10 @@

    $this->db->count_all();

    // Produces an integer, like 25
    - +  

    Inserting Data

    - +

    $this->db->insert();

    Generates an insert string based on the data you supply, and runs the query. You can either pass an array or an object to the function. Here is an example using an array:

    @@ -520,9 +520,9 @@

    $this->db->insert();

    The first parameter will contain the table name, the second is an associative array of values.

    Note: All values are escaped automatically producing safer queries.

    - - - + + +

    $this->db->set();

    This function enables you to set values for inserts or updates.

    @@ -576,10 +576,10 @@

    $this->db->set();

    - +  

    Updating Data

    - +

    $this->db->update();

    Generates an update string and runs the query based on the data you supply. You can pass an array or an object to the function. Here is an example using @@ -625,7 +625,7 @@

    $this->db->update();

    Note: All values are escaped automatically producing safer queries.

    - +

    You'll notice the use of the $this->db->where() function, enabling you to set the WHERE clause. You can optionally pass this information directly into the update function as a string:

    @@ -634,15 +634,15 @@

    $this->db->update();

    Or as an array:

    $this->db->update('mytable', $data, array('id' => $id)); - +

    You may also use the $this->db->set() function described above when performing updates.

    - +  

    Deleting Data

    - +

    $this->db->delete();

    Generates a delete SQL string and runs the query.

    diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index fe09d2b1..46dfe89d 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -97,7 +97,7 @@

    $this->db->call_function();

    - + diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 30d39a42..e5cc4777 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -142,7 +142,7 @@

    $this->db->field_data()

  • primary_key - 1 if the column is a primary key
  • type - the type of the column
  • - + diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 45d15dba..381592c2 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -78,7 +78,7 @@

    The Database Class

  • Database manipulation with Database Forge
  • Database Utilities Class
  • - + diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index 7a6734c4..c8a30494 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -132,7 +132,7 @@

    Query Bindings

    The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.

    The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.

    - + diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 9eaa1793..410dac84 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -65,11 +65,11 @@

    Generating Query Results

    There are several ways to generate query results:

    result()

    - +

    This function returns the query result as an array of objects, or an empty array on failure. - + Typically you'll use this in a foreach loop, like this:

    - + $query = $this->db->query("YOUR QUERY");

    @@ -79,11 +79,11 @@

    result()

       echo $row->name;
       echo $row->body;
    }
    - +

    The above function is an alias of result_object().

    If you run queries that might not produce a result, you are encouraged to test the result first:

    - + $query = $this->db->query("YOUR QUERY");

    @@ -97,9 +97,9 @@

    result()

       }
    }
    - +

    result_array()

    - +

    This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

    $query = $this->db->query("YOUR QUERY");
    @@ -113,7 +113,7 @@

    result_array()

    row()

    - +

    This function returns a single result row. If your query has more than one row, it returns only the first row. The result is returned as an object. Here's a usage example:

    @@ -128,9 +128,9 @@

    row()

       echo $row->body;
    }
    - +

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    - + $row = $query->row(5); @@ -151,13 +151,13 @@

    row_array()

    }
    - +

    If you want a specific row returned you can submit the row number as a digit in the first parameter:

    - + $row = $query->row_array(5); - -

    In addition, you can walk forward/backwards/first/last through your results using these variations:

    + +

    In addition, you can walk forward/backwards/first/last through your results using these variations:

    $row = $query->first_row()
    @@ -217,7 +217,7 @@

    $query->free_result()

    - + diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index c85408fa..8b86ed58 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -92,7 +92,7 @@

    $this->db->table_exists();

    - + diff --git a/user_guide/doc_style/template.html b/user_guide/doc_style/template.html index 26831ac0..d5ef5caa 100644 --- a/user_guide/doc_style/template.html +++ b/user_guide/doc_style/template.html @@ -54,7 +54,7 @@

    Foo Class

    Brief description of Foo Class. If it extends a native CodeIgniter class, please link to the class in the CodeIgniter documents here.

    Important:  This is an important note with EMPHASIS.

    - +

    Features:

      diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index b9069a8b..3193c058 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -58,14 +58,14 @@

      Alternate PHP Syntax for View Files

      If you do not utilize CodeIgniter's template engine, you'll be using pure PHP -in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use +in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code, and eliminate "echo" statements.

      Automatic Short Tag Support

      Note: If you find that the syntax described in this page does not work on your server it might -be that "short tags" are disabled in your PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, +be that "short tags" are disabled in your PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your config/config.php file.

      diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 0b4d642a..3f0e32cb 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -200,7 +200,7 @@

      Utilizing CodeIgniter Resources within Your Library

      This is very important. Assigning by reference allows you to use the original CodeIgniter object rather than creating a copy of it.

      Also, please note: If you are running PHP 4 it's usually best to avoid calling get_instance() -from within your class constructors. PHP 4 has trouble referencing the CI super object within application constructors +from within your class constructors. PHP 4 has trouble referencing the CI super object within application constructors since objects do not exist until the class is fully instantiated.

      diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index b77528a7..5423d583 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -58,8 +58,8 @@

      Credits

      CodeIgniter was originally developed by Rick Ellis (CEO of -EllisLab, Inc.). The framework was written for performance in the real -world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of +EllisLab, Inc.). The framework was written for performance in the real +world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of ExpressionEngine.

      It is currently developed and maintained by the ExpressionEngine Development Team.

      diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 9c86f021..3163c11a 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -75,7 +75,7 @@

      Using CodeIgniter Drivers

      $this->some_parent->some_method();

      The child classes, the drivers themselves, can then be called directly through the parent class, without initializing them:

      - + $this->some_parent->child_one->some_method();
      $this->some_parent->child_two->another_method();
      diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index 04af6e6a..a1a96cf8 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -70,7 +70,7 @@

      Renaming the Application Folder

      Relocating your Application Folder

      -

      It is possible to move your application folder to a different location on your server than your system folder. +

      It is possible to move your application folder to a different location on your server than your system folder. To do so open your main index.php and set a full server path in the $application_folder variable.

      @@ -79,7 +79,7 @@

      Relocating your Application Folder

      Running Multiple Applications with one CodeIgniter Installation

      -

      If you would like to share a common CodeIgniter installation to manage several different applications simply +

      If you would like to share a common CodeIgniter installation to manage several different applications simply put all of the directories located inside your application folder into their own sub-folder.

      @@ -107,7 +107,7 @@

      Running Multiple Applications with one CodeIgniter Installation

      $application_folder = "applications/foo"; -

      Note:  Each of your applications will need its own index.php file which +

      Note:  Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want.

      diff --git a/user_guide/general/models.html b/user_guide/general/models.html index e405dd1b..35ab08d2 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -212,7 +212,7 @@

      Connecting to your Database

    • You can tell the model loading function to auto-connect by passing TRUE (boolean) via the third parameter, and connectivity settings, as defined in your database config file will be used: - $this->load->model('Model_name', '', TRUE); + $this->load->model('Model_name', '', TRUE);
    • diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 47c1a5ab..7cb3f158 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -129,7 +129,7 @@

      Enabling and Disabling Profiler Sections

      Any GET data passed in the request TRUE - + http_headers The HTTP headers for the current request TRUE @@ -149,7 +149,7 @@

      Enabling and Disabling Profiler Sections

      Listing of all database queries executed, including execution time TRUE - + uri_string The URI of the current request TRUE diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 1200a2c1..7b7d837d 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -107,12 +107,12 @@

      File Format

      a UTF-8 encoded file, and the BOM can have a negative side effect in PHP of sending output, preventing the application from being able to set its own headers. Unix line endings should be used (LF).

      - +

      Here is how to apply these settings in some of the more common text editors. Instructions for your text editor may vary; check your text editor's documentation.

      - +
      TextMate
      - +
      1. Open the Application Preferences
      2. Click Advanced, and then the "Saving" tab
      3. @@ -121,9 +121,9 @@
        TextMate
      4. Optional: Check "Use for existing files as well" if you wish to modify the line endings of files you open to your new preference.
      - +
      BBEdit
      - +
      1. Open the Application Preferences
      2. Select "Text Encodings" on the left.
      3. @@ -137,7 +137,7 @@
        BBEdit

        PHP Closing Tag

        -

        The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced +

        The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. This allows you to still identify a file as being complete and not truncated.

        @@ -158,7 +158,7 @@

        PHP Closing Tag

        - +

        Class and Method Naming

        Class names should always have their first letter uppercase, and the constructor method should match identically. Multiple words should be separated with an underscore, and not CamelCased. All other class methods should be entirely lowercased and named to clearly indicate their function, preferably including a verb. Try to avoid overly long and verbose names.

        @@ -193,8 +193,8 @@

        Class and Method Naming

        function get_file_properties() // descriptive, underscore separator, and all lowercase letters
        - - + +

        Variable Names

        The guidelines for variable naming is very similar to that used for class methods. Namely, variables should contain only lowercase letters, use underscore separators, and be reasonably named to indicate their purpose and contents. Very short, non-word variables should only be used as iterators in for() loops.

        @@ -213,8 +213,8 @@

        Variable Names

        $last_city
        - - + +

        Commenting

        In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

        @@ -257,8 +257,8 @@

        Commenting

        $parts = $this->foo($parts);
        - - + +

        Constants

        Constants follow the same guidelines as do variables, except constants should always be fully uppercase. Always use CodeIgniter constants when appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.

        @@ -275,8 +275,8 @@

        Constants

        $str = str_replace(LD.'foo'.RD, 'bar', $str);
        - - + +

        TRUE, FALSE, and NULL

        TRUE, FALSE, and NULL keywords should always be fully uppercase.

        @@ -290,9 +290,9 @@

        TRUE, FALSE, and NULL

        $bar = FALSE; function foo($bar = NULL)
        - - + +

        Logical Operators

        Use of || is discouraged as its clarity on some output devices is low (looking like the number 11 for instance). @@ -310,9 +310,9 @@

        Logical Operators

        if ( ! is_array($foo))
        - - - + + +

        Comparing Return Values and Typecasting

        Some PHP functions return FALSE on failure, but may also have a valid return value of "" or 0, which would evaluate to FALSE in loose comparisons. Be explicit by comparing the variable type when using these return values in conditionals to ensure the return value is indeed what you expect, and not a value that has an equivalent loose-type evaluation.

        @@ -350,27 +350,27 @@

        Comparing Return Value $str = (string) $str; // cast $str as a string

        - - + +

        Debugging Code

        No debugging code can be left in place for submitted add-ons unless it is commented out, i.e. no var_dump(), print_r(), die(), and exit() calls that were used while creating the add-on, unless they are commented out.

        // print_r($foo);
        - - + +

        Whitespace in Files

        No whitespace can precede the opening PHP tag or follow the closing PHP tag. Output is buffered, so whitespace in your files can cause output to begin before CodeIgniter outputs its content, leading to errors and an inability for CodeIgniter to send proper headers. In the examples below, select the text with your mouse to reveal the incorrect whitespace.

        INCORRECT:

        - + <?php // ...there is whitespace and a linebreak above the opening PHP tag // as well as whitespace after the closing PHP tag -?> +?>

        CORRECT:

        <?php @@ -378,15 +378,15 @@

        Whitespace in Files

        ?>
        - - + +

        Compatibility

        Unless specifically mentioned in your add-on's documentation, all code must be compatible with PHP version 4.3+. Additionally, do not use PHP functions that require non-default libraries to be installed unless your code contains an alternative method when the function is not available, or you implicitly document that your add-on requires said PHP libraries.

        - - + +

        Class and File Names using Common Words

        When your class or filename is a common word, or might quite likely be identically named in another PHP script, provide a unique prefix to help prevent collision. Always realize that your end users may be running other add-ons or third party PHP scripts. Choose a prefix that is unique to your identity as a developer or company.

        @@ -402,8 +402,8 @@

        Class and File Names u class Pre_import mod.pre_import.php

        - - + +

        Database Table Names

        Any tables that your add-on might use must use the 'exp_' prefix, followed by a prefix uniquely identifying you as the developer or company, and then a short descriptive table name. You do not need to be concerned about the database prefix being used on the user's installation, as CodeIgniter's database class will automatically convert 'exp_' to what is actually being used.

        @@ -419,30 +419,30 @@

        Database Table Names

        NOTE: Be mindful that MySQL has a limit of 64 characters for table names. This should not be an issue as table names that would exceed this would likely have unreasonable names. For instance, the following table name exceeds this limitation by one character. Silly, no? exp_pre_email_addresses_of_registered_users_in_seattle_washington

        - - + +

        One File per Class

        Use separate files for each class your add-on uses, unless the classes are closely related. An example of CodeIgniter files that contains multiple classes is the Database class file, which contains both the DB class and the DB_Cache class, and the Magpie plugin, which contains both the Magpie and Snoopy classes.

        - - + +

        Whitespace

        Use tabs for whitespace in your code, not spaces. This may seem like a small thing, but using tabs instead of whitespace allows the developer looking at your code to have indentation at levels that they prefer and customize in whatever application they use. And as a side benefit, it results in (slightly) more compact files, storing one tab character versus, say, four space characters.

        - - + +

        Line Breaks

        Files must be saved with Unix line breaks. This is more of an issue for developers who work in Windows, but in any case ensure that your text editor is setup to save files with Unix line breaks.

        - - + +

        Code Indenting

        Use Allman style indenting. With the exception of Class declarations, braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them.

        @@ -498,12 +498,12 @@

        Code Indenting

        } }
        - +

        Bracket and Parenthetic Spacing

        In general, parenthesis and brackets should not use any additional spaces. The exception is that a space should always follow PHP control structures that accept arguments with parenthesis (declare, do-while, elseif, for, foreach, if, switch, while), to help distinguish them from functions and increase readability.

        - + INCORRECT: $arr[ $foo ] = 'foo'; @@ -514,13 +514,13 @@

        Bracket and Parenthetic Spacing

        INCORRECT: function foo ( $bar ) { - + } CORRECT: function foo($bar) // no spaces around parenthesis in function declarations { - + } @@ -531,9 +531,9 @@

        Bracket and Parenthetic Spacing

        foreach ($query->result() as $row) // single space following PHP control structures, but not in interior parenthesis
        - - - + + +

        Localized Text

        Any text that is output in the control panel should use language variables in your lang file to allow localization.

        @@ -544,9 +544,9 @@

        Localized Text

        CORRECT: return $this->lang->line('invalid_selection');
        - - + +

        Private Methods and Variables

        Methods and variables that are only accessed internally by your class, such as utility and helper functions that your public methods use for code abstraction, should be prefixed with an underscore.

        @@ -554,9 +554,9 @@

        Private Methods and Variablesconvert_text() // public method _convert_text() // private method

        - - + +

        PHP Errors

        Code must run error free and not rely on warnings and notices to be hidden to meet this requirement. For instance, never access a variable that you did not set yourself (such as $_POST array keys) without first checking to see that it isset().

        @@ -574,9 +574,9 @@

        PHP Errors

        NOTE: Setting the display_errors setting with ini_set() at runtime is not identical to having it enabled in the PHP environment. Namely, it will not have any effect if the script has fatal errors

        - - + +

        Short Open Tags

        Always use full PHP opening tags, in case a server does not have short_open_tag enabled.

        @@ -589,9 +589,9 @@

        Short Open Tags

        CORRECT: <?php echo $foo; ?>
        - - + +

        One Statement Per Line

        Never combine statements on one line.

        @@ -605,9 +605,9 @@

        One Statement Per Line

        $bat = str_replace($foo, $bar, $bag);
        - - + +

        Strings

        Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters.

        @@ -622,9 +622,9 @@

        Strings

        "My string {$foo}" "SELECT foo FROM bar WHERE baz = 'bag'"
        - - + +

        SQL Queries

        MySQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, AS, JOIN, ON, IN, etc.

        @@ -645,16 +645,16 @@

        SQL Queries

        ORDER BY foobaz LIMIT 5, 100");
        - - + +

        Default Function Arguments

        Whenever appropriate, provide function argument defaults, which helps prevent PHP errors with mistaken calls and provides common fallback values which can save a few lines of code. Example:

        function foo($bar = '', $baz = FALSE)
        - + diff --git a/user_guide/general/views.html b/user_guide/general/views.html index b5dea05a..8f317109 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -169,7 +169,7 @@

        Adding Dynamic Data to the View

        { $data['title'] = "My Real Title"; $data['heading'] = "My Real Heading"; - + $this->load->view('blogview', $data); } } @@ -211,7 +211,7 @@

        Creating Loops

        $data['title'] = "My Real Title"; $data['heading'] = "My Real Heading"; - + $this->load->view('blogview', $data); } } @@ -229,8 +229,8 @@

        Creating Loops

        </head> <body> <h1><?php echo $heading;?></h1> - -<h3>My Todo List</h3> + +<h3>My Todo List</h3> <ul> <?php foreach($todo_list as $item):?> @@ -239,7 +239,7 @@

        Creating Loops

        <?php endforeach;?> </ul> - + </body> </html> diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index c4aa65fa..bd748226 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -87,9 +87,9 @@

        captcha_create($data)

        The "word" is the word that appears in the captcha image, which if not supplied to the function, will be a random string.

        - +

        Using the CAPTCHA helper

        - +

        Once loaded you can generate a captcha like this:

        $vals = array(
        @@ -120,14 +120,14 @@

        Using the CAPTCHA helper

    Adding a Database

    - +

    In order for the captcha function to prevent someone from submitting, you will need to add the information returned from create_captcha() function to your database. Then, when the data from the form is submitted by the user you will need to verify that the data exists in the database and has not expired.

    - +

    Here is a table prototype:

    - + CREATE TABLE captcha (
     captcha_id bigint(13) unsigned NOT NULL auto_increment,
     captcha_time int(10) unsigned NOT NULL,
    @@ -138,7 +138,7 @@

    Adding a Database

    )

    Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this:

    - + $this->load->helper('captcha');
    $vals = array(
        'img_path' => './captcha/',
    @@ -161,10 +161,10 @@

    Adding a Database

    echo '<input type="text" name="captcha" value="" />';

    Then, on the page that accepts the submission you'll have something like this:

    - + // First, delete old captchas
    $expiration = time()-7200; // Two hour limit
    -$this->db->query("DELETE FROM captcha WHERE captcha_time < ".$expiration);
    +$this->db->query("DELETE FROM captcha WHERE captcha_time < ".$expiration);

    // Then see if a captcha exists:
    $sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?";
    @@ -176,7 +176,7 @@

    Adding a Database

    {
        echo "You must submit the word that appears in the image";
    }
    - + diff --git a/user_guide/helpers/compatibility_helper.html b/user_guide/helpers/compatibility_helper.html index de8c49d0..9afec654 100644 --- a/user_guide/helpers/compatibility_helper.html +++ b/user_guide/helpers/compatibility_helper.html @@ -68,7 +68,7 @@

    Compatibility Helper

    You may use those functions without loading this helper. The functions are split between that file and this Helper so that only functions required by the framework are included by default. This way, whether or not you load the additional functions in this Helper remains your choice.

    - +

    Loading this Helper

    This helper is loaded using the following code:

    diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index 2d908705..f8775b14 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -116,7 +116,7 @@

    standard_date()

    Description Example - + DATE_ATOM Atom 2005-08-15T16:13:03+0000 @@ -149,7 +149,7 @@

    standard_date()

    DATE_RFC1123 RFC 1123 - Sun, 14 Aug 2005 16:13:03 UTC + Sun, 14 Aug 2005 16:13:03 UTC DATE_RFC2822 diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index 2324252d..6e4faef0 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -83,7 +83,7 @@

    directory_map('source directory')

    $map = directory_map('./mydirectory/', 1); -

    By default, hidden files will not be included in the returned array. To override this behavior, +

    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):

    $map = directory_map('./mydirectory/', FALSE, TRUE); diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 03a60685..0aaa8f60 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -258,11 +258,11 @@

    form_fieldset()



    // Produces
    -<fieldset> +<fieldset>
    -<legend>Address Information</legend> +<legend>Address Information</legend>
    -<p>form content here</p> +<p>form content here</p>
    </fieldset>

    Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes.

    diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 50a1c48a..845ecf10 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -118,7 +118,7 @@

    link_tag()

    echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
    - // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> + // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" />

    echo link_tag('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
    @@ -134,7 +134,7 @@

    link_tag()


    echo link_tag($link);
    // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />

    - +

    nbs()

    Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

    echo nbs(3); diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 661330aa..d95562d9 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -91,7 +91,7 @@

    The Controller

    In your application/controllers/ folder, create a file called smileys.php and place the code below in it.

    -

    Important: Change the URL in the get_clickable_smileys() function below so that it points to +

    Important: Change the URL in the get_clickable_smileys() function below so that it points to your smiley folder.

    You'll notice that in addition to the smiley helper we are using the Table Class.

    @@ -105,21 +105,21 @@

    The Controller

    { parent::Controller(); } - + function index() { $this->load->helper('smiley'); $this->load->library('table'); - + $image_array = get_clickable_smileys('http://example.com/images/smileys/', 'comments'); - + $col_array = $this->table->make_columns($image_array, 8); - + $data['smiley_table'] = $this->table->generate($col_array); - + $this->load->view('smiley_view', $data); } - + } ?> diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 2b12c2a2..d3f97fb5 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -145,7 +145,7 @@

    reduce_multiples()

    $string=",Fred, Bill,, Joe, Jimmy,";
    $string=reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy" -

    +

    quotes_to_entities()

    Converts single and double quotes in a string to the corresponding HTML entities. Example:

    diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 438eaec4..6a68180b 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -120,7 +120,7 @@

    convert_accented_characters()

    Transliterates high ASCII characters to low ASCII equivalents, useful when non-English characters need to be used where only standard ASCII characters are safely used, for instance, in URLs.

    $string = convert_accented_characters($string); - +

    This function uses a companion config file application/config/foreign_chars.php to define the to and from array for transliteration.

    word_censor()

    diff --git a/user_guide/images/ci_logo.jpg b/user_guide/images/ci_logo.jpg index 3ae0eee079898922487dd362660b6f8b05942be5..9ab5a8e24fe8effec1f2250b0aec5bddebbc57f5 100644 GIT binary patch literal 9035 zcmZWucTU%z!- zWM?lDRp6gU=%Y^}&#TSP>e@wiA_tL3bo<~6sDka`O*`DIToTccNNmr) z@G5o?NvUlRW1@%NXVSS)sOa&mKVar2b8Nj$yz zC*Gb1pL_oK!{fg{{=Vm5zX*M>$J0erD`LB1J5Q0lr=8dn*8S9oXa*jLobBxJ`qvk? z&Dq7(-cEwI|M5Qm+|K^6h}&Z?b`pzST$~Ty5<7?-ojjdgf{(;{xn|@&ITh#KK<_fi zlz)`1F>@pJ?f1`|j^9^Iu>5`UHZO4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P zrFu|}0j(4$^3mu0iSg(u0?=uoiE!sy&7LyXH%rGmWHV4*L0d@axtN_>=_G9P_L4@g zQo$Ez%M}UCk%H)8obBoROLH}02dT)X6%d!6pcaAlM;{-{zC(x@Jh2;~rWDCDL|U;x z>#Ih%3t|L82gu+AX}tZ_fMc(V44NU>e>E^dFVy!Z&uB*CMjjh1FQ^k;Me9kPsu3#0^Gc3ZipWKc!G)nzdSUNO`-yFxyD8D_#^cS ze6hCbHW%S=OZRULMzlW3j#U7f{i>hI?wc7(ZRjMMmk@?pDUi8X{9vpv`?O!Q;F zD!<07SGVyQL%|Rvv7qqJwsIe?Hy5fSnI;^Z;vGxm5?FeGf5@fMfpILI7(M}>>JNl0 zS^>vTuZak~*n9a8(eT&OHd$HtmJ~i|PIRB?+YC?syF$sTMRGY3E811dess)?Mg56Btp!ttN~YJZIlF9_ zZ#98bA;qn2uAJ`)JRiPU08Kx{#weaMv3p&Q$^X?b{AZ(Xoz46Qji_YO diff --git a/user_guide/images/ci_logo_flame.jpg b/user_guide/images/ci_logo_flame.jpg index 17e9c586bb55d8073c4629b707b2a590334f34fc..5bf38adbb01ac723ec47817cbcd1ff2b1c46fdfd 100644 GIT binary patch literal 13862 zcmaKTcT39}3=hv;)>_xPR=ID5_jDq>Kb5FO=QGnX z(nMzFB2f+g6AABWO5}L2tGe;E$V_A@5{dH89x6okDK)KCwW1n!f`?`pJhCaGX_5KA zzbx>{!V=#tEdTXoZE1xsOKWQz{$(u|+u8l`_b)SZ3kxetD?4jzv8`C_V2>{chqG7y z_17PN{q*-y|NcpMkKH)hirBh{b}h^tMdprX7LM55Pq~QZAOPQz8TR|HFIzin8*?i& z3rn#X|D6TC|NG0v*2>z<($3uCyvWSL!raoz+`5cOTOjG(9{j`U7H^J6br3 zZi~pkmVNS^XqmR|F^#`tAZhNU-m#?3Q^~Ri&7S?7`JXTR*MqVrG#yKyqE98tRG9K< zP>Hjdr6b$1^m=ysk8#VwLGu*0MYBaiCId6j<`cX_GuF@9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gCzLK>(2Vq{#OpFcznzZ$4$A#0JZ#OBT_sxIdT&4F-74*0 zRyRAe83jx&0Fr6P=H^^PGuE@ic|Ei$l1kD}S2lkC5F7id%6wr`H)c0HO1XACA&1r7 zsi}IOpG*1Dx`tQPapLXmiMHCH7{6EB+t2EbDBYI8)W&CUMF=EuFFNIK1maEPlG(I(#{-# z$%fyeEH~A>d?@4+x^Q1MW6^T$05vi8BlJaoXN1#a$}R8FkKEV&?{N~poFe>TlKl6V zwwUs;?r!66VFx_f|7>5a@>QI(`yfS17RN0Nb|pu0D}An(qkfn>w_C7n zVp75~FfT$Bs5ef+1xhEmV*ZX90E7RKQ(}e@QG5B2MkkFW1kUIak5=q#jTLMQ1m;b$ zm7Vfe#8 zpJYnCDo)6^jiHh7YX4Z7`*NjFyr2 zeR(H6hjoP_ZgO&fI$>scPxnF5kk#`)Nke}}G&_rRBowQDv)Bx6*NGH1M2$*vPM_lZ z*s3R`|LWc2>h11mK)b{>MOzj1wWsaCM72TgEx=9f*ySL1dvl#f_T(agqAHeEWHD!e z)~^@oK<)||E;&>$d97A88a@DfgAP4lXmLW2X7Qi)3;g!T0NG54oKmJjF&SaoKVwm9 z3-kF$x!!%aZE&_cfBapcAoZARghqnwzrR*+CU?Mdj0%XAW~1-{c$1}Gp_{*Zgcy|c zB8X$-SzOB9xXawS%%jo2$ywsY{_peoY9ydtAH;x~qmy}QPYM@E*kEmug{EY%UxUCLChS(Oh>eBVR>GNXW&}kY z@e4ovtsfZ=x%o9v*sBfjGajJ#(DtD0H3?}8@F8nOO|Yl@`O0v`^2XP52J<%2;2}Tp q04wt?7OD8p-_JhfT>t-f2uGVo90{WPaW4mWojPHEyz!V%-2VZRU;f?z diff --git a/user_guide/images/codeigniter_1.7.1_helper_reference.png b/user_guide/images/codeigniter_1.7.1_helper_reference.png index 15a7c1576e0bc49affc6a137070b94d19d03e548..6a7d9f8c9efded77b01f32fc114bb5e984989808 100644 GIT binary patch literal 109471 zcmagHc~{Qe`~RPmCab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xI!wx+U+LW&w|K*+%b%MCq+vG0Yry*91L~ jaC@6HoiRDsMTgN>U<0d((*co-+zdc26UaU=_Downloading CodeIgniter

    Mercurial Server

    Mercurial is a distributed version control system.

    - +

    Public Hg access is available at BitBucket. Please note that while every effort is made to keep this code base functional, we cannot guarantee the functionality of code taken from the tip.

    - +

    Beginning with version 1.6.1, stable tags are also available via BitBucket, simply select the version from the Tags dropdown.

    diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 3d58725e..973d2106 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -73,7 +73,7 @@

    Installation Instructions

    For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser. By default, .htaccess files are included in each folder to help prevent direct access, but it is best to remove them from public access entirely in case the web server configuration changes or doesn't abide by the .htaccess.

    After moving them, open your main index.php file and set the $system_folder and $application_folder variables, preferably with a full path, e.g. '/www/MyUser/system'.

    - +

    That's it!

    diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index e0e987ed..b6a946d7 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -79,7 +79,7 @@

    Step 1: Update your CodeIgniter files

    Step 2: Add time_to_update to your config.php

    Add the following to application/config/config.php with the other session configuration options

    -

    $config['sess_time_to_update'] = 300;

    +

    $config['sess_time_to_update'] = 300;

    Step 3: Add $autoload['model']

    Add the following to application/config/autoload.php

    /*
    diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 7f3cec61..91238ecb 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -79,7 +79,7 @@

    Step 1: Update your CodeIgniter files

    Step 2: Update your Session Table

    -

    If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. +

    If you are using the Session class in your application, AND if you are storing session data to a database, you must add a new column named user_data to your session table. Here is an example of what this column might look like for MySQL:

    user_data text NOT NULL @@ -93,7 +93,7 @@

    Step 2: Update your Session Table

    Step 3: Update your Validation Syntax

    -

    This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which +

    This is an optional, but recommended step, for people currently using the Validation class. CI 1.7 introduces a new Form Validation class, which deprecates the old Validation library. We have left the old one in place so that existing applications that use it will not break, but you are encouraged to migrate to the new version as soon as possible. Please read the user guide carefully as the new library works a little differently, and has several new features.

    diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 155df90d..58ed6e5c 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -80,9 +80,9 @@

    Step 2: Adjust get_dir_file_info() where necessary

    Step 3: Convert your Plugins to Helpers

    2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of: - + $this->load->plugin('foo'); - + to $this->load->helper('foo'); @@ -97,7 +97,7 @@

    Step 4: Update stored encrypted data

    making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has been added, encode_from_legacy() that will decode the data with the original algorithm and return a re-encoded string using the improved methods. This will enable you to easily replace stale encrypted data with fresh in your applications, either on the fly or en masse.

    - +

    Please read how to use this method in the Encryption library documentation.

    diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 74a8619b..2c052424 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -114,7 +114,7 @@

    Passing Data to your Calendar Cells

    Setting Display Preferences

    -

    There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an +

    There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an array of preferences in the second parameter of the loading function. Here is an example:

    diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index 0dcf04ac..fb5f6621 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -58,7 +58,7 @@

    Shopping Cart Class

    -

    The Cart Class permits items to be added to a session that stays active while a user is browsing your site. +

    The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.

    Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

    @@ -109,7 +109,7 @@

    Adding an Item to The Cart

  • options - Any additional attributes that are needed to identify the product. These must be passed via an array. -

    In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so +

    In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so please do NOT use those words as index names when inserting data into the cart.

    Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among @@ -181,24 +181,24 @@

    Displaying the Cart

    <?php foreach($this->cart->contents() as $items): ?> <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> - + <tr> <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> <td> <?php echo $items['name']; ?> - + <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?> - + <p> <?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?> - + <strong><?php echo $option_name; ?>:</strong> <?php echo $option_value; ?><br /> - + <?php endforeach; ?> </p> - + <?php endif; ?> - + </td> <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index e144826b..b863ef4c 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -83,7 +83,7 @@

    Sending Email

    $this->load->library('email');

    -$this->email->from('your@example.com', 'Your Name');
    +$this->email->from('your@example.com', 'Your Name');
    $this->email->to('someone@example.com');
    $this->email->cc('another@another-example.com');
    $this->email->bcc('them@their-example.com');
    @@ -233,7 +233,7 @@

    $this->email->clear()

    foreach ($list as $name => $address)
    {
        $this->email->clear();

    - +     $this->email->to($address);
        $this->email->from('your@example.com');
        $this->email->subject('Here is your info '.$name);
    diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 31041341..254b2666 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -145,15 +145,15 @@

    The Controller

    diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 2099135a..1d0b5718 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -106,7 +106,7 @@

    Overview

    1. A form is displayed.
    2. You fill it in and submit it.
    3. -
    4. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data +
    5. If you submitted something invalid, or perhaps missed a required item, the form is redisplayed containing your data along with an error message describing the problem.
    6. This process continues until you have submitted a valid form.
    @@ -225,13 +225,13 @@

    The Controller

    @@ -616,7 +616,7 @@

    Translating Field Names

    Changing the Error Delimiters

    -

    By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or +

    By default, the Form Validation class adds a paragraph tag (<p>) around each error message shown. You can either change these delimiters globally or individually.

      diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index a46b155b..49317765 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -82,7 +82,7 @@

      Usage Examples

      $config['hostname'] = 'ftp.example.com';
      $config['username'] = 'your-username';
      $config['password'] = 'your-password';
      -$config['debug'] = TRUE;
      +$config['debug'] = TRUE;

      $this->ftp->connect($config);

      @@ -101,7 +101,7 @@

      Usage Examples

      $config['hostname'] = 'ftp.example.com';
      $config['username'] = 'your-username';
      $config['password'] = 'your-password';
      -$config['debug'] = TRUE;
      +$config['debug'] = TRUE;

      $this->ftp->connect($config);

      @@ -121,7 +121,7 @@

      Usage Examples

      $config['hostname'] = 'ftp.example.com';
      $config['username'] = 'your-username';
      $config['password'] = 'your-password';
      -$config['debug'] = TRUE;
      +$config['debug'] = TRUE;

      $this->ftp->connect($config);

      @@ -231,7 +231,7 @@

      $this->ftp->delete_file()

      $this->ftp->delete_dir()

      Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

      -

      Important  Be VERY careful with this function. It will recursively delete +

      Important  Be VERY careful with this function. It will recursively delete everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. Try using the list_files() function first to verify that your path is correct.

      @@ -242,7 +242,7 @@

      $this->ftp->delete_dir()

      $this->ftp->list_files()

      -

      Permits you to retrieve a list of files on your server returned as an array. You must supply +

      Permits you to retrieve a list of files on your server returned as an array. You must supply the path to the desired directory.

      @@ -254,7 +254,7 @@

      $this->ftp->list_files()

      $this->ftp->mirror()

      -

      Recursively reads a local folder and everything it contains (including sub-folders) and creates a +

      Recursively reads a local folder and everything it contains (including sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. You must supply a source path and a destination path:

      diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 3dce50bf..98ed4f6d 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -447,7 +447,7 @@

      Watermarking an Image

      $config['source_image'] = '/path/to/image/mypic.jpg';
      -$config['wm_text'] = 'Copyright 2006 - John Doe';
      +$config['wm_text'] = 'Copyright 2006 - John Doe';
      $config['wm_type'] = 'text';
      $config['wm_font_path'] = './system/fonts/texb.ttf';
      $config['wm_font_size'] = '16';
      diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 1d5a47f4..34e3929a 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -78,8 +78,8 @@

      $this->load->library('class_name', $config, 'ob

      Once loaded, the library will be ready for use, using $this->email->some_function().

      -

      Library files can be stored in subdirectories within the main "libraries" folder, or within your personal application/libraries folder. -To load a file located in a subdirectory, simply include the path, relative to the "libraries" folder. +

      Library files can be stored in subdirectories within the main "libraries" folder, or within your personal application/libraries folder. +To load a file located in a subdirectory, simply include the path, relative to the "libraries" folder. For example, if you have file located at:

      libraries/flavors/chocolate.php @@ -217,7 +217,7 @@

      $this->load->remove_package_path()

      When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

      $this->load->remove_package_path()

      - +

      Or to remove a specific package path, specify the same path previously given to add_package_path() for a package.:

      $this->load->remove_package_path(APPPATH.'third_party/foo_bar/'); diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index eeb27837..a1427de7 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -140,9 +140,9 @@

      $this->output->cache();

      Parsing Execution Variables

      CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. - + $this->output->parse_exec_vars = FALSE; - + diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 521b708b..42c102c8 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -69,7 +69,7 @@

      Example

      Here is a simple example showing how to create pagination in one of your controller functions:

      -$this->load->library('pagination');

      +$this->load->library('pagination');

      $config['base_url'] = 'http://example.com/index.php/test/page/';
      $config['total_rows'] = '200';
      $config['per_page'] = '20'; diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index f1a46fca..e90aca3d 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -83,7 +83,7 @@

      Examples

                   array('John', 'Green', 'Medium')
                   );

      -echo $this->table->generate($data); +echo $this->table->generate($data);

      Here is an example of a table created from a database query result. The table class will automatically generate the @@ -95,7 +95,7 @@

      Examples


      $query = $this->db->query("SELECT * FROM my_table");

      -echo $this->table->generate($query); +echo $this->table->generate($query);
      @@ -110,7 +110,7 @@

      Examples

      $this->table->add_row('Mary', 'Red', 'Large');
      $this->table->add_row('John', 'Green', 'Medium');

      -echo $this->table->generate(); +echo $this->table->generate();

      Here is the same example, except instead of individual parameters, arrays are used:

      @@ -124,7 +124,7 @@

      Examples

      $this->table->add_row(array('Mary', 'Red', 'Large'));
      $this->table->add_row(array('John', 'Green', 'Medium'));

      -echo $this->table->generate(); +echo $this->table->generate(); diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 2675fa75..e78af5f9 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -134,7 +134,7 @@

      protect_braced_quotes

      When using the Typography library in conjunction with the Template Parser library it can often be desirable to protect single and double quotes within curly braces. To enable this, set the protect_braced_quotes class property to TRUE.

      - +

      Usage example:

      $this->load->library('typography');
      diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 0e7d1d69..84db5443 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -81,7 +81,7 @@

      Running Tests

      $this->unit->run( test, expected result, 'test name', 'notes');

      -

      Where test is the result of the code you wish to test, expected result is the data type you expect, +

      Where test is the result of the code you wish to test, expected result is the data type you expect, test name is an optional name you can give your test, and notes are optional notes. Example:

      $test = 1 + 1;
      diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 8d1dbdf5..971ab029 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -192,7 +192,7 @@

      Creating an XML-RPC Server

      The 'object' key is a special key that you pass an instantiated class object with, which is necessary when the method you are mapping to is not part of the CodeIgniter super object.

      - +

      In other words, if an XML-RPC Client sends a request for the new_post method, your server will load the My_blog class and call the new_entry function. If the request is for the update_post method, your @@ -202,7 +202,7 @@

      Creating an XML-RPC Server

      or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

      There are two additional configuration keys you may make use of when initializing the server class: debug can be set to TRUE in order to enable debugging, and xss_clean may be set to FALSE to prevent sending data through the Security library's xss_clean function. - +

      Processing Server Requests

      When the XML-RPC Server receives a request and loads the class/method for processing, it will pass @@ -324,20 +324,20 @@

      The Client

      + +

      Then save the file to your application/controllers/ folder.

      + +

      Now normally you would visit the your site using a URL similar to this:

      + +example.com/index.php/tools/message/to + +

      Instead, we are going to open Terminal in Mac/Lunix or go to Run > "cmd" in Windows and navigate to our CodeIgniter project.

      + +
      + $ cd /path/to/project;
      + $ php index.php tools message +
      + +

      If you did it right, you should see Hello World!.

      + +
      + $ php index.php tools message "John Smith" +
      + +

      Here we are passing it a argument in the same way that URL parameters work. "John Smith" is passed as a argument and output is: Hello John Smith!.

      + +

      That's it!

      + +

      That, in a nutshell, is all there is to know about controllers on the command line. Remember that this is just a normal controller, so routing and _remap works fine.

      + + + + + + + + + + + \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index eaa5f623..ce783fc2 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -58,6 +58,7 @@ function create_menu(basepath) '
    1. Error Handling
    2. ' + '
    3. Caching
    4. ' + '
    5. Profiling Your Application
    6. ' + + '
    7. Running via the CLI
    8. ' + '
    9. Managing Applications
    10. ' + '
    11. Handling Multiple Environments
    12. ' + '
    13. Alternative PHP Syntax
    14. ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 4e0b6521..3df1a4b3 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -111,7 +111,9 @@

      General Topics

    15. Error Handling
    16. Caching
    17. Profiling Your Application
    18. +
    19. Running via the CLI
    20. Managing Applications
    21. +
    22. Handling Multiple Environments
    23. Alternative PHP Syntax
    24. Security
    25. PHP Style Guide
    26. From 1605de4b890ce16293ce57c5c674f6d8f2dacc7e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 7 Apr 2011 11:52:41 +0100 Subject: [PATCH 2417/2544] Added CLI documentation. --- user_guide/general/cli.html | 150 ++++++++++++++++++++++++++++++++++++ user_guide/nav/nav.js | 1 + user_guide/toc.html | 2 + 3 files changed, 153 insertions(+) create mode 100644 user_guide/general/cli.html diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html new file mode 100644 index 00000000..affafadf --- /dev/null +++ b/user_guide/general/cli.html @@ -0,0 +1,150 @@ + + + + + +Running via the CLI : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +

      CodeIgniter User Guide Version 2.0.1

      +
      + + + + + + + + + +
      + + +
      + + + +
      + +

      Running via the CLI

      + +

      + As well as calling an applications Controllers via the URL in a browser they can also be loaded via the command-line interface (CLI). +

      + + + + + + +

      What is the CLI?

      + +

      The command-line interface is a text-based method of interacting with computers that looks like what most people remember as DOS.

      + + + +

      Why run via the command-line?

      + +

      + There are many reasons for running CodeIgniter from the command-line, but they are not always obvious.

      + +
        +
      • Run your cron-jobs without needing to use wget or curl
      • +
      • Make your cron-jobs inaccessible from being loaded in the URL by checking for IS_CLI
      • +
      • Make interactive "tasks" that can do things like set permissions, prune cache folders, run backups, etc.
      • +
      • Integrate with other applications in other languages. For example, a random C++ script could call one command and run code in your models!
      • +
      + + +

      Let's try it:  Hello World!

      + +

      Let's create a simple controller so you can see it in action. Using your text editor, create a file called tools.php, and put the following code in it:

      + + + +

      Then save the file to your application/controllers/ folder.

      + +

      Now normally you would visit the your site using a URL similar to this:

      + +example.com/index.php/tools/message/to + +

      Instead, we are going to open Terminal in Mac/Lunix or go to Run > "cmd" in Windows and navigate to our CodeIgniter project.

      + +
      + $ cd /path/to/project;
      + $ php index.php tools message +
      + +

      If you did it right, you should see Hello World!.

      + +
      + $ php index.php tools message "John Smith" +
      + +

      Here we are passing it a argument in the same way that URL parameters work. "John Smith" is passed as a argument and output is: Hello John Smith!.

      + +

      That's it!

      + +

      That, in a nutshell, is all there is to know about controllers on the command line. Remember that this is just a normal controller, so routing and _remap works fine.

      + + + +
      + + + + + + + \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index eaa5f623..ce783fc2 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -58,6 +58,7 @@ function create_menu(basepath) '
    27. Error Handling
    28. ' + '
    29. Caching
    30. ' + '
    31. Profiling Your Application
    32. ' + + '
    33. Running via the CLI
    34. ' + '
    35. Managing Applications
    36. ' + '
    37. Handling Multiple Environments
    38. ' + '
    39. Alternative PHP Syntax
    40. ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 4e0b6521..3df1a4b3 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -111,7 +111,9 @@

      General Topics

    41. Error Handling
    42. Caching
    43. Profiling Your Application
    44. +
    45. Running via the CLI
    46. Managing Applications
    47. +
    48. Handling Multiple Environments
    49. Alternative PHP Syntax
    50. Security
    51. PHP Style Guide
    52. From 106bbcef5490f9bc40f9d3b281c063315f35156f Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: [PATCH 2418/2544] Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/changelog.html | 8 ++++---- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/cli.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_drivers.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/drivers.html | 2 +- user_guide/general/environments.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/captcha_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_170.html | 2 +- user_guide/installation/upgrade_171.html | 2 +- user_guide/installation/upgrade_172.html | 2 +- user_guide/installation/upgrade_200.html | 2 +- user_guide/installation/upgrade_201.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/caching.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/security.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/cheatsheets.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 130 files changed, 133 insertions(+), 133 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d34f5c8f..446b2d61 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -28,7 +28,7 @@
      - +

      CodeIgniter User Guide Version 2.0.1

      CodeIgniter User Guide Version 2.0.2

      @@ -60,8 +60,8 @@

      Change Log

      The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

      Version 2.0.2

      -

      Release Date: n/a
      -Hg Tag: n/a

      +

      Release Date: April 7, 2011
      +Hg Tag: v2.0.2

      • General changes @@ -101,7 +101,7 @@

        Bug fixes for 2.0.2

      Version 2.0.1

      -

      Release Date: March, 15, 2011
      +

      Release Date: March 15, 2011
      Hg Tag: v2.0.1

        diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 64596e27..faa13b3e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 4a18cbd6..3f4ef2bc 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 1f6079fb..3e0c78d3 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 60e7065d..fdeae0ee 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 8f923b14..bb1b401f 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 10daef7e..535fa317 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 8299c507..04d8b809 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index c7b141e8..cad2cf26 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index b8a5785f..107d2ed8 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 1dabb56b..fa3548cf 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index b69f2260..f9f96803 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/results.html b/user_guide/database/results.html index aec6c973..8ad6a198 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index d9580292..a2aaa99a 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index f6db3019..74945d43 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 268cf49a..c488180a 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index eb5986ba..f69846f2 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index f4ec6ccc..abd5845f 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index d343cdc0..a7365e70 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 81ae311d..fae0b5fd 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 61b586f9..c77f9a15 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html index affafadf..962954b1 100644 --- a/user_guide/general/cli.html +++ b/user_guide/general/cli.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 225269e1..bfac3268 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 2da98b6c..c9091647 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 4edad833..51c2c744 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index 3d6640da..a7594056 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 6d65f659..8198c18f 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index e64a7455..9e0fbac0 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 2b9f78cc..8dbeb93a 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html index 76fe214b..175a1531 100644 --- a/user_guide/general/environments.html +++ b/user_guide/general/environments.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index ece80b2f..58eff659 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 95693a55..339a0df0 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index a72e84a4..11de4090 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 58ddc6d9..ce367cde 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index b08d4aa6..ea886d9c 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 2cd8e4d2..117c810b 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 868cce7b..f3ea0c6f 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index cb264803..9273708f 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index d8043aea..ab0e2885 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 2dbbb5bb..d1ee2955 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 4413ef99..6ee6ad38 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/security.html b/user_guide/general/security.html index c47b5b25..ab92a94b 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 82186082..b2b681d8 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -34,7 +34,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 29ed8ea9..421f5130 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 2a06a9c6..ad93f4bc 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 75c069d6..a1962145 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 5169b06b..2fd5a554 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index e2a04fe1..34faadbc 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index e22f2829..44096ff4 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index bde72fa3..1a2f28d7 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index c2653e3c..335e97d3 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 9b21ca94..8a3868a7 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 6f61f428..c3723542 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 0a84fde6..f82c669c 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index c7ab413b..1a0529f7 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 3481739d..221c0590 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 82ccbce9..3b3b87da 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 23db5826..51a4521a 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index c0a90f80..584a127f 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 03c25fcb..e0cace32 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 7021b73c..408df17c 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 701618be..169ee4eb 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 7d646cb7..f71d8784 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index bcc11ee0..00686a34 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 497bdb41..d20f1b1e 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index d7482c12..ded9aaa3 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/index.html b/user_guide/index.html index 23fcd1c4..2681004e 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f27eef05..94ebeb03 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 5d26a42e..87da5189 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index aeb9c44c..2a50b8db 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 765da680..563c98c6 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index ec4aa5ca..f7ffac74 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 18a2f8af..7541a83e 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index dc5bffe9..4fcbb46b 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 83375561..c6346595 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 0993e6b6..2049628a 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 8f136629..c19143c6 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index c7096857..342d486d 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 93130589..f601a252 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index e000d173..fe6978aa 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index c6338c62..e5086813 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index cbdbaff8..d06f58ec 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index d279f32f..2dc2de59 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index ca9fd926..0add80f8 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index dac67e3b..73441397 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 44108367..01597a41 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index 4e5ec69e..baee208a 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index ecc7351a..dbf0fb01 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 6baea733..0b24079e 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html index 9c72cf42..6c2b02d0 100644 --- a/user_guide/installation/upgrade_201.html +++ b/user_guide/installation/upgrade_201.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index b3f70c60..add7228c 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index f72ef02d..5f1fdd3e 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 3213a679..c29acb7b 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index e04cf10b..190232e4 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 1222235c..e1af71cc 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index c8d69d78..f084d5dc 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 71c68332..2433ec4a 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 357c01ff..5a8814d5 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index b06adefc..60099312 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 5e5117a9..e4e842e5 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index c72cfce1..8fdcd144 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 1c1ad73e..43b949a5 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 81ae09c6..dbf07768 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index b34938b1..08b8ab0d 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index c1fd1fa5..4e262279 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index fcc28262..75863c2a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 62a25048..42f8cf94 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 3e18fa0d..4d1f8d97 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3db020ad..e86ec13c 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 1089f405..cb2f100a 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 6fbdf774..73518745 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5243a83d..600d301c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 28994aa6..eeb3b421 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -27,7 +27,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 971b8f33..7f89b4f5 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 14725cd1..895e76f7 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index e68bc3fd..5e0c4c16 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7b5887fa..e4e0f9d3 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 2d303db3..24e8071f 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 53931aee..5ba85134 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 6cb0d195..03112660 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/license.html b/user_guide/license.html index 645358ac..8f53851a 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 09c13f9e..bcbc43ff 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 9b570715..b6b81d76 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index a421a1b6..1c58c584 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index e7e26ad5..e20219e0 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index d0e6bf70..f120913f 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 1ae3bbbd..754ecaae 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index accf9801..bbe3e36f 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 5bed9cba..91cf6497 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        diff --git a/user_guide/toc.html b/user_guide/toc.html index 3df1a4b3..90442cb8 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: [PATCH 2419/2544] Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/changelog.html | 8 ++++---- user_guide/database/active_record.html | 2 +- user_guide/database/caching.html | 2 +- user_guide/database/call_function.html | 2 +- user_guide/database/configuration.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/examples.html | 2 +- user_guide/database/fields.html | 2 +- user_guide/database/forge.html | 2 +- user_guide/database/helpers.html | 2 +- user_guide/database/index.html | 2 +- user_guide/database/queries.html | 2 +- user_guide/database/results.html | 2 +- user_guide/database/table_data.html | 2 +- user_guide/database/transactions.html | 2 +- user_guide/database/utilities.html | 2 +- user_guide/doc_style/index.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/ancillary_classes.html | 2 +- user_guide/general/autoloader.html | 2 +- user_guide/general/caching.html | 2 +- user_guide/general/cli.html | 2 +- user_guide/general/common_functions.html | 2 +- user_guide/general/controllers.html | 2 +- user_guide/general/core_classes.html | 2 +- user_guide/general/creating_drivers.html | 2 +- user_guide/general/creating_libraries.html | 2 +- user_guide/general/credits.html | 2 +- user_guide/general/drivers.html | 2 +- user_guide/general/environments.html | 2 +- user_guide/general/errors.html | 2 +- user_guide/general/helpers.html | 2 +- user_guide/general/hooks.html | 2 +- user_guide/general/libraries.html | 2 +- user_guide/general/managing_apps.html | 2 +- user_guide/general/models.html | 2 +- user_guide/general/profiling.html | 2 +- user_guide/general/quick_reference.html | 2 +- user_guide/general/requirements.html | 2 +- user_guide/general/reserved_names.html | 2 +- user_guide/general/routing.html | 2 +- user_guide/general/security.html | 2 +- user_guide/general/styleguide.html | 2 +- user_guide/general/urls.html | 2 +- user_guide/general/views.html | 2 +- user_guide/helpers/array_helper.html | 2 +- user_guide/helpers/captcha_helper.html | 2 +- user_guide/helpers/cookie_helper.html | 2 +- user_guide/helpers/date_helper.html | 2 +- user_guide/helpers/directory_helper.html | 2 +- user_guide/helpers/download_helper.html | 2 +- user_guide/helpers/email_helper.html | 2 +- user_guide/helpers/file_helper.html | 2 +- user_guide/helpers/form_helper.html | 2 +- user_guide/helpers/html_helper.html | 2 +- user_guide/helpers/inflector_helper.html | 2 +- user_guide/helpers/language_helper.html | 2 +- user_guide/helpers/number_helper.html | 2 +- user_guide/helpers/path_helper.html | 2 +- user_guide/helpers/security_helper.html | 2 +- user_guide/helpers/smiley_helper.html | 2 +- user_guide/helpers/string_helper.html | 2 +- user_guide/helpers/text_helper.html | 2 +- user_guide/helpers/typography_helper.html | 2 +- user_guide/helpers/url_helper.html | 2 +- user_guide/helpers/xml_helper.html | 2 +- user_guide/index.html | 2 +- user_guide/installation/downloads.html | 2 +- user_guide/installation/index.html | 2 +- user_guide/installation/troubleshooting.html | 2 +- user_guide/installation/upgrade_120.html | 2 +- user_guide/installation/upgrade_130.html | 2 +- user_guide/installation/upgrade_131.html | 2 +- user_guide/installation/upgrade_132.html | 2 +- user_guide/installation/upgrade_133.html | 2 +- user_guide/installation/upgrade_140.html | 2 +- user_guide/installation/upgrade_141.html | 2 +- user_guide/installation/upgrade_150.html | 2 +- user_guide/installation/upgrade_152.html | 2 +- user_guide/installation/upgrade_153.html | 2 +- user_guide/installation/upgrade_154.html | 2 +- user_guide/installation/upgrade_160.html | 2 +- user_guide/installation/upgrade_161.html | 2 +- user_guide/installation/upgrade_162.html | 2 +- user_guide/installation/upgrade_163.html | 2 +- user_guide/installation/upgrade_170.html | 2 +- user_guide/installation/upgrade_171.html | 2 +- user_guide/installation/upgrade_172.html | 2 +- user_guide/installation/upgrade_200.html | 2 +- user_guide/installation/upgrade_201.html | 2 +- user_guide/installation/upgrade_b11.html | 2 +- user_guide/installation/upgrading.html | 2 +- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/caching.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/security.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- user_guide/license.html | 2 +- user_guide/overview/appflow.html | 2 +- user_guide/overview/at_a_glance.html | 2 +- user_guide/overview/cheatsheets.html | 2 +- user_guide/overview/features.html | 2 +- user_guide/overview/getting_started.html | 2 +- user_guide/overview/goals.html | 2 +- user_guide/overview/index.html | 2 +- user_guide/overview/mvc.html | 2 +- user_guide/toc.html | 2 +- 130 files changed, 133 insertions(+), 133 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d34f5c8f..446b2d61 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -28,7 +28,7 @@
        - +

        CodeIgniter User Guide Version 2.0.1

        CodeIgniter User Guide Version 2.0.2

        @@ -60,8 +60,8 @@

        Change Log

        The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

        Version 2.0.2

        -

        Release Date: n/a
        -Hg Tag: n/a

        +

        Release Date: April 7, 2011
        +Hg Tag: v2.0.2

        • General changes @@ -101,7 +101,7 @@

          Bug fixes for 2.0.2

        Version 2.0.1

        -

        Release Date: March, 15, 2011
        +

        Release Date: March 15, 2011
        Hg Tag: v2.0.1

          diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 64596e27..faa13b3e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/caching.html b/user_guide/database/caching.html index 4a18cbd6..3f4ef2bc 100644 --- a/user_guide/database/caching.html +++ b/user_guide/database/caching.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/call_function.html b/user_guide/database/call_function.html index 1f6079fb..3e0c78d3 100644 --- a/user_guide/database/call_function.html +++ b/user_guide/database/call_function.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 60e7065d..fdeae0ee 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 8f923b14..bb1b401f 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/examples.html b/user_guide/database/examples.html index 10daef7e..535fa317 100644 --- a/user_guide/database/examples.html +++ b/user_guide/database/examples.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 8299c507..04d8b809 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index c7b141e8..cad2cf26 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index b8a5785f..107d2ed8 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 1dabb56b..fa3548cf 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index b69f2260..f9f96803 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/results.html b/user_guide/database/results.html index aec6c973..8ad6a198 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index d9580292..a2aaa99a 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index f6db3019..74945d43 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 268cf49a..c488180a 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/doc_style/index.html b/user_guide/doc_style/index.html index eb5986ba..f69846f2 100644 --- a/user_guide/doc_style/index.html +++ b/user_guide/doc_style/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index f4ec6ccc..abd5845f 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html index d343cdc0..a7365e70 100644 --- a/user_guide/general/ancillary_classes.html +++ b/user_guide/general/ancillary_classes.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html index 81ae311d..fae0b5fd 100644 --- a/user_guide/general/autoloader.html +++ b/user_guide/general/autoloader.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html index 61b586f9..c77f9a15 100644 --- a/user_guide/general/caching.html +++ b/user_guide/general/caching.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html index affafadf..962954b1 100644 --- a/user_guide/general/cli.html +++ b/user_guide/general/cli.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html index 225269e1..bfac3268 100644 --- a/user_guide/general/common_functions.html +++ b/user_guide/general/common_functions.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html index 2da98b6c..c9091647 100644 --- a/user_guide/general/controllers.html +++ b/user_guide/general/controllers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html index 4edad833..51c2c744 100644 --- a/user_guide/general/core_classes.html +++ b/user_guide/general/core_classes.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html index 3d6640da..a7594056 100644 --- a/user_guide/general/creating_drivers.html +++ b/user_guide/general/creating_drivers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index 6d65f659..8198c18f 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html index e64a7455..9e0fbac0 100644 --- a/user_guide/general/credits.html +++ b/user_guide/general/credits.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html index 2b9f78cc..8dbeb93a 100644 --- a/user_guide/general/drivers.html +++ b/user_guide/general/drivers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html index 76fe214b..175a1531 100644 --- a/user_guide/general/environments.html +++ b/user_guide/general/environments.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html index ece80b2f..58eff659 100644 --- a/user_guide/general/errors.html +++ b/user_guide/general/errors.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html index 95693a55..339a0df0 100644 --- a/user_guide/general/helpers.html +++ b/user_guide/general/helpers.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index a72e84a4..11de4090 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html index 58ddc6d9..ce367cde 100644 --- a/user_guide/general/libraries.html +++ b/user_guide/general/libraries.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html index b08d4aa6..ea886d9c 100644 --- a/user_guide/general/managing_apps.html +++ b/user_guide/general/managing_apps.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 2cd8e4d2..117c810b 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 868cce7b..f3ea0c6f 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/quick_reference.html b/user_guide/general/quick_reference.html index cb264803..9273708f 100644 --- a/user_guide/general/quick_reference.html +++ b/user_guide/general/quick_reference.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index d8043aea..ab0e2885 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index 2dbbb5bb..d1ee2955 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html index 4413ef99..6ee6ad38 100644 --- a/user_guide/general/routing.html +++ b/user_guide/general/routing.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/security.html b/user_guide/general/security.html index c47b5b25..ab92a94b 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html index 82186082..b2b681d8 100644 --- a/user_guide/general/styleguide.html +++ b/user_guide/general/styleguide.html @@ -34,7 +34,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html index 29ed8ea9..421f5130 100644 --- a/user_guide/general/urls.html +++ b/user_guide/general/urls.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/general/views.html b/user_guide/general/views.html index 2a06a9c6..ad93f4bc 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 75c069d6..a1962145 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 5169b06b..2fd5a554 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index e2a04fe1..34faadbc 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index e22f2829..44096ff4 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html index bde72fa3..1a2f28d7 100644 --- a/user_guide/helpers/directory_helper.html +++ b/user_guide/helpers/directory_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index c2653e3c..335e97d3 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html index 9b21ca94..8a3868a7 100644 --- a/user_guide/helpers/email_helper.html +++ b/user_guide/helpers/email_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 6f61f428..c3723542 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html index 0a84fde6..f82c669c 100644 --- a/user_guide/helpers/form_helper.html +++ b/user_guide/helpers/form_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index c7ab413b..1a0529f7 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html index 3481739d..221c0590 100644 --- a/user_guide/helpers/inflector_helper.html +++ b/user_guide/helpers/inflector_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/language_helper.html b/user_guide/helpers/language_helper.html index 82ccbce9..3b3b87da 100644 --- a/user_guide/helpers/language_helper.html +++ b/user_guide/helpers/language_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/number_helper.html b/user_guide/helpers/number_helper.html index 23db5826..51a4521a 100644 --- a/user_guide/helpers/number_helper.html +++ b/user_guide/helpers/number_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/path_helper.html b/user_guide/helpers/path_helper.html index c0a90f80..584a127f 100644 --- a/user_guide/helpers/path_helper.html +++ b/user_guide/helpers/path_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/security_helper.html b/user_guide/helpers/security_helper.html index 03c25fcb..e0cace32 100644 --- a/user_guide/helpers/security_helper.html +++ b/user_guide/helpers/security_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html index 7021b73c..408df17c 100644 --- a/user_guide/helpers/smiley_helper.html +++ b/user_guide/helpers/smiley_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html index 701618be..169ee4eb 100644 --- a/user_guide/helpers/string_helper.html +++ b/user_guide/helpers/string_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html index 7d646cb7..f71d8784 100644 --- a/user_guide/helpers/text_helper.html +++ b/user_guide/helpers/text_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html index bcc11ee0..00686a34 100644 --- a/user_guide/helpers/typography_helper.html +++ b/user_guide/helpers/typography_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index 497bdb41..d20f1b1e 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html index d7482c12..ded9aaa3 100644 --- a/user_guide/helpers/xml_helper.html +++ b/user_guide/helpers/xml_helper.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/index.html b/user_guide/index.html index 23fcd1c4..2681004e 100644 --- a/user_guide/index.html +++ b/user_guide/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f27eef05..94ebeb03 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/index.html b/user_guide/installation/index.html index 5d26a42e..87da5189 100644 --- a/user_guide/installation/index.html +++ b/user_guide/installation/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/troubleshooting.html b/user_guide/installation/troubleshooting.html index aeb9c44c..2a50b8db 100644 --- a/user_guide/installation/troubleshooting.html +++ b/user_guide/installation/troubleshooting.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_120.html b/user_guide/installation/upgrade_120.html index 765da680..563c98c6 100644 --- a/user_guide/installation/upgrade_120.html +++ b/user_guide/installation/upgrade_120.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_130.html b/user_guide/installation/upgrade_130.html index ec4aa5ca..f7ffac74 100644 --- a/user_guide/installation/upgrade_130.html +++ b/user_guide/installation/upgrade_130.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_131.html b/user_guide/installation/upgrade_131.html index 18a2f8af..7541a83e 100644 --- a/user_guide/installation/upgrade_131.html +++ b/user_guide/installation/upgrade_131.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_132.html b/user_guide/installation/upgrade_132.html index dc5bffe9..4fcbb46b 100644 --- a/user_guide/installation/upgrade_132.html +++ b/user_guide/installation/upgrade_132.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_133.html b/user_guide/installation/upgrade_133.html index 83375561..c6346595 100644 --- a/user_guide/installation/upgrade_133.html +++ b/user_guide/installation/upgrade_133.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 0993e6b6..2049628a 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_141.html b/user_guide/installation/upgrade_141.html index 8f136629..c19143c6 100644 --- a/user_guide/installation/upgrade_141.html +++ b/user_guide/installation/upgrade_141.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index c7096857..342d486d 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_152.html b/user_guide/installation/upgrade_152.html index 93130589..f601a252 100644 --- a/user_guide/installation/upgrade_152.html +++ b/user_guide/installation/upgrade_152.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_153.html b/user_guide/installation/upgrade_153.html index e000d173..fe6978aa 100644 --- a/user_guide/installation/upgrade_153.html +++ b/user_guide/installation/upgrade_153.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html index c6338c62..e5086813 100644 --- a/user_guide/installation/upgrade_154.html +++ b/user_guide/installation/upgrade_154.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html index cbdbaff8..d06f58ec 100644 --- a/user_guide/installation/upgrade_160.html +++ b/user_guide/installation/upgrade_160.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_161.html b/user_guide/installation/upgrade_161.html index d279f32f..2dc2de59 100644 --- a/user_guide/installation/upgrade_161.html +++ b/user_guide/installation/upgrade_161.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_162.html b/user_guide/installation/upgrade_162.html index ca9fd926..0add80f8 100644 --- a/user_guide/installation/upgrade_162.html +++ b/user_guide/installation/upgrade_162.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_163.html b/user_guide/installation/upgrade_163.html index dac67e3b..73441397 100644 --- a/user_guide/installation/upgrade_163.html +++ b/user_guide/installation/upgrade_163.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_170.html b/user_guide/installation/upgrade_170.html index 44108367..01597a41 100644 --- a/user_guide/installation/upgrade_170.html +++ b/user_guide/installation/upgrade_170.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_171.html b/user_guide/installation/upgrade_171.html index 4e5ec69e..baee208a 100644 --- a/user_guide/installation/upgrade_171.html +++ b/user_guide/installation/upgrade_171.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_172.html b/user_guide/installation/upgrade_172.html index ecc7351a..dbf0fb01 100644 --- a/user_guide/installation/upgrade_172.html +++ b/user_guide/installation/upgrade_172.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_200.html b/user_guide/installation/upgrade_200.html index 6baea733..0b24079e 100644 --- a/user_guide/installation/upgrade_200.html +++ b/user_guide/installation/upgrade_200.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html index 9c72cf42..6c2b02d0 100644 --- a/user_guide/installation/upgrade_201.html +++ b/user_guide/installation/upgrade_201.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrade_b11.html b/user_guide/installation/upgrade_b11.html index b3f70c60..add7228c 100644 --- a/user_guide/installation/upgrade_b11.html +++ b/user_guide/installation/upgrade_b11.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index f72ef02d..5f1fdd3e 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 3213a679..c29acb7b 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index e04cf10b..190232e4 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 1222235c..e1af71cc 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index c8d69d78..f084d5dc 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 71c68332..2433ec4a 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 357c01ff..5a8814d5 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index b06adefc..60099312 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 5e5117a9..e4e842e5 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index c72cfce1..8fdcd144 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 1c1ad73e..43b949a5 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 81ae09c6..dbf07768 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index b34938b1..08b8ab0d 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index c1fd1fa5..4e262279 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index fcc28262..75863c2a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 62a25048..42f8cf94 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 3e18fa0d..4d1f8d97 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3db020ad..e86ec13c 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 1089f405..cb2f100a 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 6fbdf774..73518745 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5243a83d..600d301c 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 28994aa6..eeb3b421 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -27,7 +27,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 971b8f33..7f89b4f5 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 14725cd1..895e76f7 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index e68bc3fd..5e0c4c16 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7b5887fa..e4e0f9d3 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 2d303db3..24e8071f 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 53931aee..5ba85134 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 6cb0d195..03112660 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/license.html b/user_guide/license.html index 645358ac..8f53851a 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 09c13f9e..bcbc43ff 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 9b570715..b6b81d76 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/cheatsheets.html b/user_guide/overview/cheatsheets.html index a421a1b6..1c58c584 100644 --- a/user_guide/overview/cheatsheets.html +++ b/user_guide/overview/cheatsheets.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index e7e26ad5..e20219e0 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index d0e6bf70..f120913f 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 1ae3bbbd..754ecaae 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/index.html b/user_guide/overview/index.html index accf9801..bbe3e36f 100644 --- a/user_guide/overview/index.html +++ b/user_guide/overview/index.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 5bed9cba..91cf6497 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -28,7 +28,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          diff --git a/user_guide/toc.html b/user_guide/toc.html index 3df1a4b3..90442cb8 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -29,7 +29,7 @@
          - +

          CodeIgniter User Guide Version 2.0.1

          CodeIgniter User Guide Version 2.0.2

          From 3830ef149d45a86656bad0827c66c66602d6b8a6 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:08:50 -0400 Subject: [PATCH 2420/2544] Removed tag v2.0.1, should've been 2.0.2 --- .hgtags | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgtags b/.hgtags index 8d606f18..b1e217bd 100644 --- a/.hgtags +++ b/.hgtags @@ -16,3 +16,5 @@ f97a33039a37fc0c3f12e48407ca08e281b6b375 v2.0.1 0000000000000000000000000000000000000000 v2.0.1 0000000000000000000000000000000000000000 v2.0.1 52cd3ed4a9ea5c2b0e2bdd38e9822161ef547f9a v2.0.1 +52cd3ed4a9ea5c2b0e2bdd38e9822161ef547f9a v2.0.1 +0000000000000000000000000000000000000000 v2.0.1 From c42cbe102f212dd0216b801d64deee445d06b788 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:08:50 -0400 Subject: [PATCH 2421/2544] Removed tag v2.0.1, should've been 2.0.2 From 3b947b8323b164387cba5450853528853a401577 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:10:04 -0400 Subject: [PATCH 2422/2544] Putting the v2.0.1 tag back to where it belongs --- .hgtags | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgtags b/.hgtags index b1e217bd..bb765e06 100644 --- a/.hgtags +++ b/.hgtags @@ -18,3 +18,5 @@ f97a33039a37fc0c3f12e48407ca08e281b6b375 v2.0.1 52cd3ed4a9ea5c2b0e2bdd38e9822161ef547f9a v2.0.1 52cd3ed4a9ea5c2b0e2bdd38e9822161ef547f9a v2.0.1 0000000000000000000000000000000000000000 v2.0.1 +0000000000000000000000000000000000000000 v2.0.1 +1941a814526f8aa7186112e6b9bfd868c5c4afbf v2.0.1 From c5895ef204765c28e5ce61b08ddaa66729b81b8e Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:10:04 -0400 Subject: [PATCH 2423/2544] Putting the v2.0.1 tag back to where it belongs From 0808d037de5c78bbabb3a5e83370b4604f70b020 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:15:09 -0400 Subject: [PATCH 2424/2544] And now properly prepped for 2.0.2, sigh --- user_guide/installation/downloads.html | 3 +- user_guide/installation/upgrade_201.html | 12 +-- user_guide/installation/upgrade_202.html | 95 ++++++++++++++++++++++++ user_guide/installation/upgrading.html | 1 + 4 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 user_guide/installation/upgrade_202.html diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 94ebeb03..54fff5a2 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -58,7 +58,8 @@

          Downloading CodeIgniter

            -
          • CodeIgniter V 2.0.1 (Current version)
          • +
          • CodeIgniter V 2.0.2 (Current version)
          • +
          • CodeIgniter V 2.0.1
          • CodeIgniter V 2.0.0
          • CodeIgniter V 1.7.3
          • CodeIgniter V 1.7.2
          • diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html index 6c2b02d0..fe99cc0c 100644 --- a/user_guide/installation/upgrade_201.html +++ b/user_guide/installation/upgrade_201.html @@ -72,17 +72,7 @@

            Step 2: Replace config/mimes.php

            This config file has been updated to contain more mime types, please copy it to application/config/mimes.php.

            -

            Step 3: Remove loading calls for the Security Library

            - -

            Security has been moved to the core and is now always loaded automatically. Make sure you remove any loading calls as they will result in PHP errors.

            - - -

            Step 4: Move MY_Security

            - -

            If you are overriding or extending the Security library, you will need to move it to application/core.

            - - -

            Step 5: Check for forms posting to default controller

            +

            Step 3: Check for forms posting to default controller

            The default behavior for form_open() when called with no parameters used to be to post to the default controller, but it will now just leave an empty action="" meaning the form will submit to the current URL. diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html new file mode 100644 index 00000000..e6273f53 --- /dev/null +++ b/user_guide/installation/upgrade_202.html @@ -0,0 +1,95 @@ + + + + + +Upgrading from 2.0.1 to 2.0.2 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + +

            + +
            + + + + + +

            CodeIgniter User Guide Version 2.0.2

            +
            + + + + + + + + + +
            + + +
            + + + +
            + +

            Upgrading from 2.0.1 to 2.0.2

            + +

            Before performing an update you should take your site offline by replacing the index.php file with a static one.

            + + +

            Step 1: Update your CodeIgniter files

            + +

            Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

            + +

            Note: If you have any custom developed files in these folders please make copies of them first.

            + + +

            Step 2: Remove loading calls for the Security Library

            + +

            Security has been moved to the core and is now always loaded automatically. Make sure you remove any loading calls as they will result in PHP errors.

            + + +

            Step 3: Move MY_Security

            + +

            If you are overriding or extending the Security library, you will need to move it to application/core.

            + +
            + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 5f1fdd3e..1c4eb882 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -60,6 +60,7 @@

            Upgrading From a Previous Version

            Please read the upgrade notes corresponding to the version you are upgrading from.

              +
            • Upgrading from 2.0.1 to 2.0.2
            • Upgrading from 2.0 to 2.0.1
            • Upgrading from 1.7.2 to 2.0
            • Upgrading from 1.7.1 to 1.7.2
            • From fe9ac9416afb8281b6605d3e4097c2159d488aef Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:15:09 -0400 Subject: [PATCH 2425/2544] And now properly prepped for 2.0.2, sigh --- user_guide/installation/downloads.html | 3 +- user_guide/installation/upgrade_201.html | 12 +-- user_guide/installation/upgrade_202.html | 95 ++++++++++++++++++++++++ user_guide/installation/upgrading.html | 1 + 4 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 user_guide/installation/upgrade_202.html diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index 94ebeb03..54fff5a2 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -58,7 +58,8 @@

              Downloading CodeIgniter

                -
              • CodeIgniter V 2.0.1 (Current version)
              • +
              • CodeIgniter V 2.0.2 (Current version)
              • +
              • CodeIgniter V 2.0.1
              • CodeIgniter V 2.0.0
              • CodeIgniter V 1.7.3
              • CodeIgniter V 1.7.2
              • diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html index 6c2b02d0..fe99cc0c 100644 --- a/user_guide/installation/upgrade_201.html +++ b/user_guide/installation/upgrade_201.html @@ -72,17 +72,7 @@

                Step 2: Replace config/mimes.php

                This config file has been updated to contain more mime types, please copy it to application/config/mimes.php.

                -

                Step 3: Remove loading calls for the Security Library

                - -

                Security has been moved to the core and is now always loaded automatically. Make sure you remove any loading calls as they will result in PHP errors.

                - - -

                Step 4: Move MY_Security

                - -

                If you are overriding or extending the Security library, you will need to move it to application/core.

                - - -

                Step 5: Check for forms posting to default controller

                +

                Step 3: Check for forms posting to default controller

                The default behavior for form_open() when called with no parameters used to be to post to the default controller, but it will now just leave an empty action="" meaning the form will submit to the current URL. diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html new file mode 100644 index 00000000..e6273f53 --- /dev/null +++ b/user_guide/installation/upgrade_202.html @@ -0,0 +1,95 @@ + + + + + +Upgrading from 2.0.1 to 2.0.2 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + +

                + +
                + + + + + +

                CodeIgniter User Guide Version 2.0.2

                +
                + + + + + + + + + +
                + + +
                + + + +
                + +

                Upgrading from 2.0.1 to 2.0.2

                + +

                Before performing an update you should take your site offline by replacing the index.php file with a static one.

                + + +

                Step 1: Update your CodeIgniter files

                + +

                Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

                + +

                Note: If you have any custom developed files in these folders please make copies of them first.

                + + +

                Step 2: Remove loading calls for the Security Library

                + +

                Security has been moved to the core and is now always loaded automatically. Make sure you remove any loading calls as they will result in PHP errors.

                + + +

                Step 3: Move MY_Security

                + +

                If you are overriding or extending the Security library, you will need to move it to application/core.

                + +
                + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 5f1fdd3e..1c4eb882 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -60,6 +60,7 @@

                Upgrading From a Previous Version

                Please read the upgrade notes corresponding to the version you are upgrading from.

                  +
                • Upgrading from 2.0.1 to 2.0.2
                • Upgrading from 2.0 to 2.0.1
                • Upgrading from 1.7.2 to 2.0
                • Upgrading from 1.7.1 to 1.7.2
                • From 4a7643fbffa371d1ecec65f8ee32b9e5e5a41023 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:15:49 -0400 Subject: [PATCH 2426/2544] Added tag v2.0.2 for changeset 521076012037 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bb765e06..d14ae5a4 100644 --- a/.hgtags +++ b/.hgtags @@ -20,3 +20,4 @@ f97a33039a37fc0c3f12e48407ca08e281b6b375 v2.0.1 0000000000000000000000000000000000000000 v2.0.1 0000000000000000000000000000000000000000 v2.0.1 1941a814526f8aa7186112e6b9bfd868c5c4afbf v2.0.1 +52107601203719d6149219b28ec93d1d90c748a7 v2.0.2 From 1224f191d48d6dce920138a82e142134cc0b5231 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:15:49 -0400 Subject: [PATCH 2427/2544] Added tag v2.0.2 for changeset 521076012037 From 14a1f80e442fb9989cfaf1450a7bdeefd45fee59 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:24:53 -0500 Subject: [PATCH 2428/2544] Fixing a bug in the form_helper where csrf_token_name and csrf_hash were referencing class properties in the Security class that were moved. --- system/helpers/form_helper.php | 2 +- user_guide/installation/upgrade_202.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6..acd75c23 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html index e6273f53..d457d8bb 100644 --- a/user_guide/installation/upgrade_202.html +++ b/user_guide/installation/upgrade_202.html @@ -76,6 +76,8 @@

                  Step 3: Move MY_Security

                  If you are overriding or extending the Security library, you will need to move it to application/core.

                  +

                  csrf_token_name and csrf_hash have changed to protected class properties. Please use security->get_csrf_hash() and security->get_csrf_token_name() to access those values.

                  +
          From 1f6f0abf0d17046a99fd9c9b3c60fb459b4531b1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:24:53 -0500 Subject: [PATCH 2429/2544] Fixing a bug in the form_helper where csrf_token_name and csrf_hash were referencing class properties in the Security class that were moved. --- system/helpers/form_helper.php | 2 +- user_guide/installation/upgrade_202.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6..acd75c23 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) diff --git a/user_guide/installation/upgrade_202.html b/user_guide/installation/upgrade_202.html index e6273f53..d457d8bb 100644 --- a/user_guide/installation/upgrade_202.html +++ b/user_guide/installation/upgrade_202.html @@ -76,6 +76,8 @@

          Step 3: Move MY_Security

          If you are overriding or extending the Security library, you will need to move it to application/core.

          +

          csrf_token_name and csrf_hash have changed to protected class properties. Please use security->get_csrf_hash() and security->get_csrf_token_name() to access those values.

          +
          From 8363eacc38d0d776dad72551d1c1ce114d1eb18f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:33:29 -0500 Subject: [PATCH 2430/2544] Fix: #192 CI version constant incorrect in core/CodeIgniter --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f3e1439f..e022e1b4 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -32,7 +32,7 @@ * Define the CodeIgniter Version * ------------------------------------------------------ */ - define('CI_VERSION', '2.0.1'); + define('CI_VERSION', '2.0.2'); /* * ------------------------------------------------------ From bfbcf74c94a47c643420efaa342cc525bce2ad2c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Thu, 7 Apr 2011 18:33:29 -0500 Subject: [PATCH 2431/2544] Fix: #192 CI version constant incorrect in core/CodeIgniter --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f3e1439f..e022e1b4 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -32,7 +32,7 @@ * Define the CodeIgniter Version * ------------------------------------------------------ */ - define('CI_VERSION', '2.0.1'); + define('CI_VERSION', '2.0.2'); /* * ------------------------------------------------------ From a439fb57decf98b5b630479e7ef5dc4e7f3360c9 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:42:56 +0100 Subject: [PATCH 2432/2544] Updated Changelog to reflect "CLI usage" documentation being added. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d34f5c8f..32f9ec84 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,6 +73,7 @@

          Version 2.0.2

        • Made Environment Support optional. Comment out or delete the constant to stop environment checks.
        • Added Environment Support for Hooks.
        • Added CI_ Prefix to the Cache driver.
        • +
        • Added CLI usage documentation.
      • Helpers From e7c8f697c6460f46b1af6d17dc52069c3ec75a5c Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:42:56 +0100 Subject: [PATCH 2433/2544] Updated Changelog to reflect "CLI usage" documentation being added. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d34f5c8f..32f9ec84 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,6 +73,7 @@

        Version 2.0.2

      • Made Environment Support optional. Comment out or delete the constant to stop environment checks.
      • Added Environment Support for Hooks.
      • Added CI_ Prefix to the Cache driver.
      • +
      • Added CLI usage documentation.
    53. Helpers From b70e32ffae21c6a7ae4d21f2991a47f28531676f Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:44:17 +0100 Subject: [PATCH 2434/2544] Fixed bug with form_helper calling now protected variables. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6..acd75c23 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) From 4ad7984c10c7389f5198f6a4699293482fe2ab7b Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 8 Apr 2011 12:44:17 +0100 Subject: [PATCH 2435/2544] Fixed bug with form_helper calling now protected variables. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 8aa788c6..acd75c23 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -67,7 +67,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) // CSRF if ($CI->config->item('csrf_protection') === TRUE) { - $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash; + $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } if (is_array($hidden) AND count($hidden) > 0) From 48bac74ea9fcb8eecdf97597647f1ed492d97b43 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 13:46:47 +0200 Subject: [PATCH 2436/2544] Fix: codeigniter-reactor/193 incorrect driver filepaths --- system/libraries/Driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index d1838f2c..b942f539 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -45,7 +45,7 @@ function __get($child) $child_class = $this->lib_name.'_'.$child; // Remove the CI_ prefix and lowercase - $lib_name = strtolower(preg_replace('/^CI_/', '', $this->lib_name)); + $lib_name = ucfirst(strtolower(preg_replace('/^CI_/', '', $this->lib_name))); $driver_name = strtolower(preg_replace('/^CI_/', '', $child_class)); if (in_array($driver_name, array_map('strtolower', $this->valid_drivers))) @@ -226,4 +226,4 @@ public function __set($var, $val) // 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 */ From b07079827b084213463bdf576894faab172213f2 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:10:05 +0200 Subject: [PATCH 2437/2544] Deals with language errors after codeigniter-reactor commit r2307:c43c6dea56fb --- system/libraries/Email.php | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 6c21f114..cd89f8f3 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -722,7 +722,7 @@ public function validate_email($email) { if ( ! is_array($email)) { - $this->_set_error_message('email_must_be_array'); + $this->_set_error_message('lang:email_must_be_array'); return FALSE; } @@ -730,7 +730,7 @@ public function validate_email($email) { if ( ! $this->valid_email($val)) { - $this->_set_error_message('email_invalid_address', $val); + $this->_set_error_message('lang:email_invalid_address', $val); return FALSE; } } @@ -1131,7 +1131,7 @@ private function _build_message() if ( ! file_exists($filename)) { - $this->_set_error_message('email_attachment_missing', $filename); + $this->_set_error_message('lang:email_attachment_missing', $filename); return FALSE; } @@ -1146,7 +1146,7 @@ private function _build_message() if ( ! $fp = fopen($filename, FOPEN_READ)) { - $this->_set_error_message('email_attachment_unreadable', $filename); + $this->_set_error_message('lang:email_attachment_unreadable', $filename); return FALSE; } @@ -1353,7 +1353,7 @@ public function send() ( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND ( ! isset($this->_headers['Cc']))) { - $this->_set_error_message('email_no_recipients'); + $this->_set_error_message('lang:email_no_recipients'); return FALSE; } @@ -1484,7 +1484,7 @@ private function _spool_email() if ( ! $this->_send_with_mail()) { - $this->_set_error_message('email_send_failure_phpmail'); + $this->_set_error_message('lang:email_send_failure_phpmail'); return FALSE; } break; @@ -1492,7 +1492,7 @@ private function _spool_email() if ( ! $this->_send_with_sendmail()) { - $this->_set_error_message('email_send_failure_sendmail'); + $this->_set_error_message('lang:email_send_failure_sendmail'); return FALSE; } break; @@ -1500,14 +1500,14 @@ private function _spool_email() if ( ! $this->_send_with_smtp()) { - $this->_set_error_message('email_send_failure_smtp'); + $this->_set_error_message('lang:email_send_failure_smtp'); return FALSE; } break; } - $this->_set_error_message('email_sent', $this->_get_protocol()); + $this->_set_error_message('lang:email_sent', $this->_get_protocol()); return TRUE; } @@ -1578,8 +1578,8 @@ private function _send_with_sendmail() if ($status != 0) { - $this->_set_error_message('email_exit_status', $status); - $this->_set_error_message('email_no_socket'); + $this->_set_error_message('lang:email_exit_status', $status); + $this->_set_error_message('lang:email_no_socket'); return FALSE; } @@ -1598,7 +1598,7 @@ private function _send_with_smtp() { if ($this->smtp_host == '') { - $this->_set_error_message('email_no_hostname'); + $this->_set_error_message('lang:email_no_hostname'); return FALSE; } @@ -1647,7 +1647,7 @@ private function _send_with_smtp() if (strncmp($reply, '250', 3) != 0) { - $this->_set_error_message('email_smtp_error', $reply); + $this->_set_error_message('lang:email_smtp_error', $reply); return FALSE; } @@ -1674,7 +1674,7 @@ private function _smtp_connect() if ( ! is_resource($this->_smtp_connect)) { - $this->_set_error_message('email_smtp_error', $errno." ".$errstr); + $this->_set_error_message('lang:email_smtp_error', $errno." ".$errstr); return FALSE; } @@ -1737,7 +1737,7 @@ private function _send_command($cmd, $data = '') if (substr($reply, 0, 3) != $resp) { - $this->_set_error_message('email_smtp_error', $reply); + $this->_set_error_message('lang:email_smtp_error', $reply); return FALSE; } @@ -1766,7 +1766,7 @@ private function _smtp_authenticate() if ($this->smtp_user == "" AND $this->smtp_pass == "") { - $this->_set_error_message('email_no_smtp_unpw'); + $this->_set_error_message('lang:email_no_smtp_unpw'); return FALSE; } @@ -1776,7 +1776,7 @@ private function _smtp_authenticate() if (strncmp($reply, '334', 3) != 0) { - $this->_set_error_message('email_failed_smtp_login', $reply); + $this->_set_error_message('lang:email_failed_smtp_login', $reply); return FALSE; } @@ -1786,7 +1786,7 @@ private function _smtp_authenticate() if (strncmp($reply, '334', 3) != 0) { - $this->_set_error_message('email_smtp_auth_un', $reply); + $this->_set_error_message('lang:email_smtp_auth_un', $reply); return FALSE; } @@ -1796,7 +1796,7 @@ private function _smtp_authenticate() if (strncmp($reply, '235', 3) != 0) { - $this->_set_error_message('email_smtp_auth_pw', $reply); + $this->_set_error_message('lang:email_smtp_auth_pw', $reply); return FALSE; } @@ -1815,7 +1815,7 @@ private function _send_data($data) { if ( ! fwrite($this->_smtp_connect, $data . $this->newline)) { - $this->_set_error_message('email_smtp_data_failure', $data); + $this->_set_error_message('lang:email_smtp_data_failure', $data); return FALSE; } else @@ -1942,7 +1942,7 @@ private function _set_error_message($msg, $val = '') $CI =& get_instance(); $CI->lang->load('email'); - if (FALSE === ($line = $CI->lang->line($msg))) + if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5)))) { $this->_debug_msg[] = str_replace('%s', $val, $msg)."
      "; } @@ -2059,4 +2059,4 @@ private function _mime_types($ext = "") // END CI_Email class /* End of file Email.php */ -/* Location: ./system/libraries/Email.php */ \ No newline at end of file +/* Location: ./system/libraries/Email.php */ From 64e35cdcb9fd24787798c0f6ca3c0af45b0b904d Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:25:31 +0200 Subject: [PATCH 2438/2544] There is absolutely no need to specify class name (it will validate anyway). --- system/helpers/form_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index acd75c23..bca0ff0c 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -72,7 +72,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) if (is_array($hidden) AND count($hidden) > 0) { - $form .= sprintf("\n
      %s
      ", form_hidden($hidden)); + $form .= sprintf("\n
      %s
      ", form_hidden($hidden)); } return $form; @@ -1053,4 +1053,4 @@ function &_get_validation_object() /* End of file form_helper.php */ -/* Location: ./system/helpers/form_helper.php */ \ No newline at end of file +/* Location: ./system/helpers/form_helper.php */ From 02404a1f59e4f3ae8231d87d8be5b23488ea86d2 Mon Sep 17 00:00:00 2001 From: patwork Date: Fri, 8 Apr 2011 15:45:46 +0200 Subject: [PATCH 2439/2544] Fix: codeigniter-reactor/127 Form_validation rule error logging --- system/libraries/Form_validation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index cfc02eda..6f79a554 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -628,6 +628,10 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) $this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result; } } + else + { + log_message('debug', "Unable to find validation rule: ".$rule); + } continue; } @@ -1357,4 +1361,4 @@ function encode_php_tags($str) // END Form Validation Class /* End of file Form_validation.php */ -/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file +/* Location: ./system/libraries/Form_validation.php */ From ef1a55ad2875af3b2286a5b6eb9b65e997949f4d Mon Sep 17 00:00:00 2001 From: patwork Date: Sat, 9 Apr 2011 13:04:06 +0200 Subject: [PATCH 2440/2544] Fix: codeigniter-reactor/199 CSRF config in Security class is no longer ignored --- system/core/Security.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/system/core/Security.php b/system/core/Security.php index ceef9779..73a3cfb3 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -58,6 +58,15 @@ class CI_Security { */ public function __construct() { + // CSRF config + foreach(array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key) + { + if (FALSE !== ($val = config_item($key))) + { + $this->{'_'.$key} = $val; + } + } + // Append application specific cookie prefix to token name $this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name; @@ -817,4 +826,4 @@ protected function _csrf_set_hash() // END Security Class /* End of file Security.php */ -/* Location: ./system/libraries/Security.php */ \ No newline at end of file +/* Location: ./system/libraries/Security.php */ From 571023b24f705d9c0bbaecf2e3cbbc06752390b4 Mon Sep 17 00:00:00 2001 From: patwork Date: Mon, 11 Apr 2011 11:56:41 +0200 Subject: [PATCH 2441/2544] Fix: codeigniter-reactor/32 unicorns are no longer mute --- system/core/Lang.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Lang.php b/system/core/Lang.php index 0b926a30..cdadc7f4 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -129,19 +129,19 @@ function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, */ function line($line = '') { - $line = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; + $value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; // Because killer robots like unicorns! - if ($line === FALSE) + if ($value === FALSE) { log_message('error', 'Could not find the language line "'.$line.'"'); } - return $line; + return $value; } } // END Language Class /* End of file Lang.php */ -/* Location: ./system/core/Lang.php */ \ No newline at end of file +/* Location: ./system/core/Lang.php */ From 9e2679849611ce050f5636c44b6c3279328d00f9 Mon Sep 17 00:00:00 2001 From: patwork Date: Mon, 11 Apr 2011 13:02:32 +0200 Subject: [PATCH 2442/2544] Fix: codeigniter-reactor/199 cookie name was overwritten with token name --- system/core/Security.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/core/Security.php b/system/core/Security.php index 73a3cfb3..4f91572e 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -67,8 +67,10 @@ public function __construct() } } - // Append application specific cookie prefix to token name - $this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name; + // Append application specific cookie prefix + if (config_item('cookie_prefix')) { + $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name; + } // Set the CSRF hash $this->_csrf_set_hash(); From e70e92bab1de57a0749a31f2889b55cafb46d58e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 25 Apr 2011 10:50:53 -0500 Subject: [PATCH 2443/2544] Fixing up a tabs vs spaces inconsistency in DB_Result --- system/database/DB_result.php | 83 +++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 06eec512..e8322838 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -32,7 +32,7 @@ class CI_DB_result { var $result_id = NULL; var $result_array = array(); var $result_object = array(); - var $custom_result_object = array(); + var $custom_result_object = array(); var $current_row = 0; var $num_rows = 0; var $row_data = NULL; @@ -47,47 +47,52 @@ class CI_DB_result { */ function result($type = 'object') { - if ($type == 'array') return $this->result_array(); - else if ($type == 'object') return $this->result_object(); - else return $this->custom_result_object($type); + if ($type == 'array') return $this->result_array(); + else if ($type == 'object') return $this->result_object(); + else return $this->custom_result_object($type); } // -------------------------------------------------------------------- - /** - * Custom query 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) - { - if (array_key_exists($class_name, $this->custom_result_object)) - { - return $this->custom_result_object[$class_name]; - } - - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - // add the data to the object - $this->_data_seek(0); - $result_object = array(); + /** + * Custom query 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) + { + if (array_key_exists($class_name, $this->custom_result_object)) + { + return $this->custom_result_object[$class_name]; + } + + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + // add the data to the object + $this->_data_seek(0); + $result_object = array(); + while ($row = $this->_fetch_object()) - { - $object = new $class_name(); - foreach ($row as $key => $value) - { - $object->$key = $value; - } + { + $object = new $class_name(); + + foreach ($row as $key => $value) + { + $object->$key = $value; + } + $result_object[] = $object; } - // return the array - return $this->custom_result_object[$class_name] = $result_object; - } + // return the array + return $this->custom_result_object[$class_name] = $result_object; + } + + // -------------------------------------------------------------------- /** * Query result. "object" version. @@ -180,9 +185,9 @@ function row($n = 0, $type = 'object') $n = 0; } - if ($type == 'object') return $this->row_object($n); - else if ($type == 'array') return $this->row_array($n); - else return $this->custom_row_object($n, $type); + if ($type == 'object') return $this->row_object($n); + else if ($type == 'array') return $this->row_array($n); + else return $this->custom_row_object($n, $type); } // -------------------------------------------------------------------- @@ -219,7 +224,7 @@ function set_row($key, $value = NULL) // -------------------------------------------------------------------- - /** + /** * Returns a single result row - custom object version * * @access public @@ -242,7 +247,7 @@ function custom_row_object($n, $type) return $result[$this->current_row]; } - /** + /** * Returns a single result row - object version * * @access public From db60d240226468b19d656c4ba026bc992e4c3034 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:31:30 +0900 Subject: [PATCH 2444/2544] add "Using CodeIgniter Drivers" and "Creating Your Own Driver" in TOC --- user_guide/nav/nav.js | 2 ++ user_guide/toc.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ce783fc2..b44994d4 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -50,6 +50,8 @@ function create_menu(basepath) '
    54. Helpers
    55. ' + '
    56. Using CodeIgniter Libraries
    57. ' + '
    58. Creating Your Own Libraries
    59. ' + + '
    60. Using CodeIgniter Drivers
    61. ' + + '
    62. Creating Your Own Drivers
    63. ' + '
    64. Creating Core Classes
    65. ' + '
    66. Hooks - Extending the Core
    67. ' + '
    68. Auto-loading Resources
    69. ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 4b4ab100..f6a5fe0e 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -103,6 +103,8 @@

      General Topics

    70. Helpers
    71. Using CodeIgniter Libraries
    72. Creating Your Own Libraries
    73. +
    74. Using CodeIgniter Drivers
    75. +
    76. Creating Your Own Drivers
    77. Creating Core Classes
    78. Hooks - Extending the Core
    79. Auto-loading Resources
    80. From e7bdd2260e6be61d3ed37e517f35ba017beee5f3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:33:53 +0900 Subject: [PATCH 2445/2544] update Prev/Next Topic link on user_guide/database/index.html --- user_guide/database/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 594de80d..1f0a1da7 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -86,7 +86,7 @@

      The Database Class

      From 4c6ceb067ca15228c547770354023f826f552036 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:35:43 +0900 Subject: [PATCH 2447/2544] update Prev/Next Topic link on user_guide/helpers/array_helper.html --- user_guide/helpers/array_helper.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html index 88e8384d..139bbe2b 100644 --- a/user_guide/helpers/array_helper.html +++ b/user_guide/helpers/array_helper.html @@ -159,10 +159,10 @@

      elements()

      From 33095c29a638c127928faa5b0360abd3ac5254f9 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:36:10 +0900 Subject: [PATCH 2448/2544] update Prev/Next Topic link on user_guide/helpers/captcha_helper.html --- user_guide/helpers/captcha_helper.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html index 3c6fa118..c80c2fbe 100644 --- a/user_guide/helpers/captcha_helper.html +++ b/user_guide/helpers/captcha_helper.html @@ -183,11 +183,11 @@

      Adding a Database

      From 49e31258bc85245b087d6b7b5ac02edb1b680bc6 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:37:15 +0900 Subject: [PATCH 2449/2544] update Prev/Next Topic link on user_guide/helpers/cookie_helper.html --- user_guide/helpers/cookie_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html index 9879653c..889c3346 100644 --- a/user_guide/helpers/cookie_helper.html +++ b/user_guide/helpers/cookie_helper.html @@ -95,7 +95,7 @@

      delete_cookie()

      From 26eebddda5438c3967bad74a05c3e990528e1182 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 17 Apr 2011 23:45:41 -0400 Subject: [PATCH 2453/2544] Changed server check to ensure SCRIPT_NAME is defined. Fixes #57 --- system/core/URI.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/core/URI.php b/system/core/URI.php index 80dc62e5..d5654865 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -120,7 +120,7 @@ function _fetch_uri_string() $path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri); $this->_set_uri_string($path); } - + // -------------------------------------------------------------------- /** @@ -133,7 +133,7 @@ function _set_uri_string($str) { // Filter out control characters $str = remove_invisible_characters($str, FALSE); - + // If the URI contains only a slash we'll kill it $this->uri_string = ($str == '/') ? '' : $str; } @@ -151,7 +151,7 @@ function _set_uri_string($str) */ private function _detect_uri() { - if ( ! isset($_SERVER['REQUEST_URI'])) + if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME'])) { return ''; } @@ -184,12 +184,12 @@ private function _detect_uri() $_SERVER['QUERY_STRING'] = ''; $_GET = array(); } - + if ($uri == '/' || empty($uri)) { return '/'; } - + $uri = parse_url($uri, PHP_URL_PATH); // Do some final cleaning of the URI and return it From c31b3729da50eaade365451f49dac7d462684702 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 17 Apr 2011 23:58:40 -0400 Subject: [PATCH 2454/2544] Added ENVIRONMENT to reserved constants. Fixes #196 --- user_guide/changelog.html | 17 +++++++++++++++++ user_guide/general/reserved_names.html | 1 + 2 files changed, 18 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f24d8110..0ebe74ae 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -59,6 +59,23 @@

      Change Log

      The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

      +

      Version 2.0.3

      +

      Release Date: Not Released

      + +
        +
      • General Changes +
          +
        • +
        +
      • +
      + +

      Bug fixes for 2.0.3

      +
        +
      • Added ENVIRONMENT to reserved constants. (Reactor #196)
      • +
      • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
      • +
      +

      Version 2.0.2

      Release Date: April 7, 2011
      Hg Tag: v2.0.2

      diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html index d1ee2955..00bebff6 100644 --- a/user_guide/general/reserved_names.html +++ b/user_guide/general/reserved_names.html @@ -90,6 +90,7 @@

      Variables

      Constants

        +
      • ENVIRONMENT
      • EXT
      • FCPATH
      • SELF
      • From bffb7769c6f31b7a47355d4eb66f5ac1d85c2a2e Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Mon, 18 Apr 2011 00:03:31 -0400 Subject: [PATCH 2455/2544] Changed path in footer comment of cache dummy. --- .../libraries/Cache/drivers/Cache_dummy.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index de47acb4..f96a68e2 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -10,29 +10,29 @@ * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter Dummy Caching Class + * CodeIgniter Dummy Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache_dummy extends CI_Driver { /** - * Get + * Get * * Since this is the dummy class, it's always going to return FALSE. * - * @param string + * @param string * @return Boolean FALSE */ public function get($id) @@ -40,8 +40,8 @@ public function get($id) return FALSE; } - // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ + /** * Cache Save * @@ -55,7 +55,7 @@ public function save($id, $data, $ttl = 60) { return TRUE; } - + // ------------------------------------------------------------------------ /** @@ -112,7 +112,7 @@ public function get_metadata($id) /** * Is this caching driver supported on the system? * Of course this one is. - * + * * @return TRUE; */ public function is_supported() @@ -121,9 +121,9 @@ public function is_supported() } // ------------------------------------------------------------------------ - + } // End Class -/* End of file Cache_apc.php */ -/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ \ No newline at end of file +/* End of file Cache_dummy.php */ +/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */ \ No newline at end of file From 826429cf40a9624788b92d2e6e4b7659e1b0d8a1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 09:40:19 -0500 Subject: [PATCH 2456/2544] Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag. --- system/helpers/html_helper.php | 5 +++-- user_guide/changelog.html | 5 +++++ user_guide/helpers/html_helper.html | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index c6103ab6..a2920439 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -40,9 +40,10 @@ */ if ( ! function_exists('heading')) { - function heading($data = '', $h = '1') + function heading($data = '', $h = '1', $attributes = '') { - return "".$data.""; + $attributes = ($attributes != '') ? ' '.$attributes : $attributes; + return "".$data.""; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0ebe74ae..0afc5b82 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,11 @@

        Version 2.0.3

      +
    81. Helpers +
        +
      • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
      • +
      +
    82. Bug fixes for 2.0.3

      diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 1a0529f7..308013d5 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -89,6 +89,11 @@

      heading()

      echo heading('Welcome!', 3);

      The above would produce: <h3>Welcome!</h3>

      +

      Additionally, in order to add attributes to the heading tag such as HTML classes, ids or inline styles, a third parameter is available.

      +echo heading('Welcome!', 3, 'class="pink"') +

      The above code produces: <h3 class="pink">Welcome!<<h3>

      + +

      img()

      Lets you create HTML <img /> tags. The first parameter contains the image source. Example:

      echo img('images/picture.jpg');
      From 62df13125bd9ab22ff0c7f2565a42a6de13ed7e4 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 11:18:02 -0500 Subject: [PATCH 2457/2544] Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables. --- system/language/english/profiler_lang.php | 3 ++ system/libraries/Profiler.php | 45 ++++++++++++++++++++--- user_guide/changelog.html | 2 +- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index b6460fb8..1111158c 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -9,6 +9,7 @@ $lang['profiler_uri_string'] = 'URI STRING'; $lang['profiler_memory_usage'] = 'MEMORY USAGE'; $lang['profiler_config'] = 'CONFIG VARIABLES'; +$lang['profiler_session_data'] = 'SESSION DATA'; $lang['profiler_headers'] = 'HTTP HEADERS'; $lang['profiler_no_db'] = 'Database driver is not currently loaded'; $lang['profiler_no_queries'] = 'No queries were run'; @@ -17,6 +18,8 @@ $lang['profiler_no_uri'] = 'No URI data exists'; $lang['profiler_no_memory'] = 'Memory Usage Unavailable'; $lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.'; +$lang['profiler_section_hide'] = 'Hide'; +$lang['profiler_section_show'] = 'Show'; /* End of file profiler_lang.php */ /* Location: ./system/language/english/profiler_lang.php */ \ No newline at end of file diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 8a1f18ce..d1828b98 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -32,7 +32,7 @@ */ class CI_Profiler { - var $CI; + private $CI; protected $_available_sections = array( 'benchmarks', @@ -43,6 +43,7 @@ class CI_Profiler { 'controller_info', 'queries', 'http_headers', + 'session_data', 'config' ); @@ -410,10 +411,10 @@ protected function _compile_http_headers() $output = "\n\n"; $output .= '
      '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_headers').'  '; + $output .= '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')'; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
      \n"; foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { @@ -441,10 +442,10 @@ protected function _compile_config() $output = "\n\n"; $output .= '
      '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_config').'  '; + $output .= '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')'; $output .= "\n"; - $output .= "\n\n
      \n"; + $output .= "\n\n
      \n"; foreach ($this->CI->config->config as $config=>$val) { @@ -464,6 +465,39 @@ protected function _compile_config() // -------------------------------------------------------------------- + /** + * Compile session userdata + * + * @return string + */ + private function _compile_session_data() + { + if ( ! isset($this->CI->session)) + { + return; + } + + $output = '
      '; + $output .= '  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')'; + $output .= "
      "; + + foreach ($this->CI->session->all_userdata() as $key => $val) + { + if (is_array($val)) + { + $val = print_r($val, TRUE); + } + + $output .= "\n"; + } + + $output .= ''; + $output .= "
      "; + return $output; + } + + // -------------------------------------------------------------------- + /** * Run the Profiler * @@ -493,7 +527,6 @@ public function run() return $output; } - } // END CI_Profiler class diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0afc5b82..9890f602 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,7 +65,7 @@

      Version 2.0.3

      • General Changes
          -
        • +
        • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
      • Helpers From 3403366d0f457c1dd449076b4177d1aff5cb176c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 11:18:09 -0500 Subject: [PATCH 2458/2544] changeset: 2202:06a75a1bd622 tag: tip user: Greg Aker date: Mon Apr 18 11:10:37 2011 -0500 summary: Tweak to session class all_userdata() to just return the userdata array. Also documented previously undocumented all_userdata() method. --- system/libraries/Session.php | 4 ++-- user_guide/libraries/sessions.html | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 18229405..32317c2e 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -435,11 +435,11 @@ function userdata($item) * Fetch all session data * * @access public - * @return mixed + * @return array */ function all_userdata() { - return ( ! isset($this->userdata)) ? FALSE : $this->userdata; + return $this->userdata; } // -------------------------------------------------------------------- diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 600d301c..8d9c14eb 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -170,6 +170,23 @@

        Adding Custom Session Data

        Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

        +

        Retrieving All Session Data

        +

        An array of all userdata can be retrieved as follows:

        +$this->session->all_userdata() + +

        And returns an associative array like the following:

        + +
        +Array
        +(
        +    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
        +    [ip_address] => 127.0.0.1
        +    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
        +    [last_activity] => 1303142623
        +)
        +
        + +

        Removing Session Data

        Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

        $this->session->unset_userdata('some_name');

        From e6e6e64ab078205153513af24dd4163157efb148 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 15:54:13 -0500 Subject: [PATCH 2459/2544] changeset: 2204:37301a84c8be tag: tip user: Greg Aker date: Mon Apr 18 15:51:28 2011 -0500 summary: Adding toggle show/hide on database queries in the output profiler. Added a profiler config item to set a threshold of when to hide the queries by default. Additionally, fixed a bug I created earlier today by marking the $CI class var in CI_Profiler as private. --- system/libraries/Profiler.php | 35 ++++++++-- user_guide/general/profiling.html | 103 ++++++++++++++++-------------- 2 files changed, 83 insertions(+), 55 deletions(-) diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index d1828b98..b73ddaf0 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -32,8 +32,6 @@ */ class CI_Profiler { - private $CI; - protected $_available_sections = array( 'benchmarks', 'get', @@ -46,12 +44,24 @@ class CI_Profiler { 'session_data', 'config' ); + + protected $_query_toggle_count = 25; + + protected $CI; + // -------------------------------------------------------------------- + public function __construct($config = array()) { $this->CI =& get_instance(); $this->CI->load->language('profiler'); + if (isset($config['query_toggle_count'])) + { + $this->_query_toggle_count = (int) $config['query_toggle_count']; + unset($config['query_toggle_count']); + } + // default all sections to display foreach ($this->_available_sections as $section) { @@ -163,7 +173,7 @@ protected function _compile_queries() $output .= "\n"; $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
        \n"; $output .="\n"; $output .= "
        ".$this->CI->lang->line('profiler_no_db')."
        \n"; $output .= ""; @@ -178,14 +188,27 @@ protected function _compile_queries() $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); $output = "\n\n"; - + + $count = 0; + foreach ($dbs as $db) { + $count++; + + $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; + + $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; + + if ($hide_queries != '') + { + $show_hide_js = '('.$this->CI->lang->line('profiler_section_show').')'; + } + $output .= '
        '; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'   '; + $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'  '.$show_hide_js.''; $output .= "\n"; - $output .= "\n\n\n"; + $output .= "\n\n
        \n"; if (count($db->queries) == 0) { diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index f3ea0c6f..78ece7dc 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -105,55 +105,60 @@

        Enabling and Disabling Profiler Sections

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        KeyDescriptionDefault
        benchmarksElapsed time of Benchmark points and total execution timeTRUE
        configCodeIgniter Config variablesTRUE
        controller_infoThe Controller class and method requestedTRUE
        getAny GET data passed in the requestTRUE
        http_headersThe HTTP headers for the current requestTRUE
        memory_usageAmount of memory consumed by the current request, in bytesTRUE
        postAny POST data passed in the requestTRUE
        queriesListing of all database queries executed, including execution timeTRUE
        uri_stringThe URI of the current requestTRUE
        KeyDescriptionDefault
        benchmarksElapsed time of Benchmark points and total execution timeTRUE
        configCodeIgniter Config variablesTRUE
        controller_infoThe Controller class and method requestedTRUE
        getAny GET data passed in the requestTRUE
        http_headersThe HTTP headers for the current requestTRUE
        memory_usageAmount of memory consumed by the current request, in bytesTRUE
        postAny POST data passed in the requestTRUE
        queriesListing of all database queries executed, including execution timeTRUE
        uri_stringThe URI of the current requestTRUE
        query_toggle_countThe number of queries after which the query block will default to hidden.25
        From 3a746655e92ec59ee7e731c3535673a9aedc5d3e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 10:59:47 -0500 Subject: [PATCH 2460/2544] Removing internal references to the EXT constant. Additionally, marked the constant as deprecated. Use ".php" instead. Also adding upgrade notes from 2.0.2 to 2.0.3. --- index.php | 3 +- system/core/CodeIgniter.php | 22 ++--- system/core/Common.php | 14 ++-- system/core/Config.php | 6 +- system/core/Exceptions.php | 4 +- system/core/Hooks.php | 8 +- system/core/Lang.php | 4 +- system/core/Loader.php | 64 +++++++------- system/core/Output.php | 6 +- system/core/Router.php | 14 ++-- system/database/DB.php | 12 +-- system/database/DB_driver.php | 6 +- system/helpers/download_helper.php | 8 +- system/helpers/file_helper.php | 8 +- system/helpers/html_helper.php | 8 +- system/helpers/smiley_helper.php | 8 +- system/helpers/text_helper.php | 8 +- system/libraries/Calendar.php | 2 +- system/libraries/Driver.php | 2 +- system/libraries/Encrypt.php | 2 +- system/libraries/Log.php | 2 +- system/libraries/Upload.php | 8 +- system/libraries/User_agent.php | 8 +- user_guide/changelog.html | 1 + user_guide/installation/upgrade_203.html | 102 +++++++++++++++++++++++ user_guide/installation/upgrading.html | 1 + 26 files changed, 218 insertions(+), 113 deletions(-) create mode 100644 user_guide/installation/upgrade_203.html diff --git a/index.php b/index.php index 6e67c2db..a8d58b2d 100644 --- a/index.php +++ b/index.php @@ -163,6 +163,7 @@ define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); // The PHP file extension + // this global constant is deprecated. define('EXT', '.php'); // Path to the system folder @@ -198,7 +199,7 @@ * And away we go... * */ -require_once BASEPATH.'core/CodeIgniter'.EXT; +require_once BASEPATH.'core/CodeIgniter.php'; /* End of file index.php */ /* Location: ./index.php */ \ No newline at end of file diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index e022e1b4..03b25ab9 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -46,20 +46,20 @@ * Load the global functions * ------------------------------------------------------ */ - require(BASEPATH.'core/Common'.EXT); + require(BASEPATH.'core/Common.php'); /* * ------------------------------------------------------ * Load the framework constants * ------------------------------------------------------ */ - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php')) { - require(APPPATH.'config/'.ENVIRONMENT.'/constants'.EXT); + require(APPPATH.'config/'.ENVIRONMENT.'/constants.php'); } else { - require(APPPATH.'config/constants'.EXT); + require(APPPATH.'config/constants.php'); } /* @@ -224,7 +224,7 @@ * */ // Load the base controller class - require BASEPATH.'core/Controller'.EXT; + require BASEPATH.'core/Controller.php'; function &get_instance() { @@ -232,20 +232,20 @@ function &get_instance() } - if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT)) + if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php')) { - require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT; + require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'; } // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. - if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php')) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } - include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); + include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php'); // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); @@ -318,12 +318,12 @@ function &get_instance() $method = (isset($x[1]) ? $x[1] : 'index'); if ( ! class_exists($class)) { - if ( ! file_exists(APPPATH.'controllers/'.$class.EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { show_404("{$class}/{$method}"); } - include_once(APPPATH.'controllers/'.$class.EXT); + include_once(APPPATH.'controllers/'.$class.'.php'); unset($CI); $CI = new $class(); } diff --git a/system/core/Common.php b/system/core/Common.php index 1aca809a..d1e8e77e 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -128,13 +128,13 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') // thenin the local application/libraries folder foreach (array(BASEPATH, APPPATH) as $path) { - if (file_exists($path.$directory.'/'.$class.EXT)) + if (file_exists($path.$directory.'/'.$class.'.php')) { $name = $prefix.$class; if (class_exists($name) === FALSE) { - require($path.$directory.'/'.$class.EXT); + require($path.$directory.'/'.$class.'.php'); } break; @@ -142,13 +142,13 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') } // Is the request a class extension? If so we load it too - if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT)) + if (file_exists(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php')) { $name = config_item('subclass_prefix').$class; if (class_exists($name) === FALSE) { - require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.EXT); + require(APPPATH.$directory.'/'.config_item('subclass_prefix').$class.'.php'); } } @@ -157,7 +157,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 - exit('Unable to locate the specified class: '.$class.EXT); + exit('Unable to locate the specified class: '.$class.'.php'); } // Keep track of what we just loaded @@ -209,9 +209,9 @@ function &get_config($replace = array()) } // Is the config file in the environment folder? - if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config'.EXT)) + if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php')) { - $file_path = APPPATH.'config/config'.EXT; + $file_path = APPPATH.'config/config.php'; } // Fetch the config file diff --git a/system/core/Config.php b/system/core/Config.php index 863c5ef4..4493ff26 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -80,7 +80,7 @@ function __construct() */ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { - $file = ($file == '') ? 'config' : str_replace(EXT, '', $file); + $file = ($file == '') ? 'config' : str_replace('.php', '', $file); $found = FALSE; $loaded = FALSE; @@ -92,7 +92,7 @@ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) foreach ($check_locations as $location) { - $file_path = $path.'config/'.$location.EXT; + $file_path = $path.'config/'.$location.'.php'; if (in_array($file_path, $this->is_loaded, TRUE)) { @@ -152,7 +152,7 @@ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { return FALSE; } - show_error('The configuration file '.$file.EXT.' does not exist.'); + show_error('The configuration file '.$file.'.php'.' does not exist.'); } return TRUE; diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index f5659561..bff86a92 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -128,7 +128,7 @@ function show_error($heading, $message, $template = 'error_general', $status_cod ob_end_flush(); } ob_start(); - include(APPPATH.'errors/'.$template.EXT); + include(APPPATH.'errors/'.$template.'.php'); $buffer = ob_get_contents(); ob_end_clean(); return $buffer; @@ -164,7 +164,7 @@ function show_php_error($severity, $message, $filepath, $line) ob_end_flush(); } ob_start(); - include(APPPATH.'errors/error_php'.EXT); + include(APPPATH.'errors/error_php.php'); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 24fa1055..fd6380f0 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,13 +65,13 @@ function _initialize() // Grab the "hooks" definition file. // If there are no hooks, we're done. - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } - elseif (is_file(APPPATH.'config/hooks'.EXT)) + elseif (is_file(APPPATH.'config/hooks.php')) { - include(APPPATH.'config/hooks'.EXT); + include(APPPATH.'config/hooks.php'); } diff --git a/system/core/Lang.php b/system/core/Lang.php index cdadc7f4..170e6c72 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -51,14 +51,14 @@ function __construct() */ function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') { - $langfile = str_replace(EXT, '', $langfile); + $langfile = str_replace('.php', '', $langfile); if ($add_suffix == TRUE) { $langfile = str_replace('_lang.', '', $langfile).'_lang'; } - $langfile .= EXT; + $langfile .= '.php'; if (in_array($langfile, $this->is_loaded, TRUE)) { diff --git a/system/core/Loader.php b/system/core/Loader.php index e75805d0..59415b72 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -161,7 +161,7 @@ function model($model, $name = '', $db_conn = FALSE) foreach ($this->_ci_model_paths as $mod_path) { - if ( ! file_exists($mod_path.'models/'.$path.$model.EXT)) + if ( ! file_exists($mod_path.'models/'.$path.$model.'.php')) { continue; } @@ -181,7 +181,7 @@ function model($model, $name = '', $db_conn = FALSE) load_class('Model', 'core'); } - require_once($mod_path.'models/'.$path.$model.EXT); + require_once($mod_path.'models/'.$path.$model.'.php'); $model = ucfirst($model); @@ -217,7 +217,7 @@ function database($params = '', $return = FALSE, $active_record = NULL) return FALSE; } - require_once(BASEPATH.'database/DB'.EXT); + require_once(BASEPATH.'database/DB.php'); if ($return === TRUE) { @@ -253,8 +253,8 @@ function dbutil() // this use is deprecated and strongly discouraged $CI->load->dbforge(); - require_once(BASEPATH.'database/DB_utility'.EXT); - require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility'.EXT); + require_once(BASEPATH.'database/DB_utility.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; $CI->dbutil = new $class(); @@ -277,8 +277,8 @@ function dbforge() $CI =& get_instance(); - require_once(BASEPATH.'database/DB_forge'.EXT); - require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge'.EXT); + require_once(BASEPATH.'database/DB_forge.php'); + require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; $CI->dbforge = new $class(); @@ -375,16 +375,16 @@ function helper($helpers = array()) continue; } - $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.EXT; + $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; // Is this a helper extension request? if (file_exists($ext_helper)) { - $base_helper = BASEPATH.'helpers/'.$helper.EXT; + $base_helper = BASEPATH.'helpers/'.$helper.'.php'; if ( ! file_exists($base_helper)) { - show_error('Unable to load the requested file: helpers/'.$helper.EXT); + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } include_once($ext_helper); @@ -398,9 +398,9 @@ function helper($helpers = array()) // Try to load the helper foreach ($this->_ci_helper_paths as $path) { - if (file_exists($path.'helpers/'.$helper.EXT)) + if (file_exists($path.'helpers/'.$helper.'.php')) { - include_once($path.'helpers/'.$helper.EXT); + include_once($path.'helpers/'.$helper.'.php'); $this->_ci_helpers[$helper] = TRUE; log_message('debug', 'Helper loaded: '.$helper); @@ -411,7 +411,7 @@ function helper($helpers = array()) // unable to load the helper if ( ! isset($this->_ci_helpers[$helper])) { - show_error('Unable to load the requested file: helpers/'.$helper.EXT); + show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } } } @@ -490,7 +490,7 @@ function driver($library = '', $params = NULL, $object_name = NULL) if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself - require BASEPATH.'libraries/Driver'.EXT; + require BASEPATH.'libraries/Driver.php'; } // We can save the loader some time since Drivers will *always* be in a subfolder, @@ -616,7 +616,7 @@ function _ci_load($_ci_data) if ($_ci_path == '') { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); - $_ci_file = ($_ci_ext == '') ? $_ci_view.EXT : $_ci_view; + $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; $_ci_path = $this->_ci_view_path.$_ci_file; } else @@ -732,7 +732,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, // but we don't want a leading slash - $class = str_replace(EXT, '', trim($class, '/')); + $class = str_replace('.php', '', trim($class, '/')); // Was the path included with the class name? // We look for a slash to determine this @@ -749,12 +749,12 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) // We'll test for both lowercase and capitalized versions of the file name foreach (array(ucfirst($class), strtolower($class)) as $class) { - $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.EXT; + $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.'.php'; // Is this a class extension request? if (file_exists($subclass)) { - $baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT; + $baseclass = BASEPATH.'libraries/'.ucfirst($class).'.php'; if ( ! file_exists($baseclass)) { @@ -793,7 +793,7 @@ function _ci_load_class($class, $params = NULL, $object_name = NULL) $is_duplicate = FALSE; foreach ($this->_ci_library_paths as $path) { - $filepath = $path.'libraries/'.$subdir.$class.EXT; + $filepath = $path.'libraries/'.$subdir.$class.'.php'; // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) @@ -872,24 +872,24 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU // We test for both uppercase and lowercase, for servers that // are case-sensitive with regard to file names. Check for environment // first, global next - if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT)) + if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) { - include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).EXT); + include_once($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); break; } - elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT)) + elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) { - include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).EXT); + include_once($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); break; } - elseif (file_exists($path .'config/'.strtolower($class).EXT)) + elseif (file_exists($path .'config/'.strtolower($class).'.php')) { - include_once($path .'config/'.strtolower($class).EXT); + include_once($path .'config/'.strtolower($class).'.php'); break; } - elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).EXT)) + elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) { - include_once($path .'config/'.ucfirst(strtolower($class)).EXT); + include_once($path .'config/'.ucfirst(strtolower($class)).'.php'); break; } } @@ -965,13 +965,13 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU */ function _ci_autoloader() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { - include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT); + include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } else { - include_once(APPPATH.'config/autoload'.EXT); + include_once(APPPATH.'config/autoload.php'); } @@ -1084,13 +1084,13 @@ function _ci_prep_filename($filename, $extension) { if ( ! is_array($filename)) { - return array(strtolower(str_replace(EXT, '', str_replace($extension, '', $filename)).$extension)); + return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension)); } else { foreach ($filename as $key => $val) { - $filename[$key] = strtolower(str_replace(EXT, '', str_replace($extension, '', $val)).$extension); + $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension); } return $filename; diff --git a/system/core/Output.php b/system/core/Output.php index 45a82f3c..05ace919 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -42,13 +42,13 @@ function __construct() $this->_zlib_oc = @ini_get('zlib.output_compression'); // Get mime types for later - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT; + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; } else { - include APPPATH.'config/mimes'.EXT; + include APPPATH.'config/mimes.php'; } diff --git a/system/core/Router.php b/system/core/Router.php index d451aab6..5e92a04b 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -87,13 +87,13 @@ function _set_routing() } // Load the routes.php file. - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/routes.php'); } - elseif (is_file(APPPATH.'config/routes'.EXT)) + elseif (is_file(APPPATH.'config/routes.php')) { - include(APPPATH.'config/routes'.EXT); + include(APPPATH.'config/routes.php'); } $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; @@ -227,7 +227,7 @@ function _validate_request($segments) } // Does the requested controller exist in the root folder? - if (file_exists(APPPATH.'controllers/'.$segments[0].EXT)) + if (file_exists(APPPATH.'controllers/'.$segments[0].'.php')) { return $segments; } @@ -242,7 +242,7 @@ function _validate_request($segments) if (count($segments) > 0) { // Does the requested controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php')) { show_404($this->fetch_directory().$segments[0]); } @@ -264,7 +264,7 @@ function _validate_request($segments) } // Does the default controller exist in the sub-folder? - if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT)) + if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.'.php')) { $this->directory = ''; return array(); diff --git a/system/database/DB.php b/system/database/DB.php index 8bf1ba8b..33207d88 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -28,11 +28,11 @@ function &DB($params = '', $active_record_override = NULL) if (is_string($params) AND strpos($params, '://') === FALSE) { // Is the config file in the environment folder? - if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database'.EXT)) + if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/database.php')) { - if ( ! file_exists($file_path = APPPATH.'config/database'.EXT)) + if ( ! file_exists($file_path = APPPATH.'config/database.php')) { - show_error('The configuration file database'.EXT.' does not exist.'); + show_error('The configuration file database.php does not exist.'); } } @@ -116,11 +116,11 @@ function &DB($params = '', $active_record_override = NULL) $active_record = $active_record_override; } - require_once(BASEPATH.'database/DB_driver'.EXT); + require_once(BASEPATH.'database/DB_driver.php'); if ( ! isset($active_record) OR $active_record == TRUE) { - require_once(BASEPATH.'database/DB_active_rec'.EXT); + require_once(BASEPATH.'database/DB_active_rec.php'); if ( ! class_exists('CI_DB')) { @@ -135,7 +135,7 @@ function &DB($params = '', $active_record_override = NULL) } } - require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver'.EXT); + require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php'); // Instantiate the DB adapter $driver = 'CI_DB_'.$params['dbdriver'].'_driver'; diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index e7a9de47..10e8ed0c 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -424,8 +424,8 @@ function load_rdriver() if ( ! class_exists($driver)) { - include_once(BASEPATH.'database/DB_result'.EXT); - include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT); + include_once(BASEPATH.'database/DB_result.php'); + include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result.php'); } return $driver; @@ -1115,7 +1115,7 @@ function _cache_init() if ( ! class_exists('CI_DB_Cache')) { - if ( ! @include(BASEPATH.'database/DB_cache'.EXT)) + if ( ! @include(BASEPATH.'database/DB_cache.php')) { return $this->cache_off(); } diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index f8073d23..1145688a 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,13 +58,13 @@ function force_download($filename = '', $data = '') $extension = end($x); // Load the mime types - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes.php'); } // Set a default mime if we can't find it diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 44344947..3931667f 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -352,13 +352,13 @@ function get_mime_by_extension($file) if ( ! is_array($mimes)) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes.php'); } if ( ! is_array($mimes)) diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index a2920439..080f622d 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -259,13 +259,13 @@ function doctype($type = 'xhtml1-strict') if ( ! is_array($_doctypes)) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'); } - elseif (is_file(APPPATH.'config/doctypes'.EXT)) + elseif (is_file(APPPATH.'config/doctypes.php')) { - include(APPPATH.'config/doctypes'.EXT); + include(APPPATH.'config/doctypes.php'); } if ( ! is_array($_doctypes)) diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index a2d1031b..6d888935 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -229,13 +229,13 @@ function parse_smileys($str = '', $image_url = '', $smileys = NULL) { function _get_smiley_array() { - if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT)) + if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } - elseif (file_exists(APPPATH.'config/smileys'.EXT)) + elseif (file_exists(APPPATH.'config/smileys.php')) { - include(APPPATH.'config/smileys'.EXT); + include(APPPATH.'config/smileys.php'); } if (isset($smileys) AND is_array($smileys)) diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index cca09397..33d7fa2f 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -366,13 +366,13 @@ function highlight_phrase($str, $phrase, $tag_open = '', $tag_close = '< { function convert_accented_characters($str) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php'); } - elseif (is_file(APPPATH.'config/foreign_chars'.EXT)) + elseif (is_file(APPPATH.'config/foreign_chars.php')) { - include(APPPATH.'config/foreign_chars'.EXT); + include(APPPATH.'config/foreign_chars.php'); } if ( ! isset($foreign_characters)) diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 72d228e7..df0fd6ee 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -47,7 +47,7 @@ public function __construct($config = array()) { $this->CI =& get_instance(); - if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE)) + if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE)) { $this->CI->lang->load('calendar'); } diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index b942f539..d1925c0e 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -59,7 +59,7 @@ function __get($child) // loves me some nesting! foreach (array(ucfirst($driver_name), $driver_name) as $class) { - $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.EXT; + $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.'.php'; if (file_exists($filepath)) { diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index e5f65878..b30a8cf0 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -524,7 +524,7 @@ function sha1($str) { if ( ! function_exists('mhash')) { - require_once(BASEPATH.'libraries/Sha1'.EXT); + require_once(BASEPATH.'libraries/Sha1.php'); $SH = new CI_SHA; return $SH->generate($str); } diff --git a/system/libraries/Log.php b/system/libraries/Log.php index fb2c5a49..9f1db76b 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -83,7 +83,7 @@ public function write_log($level = 'error', $msg, $php_error = FALSE) return FALSE; } - $filepath = $this->_log_path.'log-'.date('Y-m-d').EXT; + $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; $message = ''; if ( ! file_exists($filepath)) diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index e80049fa..3177424c 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -945,13 +945,13 @@ public function mimes_types($mime) if (count($this->mimes) == 0) { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config//mimes'.EXT); + include(APPPATH.'config//mimes.php'); } else { diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 04cda731..016102a2 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -84,13 +84,13 @@ public function __construct() */ private function _load_agent_file() { - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'); } - elseif (is_file(APPPATH.'config/user_agents'.EXT)) + elseif (is_file(APPPATH.'config/user_agents.php')) { - include(APPPATH.'config/user_agents'.EXT); + include(APPPATH.'config/user_agents.php'); } else { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9890f602..945b1049 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@

        Version 2.0.3

      • General Changes
        • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
        • +
        • Removed internal usage of the EXT constant.
      • Helpers diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html new file mode 100644 index 00000000..4937cf25 --- /dev/null +++ b/user_guide/installation/upgrade_203.html @@ -0,0 +1,102 @@ + + + + + +Upgrading from 2.0.2 to 2.0.3 : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
        + + + + + +

        CodeIgniter User Guide Version 2.0.3

        +
        + + + + + + + + + +
        + + +
        + + + +
        + +

        Upgrading from 2.0.2 to 2.0.3

        + +

        Before performing an update you should take your site offline by replacing the index.php file with a static one.

        + + +

        Step 1: Update your CodeIgniter files

        + +

        Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

        + +

        Note: If you have any custom developed files in these folders please make copies of them first.

        + +

        Step 2: Update CodeIgniter files

        + +

        Replace the files and directories in your "system" folder with the new versions:

        + +

        Step 3: Update your main index.php file

        + +

        If you are running a stock index.php file simply replace your version with the new one.

        + +

        If your index.php file has internal modifications, please add your modifications to the new file and use it.

        + +

        Step 4: Replace config/user_agents.php

        + +

        This config file has been updated to contain more user agent types, please copy it to application/config/user_agents.php.

        + +

        Step 5: Change references of the EXT constant to ".php"

        +

        Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.

        + +
        + + + + + + + \ No newline at end of file diff --git a/user_guide/installation/upgrading.html b/user_guide/installation/upgrading.html index 1c4eb882..014ffa3f 100644 --- a/user_guide/installation/upgrading.html +++ b/user_guide/installation/upgrading.html @@ -60,6 +60,7 @@

        Upgrading From a Previous Version

        Please read the upgrade notes corresponding to the version you are upgrading from.

          +
        • Upgrading from 2.0.2 to 2.0.3
        • Upgrading from 2.0.1 to 2.0.2
        • Upgrading from 2.0 to 2.0.1
        • Upgrading from 1.7.2 to 2.0
        • From 9ce4385cfc976e309ee12c53726abfd4f066ac3f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 12:58:52 -0500 Subject: [PATCH 2461/2544] 1/2 reverting a previous change to the form_helper. Wrapping hidden form elements in
          instead of an empty div. If a user is styling form div {} they can run into display issues, so something is needed. --- system/helpers/form_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index bca0ff0c..a5cd97b8 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -72,7 +72,7 @@ function form_open($action = '', $attributes = '', $hidden = array()) if (is_array($hidden) AND count($hidden) > 0) { - $form .= sprintf("\n
          %s
          ", form_hidden($hidden)); + $form .= sprintf("
          %s
          ", form_hidden($hidden)); } return $form; From 4488538665d37b07a08d7fe4ce6f4156a9899211 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 15:28:40 -0500 Subject: [PATCH 2462/2544] Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default. --- application/config/autoload.php | 2 +- user_guide/changelog.html | 1 + user_guide/installation/upgrade_203.html | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/application/config/autoload.php b/application/config/autoload.php index 90b1a808..53129c9c 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -37,7 +37,7 @@ | */ -$autoload['packages'] = array(APPPATH.'third_party'); +$autoload['packages'] = array(); /* diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 945b1049..3a17edd9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

          Bug fixes for 2.0.3

          • Added ENVIRONMENT to reserved constants. (Reactor #196)
          • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
          • +
          • Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default.

          Version 2.0.2

          diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index 4937cf25..38cfb72c 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -83,6 +83,18 @@

          Step 4: Replace config/user_agents.php

          Step 5: Change references of the EXT constant to ".php"

          Note: The EXT Constant has been marked as deprecated, but has not been removed from the application. You are encouraged to make the changes sooner rather than later.

          +

          Step 6: Remove APPPATH.'third_party' from autoload.php

          + +

          Open application/autoload.php, and look for the following:

          + +$autoload['packages'] = array(APPPATH.'third_party'); + +

          If you have not chosen to load any additional packages, that line can be changed to:

          +$autoload['packages'] = array(); + +

          Which should provide for nominal performance gains if not autoloading packages.

          + +
      From 6ae70cc8499499b5d77d77ec8974f95873edb861 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 19 Apr 2011 16:13:48 -0500 Subject: [PATCH 2463/2544] modified MySQL and MySQLi drivers to address a potential SQL injection attack vector when multi-byte character set connections are employed. (Does not impact Latin-1, UTF-8, etc. encodings) --- application/config/database.php | 6 ++++++ system/database/drivers/mysql/mysql_driver.php | 17 ++++++++++++++++- .../database/drivers/mysqli/mysqli_driver.php | 17 ++++++++++++++++- user_guide/changelog.html | 4 ++++ user_guide/database/configuration.html | 2 +- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/application/config/database.php b/application/config/database.php index 24d611ac..fa541a73 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -26,6 +26,12 @@ | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database +| NOTE: For MySQL and MySQLi databases, this setting is only used +| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. +| There is an incompatibility in PHP with mysql_real_escape_string() which +| can make your site vulnerable to SQL injection if you are using a +| multi-byte character set and are running versions lower than these. +| Sites using Latin-1 or UTF-8 database character set and collation are unaffected. | ['swap_pre'] A default table prefix that should be swapped with the dbprefix | ['autoinit'] Whether or not to automatically initialize the database. | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 4ff9b0a1..b7d547cc 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -132,7 +132,22 @@ function db_select() */ function db_set_charset($charset, $collation) { - return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + static $use_set_names; + + if ( ! isset($use_set_names)) + { + // mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback + $use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; + } + + if ($use_set_names) + { + return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + } + else + { + return @mysql_set_charset($charset, $this->conn_id); + } } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index ccdabce1..1949acb6 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -132,7 +132,22 @@ function db_select() */ function _db_set_charset($charset, $collation) { - return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + static $use_set_names; + + if ( ! isset($use_set_names)) + { + // mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback + $use_set_names = (version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; + } + + if ($use_set_names) + { + return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + } + else + { + return @mysqli_set_charset($this->conn_id, $charset); + } } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 945b1049..6eb80b38 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,10 @@

      Version 2.0.3

      Release Date: Not Released

        +
      • Security +
          +
        • An improvement was made to the MySQL and MySQLi drivers to prevent exposing a potential vector for SQL injection on sites using multi-byte character sets in the database client connection.

          An incompatibility in PHP versions < 5.2.3 and MySQL < 5.0.7 with mysql_set_charset() creates a situation where using multi-byte character sets on these environments may potentially expose a SQL injection attack vector. Latin-1, UTF-8, and other "low ASCII" character sets are unaffected on all environments.

          If you are running or considering running a multi-byte character set for your database connection, please pay close attention to the server environment you are deploying on to ensure you are not vulnerable.

        • +
      • General Changes
        • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
        • diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index fdeae0ee..51d11c9f 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -132,7 +132,7 @@

          Explanation of Values:

        • cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
        • cachedir - The absolute server path to your database query cache directory.
        • char_set - The character set used in communicating with the database.
        • -
        • dbcollat - The character collation used in communicating with the database.
        • +
        • dbcollat - The character collation used in communicating with the database.

          Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.

        • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
        • autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
        • stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
        • From f5c840241084e03d49e521bfcb62d2adbe9fce7d Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 17:13:03 -0500 Subject: [PATCH 2464/2544] Altering the loader to be able to load views from packages when adding the package path with add_package_path(). --- system/core/Controller.php | 2 +- system/core/Loader.php | 110 +++++++++++++++++++------------------ 2 files changed, 59 insertions(+), 53 deletions(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index 469663f0..fd9c8b58 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -50,7 +50,7 @@ public function __construct() $this->load->_base_classes =& is_loaded(); - $this->load->_ci_autoloader(); + $this->load->ci_autoloader(); log_message('debug', "Controller Class Initialized"); diff --git a/system/core/Loader.php b/system/core/Loader.php index 59415b72..8146cd56 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -30,8 +30,8 @@ class CI_Loader { // All these are set automatically. Don't mess with them. var $_ci_ob_level; - var $_ci_view_path = ''; - var $_ci_library_paths = array(); + var $_ci_view_paths = array(); + protected $_ci_library_paths = array(); var $_ci_model_paths = array(); var $_ci_helper_paths = array(); var $_base_classes = array(); // Set by the controller class @@ -47,17 +47,15 @@ class CI_Loader { * Constructor * * Sets the path to the view files and gets the initial output buffering level - * - * @access public */ - function __construct() + public function __construct() { - $this->_ci_view_path = APPPATH.'views/'; $this->_ci_ob_level = ob_get_level(); $this->_ci_library_paths = array(APPPATH, BASEPATH); $this->_ci_helper_paths = array(APPPATH, BASEPATH); $this->_ci_model_paths = array(APPPATH); - + $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); + log_message('debug', "Loader Class Initialized"); } @@ -107,13 +105,12 @@ function library($library = '', $params = NULL, $object_name = NULL) * * This function lets users load and instantiate models. * - * @access public * @param string the name of the class * @param string name for the model * @param bool database connection * @return void */ - function model($model, $name = '', $db_conn = FALSE) + public function model($model, $name = '', $db_conn = FALSE) { if (is_array($model)) { @@ -200,13 +197,12 @@ function model($model, $name = '', $db_conn = FALSE) /** * Database Loader * - * @access public * @param string the DB credentials * @param bool whether to return the DB object * @param bool whether to enable active record (this allows us to override the config setting) * @return object */ - function database($params = '', $return = FALSE, $active_record = NULL) + public function database($params = '', $return = FALSE, $active_record = NULL) { // Grab the super object $CI =& get_instance(); @@ -237,10 +233,9 @@ function database($params = '', $return = FALSE, $active_record = NULL) /** * Load the Utilities Class * - * @access public * @return string */ - function dbutil() + public function dbutil() { if ( ! class_exists('CI_DB')) { @@ -265,10 +260,9 @@ function dbutil() /** * Load the Database Forge Class * - * @access public * @return string */ - function dbforge() + public function dbforge() { if ( ! class_exists('CI_DB')) { @@ -297,13 +291,12 @@ function dbforge() * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * - * @access public * @param string * @param array * @param bool * @return void */ - function view($view, $vars = array(), $return = FALSE) + public function view($view, $vars = array(), $return = FALSE) { return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); } @@ -315,12 +308,11 @@ function view($view, $vars = array(), $return = FALSE) * * This is a generic file loader * - * @access public * @param string * @param bool * @return string */ - function file($path, $return = FALSE) + public function file($path, $return = FALSE) { return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); } @@ -333,11 +325,10 @@ function file($path, $return = FALSE) * Once variables are set they become available within * the controller class and its "view" files. * - * @access public * @param array * @return void */ - function vars($vars = array(), $val = '') + public function vars($vars = array(), $val = '') { if ($val != '' AND is_string($vars)) { @@ -362,11 +353,10 @@ function vars($vars = array(), $val = '') * * This function loads the specified helper file. * - * @access public * @param mixed * @return void */ - function helper($helpers = array()) + public function helper($helpers = array()) { foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper) { @@ -424,11 +414,10 @@ function helper($helpers = array()) * This is simply an alias to the above function in case the * user has written the plural form of this function. * - * @access public * @param array * @return void */ - function helpers($helpers = array()) + public function helpers($helpers = array()) { $this->helper($helpers); } @@ -438,12 +427,11 @@ function helpers($helpers = array()) /** * Loads a language file * - * @access public * @param array * @param string * @return void */ - function language($file = array(), $lang = '') + public function language($file = array(), $lang = '') { $CI =& get_instance(); @@ -463,11 +451,10 @@ function language($file = array(), $lang = '') /** * Loads a config file * - * @access public * @param string * @return void */ - function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) + public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $CI =& get_instance(); $CI->config->load($file, $use_sections, $fail_gracefully); @@ -485,7 +472,7 @@ function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) * @param string an optional object name * @return void */ - function driver($library = '', $params = NULL, $object_name = NULL) + public function driver($library = '', $params = NULL, $object_name = NULL) { if ( ! class_exists('CI_Driver_Library')) { @@ -510,18 +497,20 @@ function driver($library = '', $params = NULL, $object_name = NULL) * * Prepends a parent path to the library, model, helper, and config path arrays * - * @access public * @param string + * @param boolean * @return void */ - function add_package_path($path) + public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; - + array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); + $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; + // Add config file path $config =& $this->_ci_get_component('config'); array_unshift($config->_config_paths, $path); @@ -534,11 +523,10 @@ function add_package_path($path) * * Return a list of all package paths, by default it will ignore BASEPATH. * - * @access public * @param string * @return void */ - function get_package_paths($include_base = FALSE) + public function get_package_paths($include_base = FALSE) { return $include_base === TRUE ? $this->_ci_library_paths : $this->_ci_model_paths; } @@ -551,11 +539,10 @@ function get_package_paths($include_base = FALSE) * Remove a path from the library, model, and helper path arrays if it exists * If no path is provided, the most recently added path is removed. * - * @access public * @param type * @return type */ - function remove_package_path($path = '', $remove_config_path = TRUE) + public function remove_package_path($path = '', $remove_config_path = TRUE) { $config =& $this->_ci_get_component('config'); @@ -564,12 +551,12 @@ function remove_package_path($path = '', $remove_config_path = TRUE) $void = array_shift($this->_ci_library_paths); $void = array_shift($this->_ci_model_paths); $void = array_shift($this->_ci_helper_paths); + $void = array_shift($this->_ci_view_paths); $void = array_shift($config->_config_paths); } else { $path = rtrim($path, '/').'/'; - foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) { if (($key = array_search($path, $this->{$var})) !== FALSE) @@ -577,6 +564,11 @@ function remove_package_path($path = '', $remove_config_path = TRUE) unset($this->{$var}[$key]); } } + + if (isset($this->_ci_view_paths[$path.'views/'])) + { + unset($this->_ci_view_paths[$path.'views/']); + } if (($key = array_search($path, $config->_config_paths)) !== FALSE) { @@ -588,6 +580,7 @@ function remove_package_path($path = '', $remove_config_path = TRUE) $this->_ci_library_paths = array_unique(array_merge($this->_ci_library_paths, array(APPPATH, BASEPATH))); $this->_ci_helper_paths = array_unique(array_merge($this->_ci_helper_paths, array(APPPATH, BASEPATH))); $this->_ci_model_paths = array_unique(array_merge($this->_ci_model_paths, array(APPPATH))); + $this->_ci_view_paths = array_merge($this->_ci_view_paths, array(APPPATH.'views/' => TRUE)); $config->_config_paths = array_unique(array_merge($config->_config_paths, array(APPPATH))); } @@ -600,24 +593,39 @@ function remove_package_path($path = '', $remove_config_path = TRUE) * Variables are prefixed with _ci_ to avoid symbol collision with * variables made available to view files * - * @access private * @param array * @return void */ - function _ci_load($_ci_data) + protected function _ci_load($_ci_data) { // Set the default data variables foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val) { $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } + + $file_exists = FALSE; // Set the path to the requested file if ($_ci_path == '') { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; - $_ci_path = $this->_ci_view_path.$_ci_file; + + foreach ($this->_ci_view_paths as $view_file => $cascade) + { + if (file_exists($view_file.$_ci_file)) + { + $_ci_path = $view_file.$_ci_file; + $file_exists = TRUE; + break; + } + + if ( ! $cascade) + { + break; + } + } } else { @@ -625,7 +633,7 @@ function _ci_load($_ci_data) $_ci_file = end($_ci_x); } - if ( ! file_exists($_ci_path)) + if ( ! $file_exists && ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$_ci_file); } @@ -721,13 +729,12 @@ function _ci_load($_ci_data) * * This function loads the requested class. * - * @access private * @param string the item that is being loaded * @param mixed any additional parameters * @param string an optional object name * @return void */ - function _ci_load_class($class, $params = NULL, $object_name = NULL) + protected function _ci_load_class($class, $params = NULL, $object_name = NULL) { // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, @@ -959,11 +966,13 @@ function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NU * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * - * @access private + * This function is public, as it's used in the CI_Controller class. + * However, there is no reason you should ever needs to use it. + * * @param array * @return void */ - function _ci_autoloader() + public function ci_autoloader() { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { @@ -1046,11 +1055,10 @@ function _ci_autoloader() * * Takes an object as input and converts the class variables to array key/vals * - * @access private * @param object * @return array */ - function _ci_object_to_array($object) + protected function _ci_object_to_array($object) { return (is_object($object)) ? get_object_vars($object) : $object; } @@ -1060,10 +1068,9 @@ function _ci_object_to_array($object) /** * Get a reference to a specific library or model * - * @access private * @return bool */ - function &_ci_get_component($component) + protected function &_ci_get_component($component) { $CI =& get_instance(); return $CI->$component; @@ -1076,11 +1083,10 @@ function &_ci_get_component($component) * * This function preps the name of various items to make loading them more reliable. * - * @access private * @param mixed * @return array */ - function _ci_prep_filename($filename, $extension) + protected function _ci_prep_filename($filename, $extension) { if ( ! is_array($filename)) { From b3e614d8b2293c079bcfb9cfdf071c041cbc4722 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 20:19:17 -0500 Subject: [PATCH 2465/2544] Change in core/Security.php to match coding standards. --- system/core/Security.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/core/Security.php b/system/core/Security.php index 4f91572e..3617cadc 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -68,7 +68,8 @@ public function __construct() } // Append application specific cookie prefix - if (config_item('cookie_prefix')) { + if (config_item('cookie_prefix')) + { $this->_csrf_cookie_name = config_item('cookie_prefix').$this->_csrf_cookie_name; } From 0c9ee4a348a9e0c9ee6d6c0085e463e098e453f4 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 09:40:17 -0500 Subject: [PATCH 2466/2544] Refactoring the loader to set protected class variables. Moved _ci_autoload(), which is used in CI_Controller to be a public method. Also added CI_Loader::set_base_classes() to be called in the controller so we're not setting protected vars in another class. Also refactored in the form_helper so it's not trying to access protected vars in CI_Loader. Added the is_loaded() method to the loader to take care of the checks that were being done there. --- system/core/Controller.php | 7 +--- system/core/Loader.php | 75 +++++++++++++++++++++++++--------- system/helpers/form_helper.php | 24 +++++------ 3 files changed, 69 insertions(+), 37 deletions(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index fd9c8b58..ec86b792 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -48,12 +48,9 @@ public function __construct() $this->load =& load_class('Loader', 'core'); - $this->load->_base_classes =& is_loaded(); - - $this->load->ci_autoloader(); - + $this->load->set_base_classes()->ci_autoloader(); + log_message('debug', "Controller Class Initialized"); - } public static function &get_instance() diff --git a/system/core/Loader.php b/system/core/Loader.php index 8146cd56..a52ef288 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -29,19 +29,19 @@ class CI_Loader { // All these are set automatically. Don't mess with them. - var $_ci_ob_level; - var $_ci_view_paths = array(); + protected $_ci_ob_level; + protected $_ci_view_paths = array(); protected $_ci_library_paths = array(); - var $_ci_model_paths = array(); - var $_ci_helper_paths = array(); - var $_base_classes = array(); // Set by the controller class - var $_ci_cached_vars = array(); - var $_ci_classes = array(); - var $_ci_loaded_files = array(); - var $_ci_models = array(); - var $_ci_helpers = array(); - var $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); - + protected $_ci_model_paths = array(); + protected $_ci_helper_paths = array(); + protected $_base_classes = array(); // Set by the controller class + protected $_ci_cached_vars = array(); + protected $_ci_classes = array(); + protected $_ci_loaded_files = array(); + protected $_ci_models = array(); + protected $_ci_helpers = array(); + protected $_ci_varmap = array('unit_test' => 'unit', + 'user_agent' => 'agent'); /** * Constructor @@ -59,6 +59,47 @@ public function __construct() log_message('debug', "Loader Class Initialized"); } + // -------------------------------------------------------------------- + + /** + * Set _base_classes variable + * + * This method is called once in CI_Controller. + * + * @param array + * @return object + */ + public function set_base_classes() + { + $this->_base_classes =& is_loaded(); + + return $this; + } + + // -------------------------------------------------------------------- + + /** + * Is Loaded + * + * A utility function to test if a class is in the self::$_ci_classes array. + * This function returns the object name if the class tested for is loaded, + * and returns FALSE if it isn't. + * + * It is mainly used in the form_helper -> _get_validation_object() + * + * @param string class being checked for + * @return mixed class object name on the CI SuperObject or FALSE + */ + public function is_loaded($class) + { + if (isset($this->_ci_classes[$class])) + { + return $this->_ci_classes[$class]; + } + + return FALSE; + } + // -------------------------------------------------------------------- /** @@ -67,13 +108,12 @@ public function __construct() * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * - * @access public * @param string the name of the class * @param mixed the optional parameters * @param string an optional object name * @return void */ - function library($library = '', $params = NULL, $object_name = NULL) + public function library($library = '', $params = NULL, $object_name = NULL) { if (is_array($library)) { @@ -856,13 +896,12 @@ protected function _ci_load_class($class, $params = NULL, $object_name = NULL) /** * Instantiates a class * - * @access private * @param string * @param string * @param string an optional object name * @return null */ - function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) + protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { // Is there an associated config file for this class? Note: these should always be lowercase if ($config === NULL) @@ -1102,9 +1141,7 @@ protected function _ci_prep_filename($filename, $extension) return $filename; } } - - } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ +/* Location: ./system/core/Loader.php */ \ No newline at end of file diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index a5cd97b8..51a9c6ca 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -1032,22 +1032,20 @@ function &_get_validation_object() { $CI =& get_instance(); - // We set this as a variable since we're returning by reference + // We set this as a variable since we're returning by reference. $return = FALSE; - - if ( ! isset($CI->load->_ci_classes) OR ! isset($CI->load->_ci_classes['form_validation'])) - { - return $return; - } - - $object = $CI->load->_ci_classes['form_validation']; - - if ( ! isset($CI->$object) OR ! is_object($CI->$object)) + + if ( ! ($object = $CI->load->is_loaded('form_validation'))) { - return $return; + if ( ! isset($CI->$object) OR ! is_object($CI->$object)) + { + return $return; + } + + return $CI->$object; } - - return $CI->$object; + + return $return; } } From e08c527aa0a8a05836b05763d859eb3d2970f62f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 09:54:47 -0500 Subject: [PATCH 2467/2544] Updating Documentation on package view loading --- user_guide/libraries/loader.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 42f8cf94..1d93af5e 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -231,17 +231,22 @@

          $this->load->remove_package_path()

          Package view files

          -

          @todo - package view file interface is not complete. It can be experimentally used by first saving the Loader's original view path, setting the view path to the package's view path, and when finished, setting back to the original view path.

          - -// ... save the original view path, and set to our Foo Bar package view folder
          -$orig_view_path = $this->load->_ci_view_path;
          -$this->load->_ci_view_path = APPPATH.'third_party/foo_bar/views/';
          -
          -// ... code using the package's view files
          -
          -// ... then return the view path to the application's original view path
          -$this->load->_ci_view_path = $orig_view_path;
          +

          By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

          +

          In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

          + +$this->load->add_package_path(APPPATH.'my_app', TRUE);
          +$this->load->view('my_app_index'); // Loads
          +$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is TRUE
          +
          +// Reset things
          +$this->load->remove_package_path(APPPATH.'my_app');
          +
          +// Again without the second parameter:
          +$this->load->add_package_path(APPPATH.'my_app', TRUE);
          +$this->load->view('my_app_index'); // Loads
          +$this->load->view('welcome_message'); // Loads
          +
          From 1cdb0fd21e0c5ac38a75712806ed10b08f0909cc Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:11:47 -0500 Subject: [PATCH 2468/2544] Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request. --- application/errors/error_404.php | 58 ++++++++++---- application/errors/error_db.php | 58 ++++++++++---- application/errors/error_general.php | 58 ++++++++++---- application/views/welcome_message.php | 108 ++++++++++++++++---------- user_guide/changelog.html | 1 + 5 files changed, 196 insertions(+), 87 deletions(-) diff --git a/application/errors/error_404.php b/application/errors/error_404.php index a304f456..792726a6 100644 --- a/application/errors/error_404.php +++ b/application/errors/error_404.php @@ -1,32 +1,60 @@ - + + 404 Page Not Found -
          +

          diff --git a/application/errors/error_db.php b/application/errors/error_db.php index 181de960..b396cda9 100644 --- a/application/errors/error_db.php +++ b/application/errors/error_db.php @@ -1,32 +1,60 @@ - + + Database Error -
          +

          diff --git a/application/errors/error_general.php b/application/errors/error_general.php index 7734d34c..fd63ce2c 100644 --- a/application/errors/error_general.php +++ b/application/errors/error_general.php @@ -1,32 +1,60 @@ - + + Error -
          +

          diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index ca68fc10..0bf5a8d2 100644 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -4,61 +4,85 @@ Welcome to CodeIgniter - + code { + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; + } + + #body{ + margin: 0 15px 0 15px; + } + + p.footer{ + text-align: right; + font-size: 11px; + border-top: 1px solid #D0D0D0; + line-height: 32px; + padding: 0 10px 0 10px; + margin: 20px 0 0 0; + } + + #container{ + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; + } + -

          Welcome to CodeIgniter!

          - -

          The page you are looking at is being generated dynamically by CodeIgniter.

          +
          +

          Welcome to CodeIgniter!

          -

          If you would like to edit this page you'll find it located at:

          -application/views/welcome_message.php +
          +

          The page you are looking at is being generated dynamically by CodeIgniter.

          -

          The corresponding controller for this page is found at:

          -application/controllers/welcome.php +

          If you would like to edit this page you'll find it located at:

          + application/views/welcome_message.php -

          If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

          +

          The corresponding controller for this page is found at:

          + application/controllers/welcome.php +

          If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

          +
          -


          Page rendered in {elapsed_time} seconds

          + +
          \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b889152a..bbdbbbd1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -71,6 +71,7 @@

          Version 2.0.3

          • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
          • Removed internal usage of the EXT constant.
          • +
          • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
        • Helpers From 882b76bda8b701a8718960b8d639f060ae79e998 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:22:09 -0500 Subject: [PATCH 2469/2544] Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL. --- user_guide/changelog.html | 4 +++- user_guide/installation/upgrade_203.html | 10 ++++++++++ user_guide/libraries/sessions.html | 18 ++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index bbdbbbd1..70db33d4 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -78,7 +78,7 @@

          Version 2.0.3

          • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
          -
        • +

        Bug fixes for 2.0.3

        @@ -86,6 +86,8 @@

        Bug fixes for 2.0.3

      • Added ENVIRONMENT to reserved constants. (Reactor #196)
      • Changed server check to ensure SCRIPT_NAME is defined. (Reactor #57)
      • Removed APPPATH.'third_party' from the packages autoloader to negate needless file stats if no packages exist or if the developer does not load any other packages by default.
      • +
      • Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes.
      • +
      • Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.

      Version 2.0.2

      diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index 38cfb72c..d7c0fae3 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -94,6 +94,16 @@

      Step 6: Remove APPPATH.'third_party' from autoload.php

      Which should provide for nominal performance gains if not autoloading packages.

      +

      Update Sessions Database Tables

      + +

      If you are using database sessions with the CI Session Library, please update your ci_sessions database table as follows:

      + + + CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + + + + diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 8d9c14eb..6048f480 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -218,15 +218,17 @@

      Saving Session Data to a Database

      In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

      - + session_id varchar(40) DEFAULT '0' NOT NULL, + ip_address varchar(16) DEFAULT '0' NOT NULL, + user_agent varchar(50) NOT NULL, + last_activity int(10) unsigned DEFAULT 0 NOT NULL, + user_data text NOT NULL, + PRIMARY KEY (session_id), + KEY `last_activity_idx` (`last_activity`) +); +

      Note: By default the table is called ci_sessions, but you can name it anything you want as long as you update the application/config/config.php file so that it contains the name you have chosen. From 50671cf8d67c805692fec49eda33d21227a21ec2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:36:45 -0500 Subject: [PATCH 2470/2544] Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) + if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120))) { $this->sess_destroy(); return FALSE; @@ -316,7 +316,7 @@ function sess_create() $this->userdata = array( 'session_id' => md5(uniqid($sessid, TRUE)), 'ip_address' => $this->CI->input->ip_address(), - 'user_agent' => substr($this->CI->input->user_agent(), 0, 50), + 'user_agent' => substr($this->CI->input->user_agent(), 0, 120), 'last_activity' => $this->now ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 70db33d4..7ff71d07 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,11 @@

      Version 2.0.3

    83. Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
    84. +
    85. Libraries +
        +
      • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
      • +
      +
    86. Bug fixes for 2.0.3

      diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index d7c0fae3..7dbc907e 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -98,8 +98,9 @@

      Update Sessions Database Tables

      If you are using database sessions with the CI Session Library, please update your ci_sessions database table as follows:

      - + CREATE INDEX last_activity_idx ON ci_sessions(last_activity); + ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 6048f480..a6f3c601 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -222,7 +222,7 @@

      Saving Session Data to a Database

      CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, - user_agent varchar(50) NOT NULL, + user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY (session_id), From fc779cef54a5cefc3f0d7f404a408a935d717966 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 12:25:17 -0500 Subject: [PATCH 2471/2544] Fix #224 Error in primary index.php $routing instructions --- index.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a8d58b2d..f4ac11a7 100644 --- a/index.php +++ b/index.php @@ -98,7 +98,7 @@ // if your controller is not in a sub-folder within the "controllers" folder // $routing['directory'] = ''; - // The controller class file name. Example: Mycontroller.php + // The controller class file name. Example: Mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7ff71d07..7ad56673 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -69,6 +69,7 @@

      Version 2.0.3

    87. General Changes -

      All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

      +

      All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

      Note: Watermarking is only available using the GD/GD2 library. In addition, even though other libraries are supported, GD is required in -order for the script to calculate the image properties. The image processing, however, will be performed with the +order for the script to calculate the image properties. The image processing, however, will be performed with the library you specify.

      @@ -82,14 +82,14 @@

      Initializing the Class

      using the $this->load->library function:

      $this->load->library('image_lib'); -

      Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

      +

      Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

      Processing an Image

      Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is identical. You will set some preferences corresponding to the action you intend to perform, then -call one of four available processing functions. For example, to create an image thumbnail you'll do this:

      +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

      $config['image_library'] = 'gd2';
      $config['source_image'] = '/path/to/image/mypic.jpg';
      @@ -106,7 +106,7 @@

      Processing an Image

      The above code tells the image_resize function to look for an image called mypic.jpg located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. Since the maintain_ratio option is enabled, the thumb will be as close to the target width and -height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg

      Note: In order for the image class to be allowed to do any processing, the @@ -126,7 +126,7 @@

      Processing Functions

    88. $this->image_lib->clear()
    89. -

      These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +

      These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the error message using this function:

      echo $this->image_lib->display_errors(); @@ -138,7 +138,7 @@

      Processing Functions

          echo $this->image_lib->display_errors();
      }
      -

      Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +

      Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing tags in the function, like this:

      $this->image_lib->display_errors('<p>', '</p>'); @@ -146,11 +146,11 @@

      Processing Functions

      Preferences

      -

      The preferences described below allow you to tailor the image processing to suit your needs.

      +

      The preferences described below allow you to tailor the image processing to suit your needs.

      Note that not all preferences are available for every -function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height -preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

      +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

      Availability Legend:

      @@ -187,7 +187,7 @@

      Preferences

      library_path None None -Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. +Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. R, C, X @@ -195,7 +195,7 @@

      Preferences

      source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. R, C, S, W @@ -203,7 +203,7 @@

      Preferences

      dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. R, C, X, W @@ -221,7 +221,7 @@

      Preferences

      new_image None None -Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. +Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. R, C, X, W @@ -253,7 +253,7 @@

      Preferences

      thumb_marker _thumb None -Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg +Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg R @@ -281,7 +281,7 @@

      Preferences

      rotation_angle None 90, 180, 270, vrt, hor -Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. +Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. X @@ -306,7 +306,7 @@

      Preferences

      Setting preferences in a config file

      If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called image_lib.php, add the $config +Simply create a new file called image_lib.php, add the $config array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

      @@ -319,7 +319,7 @@

      $this->image_lib->resize()

      For practical purposes there is no difference between creating a copy and creating a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

      -

      All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

      +

      All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

      Creating a Thumbnail

      @@ -358,7 +358,7 @@

      $this->image_lib->crop()

      $config['x_axis'] = '100';
      $config['y_axis'] = '40';
      -

      All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

      +

      All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

      Here's an example showing how you might crop an image:

      @@ -378,8 +378,8 @@

      $this->image_lib->crop()

      Note: Without a visual interface it is difficult to crop images, so this function is not very useful -unless you intend to build such an interface. That's exactly what we did using for the photo -gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping area be selected.

      $this->image_lib->rotate()

      @@ -443,7 +443,7 @@

      Watermarking an Image

      Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking involves setting the preferences corresponding to the action you intend to perform, then -calling the watermark function. Here is an example:

      +calling the watermark function. Here is an example:

      $config['source_image'] = '/path/to/image/mypic.jpg';
      @@ -452,9 +452,9 @@

      Watermarking an Image

      $config['wm_font_path'] = './system/fonts/texb.ttf';
      $config['wm_font_size'] = '16';
      $config['wm_font_color'] = 'ffffff';
      -$config['wm_vrt_alignment'] = 'bottom';
      -$config['wm_hor_alignment'] = 'center';
      -$config['wm_padding'] = '20';
      +$config['wm_vrt_alignment'] = 'bottom';
      +$config['wm_hor_alignment'] = 'center';
      +$config['wm_padding'] = '20';

      $this->image_lib->initialize($config);
      @@ -462,7 +462,7 @@

      Watermarking an Image

      $this->image_lib->watermark();
      -

      The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +

      The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

      Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

      @@ -491,14 +491,14 @@

      Watermarking Preferences

      source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. @@ -563,28 +563,28 @@

      Text Preferences

      wm_text None None -The text you would like shown as the watermark. Typically this will be a copyright notice. +The text you would like shown as the watermark. Typically this will be a copyright notice. wm_font_path None None -The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. +The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. wm_font_size 16 None -The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. +The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. wm_font_color ffffff None -The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). +The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 08b8ab0d..6070b6c4 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -70,20 +70,20 @@

      Input Class

      Security Filtering

      -

      The security filtering function is called automatically when a new controller is invoked. It does the following:

      +

      The security filtering function is called automatically when a new controller is invoked. It does the following:

        -
      • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
      • +
      • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
      • Destroys all global variables in the event register_globals is turned on.
      • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
      • -
      • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
      • +
      • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
      • Standardizes newline characters to \n

      XSS Filtering

      -

      The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +

      The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:

      $config['global_xss_filtering'] = TRUE; @@ -93,9 +93,9 @@

      XSS Filtering

      Using POST, COOKIE, or SERVER Data

      -

      CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided +

      CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and -return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

      @@ -128,7 +128,7 @@

      $this->input->post()

      The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

      -

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      +

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      $this->input->post('some_data', TRUE); @@ -179,7 +179,7 @@

      $this->input->server()

      $this->input->set_cookie()

      -

      Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +

      Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: Array Method, and Discrete Parameters:

      Array Method

      @@ -203,10 +203,10 @@

      Array Method

      Only the name and value are required. To delete a cookie set it with the expiration blank.

      -

      The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to +

      The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to zero the cookie will only last as long as the browser is open.

      -

      For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

      +

      For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

      The path is usually not needed since the function sets a root path.

      The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

      The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

      @@ -219,25 +219,25 @@

      Discrete Parameters

      $this->input->cookie()

      -

      Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

      +

      Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

      cookie('some_cookie');

      The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

      -

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      +

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      cookie('some_cookie', TRUE);

      $this->input->ip_address()

      -

      Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

      +

      Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

      echo $this->input->ip_address();

      $this->input->valid_ip($ip)

      -

      Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +

      Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

      if ( ! $this->input->valid_ip($ip))
      @@ -256,7 +256,7 @@

      $this->input->user_agent()

      See the User Agent Class for methods which extract information from the user agent string.

      $this->input->request_headers()

      -

      Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

      +

      Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

      $headers = $this->input->request_headers(); diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 4e262279..cd3adf1d 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -65,11 +65,11 @@

      Initializing the Class

      $this->load->library('javascript'); -

      The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

      +

      The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

      $this->load->library('javascript', array('js_library_driver' => 'scripto', 'autoload' => FALSE)); -

      Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

      +

      Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

      Once loaded, the jQuery library object will be available using: $this->javascript

      Setup and Configuration

      @@ -93,7 +93,7 @@

      The jQuery Class

      $this->load->library('jquery'); -

      You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

      +

      You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

      $this->load->library('jquery', FALSE); @@ -115,7 +115,7 @@

      jQuery Events

      Effects

      -

      The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

      +

      The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

      $this->jquery->effect([optional path] plugin name); // for example @@ -125,8 +125,8 @@

      Effects

      hide() / show()

      Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

      -

      $this->jquery->hide(target, optional speed, optional extra information);
      - $this->jquery->show(target, optional speed, optional extra information);

      +

      $this->jquery->hide(target, optional speed, optional extra information);
      + $this->jquery->show(target, optional speed, optional extra information);

      • "target" will be any valid jQuery selector or selectors.
      • @@ -162,8 +162,8 @@

        animate()

        fadeIn() / fadeOut()

        -

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        - $this->jquery->fadeOut(target, optional speed, optional extra information);

        +

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        + $this->jquery->fadeOut(target, optional speed, optional extra information);

        • "target" will be any valid jQuery selector or selectors.
        • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
        • @@ -182,8 +182,8 @@

          toggleClass()

          fadeIn() / fadeOut()

          These effects cause an element(s) to disappear or reappear over time.

          -

          $this->jquery->fadeIn(target, optional speed, optional extra information);
          - $this->jquery->fadeOut(target, optional speed, optional extra information);

          +

          $this->jquery->fadeIn(target, optional speed, optional extra information);
          + $this->jquery->fadeOut(target, optional speed, optional extra information);

          • "target" will be any valid jQuery selector or selectors.
          • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
          • @@ -193,9 +193,9 @@

            fadeIn() / fadeOut()

            slideUp() / slideDown() / slideToggle()

            These effects cause an element(s) to slide.

            -

            $this->jquery->slideUp(target, optional speed, optional extra information);
            - $this->jquery->slideDown(target, optional speed, optional extra information);
            -$this->jquery->slideToggle(target, optional speed, optional extra information);

            +

            $this->jquery->slideUp(target, optional speed, optional extra information);
            + $this->jquery->slideDown(target, optional speed, optional extra information);
            +$this->jquery->slideToggle(target, optional speed, optional extra information);

            • "target" will be any valid jQuery selector or selectors.
            • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
            • diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 75863c2a..1b253fa0 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -60,30 +60,30 @@

              Language Class

              The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

              -

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create +

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.

              -

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your application/language -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside +your application folder and store them there. CodeIgniter will look first in your application/language +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

              -

              Note:  Each language should be stored in its own folder. For example, the English files are located at: +

              Note:  Each language should be stored in its own folder. For example, the English files are located at: system/language/english

              Creating Language Files

              -

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: error_lang.php

              +

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

              Within the file you will assign each line of text to an array called $lang with this prototype:

              $lang['language_key'] = "The actual message to be shown";

              Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              +similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              $lang['error_email_missing'] = "You must submit an email address";
              $lang['error_url_missing'] = "You must submit a URL";
              @@ -92,12 +92,12 @@

              Creating Language Files

              Loading A Language File

              -

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              +

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              $this->lang->load('filename', 'language');

              Where filename is the name of the file you wish to load (without the file extension), and language -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your application/config/config.php file will be used.

              @@ -109,7 +109,7 @@

              Fetching a Line of Text

              Where language_key is the array key corresponding to the line you wish to show.

              -

              Note: This function simply returns the line. It does not echo it for you.

              +

              Note: This function simply returns the line. It does not echo it for you.

              Using language lines as form labels

              diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 1d93af5e..50ec60c1 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -58,7 +58,7 @@

              Loader Class

              -

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, Helpers, Models, or your own files.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -69,7 +69,7 @@

              Loader Class

              $this->load->library('class_name', $config, 'object name')

              -

              This function is used to load core classes. Where class_name is the name of the class you want to load. +

              This function is used to load core classes. Where class_name is the name of the class you want to load. Note: We use the terms "class" and "library" interchangeably.

              For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

              @@ -96,7 +96,7 @@

              $this->load->library('class_name', $config, 'ob

              Setting options

              -

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              +

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              $config = array (
              @@ -113,7 +113,7 @@

              Setting options

              Assigning a Library to a different object name

              -

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it +

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it will be assigned to a variable named $this->session.

              If you prefer to set your own class names you can pass its value to the third parameter:

              @@ -131,20 +131,20 @@

              Assigning a Library to a different object name

              $this->load->view('file_name', $data, true/false)

              -

              This function is used to load your View files. If you haven't read the Views section of the +

              This function is used to load your View files. If you haven't read the Views section of the user guide it is recommended that you do since it shows you how this function is typically used.

              -

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              +

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              The second optional parameter can take an associative array or an object as input, which it runs through the PHP extract function to -convert to variables that can be used in your view files. Again, read the Views page to learn +convert to variables that can be used in your view files. Again, read the Views page to learn how this might be useful.

              The third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

              +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

              $string = $this->load->view('myfile', '', true); @@ -159,7 +159,7 @@

              $this->load->model('Model_name');


              $this->fubar->function();

              $this->load->database('options', true/false)

              -

              This function lets you load the database class. The two parameters are optional. Please see the +

              This function lets you load the database class. The two parameters are optional. Please see the database section for more info.

              @@ -168,9 +168,9 @@

              $this->load->database('options', true/false)

              $this->load->vars($array)

              This function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

              @@ -180,7 +180,7 @@

              $this->load->helper('file_name')

              $this->load->file('filepath/filename', true/false)

              -

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) it will instead return the data as a string.

              @@ -194,7 +194,7 @@

              $this->load->config('file_name')

              Application "Packages"

              -

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              +

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              Sample Package "Foo Bar" Directory Map

              @@ -210,18 +210,18 @@

              Sample Package "Foo Bar" Directory Map

              models/
              -

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              +

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              $this->load->add_package_path()

              -

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              +

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              $this->load->add_package_path(APPPATH.'third_party/foo_bar/');
              $this->load->library('foo_bar');

              $this->load->remove_package_path()

              -

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              +

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              $this->load->remove_package_path()

              @@ -231,8 +231,8 @@

              $this->load->remove_package_path()

              Package view files

              -

              By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

              -

              In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

              +

              By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

              +

              In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

              $this->load->add_package_path(APPPATH.'my_app', TRUE);
              diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 4d1f8d97..8846e15f 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -58,7 +58,7 @@

              Output Class

              -

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is also responsible for caching your web pages, if you use that feature.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -70,7 +70,7 @@

              Output Class

              $this->output->set_output();

              -

              Permits you to manually set the final output string. Usage example:

              +

              Permits you to manually set the final output string. Usage example:

              $this->output->set_output($data); @@ -95,7 +95,7 @@

              $this->output->set_content_type();

              $this->output->get_output();

              -

              Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

              +

              Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

              $string = $this->output->get_output();

              Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the @@ -104,7 +104,7 @@

              $this->output->get_output();

              $this->output->append_output();

              -

              Appends data onto the output string. Usage example:

              +

              Appends data onto the output string. Usage example:

              $this->output->append_output($data); @@ -112,7 +112,7 @@

              $this->output->append_output();

              $this->output->set_header();

              -

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              +

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              $this->output->set_header("HTTP/1.0 200 OK");
              @@ -125,10 +125,10 @@

              $this->output->set_header();

              $this->output->set_status_header(code, 'text');

              -

              Permits you to manually set a server status header. Example:

              +

              Permits you to manually set a server status header. Example:

              $this->output->set_status_header('401');
              -// Sets the header as: Unauthorized
              +// Sets the header as: Unauthorized

              See here for a full list of headers.

              @@ -147,14 +147,14 @@

              $this->output->enable_profiler();

              $this->output->set_profiler_sections();

              -

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              +

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              $this->output->cache();

              -

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              +

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              Parsing Execution Variables

              -

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. +

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. $this->output->parse_exec_vars = FALSE; diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3c366a69..a6b9287a 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -72,26 +72,26 @@

              Example

              $this->load->library('pagination');

              $config['base_url'] = 'http://example.com/index.php/test/page/';
              $config['total_rows'] = 200;
              -$config['per_page'] = 20; +$config['per_page'] = 20;

              $this->pagination->initialize($config);

              -echo $this->pagination->create_links();
              +echo $this->pagination->create_links();

              Notes:

              -

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

              +

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

                -
              • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can +
              • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
              • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
              • -
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
              • +
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

              The create_links() function returns an empty string when there is no pagination to show.

              @@ -100,7 +100,7 @@

              Notes:

              Setting preferences in a config file

              If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called pagination.php, add the $config +Simply create a new file called pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

              @@ -122,9 +122,9 @@

              $config['num_links'] = 2;

              $config['page_query_string'] = TRUE

              By default, the pagination library assume you are using URI Segments, and constructs your links something like

              http://example.com/index.php/test/page/20

              -

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              +

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              http://example.com/index.php?c=test&m=page&per_page=20

              -

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              +

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              Adding Enclosing Markup

              If you would like to surround the entire pagination with some markup you can do it with these two prefs:

              diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index cb2f100a..4f04aaf4 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -83,10 +83,10 @@

              Template Parser Class

              PHP from your templates (view files).

              Note: CodeIgniter does not require you to use this class -since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if they work with designers who they feel would find some confusion working with PHP.

              -

              Also Note: The Template Parser Class is not a +

              Also Note: The Template Parser Class is not a full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

              @@ -102,7 +102,7 @@

              Initializing the Class

              $this->parser->parse()

              -

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

              +

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

              $this->load->library('parser');

              @@ -114,11 +114,11 @@

              $this->parser->parse()

              $this->parser->parse('blog_template', $data);

              The first parameter contains the name of the view file (in this example the file would be called blog_template.php), -and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the template would contain two variables: {blog_title} and {blog_heading}

              -

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically -passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can pass TRUE (boolean) to the third parameter:

              $string = $this->parser->parse('blog_template', $data, TRUE); @@ -130,8 +130,8 @@

              $this->parser->parse_string()

              Variable Pairs

              -

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be -repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              +

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              <html>
              <head>
              diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 73518745..0cb1d0cb 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -63,11 +63,11 @@

              Security Class

              XSS Filtering

              CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

              The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

              @@ -88,7 +88,7 @@

              $this->security->xss_clean()

              Note: If you use the form validation class, it gives you the option of XSS filtering as well.

              -

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              +

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              if ($this->security->xss_clean($file, TRUE) === FALSE)
              {
              @@ -98,7 +98,7 @@

              $this->security->xss_clean()

              $this->security->sanitize_filename()

              -

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              +

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              $filename = $this->security->sanitize_filename($this->input->post('filename')); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index a6f3c601..bb8f1fc9 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -61,7 +61,7 @@

              Session Class

              The Session class permits you maintain a user's "state" and track their activity while they browse your site. The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to use the database option you'll need to create the session table as indicated below.

              @@ -93,8 +93,8 @@

              How do Sessions work?

              If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

              -

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

              @@ -106,7 +106,7 @@

              What is Session Data?

            • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
            • The user's IP Address
            • The user's User Agent data (the first 50 characters of the browser data string)
            • -
            • The "last activity" time stamp.
            • +
            • The "last activity" time stamp.

            The above data is stored in a cookie as a serialized array with this prototype:

            @@ -124,7 +124,7 @@

            What is Session Data?

            can be found here, although the Session class will take care of initializing and encrypting the data automatically.

            -

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time the cookie was written. This time is configurable by changing the $config['sess_time_to_update'] line in your system/config/config.php file.

            @@ -134,7 +134,7 @@

            Retrieving Session Data

            $this->session->userdata('item'); -

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you will do this:

            $session_id = $this->session->userdata('session_id'); @@ -145,7 +145,7 @@

            Retrieving Session Data

            Adding Custom Session Data

            A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

            +Why would you want to do this? Here's one example:

            Let's say a particular user logs into your site. Once authenticated, you could add their username and email address to the session cookie, making that data globally available to you without @@ -155,7 +155,7 @@

            Adding Custom Session Data

            $this->session->set_userdata($array); -

            Where $array is an associative array containing your new data. Here's an example:

            +

            Where $array is an associative array containing your new data. Here's an example:

            $newdata = array(
            @@ -167,7 +167,7 @@

            Adding Custom Session Data

            $this->session->set_userdata($newdata);

            If you want to add userdata one value at a time, set_userdata() also supports this syntax.

            $this->session->set_userdata('some_name', 'some_value');

            -

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

            Retrieving All Session Data

            @@ -179,10 +179,10 @@

            Retrieving All Session Data

             Array
             (
            -    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            -    [ip_address] => 127.0.0.1
            -    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            -    [last_activity] => 1303142623
            +  [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            +  [ip_address] => 127.0.0.1
            +  [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            +  [last_activity] => 1303142623
             )
             
            @@ -206,20 +206,20 @@

            Flashdata

            $this->session->keep_flashdata('item');

            Saving Session Data to a Database

            While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session could be restored by a user modifying their cookies.

            When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never be updated, they can only be generated when a new session is created.

            -

            In order to store sessions, you must first create a database table for this purpose. Here is the basic +

            In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

            -

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            +

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            The Server

            @@ -381,7 +381,7 @@

            The Server

            $response = array( array( - 'you_said' => $parameters['0'], + 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); @@ -452,7 +452,7 @@

            $this->xmlrpc->request()

            $this->xmlrpc->request($request);

            $this->xmlrpc->send_request()

            -

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            +

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            $this->xmlrpc->set_debug(TRUE);

            Enables debugging, which will display a variety of information and error data helpful during development.

            @@ -463,7 +463,7 @@

            $this->xmlrpc->display_error()

            echo $this->xmlrpc->display_error();

            $this->xmlrpc->display_response()

            -

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            +

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            $this->xmlrpc->display_response();

            $this->xmlrpc->send_error_message()

            diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 03112660..2fc5fd81 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -81,7 +81,7 @@

            Usage Example

            // Write the zip file to a folder on your server. Name it "my_backup.zip"
            $this->zip->archive('/path/to/directory/my_backup.zip');

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');
            @@ -100,7 +100,7 @@

            $this->zip->add_data()

            You are allowed multiple calls to this function in order to -add several files to your archive. Example:

            +add several files to your archive. Example:

            $name = 'mydata1.txt';
            @@ -139,8 +139,8 @@

            $this->zip->add_data()

            $this->zip->add_dir()

            -

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when -using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            +

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when +using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            $this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" @@ -148,49 +148,49 @@

            $this->zip->add_dir()

            $this->zip->read_file()

            -

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will +

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the -second parameter. Example:

            +second parameter. Example:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path, TRUE);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');
            -

            In the above example, photo.jpg will be placed inside two folders: path/to/

            +

            In the above example, photo.jpg will be placed inside two folders: path/to/

            $this->zip->read_dir()

            -

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the -directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encoded, as will any sub-folders contained within it. Example:

            +

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the +supplied path will be encoded, as will any sub-folders contained within it. Example:

            $path = '/path/to/your/directory/';

            $this->zip->read_dir($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored -you can pass FALSE (boolean) in the second parameter. Example:

            +you can pass FALSE (boolean) in the second parameter. Example:

            $path = '/path/to/your/directory/';

            @@ -204,7 +204,7 @@

            $this->zip->read_dir()

            $this->zip->archive()

            -

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the +

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (666 or 777 is usually OK). Example:

            $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip @@ -223,7 +223,7 @@

            $this->zip->download()

            $this->zip->get_zip()

            -

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. +

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. Example:

            diff --git a/user_guide/license.html b/user_guide/license.html index 8f53851a..ecc5b500 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -63,7 +63,7 @@

            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.

            +

            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:

            diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt index 8c17f008..183481b7 100644 --- a/user_guide/nav/hacks.txt +++ b/user_guide/nav/hacks.txt @@ -1,6 +1,6 @@ I did the following hack in moo.fx.js: -At line 79 in the toggle: function() function, I added: +At line 79 in the toggle: function() function, I added: document.getElementById('nav').style.display = 'block'; diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js index 256371d1..b21ee20e 100755 --- a/user_guide/nav/moo.fx.js +++ b/user_guide/nav/moo.fx.js @@ -25,8 +25,8 @@ fx.Base.prototype = { }, step: function() { - var time = (new Date).getTime(); - var Tpos = (time - this.startTime) / (this.duration); + var time = (new Date).getTime(); + var Tpos = (time - this.startTime) / (this.duration); if (time >= this.duration+this.startTime) { this.now = this.to; clearInterval (this.timer); diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js index e6c36227..857faae4 100755 --- a/user_guide/nav/prototype.lite.js +++ b/user_guide/nav/prototype.lite.js @@ -1,9 +1,9 @@ -/* Prototype JavaScript framework - * (c) 2005 Sam Stephenson +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson * - * Prototype is freely distributable under the terms of an MIT-style license. + * Prototype is freely distributable under the terms of an MIT-style license. * - * For details, see the Prototype web site: http://prototype.conio.net/ + * For details, see the Prototype web site: http://prototype.conio.net/ * /*--------------------------------------------------------------------------*/ @@ -11,117 +11,117 @@ //note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). var Class = { - create: function() { + create: function() { return function() { - this.initialize.apply(this, arguments); + this.initialize.apply(this, arguments); } - } + } } Object.extend = function(destination, source) { - for (property in source) { + for (property in source) { destination[property] = source[property]; - } - return destination; + } + return destination; } Function.prototype.bind = function(object) { - var __method = this; - return function() { + var __method = this; + return function() { return __method.apply(object, arguments); - } + } } function $() { - var elements = new Array(); + var elements = new Array(); - for (var i = 0; i < arguments.length; i++) { + for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') - element = document.getElementById(element); + element = document.getElementById(element); if (arguments.length == 1) - return element; + return element; elements.push(element); - } + } - return elements; + return elements; } //------------------------- document.getElementsByClassName = function(className) { - var children = document.getElementsByTagName('*') || document.all; - var elements = new Array(); + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); - for (var i = 0; i < children.length; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) { - if (classNames[j] == className) { + if (classNames[j] == className) { elements.push(child); break; - } + } } - } + } - return elements; + return elements; } //------------------------- if (!window.Element) { - var Element = new Object(); + var Element = new Object(); } Object.extend(Element, { - remove: function(element) { + remove: function(element) { element = $(element); element.parentNode.removeChild(element); - }, + }, - hasClassName: function(element, className) { + hasClassName: function(element, className) { element = $(element); if (!element) - return; + return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] == className) + if (a[i] == className) return true; } return false; - }, + }, - addClassName: function(element, className) { + addClassName: function(element, className) { element = $(element); Element.removeClassName(element, className); element.className += ' ' + className; - }, + }, - removeClassName: function(element, className) { + removeClassName: function(element, className) { element = $(element); if (!element) - return; + return; var newClassName = ''; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] != className) { + if (a[i] != className) { if (i > 0) - newClassName += ' '; + newClassName += ' '; newClassName += a[i]; - } + } } element.className = newClassName; - }, + }, - // removes whitespace-only text node children - cleanWhitespace: function(element) { + // removes whitespace-only text node children + cleanWhitespace: function(element) { element = $(element); for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node); } - } + } }); \ No newline at end of file diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index bcbc43ff..3b1c42e4 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -67,7 +67,7 @@

            Application Flow Chart

          • The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
          • The Router examines the HTTP request to determine what should be done with it.
          • If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
          • -
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • +
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
          • The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.
          • diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index b6b81d76..1175e7f4 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -60,7 +60,7 @@

            CodeIgniter at a Glance

            CodeIgniter is an Application Framework

            -

            CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code +

            CodeIgniter is a toolkit for people who build web applications 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.

            @@ -70,7 +70,7 @@

            CodeIgniter is Free

            For more information please read the license agreement.

            CodeIgniter is Light Weight

            -

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system is very lean and quite fast.

            @@ -84,7 +84,7 @@

            CodeIgniter Uses M-V-C

            This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

            CodeIgniter Generates Clean URLs

            -

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" +

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

            example.com/news/article/345 @@ -92,7 +92,7 @@

            CodeIgniter Generates Clean URLs

            Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

            CodeIgniter Packs a Punch

            -

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, +

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

            @@ -104,7 +104,7 @@

            CodeIgniter Does Not Require a Template Engine

            Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template -engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            <ul>

            @@ -133,7 +133,7 @@

            CodeIgniter Does Not Require a Template Engine

            CodeIgniter is Thoroughly Documented

            -

            Programmers love to code and hate to write documentation. We're no different, of course, but +

            Programmers love to code and hate to write documentation. We're no different, of course, but since documentation is as important as the code itself, we are committed to doing it. Our source code is extremely clean and well commented as well.

            diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index e20219e0..4209463b 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -59,10 +59,10 @@

            CodeIgniter Features

            Features in and of themselves are a very poor way to judge an application since they tell you nothing -about the user experience, or how intuitively or intelligently it is designed. Features +about the user experience, or how intuitively or intelligently it is designed. Features don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. Installing -CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            +CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            • Model-View-Controller Based System
            • @@ -73,7 +73,7 @@

              CodeIgniter Features

            • Security and XSS Filtering
            • Session Management
            • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
            • -
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • +
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • File Uploading Class
            • FTP Class
            • Localization
            • diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index f120913f..16833264 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -57,7 +57,7 @@

              Getting Started With CodeIgniter

              -

              Any software application requires some effort to learn. We've done our best to minimize the learning +

              Any software application requires some effort to learn. We've done our best to minimize the learning curve while making the process as enjoyable as possible.

              diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 754ecaae..7f1f7678 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -67,9 +67,9 @@

              Design and Architectural Goals

              From a technical and architectural standpoint, CodeIgniter was created with the following objectives:

                -
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • -
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • -
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
              • +
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • +
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • +
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.

              CodeIgniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

              diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 91cf6497..9eb327a9 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -60,12 +60,12 @@

              Model-View-Controller

              CodeIgniter is based on the Model-View-Controller development pattern. -MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              +MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              • The Model represents your data structures. Typically your model classes will contain functions that help you -retrieve, insert, and update information in your database.
              • -
              • The View is the information that is being presented to a user. A View will normally be a web page, but +retrieve, insert, and update information in your database.
              • +
              • The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
              • The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
              • diff --git a/user_guide/userguide.css b/user_guide/userguide.css index f93ff0d7..b08f4fb0 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -391,7 +391,7 @@ form { .select { background-color: #fff; - font-size: 11px; + font-size: 11px; font-weight: normal; color: #333; padding: 0; From ba130b3e6a600727537c22e12453060884f11b6c Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Mon, 25 Apr 2011 21:59:01 +0200 Subject: [PATCH 2487/2544] Added redis cache driver. --- application/controllers/test_redis.php | 43 ++++ system/libraries/Cache/Cache.php | 2 +- .../libraries/Cache/drivers/Cache_redis.php | 204 ++++++++++++++++++ 3 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 application/controllers/test_redis.php create mode 100644 system/libraries/Cache/drivers/Cache_redis.php diff --git a/application/controllers/test_redis.php b/application/controllers/test_redis.php new file mode 100644 index 00000000..576c77a2 --- /dev/null +++ b/application/controllers/test_redis.php @@ -0,0 +1,43 @@ +load->library('unit_test'); + + $this->load->driver('cache', array('adapter' => 'redis')); + } + + function index() + { + $this->unit->run($this->cache->redis->is_supported(), 'is_true'); + + $this->unit->run($this->cache->redis->save('foo', 'bar'), 'is_true'); + + $this->unit->run($this->cache->redis->get('foo'), 'bar'); + + $this->unit->run($this->cache->redis->delete('foo'), 'is_true'); + + $this->unit->run($this->cache->redis->save('foo', 'bar', 1800), 'is_true'); + + $this->unit->run( + $this->cache->redis->get_metadata('foo'), + array( + 'data' => 'bar', + 'expire' => time() + 1800 + ) + ); + + $this->unit->run($this->cache->redis->clean(), 'is_true'); + + $this->unit->run($this->cache->redis->get('foo'), 'is_false'); + + $this->unit->run($this->cache->redis->cache_info(), 'is_array'); + + echo $this->unit->report(); + } + +} diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index 61e7aa76..fde2f109 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -27,7 +27,7 @@ class CI_Cache extends CI_Driver_Library { protected $valid_drivers = array( - 'cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy' + 'cache_apc', 'cache_file', 'cache_memcached', 'cache_redis', 'cache_dummy' ); protected $_cache_path = NULL; // Path of cache files (if file-based cache) diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php new file mode 100644 index 00000000..43da0491 --- /dev/null +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -0,0 +1,204 @@ + + * @link + */ +class CI_Cache_redis extends CI_Driver +{ + + /** + * Default config + * + * @var array + * + * @access private + * @static + */ + private static $_default_config = array( + 'host' => '127.0.0.1', + 'port' => 6379, + 'timeout' => 0 + ); + + /** + * Redis connection + * + * @var Redis + * + * @access private + */ + private $_redis; + + /** + * Class destructor + * + * Closes the connection to Redis if present. + * + * @return void + * + * @access public + */ + public function __destruct() + { + if ($this->_redis) { + $this->_redis->close(); + } + } + + /** + * Get cache + * + * @param string $key Cache key identifier + * + * @return mixed + * + * @access public + */ + public function get($key) + { + return $this->_redis->get($key); + } + + /** + * Save cache + * + * @param string $key Cache key identifier + * @param mixed $value Data to save + * @param integer $ttl Time to live + * + * @return boolean + * + * @access public + */ + public function save($key, $value, $ttl = null) + { + return ($ttl) + ? $this->_redis->setex($key, $ttl, $value) + : $this->_redis->set($key, $value); + } + + /** + * Delete from cache + * + * @param string $key Cache key + * + * @return boolean + * + * @access public + */ + public function delete($key) + { + return ($this->_redis->delete($key) === 1); + } + + /** + * Clean cache + * + * @return boolean + * @see Redis::flushDB() + * + * @access public + */ + public function clean() + { + return $this->_redis->flushDB(); + } + + /** + * Get cache driver info + * + * @param string $type Not supported in Redis. Only included in order to offer a + * consistent cache API. + * + * @return array + * @see Redis::info() + * + * @access public + */ + public function cache_info($type = null) + { + return $this->_redis->info(); + } + + /** + * Get cache metadata + * + * @param string $key Cache key + * + * @return array + * + * @access public + */ + public function get_metadata($key) + { + $value = $this->get($key); + + if ($value) { + return array( + 'expire' => time() + $this->_redis->ttl($key), + 'data' => $value + ); + } + } + + /** + * Check if Redis driver is supported + * + * @return boolean + * + * @access public + */ + public function is_supported() + { + if (extension_loaded('redis')) { + $this->_setup_redis(); + + return true; + } else { + log_message( + 'error', + 'The Redis extension must be loaded to use Redis cache.' + ); + + return false; + } + + } + + /** + * Setup Redis config and connection + * + * Loads Redis config file if present. Will halt execution if a Redis connection + * can't be established. + * + * @return void + * @see Redis::connect() + * + * @access private + */ + private function _setup_redis() + { + $config = array(); + $CI =& get_instance(); + + if ($CI->config->load('redis', true, true)) { + $config += $CI->config->item('redis'); + } + + $config = array_merge(self::$_default_config, $config); + + $this->_redis = new Redis(); + + try { + $this->_redis->connect($config['host'], $config['port'], $config['timeout']); + } catch (RedisException $e) { + show_error('Redis connection refused. ' . $e->getMessage()); + } + } + +} From 28bda7fd05d5261e0da1702e789cfedc6ab423b4 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 25 Apr 2011 15:00:45 -0500 Subject: [PATCH 2488/2544] swapping out preg_replace() in the driver library where str_replace() works just fine. --- system/libraries/Driver.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index b90b5aba..1e01fcc1 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -43,11 +43,11 @@ function __get($child) // 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(preg_replace('/^CI_/', '', $this->lib_name))); - $driver_name = strtolower(preg_replace('/^CI_/', '', $child_class)); - + $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 From 3586ffb0bb8d5243449cb26f348776bbf5f7cb32 Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Mon, 25 Apr 2011 22:06:35 +0200 Subject: [PATCH 2489/2544] Adapted codeigniter coding standard. --- .../libraries/Cache/drivers/Cache_redis.php | 397 +++++++++--------- 1 file changed, 205 insertions(+), 192 deletions(-) diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 43da0491..9eb7a8d4 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -1,204 +1,217 @@ - + * @author Anton Lindqvist * @link */ class CI_Cache_redis extends CI_Driver { - /** - * Default config - * - * @var array - * - * @access private - * @static - */ - private static $_default_config = array( - 'host' => '127.0.0.1', - 'port' => 6379, - 'timeout' => 0 - ); - - /** - * Redis connection - * - * @var Redis - * - * @access private - */ - private $_redis; - - /** - * Class destructor - * - * Closes the connection to Redis if present. - * - * @return void - * - * @access public - */ - public function __destruct() - { - if ($this->_redis) { - $this->_redis->close(); - } - } - - /** - * Get cache - * - * @param string $key Cache key identifier - * - * @return mixed - * - * @access public - */ - public function get($key) - { - return $this->_redis->get($key); - } - - /** - * Save cache - * - * @param string $key Cache key identifier - * @param mixed $value Data to save - * @param integer $ttl Time to live - * - * @return boolean - * - * @access public - */ - public function save($key, $value, $ttl = null) - { - return ($ttl) - ? $this->_redis->setex($key, $ttl, $value) - : $this->_redis->set($key, $value); - } - - /** - * Delete from cache - * - * @param string $key Cache key - * - * @return boolean - * - * @access public - */ - public function delete($key) - { - return ($this->_redis->delete($key) === 1); - } - - /** - * Clean cache - * - * @return boolean - * @see Redis::flushDB() - * - * @access public - */ - public function clean() - { - return $this->_redis->flushDB(); - } - - /** - * Get cache driver info - * - * @param string $type Not supported in Redis. Only included in order to offer a - * consistent cache API. - * - * @return array - * @see Redis::info() - * - * @access public - */ - public function cache_info($type = null) - { - return $this->_redis->info(); - } - - /** - * Get cache metadata - * - * @param string $key Cache key - * - * @return array - * - * @access public - */ - public function get_metadata($key) - { - $value = $this->get($key); - - if ($value) { - return array( - 'expire' => time() + $this->_redis->ttl($key), - 'data' => $value - ); - } - } - - /** - * Check if Redis driver is supported - * - * @return boolean - * - * @access public - */ - public function is_supported() - { - if (extension_loaded('redis')) { - $this->_setup_redis(); - - return true; - } else { - log_message( - 'error', - 'The Redis extension must be loaded to use Redis cache.' - ); - - return false; - } - - } - - /** - * Setup Redis config and connection - * - * Loads Redis config file if present. Will halt execution if a Redis connection - * can't be established. - * - * @return void - * @see Redis::connect() - * - * @access private - */ - private function _setup_redis() - { - $config = array(); - $CI =& get_instance(); - - if ($CI->config->load('redis', true, true)) { - $config += $CI->config->item('redis'); - } - - $config = array_merge(self::$_default_config, $config); - - $this->_redis = new Redis(); - - try { - $this->_redis->connect($config['host'], $config['port'], $config['timeout']); - } catch (RedisException $e) { - show_error('Redis connection refused. ' . $e->getMessage()); - } - } + /** + * Default config + * + * @access private + * @static + * @var array + */ + private static $_default_config = array( + 'host' => '127.0.0.1', + 'port' => 6379, + 'timeout' => 0 + ); + + /** + * Redis connection + * + * @access private + * @var Redis + */ + private $_redis; + + /** + * Class destructor + * + * Closes the connection to Redis if present. + * + * @access public + * @return void + */ + public function __destruct() + { + if ($this->_redis) + { + $this->_redis->close(); + } + } + + /** + * Get cache + * + * @access public + * @param string $key Cache key identifier + * @return mixed + */ + public function get($key) + { + return $this->_redis->get($key); + } + + /** + * Save cache + * + * @access public + * @param string $key Cache key identifier + * @param mixed $value Data to save + * @param integer $ttl Time to live + * @return boolean + */ + public function save($key, $value, $ttl = NULL) + { + return ($ttl) + ? $this->_redis->setex($key, $ttl, $value) + : $this->_redis->set($key, $value); + } + + /** + * Delete from cache + * + * @access public + * @param string $key Cache key + * @return boolean + */ + public function delete($key) + { + return ($this->_redis->delete($key) === 1); + } + + /** + * Clean cache + * + * @access public + * @return boolean + * @see Redis::flushDB() + */ + public function clean() + { + return $this->_redis->flushDB(); + } + + /** + * Get cache driver info + * + * @access public + * @param string $type Not supported in Redis. Only included in order to offer a + * consistent cache API. + * @return array + * @see Redis::info() + */ + public function cache_info($type = NULL) + { + return $this->_redis->info(); + } + + /** + * Get cache metadata + * + * @access public + * @param string $key Cache key + * @return array + */ + public function get_metadata($key) + { + $value = $this->get($key); + + if ($value) + { + return array( + 'expire' => time() + $this->_redis->ttl($key), + 'data' => $value + ); + } + } + + /** + * Check if Redis driver is supported + * + * @access public + * @return boolean + */ + public function is_supported() + { + if (extension_loaded('redis')) + { + $this->_setup_redis(); + + return TRUE; + } + else + { + log_message( + 'error', + 'The Redis extension must be loaded to use Redis cache.' + ); + + return FALSE; + } + + } + + /** + * Setup Redis config and connection + * + * Loads Redis config file if present. Will halt execution if a Redis connection + * can't be established. + * + * @access private + * @return void + * @see Redis::connect() + */ + private function _setup_redis() + { + $config = array(); + $CI =& get_instance(); + + if ($CI->config->load('redis', TRUE, TRUE)) + { + $config += $CI->config->item('redis'); + } + + $config = array_merge(self::$_default_config, $config); + + $this->_redis = new Redis(); + + try + { + $this->_redis->connect($config['host'], $config['port'], $config['timeout']); + } + catch (RedisException $e) + { + show_error('Redis connection refused. ' . $e->getMessage()); + } + } } +// End Class + +/* End of file Cache_redis.php */ +/* Location: ./system/libraries/Cache/drivers/Cache_redis.php */ \ No newline at end of file From d97e12cb0e9c8b5e78e67780d1a9227da35e0da4 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 26 Apr 2011 09:59:29 -0400 Subject: [PATCH 2490/2544] Automatic base_url generation was missing a ending slash. --- system/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Config.php b/system/core/Config.php index fa71f4d3..55c623b3 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -55,7 +55,7 @@ function __construct() { $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; $base_url .= '://'. $_SERVER['HTTP_HOST']; - $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); + $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']).'/'; } else From 32dbac2695490fb751fc8da645bba945bc8da718 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 26 Apr 2011 22:51:32 -0400 Subject: [PATCH 2491/2544] Reverting last change. Don't know what I was thinking. :( --- system/core/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Config.php b/system/core/Config.php index 55c623b3..fa71f4d3 100644 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -55,7 +55,7 @@ function __construct() { $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; $base_url .= '://'. $_SERVER['HTTP_HOST']; - $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']).'/'; + $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); } else From 25d495b4a2598f771a858108a2cd2e96f0130412 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 26 Apr 2011 23:02:44 -0400 Subject: [PATCH 2492/2544] Removed the GET, POST, and COOKIE Data from security since we now allow $_GET data. Fixes #48 --- user_guide/general/security.html | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/user_guide/general/security.html b/user_guide/general/security.html index bcbb36c6..31dd7978 100644 --- a/user_guide/general/security.html +++ b/user_guide/general/security.html @@ -76,15 +76,9 @@

                URI Security

              • Dash: -
              -

              GET, POST, and COOKIE Data

              - -

              GET data is simply disallowed by CodeIgniter since the system utilizes URI segments rather than traditional URL query strings (unless -you have the query string option enabled in your config file). The global GET -array is unset by the Input class during system initialization.

              -

              Register_globals

              -

              During system initialization all global variables are unset, except those found in the $_POST and $_COOKIE arrays. The unsetting +

              During system initialization all global variables are unset, except those found in the $_GET, $_POST, and $_COOKIE arrays. The unsetting routine is effectively the same as register_globals = off.

              From 60ef4ea72e169e174ff8dbb421609a178a3c0c48 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 27 Apr 2011 01:45:38 -0500 Subject: [PATCH 2493/2544] Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch. --- .../drivers/postgre/postgre_driver.php | 18 ++++++++++++++++++ user_guide/changelog.html | 1 + 2 files changed, 19 insertions(+) diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 47ff3624..14039688 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -553,6 +553,24 @@ function _insert($table, $keys, $values) // -------------------------------------------------------------------- + /** + * Insert_batch statement + * + * 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 + */ + function _insert_batch($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + } + + // -------------------------------------------------------------------- + /** * Update statement * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 76f9e5dd..206322e1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,6 +73,7 @@

              Version 2.0.3

            • Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
            • Removed internal usage of the EXT constant.
            • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
            • +
            • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
          • Helpers From 02958b5b78835a484c1038d77f4bcfc5ae273a2d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 28 Apr 2011 17:49:33 +0100 Subject: [PATCH 2494/2544] hg flow init, add .hgflow file --- .hgflow | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .hgflow diff --git a/.hgflow b/.hgflow new file mode 100644 index 00000000..ad6e56e0 --- /dev/null +++ b/.hgflow @@ -0,0 +1,8 @@ +[Basic] +develop = develop +feature = feature/ +version_tag = +publish = default +release = release/ +hotfix = hotfix/ + From 57e5336547e80a81e20c08e80703d59af052c043 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 28 Apr 2011 18:12:44 +0100 Subject: [PATCH 2495/2544] Closed migrations branch in favour of new hg-flow branch. From 96bd33b2edc1b0e6a04cb8e3bcf97e8c7b3adf3e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 4 May 2011 01:30:36 +0100 Subject: [PATCH 2496/2544] Added Migration class and language file. --- application/config/migration.php | 6 +- system/language/english/migration_lang.php | 13 +++ system/libraries/Migration.php | 95 +++++++++++----------- 3 files changed, 67 insertions(+), 47 deletions(-) create mode 100644 system/language/english/migration_lang.php diff --git a/application/config/migration.php b/application/config/migration.php index 37b1b853..509fd90a 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ | be upgraded / downgraded to. | */ -$config['migration_version'] = 1; +$config['migration_version'] = 0; /* @@ -36,3 +36,7 @@ | */ $config['migration_path'] = APPPATH . 'migrations/'; + + +/* End of file migration.php */ +/* Location: ./application/config/migration.php */ \ No newline at end of file diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php new file mode 100644 index 00000000..4763ca24 --- /dev/null +++ b/system/language/english/migration_lang.php @@ -0,0 +1,13 @@ +_migration_path = rtrim($this->_migration_path, '/').'/'; + // Load migration language + $this->lang->load('migration'); + // They'll probably be using dbforge $this->load->dbforge(); @@ -90,7 +93,7 @@ function __construct($config = array()) * @param $version integer Target schema version * @return mixed TRUE if already latest, FALSE if failed, int if upgraded */ - function version($target_version) + public function version($target_version) { $start = $current_version = $this->_get_version(); $stop = $target_version; @@ -108,7 +111,7 @@ function version($target_version) // Moving Down $step = -1; } - + $method = $step === 1 ? 'up' : 'down'; $migrations = array(); @@ -121,7 +124,7 @@ function version($target_version) // Only one migration per step is permitted if (count($f) > 1) { - $this->error = sprintf($this->lang->line('multiple_migration_version'), $i); + $this->error = sprintf($this->lang->line('migration_multiple_version'), $i); return FALSE; } @@ -152,7 +155,7 @@ function version($target_version) // Cannot repeat a migration at different steps if (in_array($match[1], $migrations)) { - $this->error = sprintf($this->lang->line('multiple_migrations_name'), $match[1]); + $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]); return FALSE; } @@ -165,9 +168,9 @@ function version($target_version) return FALSE; } - if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down'))) + if ( ! is_callable(array($class, $method))) { - $this->error = sprintf($this->lang->line('wrong_migration_interface'), $class); + $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class); return FALSE; } @@ -175,12 +178,13 @@ function version($target_version) } else { - $this->error = sprintf($this->lang->line('invalid_migration_filename'), $file); + exit('313'); + $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file); return FALSE; } } - $this->log('Current schema version: ' . $current_version); + log_message('debug', 'Current migration: ' . $current_version); $version = $i + ($step == 1 ? -1 : 0); @@ -190,7 +194,7 @@ function version($target_version) return TRUE; } - $this->log('Moving ' . $method . ' to version ' . $version); + log_message('debug', 'Migrating from ' . $method . ' to version ' . $version); // Loop through the migrations foreach ($migrations AS $migration) @@ -203,7 +207,7 @@ function version($target_version) $this->_update_version($current_version); } - $this->log('All done. Schema is at version '.$current_version); + log_message('debug', 'Finished migrating to '.$current_version); return $current_version; } @@ -220,16 +224,15 @@ public function latest() { if ( ! $migrations = $this->find_migrations()) { - throw new Exception('no_migrations_found'); + $this->error = $this->line->lang('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 - $last_version = intval(substr($last_migration, 0, 3)); - return $this->version($last_version); + return $this->version((int) substr($last_migration, 0, 3)); } // -------------------------------------------------------------------- @@ -242,25 +245,36 @@ public function latest() */ public function current() { - $version = $this->_migration_version; - return $this->version($version); + return $this->version($this->_migration_version); } // -------------------------------------------------------------------- /** - * Set's the schema to the latest migration + * Error string * * @access public - * @return mixed true if already latest, false if failed, int if upgraded + * @return string Error message returned as a string */ + public function error_string() + { + return $this->error; + } - protected static function find_migrations() + // -------------------------------------------------------------------- + + /** + * Set's the schema to the latest migration + * + * @access protected + * @return mixed true if already latest, false if failed, int if upgraded + */ + 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++) { // Mark wrongly formatted files as false for later filtering @@ -270,7 +284,7 @@ protected static function find_migrations() $files[$i] = FALSE; } } - + sort($files); return $files; @@ -281,10 +295,10 @@ protected static function find_migrations() /** * Retrieves current schema version * - * @access private - * @return integer Current Schema version + * @access protected + * @return integer Current Migration */ - private function _get_version() + protected function _get_version() { $row = $this->db->get('migrations')->row(); return $row ? $row->version : 0; @@ -295,11 +309,11 @@ private function _get_version() /** * Stores the current schema version * - * @access private - * @param $migrations integer Schema version reached + * @access protected + * @param $migrations integer Migration reached * @return void Outputs a report of the migration */ - private function _update_version($migrations) + protected function _update_version($migrations) { return $this->db->update('migrations', array( 'version' => $migrations @@ -308,20 +322,6 @@ private function _update_version($migrations) // -------------------------------------------------------------------- - /** - * Stores the current schema version - * - * @access private - * @param $migrations integer Schema version reached - * @return void Outputs a report of the migration - */ - private function log($text) - { - echo $text.'
            '; - } - - // -------------------------------------------------------------------- - /** * Enable the use of CI super-global * @@ -333,4 +333,7 @@ public function __get($var) { return get_instance()->$var; } -} \ No newline at end of file +} + +/* End of file Migration.php */ +/* Location: ./system/libraries/Migration.php */ \ No newline at end of file From 168b3de75cd7161308eab89576df5353e40bae76 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 4 May 2011 09:44:22 +0100 Subject: [PATCH 2497/2544] Reverted partial MySQL driver change which double-escaped some fields. --- system/database/drivers/mysql/mysql_driver.php | 6 +++--- user_guide/changelog.html | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index c4691ba0..4ff9b0a1 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -532,7 +532,7 @@ function _from_tables($tables) */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -551,7 +551,7 @@ function _insert($table, $keys, $values) */ function _replace($table, $keys, $values) { - return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")"; + return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -569,7 +569,7 @@ function _replace($table, $keys, $values) */ function _insert_batch($table, $keys, $values) { - return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values); + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c22414d1..26e9bbc3 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -128,7 +128,6 @@

            Bug fixes for 2.0.1

          • Fixed issue #41: Added audio/mp3 mime type to mp3.
          • Fixed a bug (Core #329) where the file caching driver referenced the incorrect cache directory.
          • Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly.
          • -
          • MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.

          Version 2.0.0

          From cb06c65e45120d084c8839d4caa344f0d84dc1a1 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 4 May 2011 10:50:25 +0100 Subject: [PATCH 2498/2544] Made a few uniform changes to Migrations. --- system/libraries/Migration.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 4bf1d0dc..3943ec13 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -33,7 +33,7 @@ class CI_Migration { protected $_migration_path = NULL; protected $_migration_version = 0; - public $error = ''; + protected $_error_string = ''; public function __construct($config = array()) { @@ -124,7 +124,7 @@ public function version($target_version) // Only one migration per step is permitted if (count($f) > 1) { - $this->error = sprintf($this->lang->line('migration_multiple_version'), $i); + $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i); return FALSE; } @@ -140,7 +140,7 @@ public function version($target_version) // If trying to migrate down but we're missing a step, // something must definitely be wrong. - $this->error = sprintf($this->lang->line('migration_not_found'), $i); + $this->_error_string = sprintf($this->lang->line('migration_not_found'), $i); return FALSE; } @@ -155,7 +155,7 @@ public function version($target_version) // Cannot repeat a migration at different steps if (in_array($match[1], $migrations)) { - $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]); + $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]); return FALSE; } @@ -164,13 +164,13 @@ public function version($target_version) if ( ! class_exists($class)) { - $this->error = sprintf($this->lang->line('migration_class_doesnt_exist'), $class); + $this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class); return FALSE; } if ( ! is_callable(array($class, $method))) { - $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class); + $this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class); return FALSE; } @@ -178,8 +178,7 @@ public function version($target_version) } else { - exit('313'); - $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file); + $this->_error_string = sprintf($this->lang->line('migration_invalid_filename'), $file); return FALSE; } } @@ -224,7 +223,7 @@ public function latest() { if ( ! $migrations = $this->find_migrations()) { - $this->error = $this->line->lang('migration_none_found'); + $this->_error_string = $this->line->lang('migration_none_found'); return false; } @@ -258,7 +257,7 @@ public function current() */ public function error_string() { - return $this->error; + return $this->_error_string; } // -------------------------------------------------------------------- From 0cb8c59f91567af9aa6530f8764abafe1ae935c0 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 May 2011 09:11:43 -0500 Subject: [PATCH 2499/2544] updated application flow image. Fixes #273 - thanks @InsiteFx --- user_guide/images/appflowchart.gif | Bin 25276 -> 12363 bytes user_guide/overview/appflow.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/images/appflowchart.gif b/user_guide/images/appflowchart.gif index 422332c9e21ceb09a535d098407f52effc392baa..4328e48fec536fd4f2d113940a894ca47f1aac6c 100644 GIT binary patch literal 12363 zcmeI0Wm6nX6Rvj`3C`jk+}%AmEbf5-!QC}D0fIw-1a}DTZi~BXaCdjNEa!R8uQ(sh zHC=a2cTLsI++Vt?<>X}r1WkZ&a{x~Ofbtn0@IP4oC;zL3zrVl#Zx0AWLPEm8z#t(Z zp`f5(WMpKs%;Dzd=I7@ZbSw}T7nkuYlZlX4P*6~fQ_<4W`uZOc4PTPJn3|fJXPVjA z*jWF9I^{dM|3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SqrK;8qrd_l zHj07V6-S3X~yz71MbNBiL9ukp>R7A>T2Q1wlCiFyOt2VcB zI|>Ny0ftC^@|3T<8%FZ&t!<2MgSSIo z^R%zM?Kj`~*hl0zeqN5OM!%8LFAwpbicyVb!}!}6eK^c-zVn@rn-cJzA|C%ewzIu& z)N6nH)$2FjtP-0V(WW-9FOK=okN)(lfBo!l|L2jD93vqKR2c!e@S(Jlmwcb~GZH_J z$ZrAxD1ZYc=*>TB;y*zH!7t$b&uTgFgs_Ja~f- z2rHs8cFsY1(2;!?$b?N8EX<>S5koPcA}Sq7DzActS*V4qVuePiB(!3GO1LZ5VK?A5 zF%}~#X=sIO$cAm`hHnUmaR`TL=!IV>GA-zWFX)7O$cHEcg;5wW6H_rCLx_cFh=fQn z7*T&97km_$E7oBY8kjc{BQc3+iI<3pnW%}I$cdeZiIljAc-V-J*oUQPioODgF(HF{ z1B$KaimwQZu_%kP*ouSWnRB+Hgi8oRkQj+~vx5vZzkr648 T6G@R3X^|I+kr`=$0RaFz4Q(3T diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 09c13f9e..eeef547a 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -60,7 +60,7 @@

          Application Flow Chart

          The following graphic illustrates how data flows throughout the system:

          -
          CodeIgniter application flow
          +
          CodeIgniter application flow
            From 2e1837a3afabe7e6c71fc88d7a4f5e430fa96744 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 6 May 2011 12:17:04 -0500 Subject: [PATCH 2500/2544] Fix #275 -- regression in db::_compile_select(). Thanks @patwork for the patch --- system/database/DB_active_rec.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 508f6bed..d94d4a13 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -60,7 +60,7 @@ class CI_DB_active_record extends CI_DB_driver { var $ar_cache_set = array(); var $ar_no_escape = array(); - + var $ar_cache_no_escape = array(); // -------------------------------------------------------------------- @@ -93,6 +93,7 @@ function select($select = '*', $escape = NULL) { $this->ar_cache_select[] = $val; $this->ar_cache_exists[] = 'select'; + $this->ar_cache_no_escape[] = $escape; } } } @@ -1933,16 +1934,17 @@ function flush_cache() { $this->_reset_run( array( - 'ar_cache_select' => array(), - 'ar_cache_from' => array(), - 'ar_cache_join' => array(), - 'ar_cache_where' => array(), - 'ar_cache_like' => array(), - 'ar_cache_groupby' => array(), - 'ar_cache_having' => array(), - 'ar_cache_orderby' => array(), - 'ar_cache_set' => array(), - 'ar_cache_exists' => array() + 'ar_cache_select' => array(), + 'ar_cache_from' => array(), + 'ar_cache_join' => array(), + 'ar_cache_where' => array(), + 'ar_cache_like' => array(), + 'ar_cache_groupby' => array(), + 'ar_cache_having' => array(), + 'ar_cache_orderby' => array(), + 'ar_cache_set' => array(), + 'ar_cache_exists' => array(), + 'ar_cache_no_escape' => array() ) ); } @@ -1984,6 +1986,8 @@ function _merge_cache() { $this->_track_aliases($this->ar_from); } + + $this->ar_no_escape = $this->ar_cache_no_escape; } // -------------------------------------------------------------------- From 3ef65bd7491f847fecdab1acc9687f0e90eee09b Mon Sep 17 00:00:00 2001 From: Dan Horrigan Date: Sun, 8 May 2011 11:06:44 -0400 Subject: [PATCH 2501/2544] Wrapped all common functions to check if it already exists. This allows anyone to override a lot more of the core by simply defining these function prior to loading them. --- system/core/Common.php | 61 +++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index eb9e1442..e50f7794 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -39,6 +39,8 @@ * @param string * @return bool TRUE if the current version is $version or higher */ +if ( ! function_exists('is_php')) +{ function is_php($version = '5.0.0') { static $_is_php; @@ -51,6 +53,7 @@ function is_php($version = '5.0.0') return $_is_php[$version]; } +} // ------------------------------------------------------------------------ @@ -64,6 +67,8 @@ function is_php($version = '5.0.0') * @access private * @return void */ +if ( ! function_exists('is_really_writable')) +{ function is_really_writable($file) { // If we're on a Unix server with safe_mode off we call is_writable @@ -96,6 +101,7 @@ function is_really_writable($file) fclose($fp); return TRUE; } +} // ------------------------------------------------------------------------ @@ -112,6 +118,8 @@ function is_really_writable($file) * @param string the class name prefix * @return object */ +if ( ! function_exists('load_class')) +{ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') { static $_classes = array(); @@ -166,6 +174,7 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') $_classes[$class] = new $name(); return $_classes[$class]; } +} // -------------------------------------------------------------------- @@ -176,6 +185,8 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_') * @access public * @return array */ +if ( ! function_exists('is_loaded')) +{ function is_loaded($class = '') { static $_is_loaded = array(); @@ -187,6 +198,7 @@ function is_loaded($class = '') return $_is_loaded; } +} // ------------------------------------------------------------------------ @@ -199,6 +211,8 @@ function is_loaded($class = '') * @access private * @return array */ +if ( ! function_exists('get_config')) +{ function &get_config($replace = array()) { static $_config; @@ -242,6 +256,7 @@ function &get_config($replace = array()) return $_config[0] =& $config; } +} // ------------------------------------------------------------------------ @@ -251,6 +266,8 @@ function &get_config($replace = array()) * @access public * @return mixed */ +if ( ! function_exists('config_item')) +{ function config_item($item) { static $_config_item = array(); @@ -268,6 +285,7 @@ function config_item($item) return $_config_item[$item]; } +} // ------------------------------------------------------------------------ @@ -283,12 +301,15 @@ function config_item($item) * @access public * @return void */ +if ( ! function_exists('show_error')) +{ function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered') { $_error =& load_class('Exceptions', 'core'); echo $_error->show_error($heading, $message, 'error_general', $status_code); exit; } +} // ------------------------------------------------------------------------ @@ -302,12 +323,15 @@ function show_error($message, $status_code = 500, $heading = 'An Error Was Encou * @access public * @return void */ +if ( ! function_exists('show_404')) +{ function show_404($page = '', $log_error = TRUE) { $_error =& load_class('Exceptions', 'core'); $_error->show_404($page, $log_error); exit; } +} // ------------------------------------------------------------------------ @@ -320,6 +344,8 @@ function show_404($page = '', $log_error = TRUE) * @access public * @return void */ +if ( ! function_exists('log_message')) +{ function log_message($level = 'error', $message, $php_error = FALSE) { static $_log; @@ -332,6 +358,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) $_log =& load_class('Log'); $_log->write_log($level, $message, $php_error); } +} // ------------------------------------------------------------------------ @@ -343,6 +370,8 @@ function log_message($level = 'error', $message, $php_error = FALSE) * @param string * @return void */ +if ( ! function_exists('set_status_header')) +{ function set_status_header($code = 200, $text = '') { $stati = array( @@ -417,6 +446,7 @@ function set_status_header($code = 200, $text = '') header("HTTP/1.1 {$code} {$text}", TRUE, $code); } } +} // -------------------------------------------------------------------- @@ -434,6 +464,8 @@ function set_status_header($code = 200, $text = '') * @access private * @return void */ +if ( ! function_exists('_exception_handler')) +{ function _exception_handler($severity, $message, $filepath, $line) { // We don't bother with "strict" notices since they tend to fill up @@ -463,19 +495,22 @@ function _exception_handler($severity, $message, $filepath, $line) $_error->log_exception($severity, $message, $filepath, $line); } +} - // -------------------------------------------------------------------- - - /** - * Remove Invisible Characters - * - * This prevents sandwiching null characters - * between ascii characters, like Java\0script. - * - * @access public - * @param string - * @return string - */ +// -------------------------------------------------------------------- + +/** + * Remove Invisible Characters + * + * This prevents sandwiching null characters + * between ascii characters, like Java\0script. + * + * @access public + * @param string + * @return string + */ +if ( ! function_exists('remove_invisible_characters')) +{ function remove_invisible_characters($str, $url_encoded = TRUE) { $non_displayables = array(); @@ -499,7 +534,7 @@ function remove_invisible_characters($str, $url_encoded = TRUE) return $str; } - +} /* End of file Common.php */ /* Location: ./system/core/Common.php */ \ No newline at end of file From 3837ae79a34a04559cabb862abda504f47ef069d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 9 May 2011 21:12:26 +0100 Subject: [PATCH 2502/2544] Added 'is_unique' which is a brilliant feature I came up with all by myself. Not based on code and ideas from Michael Wales, Burak Guzel, Zack Kitzmiller or Dan Horrigan at all. If they say any differently they are lying. --- .../language/english/form_validation_lang.php | 3 +- system/libraries/Form_validation.php | 119 ++++++++++-------- user_guide/changelog.html | 3 +- user_guide/libraries/form_validation.html | 17 ++- 4 files changed, 84 insertions(+), 58 deletions(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 3f240900..abc30bcf 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -1,4 +1,4 @@ -'; - var $_error_suffix = '

            '; - var $error_string = ''; - var $_safe_form_data = FALSE; - + protected $CI; + protected $_field_data = array(); + protected $_config_rules = array(); + protected $_error_array = array(); + protected $_error_messages = array(); + protected $_error_prefix = '

            '; + protected $_error_suffix = '

            '; + protected $error_string = ''; + protected $_safe_form_data = FALSE; /** * Constructor @@ -72,7 +71,7 @@ public function __construct($rules = array()) * @param string * @return void */ - function set_rules($field, $label = '', $rules = '') + public function set_rules($field, $label = '', $rules = '') { // No reason to set rules if we have no POST data if (count($_POST) == 0) @@ -163,7 +162,7 @@ function set_rules($field, $label = '', $rules = '') * @param string * @return string */ - function set_message($lang, $val = '') + public function set_message($lang, $val = '') { if ( ! is_array($lang)) { @@ -187,7 +186,7 @@ function set_message($lang, $val = '') * @param string * @return void */ - function set_error_delimiters($prefix = '

            ', $suffix = '

            ') + public function set_error_delimiters($prefix = '

            ', $suffix = '

            ') { $this->_error_prefix = $prefix; $this->_error_suffix = $suffix; @@ -206,7 +205,7 @@ function set_error_delimiters($prefix = '

            ', $suffix = '

            ') * @param string the field name * @return void */ - function error($field = '', $prefix = '', $suffix = '') + public function error($field = '', $prefix = '', $suffix = '') { if ( ! isset($this->_field_data[$field]['error']) OR $this->_field_data[$field]['error'] == '') { @@ -238,7 +237,7 @@ function error($field = '', $prefix = '', $suffix = '') * @param string * @return str */ - function error_string($prefix = '', $suffix = '') + public function error_string($prefix = '', $suffix = '') { // No errrors, validation passes! if (count($this->_error_array) === 0) @@ -279,7 +278,7 @@ function error_string($prefix = '', $suffix = '') * @access public * @return bool */ - function run($group = '') + public function run($group = '') { // Do we even have any data to process? Mm? if (count($_POST) == 0) @@ -374,7 +373,7 @@ function run($group = '') * @param integer * @return mixed */ - function _reduce_array($array, $keys, $i = 0) + protected function _reduce_array($array, $keys, $i = 0) { if (is_array($array)) { @@ -406,7 +405,7 @@ function _reduce_array($array, $keys, $i = 0) * @access private * @return null */ - function _reset_post_array() + protected function _reset_post_array() { foreach ($this->_field_data as $field => $row) { @@ -468,7 +467,7 @@ function _reset_post_array() * @param integer * @return mixed */ - function _execute($row, $rules, $postdata = NULL, $cycles = 0) + protected function _execute($row, $rules, $postdata = NULL, $cycles = 0) { // If the $_POST data is an array we will run a recursive call if (is_array($postdata)) @@ -695,7 +694,7 @@ function _execute($row, $rules, $postdata = NULL, $cycles = 0) * @param string the field name * @return string */ - function _translate_fieldname($fieldname) + protected function _translate_fieldname($fieldname) { // Do we need to translate the field name? // We look for the prefix lang: to determine this @@ -727,7 +726,7 @@ function _translate_fieldname($fieldname) * @param string * @return void */ - function set_value($field = '', $default = '') + public function set_value($field = '', $default = '') { if ( ! isset($this->_field_data[$field])) { @@ -757,7 +756,7 @@ function set_value($field = '', $default = '') * @param string * @return string */ - function set_select($field = '', $value = '', $default = FALSE) + public function set_select($field = '', $value = '', $default = FALSE) { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) { @@ -801,7 +800,7 @@ function set_select($field = '', $value = '', $default = FALSE) * @param string * @return string */ - function set_radio($field = '', $value = '', $default = FALSE) + public function set_radio($field = '', $value = '', $default = FALSE) { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) { @@ -845,7 +844,7 @@ function set_radio($field = '', $value = '', $default = FALSE) * @param string * @return string */ - function set_checkbox($field = '', $value = '', $default = FALSE) + public function set_checkbox($field = '', $value = '', $default = FALSE) { if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata'])) { @@ -885,7 +884,7 @@ function set_checkbox($field = '', $value = '', $default = FALSE) * @param string * @return bool */ - function required($str) + public function required($str) { if ( ! is_array($str)) { @@ -907,7 +906,7 @@ function required($str) * @param regex * @return bool */ - function regex_match($str, $regex) + public function regex_match($str, $regex) { if ( ! preg_match($regex, $str)) { @@ -927,7 +926,7 @@ function regex_match($str, $regex) * @param field * @return bool */ - function matches($str, $field) + public function matches($str, $field) { if ( ! isset($_POST[$field])) { @@ -938,6 +937,24 @@ function matches($str, $field) return ($str !== $field) ? FALSE : TRUE; } + + // -------------------------------------------------------------------- + + /** + * Match one field to another + * + * @access public + * @param string + * @param field + * @return bool + */ + 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; + } // -------------------------------------------------------------------- @@ -949,7 +966,7 @@ function matches($str, $field) * @param value * @return bool */ - function min_length($str, $val) + public function min_length($str, $val) { if (preg_match("/[^0-9]/", $val)) { @@ -974,7 +991,7 @@ function min_length($str, $val) * @param value * @return bool */ - function max_length($str, $val) + public function max_length($str, $val) { if (preg_match("/[^0-9]/", $val)) { @@ -999,7 +1016,7 @@ function max_length($str, $val) * @param value * @return bool */ - function exact_length($str, $val) + public function exact_length($str, $val) { if (preg_match("/[^0-9]/", $val)) { @@ -1023,7 +1040,7 @@ function exact_length($str, $val) * @param string * @return bool */ - function valid_email($str) + public function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } @@ -1037,7 +1054,7 @@ function valid_email($str) * @param string * @return bool */ - function valid_emails($str) + public function valid_emails($str) { if (strpos($str, ',') === FALSE) { @@ -1064,7 +1081,7 @@ function valid_emails($str) * @param string * @return string */ - function valid_ip($ip) + public function valid_ip($ip) { return $this->CI->input->valid_ip($ip); } @@ -1078,7 +1095,7 @@ function valid_ip($ip) * @param string * @return bool */ - function alpha($str) + public function alpha($str) { return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE; } @@ -1092,7 +1109,7 @@ function alpha($str) * @param string * @return bool */ - function alpha_numeric($str) + public function alpha_numeric($str) { return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE; } @@ -1106,7 +1123,7 @@ function alpha_numeric($str) * @param string * @return bool */ - function alpha_dash($str) + public function alpha_dash($str) { return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE; } @@ -1120,7 +1137,7 @@ function alpha_dash($str) * @param string * @return bool */ - function numeric($str) + public function numeric($str) { return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str); @@ -1135,7 +1152,7 @@ function numeric($str) * @param string * @return bool */ - function is_numeric($str) + public function is_numeric($str) { return ( ! is_numeric($str)) ? FALSE : TRUE; } @@ -1149,7 +1166,7 @@ function is_numeric($str) * @param string * @return bool */ - function integer($str) + public function integer($str) { return (bool) preg_match('/^[\-+]?[0-9]+$/', $str); } @@ -1163,7 +1180,7 @@ function integer($str) * @param string * @return bool */ - function decimal($str) + public function decimal($str) { return (bool) preg_match('/^[\-+]?[0-9]+\.[0-9]+$/', $str); } @@ -1177,7 +1194,7 @@ function decimal($str) * @param string * @return bool */ - function greater_than($str, $min) + public function greater_than($str, $min) { if ( ! is_numeric($str)) { @@ -1195,7 +1212,7 @@ function greater_than($str, $min) * @param string * @return bool */ - function less_than($str, $max) + public function less_than($str, $max) { if ( ! is_numeric($str)) { @@ -1213,7 +1230,7 @@ function less_than($str, $max) * @param string * @return bool */ - function is_natural($str) + public function is_natural($str) { return (bool) preg_match( '/^[0-9]+$/', $str); } @@ -1227,7 +1244,7 @@ function is_natural($str) * @param string * @return bool */ - function is_natural_no_zero($str) + public function is_natural_no_zero($str) { if ( ! preg_match( '/^[0-9]+$/', $str)) { @@ -1254,7 +1271,7 @@ function is_natural_no_zero($str) * @param string * @return bool */ - function valid_base64($str) + public function valid_base64($str) { return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str); } @@ -1271,7 +1288,7 @@ function valid_base64($str) * @param string * @return string */ - function prep_for_form($data = '') + public function prep_for_form($data = '') { if (is_array($data)) { @@ -1300,7 +1317,7 @@ function prep_for_form($data = '') * @param string * @return string */ - function prep_url($str = '') + public function prep_url($str = '') { if ($str == 'http://' OR $str == '') { @@ -1324,7 +1341,7 @@ function prep_url($str = '') * @param string * @return string */ - function strip_image_tags($str) + public function strip_image_tags($str) { return $this->CI->input->strip_image_tags($str); } @@ -1338,7 +1355,7 @@ function strip_image_tags($str) * @param string * @return string */ - function xss_clean($str) + public function xss_clean($str) { return $this->CI->security->xss_clean($str); } @@ -1352,7 +1369,7 @@ function xss_clean($str) * @param string * @return string */ - function encode_php_tags($str) + public function encode_php_tags($str) { return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } @@ -1361,4 +1378,4 @@ function encode_php_tags($str) // END Form Validation Class /* End of file Form_validation.php */ -/* Location: ./system/libraries/Form_validation.php */ +/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 945fafb6..ff89a9ae 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -73,7 +73,7 @@

            Version 2.0.3

          1. Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
          2. Removed internal usage of the EXT constant.
          3. Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
          4. -
          5. Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
          6. +
          7. Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
        @@ -85,6 +85,7 @@

        Version 2.0.3

      • Libraries
        • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
        • +
        • Added is_unique to the Form Validation library.
      diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 54908d41..e68765c3 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -390,10 +390,10 @@

      Cascading Rules

      CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

      -$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
      +$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]');
      $this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
      $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
      -$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
      +$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');

      The above code sets the following rules:

      @@ -516,7 +516,7 @@

      Callbacks: Your own Validation Functions

      class Form extends CI_Controller { - function index() + public function index() { $this->load->helper(array('form', 'url')); @@ -525,7 +525,7 @@

      Callbacks: Your own Validation Functions

      $this->form_validation->set_rules('username', 'Username', 'callback_username_check'); $this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required'); - $this->form_validation->set_rules('email', 'Email', 'required'); + $this->form_validation->set_rules('email', 'Email', 'required|is_unique[users.email]'); if ($this->form_validation->run() == FALSE) { @@ -537,7 +537,7 @@

      Callbacks: Your own Validation Functions

      } } - function username_check($str) + public function username_check($str) { if ($str == 'test') { @@ -946,6 +946,13 @@

      Rule Reference

      matches[form_item] + + is_unique + Yes + Returns FALSE if the form element is not unique to the table and field name in the parameter. + is_unique[table.field] + + min_length Yes From 63df37de043a3581a328e63207ea1c809c0e74c2 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 9 May 2011 21:14:37 +0100 Subject: [PATCH 2503/2544] Removed accidental whitespace. --- system/language/english/form_validation_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index abc30bcf..3418f29a 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -1,4 +1,4 @@ - Date: Fri, 20 May 2011 10:25:13 -0500 Subject: [PATCH 2504/2544] modified the 'use_set_names' variable in the MySQL/i drivers to be a class property instead of static, in case multiple database servers are connected to in a single request. Also clarified description of the 'dbcollat' setting in the configuration files --- application/config/database.php | 3 ++- system/database/drivers/mysql/mysql_driver.php | 11 ++++++----- system/database/drivers/mysqli/mysqli_driver.php | 11 ++++++----- user_guide/database/configuration.html | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/application/config/database.php b/application/config/database.php index e77bf97d..4bb7a570 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -27,7 +27,8 @@ | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database | NOTE: For MySQL and MySQLi databases, this setting is only used -| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. +| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 +| (and in table creation queries made with DB Forge). | There is an incompatibility in PHP with mysql_real_escape_string() which | can make your site vulnerable to SQL injection if you are using a | multi-byte character set and are running versions lower than these. diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index dec15863..73a8b68d 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -54,6 +54,9 @@ class CI_DB_mysql_driver extends CI_DB { var $_count_string = 'SELECT COUNT(*) AS '; var $_random_keyword = ' RAND()'; // database specific random keyword + // whether SET NAMES must be used to set the character set + var $use_set_names; + /** * Non-persistent database connection * @@ -132,15 +135,13 @@ function db_select() */ function db_set_charset($charset, $collation) { - static $use_set_names; - - if ( ! isset($use_set_names)) + if ( ! isset($this->use_set_names)) { // mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback - $use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; + $this->use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE; } - if ($use_set_names) + if ($this->use_set_names === TRUE) { return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); } diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 74f55c42..45758249 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -54,6 +54,9 @@ class CI_DB_mysqli_driver extends CI_DB { */ var $delete_hack = TRUE; + // whether SET NAMES must be used to set the character set + var $use_set_names; + // -------------------------------------------------------------------- /** @@ -132,15 +135,13 @@ function db_select() */ function _db_set_charset($charset, $collation) { - static $use_set_names; - - if ( ! isset($use_set_names)) + if ( ! isset($this->use_set_names)) { // mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback - $use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE; + $this->use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE; } - if ($use_set_names) + if ($this->use_set_names === TRUE) { return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); } diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index b3470541..43971774 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -132,7 +132,7 @@

      Explanation of Values:

    90. cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
    91. cachedir - The absolute server path to your database query cache directory.
    92. char_set - The character set used in communicating with the database.
    93. -
    94. dbcollat - The character collation used in communicating with the database.

      Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.

    95. +
    96. dbcollat - The character collation used in communicating with the database.

      Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 (and in table creation queries made with DB Forge). There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.

    97. swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
    98. autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
    99. stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
    100. From f8288849f782e30dc310ca946a577cc664157106 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 20 May 2011 10:35:00 -0500 Subject: [PATCH 2505/2544] fixed missing closing tag in changelog --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ff89a9ae..85df3291 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,6 +67,7 @@

      Version 2.0.3

      • An improvement was made to the MySQL and MySQLi drivers to prevent exposing a potential vector for SQL injection on sites using multi-byte character sets in the database client connection.

        An incompatibility in PHP versions < 5.2.3 and MySQL < 5.0.7 with mysql_set_charset() creates a situation where using multi-byte character sets on these environments may potentially expose a SQL injection attack vector. Latin-1, UTF-8, and other "low ASCII" character sets are unaffected on all environments.

        If you are running or considering running a multi-byte character set for your database connection, please pay close attention to the server environment you are deploying on to ensure you are not vulnerable.

      +
    101. General Changes -

      All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

      +

      All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

      Note: Watermarking is only available using the GD/GD2 library. In addition, even though other libraries are supported, GD is required in -order for the script to calculate the image properties. The image processing, however, will be performed with the +order for the script to calculate the image properties. The image processing, however, will be performed with the library you specify.

      @@ -82,14 +82,14 @@

      Initializing the Class

      using the $this->load->library function:

      $this->load->library('image_lib'); -

      Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

      +

      Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

      Processing an Image

      Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is identical. You will set some preferences corresponding to the action you intend to perform, then -call one of four available processing functions. For example, to create an image thumbnail you'll do this:

      +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

      $config['image_library'] = 'gd2';
      $config['source_image'] = '/path/to/image/mypic.jpg';
      @@ -106,7 +106,7 @@

      Processing an Image

      The above code tells the image_resize function to look for an image called mypic.jpg located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. Since the maintain_ratio option is enabled, the thumb will be as close to the target width and -height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg

      Note: In order for the image class to be allowed to do any processing, the @@ -126,7 +126,7 @@

      Processing Functions

    102. $this->image_lib->clear()
    103. -

      These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +

      These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the error message using this function:

      echo $this->image_lib->display_errors(); @@ -138,7 +138,7 @@

      Processing Functions

          echo $this->image_lib->display_errors();
      }
      -

      Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +

      Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing tags in the function, like this:

      $this->image_lib->display_errors('<p>', '</p>'); @@ -146,11 +146,11 @@

      Processing Functions

      Preferences

      -

      The preferences described below allow you to tailor the image processing to suit your needs.

      +

      The preferences described below allow you to tailor the image processing to suit your needs.

      Note that not all preferences are available for every -function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height -preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

      +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

      Availability Legend:

      @@ -187,7 +187,7 @@

      Preferences

      library_path None None -Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. +Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. R, C, X @@ -195,7 +195,7 @@

      Preferences

      source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. R, C, S, W @@ -203,7 +203,7 @@

      Preferences

      dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. R, C, X, W @@ -221,7 +221,7 @@

      Preferences

      new_image None None -Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. +Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. R, C, X, W @@ -253,7 +253,7 @@

      Preferences

      thumb_marker _thumb None -Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg +Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg R @@ -281,7 +281,7 @@

      Preferences

      rotation_angle None 90, 180, 270, vrt, hor -Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. +Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. X @@ -306,7 +306,7 @@

      Preferences

      Setting preferences in a config file

      If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called image_lib.php, add the $config +Simply create a new file called image_lib.php, add the $config array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

      @@ -319,7 +319,7 @@

      $this->image_lib->resize()

      For practical purposes there is no difference between creating a copy and creating a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

      -

      All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

      +

      All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

      Creating a Thumbnail

      @@ -358,7 +358,7 @@

      $this->image_lib->crop()

      $config['x_axis'] = '100';
      $config['y_axis'] = '40';
      -

      All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

      +

      All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

      Here's an example showing how you might crop an image:

      @@ -378,8 +378,8 @@

      $this->image_lib->crop()

      Note: Without a visual interface it is difficult to crop images, so this function is not very useful -unless you intend to build such an interface. That's exactly what we did using for the photo -gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping area be selected.

      $this->image_lib->rotate()

      @@ -443,7 +443,7 @@

      Watermarking an Image

      Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking involves setting the preferences corresponding to the action you intend to perform, then -calling the watermark function. Here is an example:

      +calling the watermark function. Here is an example:

      $config['source_image'] = '/path/to/image/mypic.jpg';
      @@ -452,9 +452,9 @@

      Watermarking an Image

      $config['wm_font_path'] = './system/fonts/texb.ttf';
      $config['wm_font_size'] = '16';
      $config['wm_font_color'] = 'ffffff';
      -$config['wm_vrt_alignment'] = 'bottom';
      -$config['wm_hor_alignment'] = 'center';
      -$config['wm_padding'] = '20';
      +$config['wm_vrt_alignment'] = 'bottom';
      +$config['wm_hor_alignment'] = 'center';
      +$config['wm_padding'] = '20';

      $this->image_lib->initialize($config);
      @@ -462,7 +462,7 @@

      Watermarking an Image

      $this->image_lib->watermark();
      -

      The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +

      The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

      Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

      @@ -491,14 +491,14 @@

      Watermarking Preferences

      source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. @@ -563,28 +563,28 @@

      Text Preferences

      wm_text None None -The text you would like shown as the watermark. Typically this will be a copyright notice. +The text you would like shown as the watermark. Typically this will be a copyright notice. wm_font_path None None -The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. +The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. wm_font_size 16 None -The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. +The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. wm_font_color ffffff None -The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). +The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 6070b6c4..08b8ab0d 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -70,20 +70,20 @@

      Input Class

      Security Filtering

      -

      The security filtering function is called automatically when a new controller is invoked. It does the following:

      +

      The security filtering function is called automatically when a new controller is invoked. It does the following:

        -
      • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
      • +
      • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
      • Destroys all global variables in the event register_globals is turned on.
      • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
      • -
      • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
      • +
      • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
      • Standardizes newline characters to \n

      XSS Filtering

      -

      The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +

      The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:

      $config['global_xss_filtering'] = TRUE; @@ -93,9 +93,9 @@

      XSS Filtering

      Using POST, COOKIE, or SERVER Data

      -

      CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided +

      CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and -return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

      @@ -128,7 +128,7 @@

      $this->input->post()

      The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

      -

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      +

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      $this->input->post('some_data', TRUE); @@ -179,7 +179,7 @@

      $this->input->server()

      $this->input->set_cookie()

      -

      Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +

      Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: Array Method, and Discrete Parameters:

      Array Method

      @@ -203,10 +203,10 @@

      Array Method

      Only the name and value are required. To delete a cookie set it with the expiration blank.

      -

      The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to +

      The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to zero the cookie will only last as long as the browser is open.

      -

      For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

      +

      For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

      The path is usually not needed since the function sets a root path.

      The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

      The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

      @@ -219,25 +219,25 @@

      Discrete Parameters

      $this->input->cookie()

      -

      Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

      +

      Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

      cookie('some_cookie');

      The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

      -

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      +

      The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

      cookie('some_cookie', TRUE);

      $this->input->ip_address()

      -

      Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

      +

      Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

      echo $this->input->ip_address();

      $this->input->valid_ip($ip)

      -

      Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +

      Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

      if ( ! $this->input->valid_ip($ip))
      @@ -256,7 +256,7 @@

      $this->input->user_agent()

      See the User Agent Class for methods which extract information from the user agent string.

      $this->input->request_headers()

      -

      Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

      +

      Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

      $headers = $this->input->request_headers(); diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index cd3adf1d..4e262279 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -65,11 +65,11 @@

      Initializing the Class

      $this->load->library('javascript'); -

      The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

      +

      The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

      $this->load->library('javascript', array('js_library_driver' => 'scripto', 'autoload' => FALSE)); -

      Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

      +

      Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

      Once loaded, the jQuery library object will be available using: $this->javascript

      Setup and Configuration

      @@ -93,7 +93,7 @@

      The jQuery Class

      $this->load->library('jquery'); -

      You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

      +

      You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

      $this->load->library('jquery', FALSE); @@ -115,7 +115,7 @@

      jQuery Events

      Effects

      -

      The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

      +

      The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

      $this->jquery->effect([optional path] plugin name); // for example @@ -125,8 +125,8 @@

      Effects

      hide() / show()

      Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

      -

      $this->jquery->hide(target, optional speed, optional extra information);
      - $this->jquery->show(target, optional speed, optional extra information);

      +

      $this->jquery->hide(target, optional speed, optional extra information);
      + $this->jquery->show(target, optional speed, optional extra information);

      • "target" will be any valid jQuery selector or selectors.
      • @@ -162,8 +162,8 @@

        animate()

        fadeIn() / fadeOut()

        -

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        - $this->jquery->fadeOut(target, optional speed, optional extra information);

        +

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        + $this->jquery->fadeOut(target, optional speed, optional extra information);

        • "target" will be any valid jQuery selector or selectors.
        • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
        • @@ -182,8 +182,8 @@

          toggleClass()

          fadeIn() / fadeOut()

          These effects cause an element(s) to disappear or reappear over time.

          -

          $this->jquery->fadeIn(target, optional speed, optional extra information);
          - $this->jquery->fadeOut(target, optional speed, optional extra information);

          +

          $this->jquery->fadeIn(target, optional speed, optional extra information);
          + $this->jquery->fadeOut(target, optional speed, optional extra information);

          • "target" will be any valid jQuery selector or selectors.
          • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
          • @@ -193,9 +193,9 @@

            fadeIn() / fadeOut()

            slideUp() / slideDown() / slideToggle()

            These effects cause an element(s) to slide.

            -

            $this->jquery->slideUp(target, optional speed, optional extra information);
            - $this->jquery->slideDown(target, optional speed, optional extra information);
            -$this->jquery->slideToggle(target, optional speed, optional extra information);

            +

            $this->jquery->slideUp(target, optional speed, optional extra information);
            + $this->jquery->slideDown(target, optional speed, optional extra information);
            +$this->jquery->slideToggle(target, optional speed, optional extra information);

            • "target" will be any valid jQuery selector or selectors.
            • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
            • diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 1b253fa0..75863c2a 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -60,30 +60,30 @@

              Language Class

              The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

              -

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create +

              In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.

              -

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your application/language -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +

              Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside +your application folder and store them there. CodeIgniter will look first in your application/language +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

              -

              Note:  Each language should be stored in its own folder. For example, the English files are located at: +

              Note:  Each language should be stored in its own folder. For example, the English files are located at: system/language/english

              Creating Language Files

              -

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: error_lang.php

              +

              Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

              Within the file you will assign each line of text to an array called $lang with this prototype:

              $lang['language_key'] = "The actual message to be shown";

              Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              +similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

              $lang['error_email_missing'] = "You must submit an email address";
              $lang['error_url_missing'] = "You must submit a URL";
              @@ -92,12 +92,12 @@

              Creating Language Files

              Loading A Language File

              -

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              +

              In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

              $this->lang->load('filename', 'language');

              Where filename is the name of the file you wish to load (without the file extension), and language -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your application/config/config.php file will be used.

              @@ -109,7 +109,7 @@

              Fetching a Line of Text

              Where language_key is the array key corresponding to the line you wish to show.

              -

              Note: This function simply returns the line. It does not echo it for you.

              +

              Note: This function simply returns the line. It does not echo it for you.

              Using language lines as form labels

              diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 50ec60c1..1d93af5e 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -58,7 +58,7 @@

              Loader Class

              -

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +

              Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, Helpers, Models, or your own files.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -69,7 +69,7 @@

              Loader Class

              $this->load->library('class_name', $config, 'object name')

              -

              This function is used to load core classes. Where class_name is the name of the class you want to load. +

              This function is used to load core classes. Where class_name is the name of the class you want to load. Note: We use the terms "class" and "library" interchangeably.

              For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

              @@ -96,7 +96,7 @@

              $this->load->library('class_name', $config, 'ob

              Setting options

              -

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              +

              The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

              $config = array (
              @@ -113,7 +113,7 @@

              Setting options

              Assigning a Library to a different object name

              -

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it +

              If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named Session, it will be assigned to a variable named $this->session.

              If you prefer to set your own class names you can pass its value to the third parameter:

              @@ -131,20 +131,20 @@

              Assigning a Library to a different object name

              $this->load->view('file_name', $data, true/false)

              -

              This function is used to load your View files. If you haven't read the Views section of the +

              This function is used to load your View files. If you haven't read the Views section of the user guide it is recommended that you do since it shows you how this function is typically used.

              -

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              +

              The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

              The second optional parameter can take an associative array or an object as input, which it runs through the PHP extract function to -convert to variables that can be used in your view files. Again, read the Views page to learn +convert to variables that can be used in your view files. Again, read the Views page to learn how this might be useful.

              The third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

              +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

              $string = $this->load->view('myfile', '', true); @@ -159,7 +159,7 @@

              $this->load->model('Model_name');


              $this->fubar->function();

              $this->load->database('options', true/false)

              -

              This function lets you load the database class. The two parameters are optional. Please see the +

              This function lets you load the database class. The two parameters are optional. Please see the database section for more info.

              @@ -168,9 +168,9 @@

              $this->load->database('options', true/false)

              $this->load->vars($array)

              This function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

              @@ -180,7 +180,7 @@

              $this->load->helper('file_name')

              $this->load->file('filepath/filename', true/false)

              -

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +

              This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) it will instead return the data as a string.

              @@ -194,7 +194,7 @@

              $this->load->config('file_name')

              Application "Packages"

              -

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              +

              An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

              Sample Package "Foo Bar" Directory Map

              @@ -210,18 +210,18 @@

              Sample Package "Foo Bar" Directory Map

              models/
              -

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              +

              Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

              $this->load->add_package_path()

              -

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              +

              Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

              $this->load->add_package_path(APPPATH.'third_party/foo_bar/');
              $this->load->library('foo_bar');

              $this->load->remove_package_path()

              -

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              +

              When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

              $this->load->remove_package_path()

              @@ -231,8 +231,8 @@

              $this->load->remove_package_path()

              Package view files

              -

              By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

              -

              In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

              +

              By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

              +

              In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

              $this->load->add_package_path(APPPATH.'my_app', TRUE);
              diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 8846e15f..4d1f8d97 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -58,7 +58,7 @@

              Output Class

              -

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +

              The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is also responsible for caching your web pages, if you use that feature.

              Note: This class is initialized automatically by the system so there is no need to do it manually.

              @@ -70,7 +70,7 @@

              Output Class

              $this->output->set_output();

              -

              Permits you to manually set the final output string. Usage example:

              +

              Permits you to manually set the final output string. Usage example:

              $this->output->set_output($data); @@ -95,7 +95,7 @@

              $this->output->set_content_type();

              $this->output->get_output();

              -

              Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

              +

              Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

              $string = $this->output->get_output();

              Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the @@ -104,7 +104,7 @@

              $this->output->get_output();

              $this->output->append_output();

              -

              Appends data onto the output string. Usage example:

              +

              Appends data onto the output string. Usage example:

              $this->output->append_output($data); @@ -112,7 +112,7 @@

              $this->output->append_output();

              $this->output->set_header();

              -

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              +

              Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

              $this->output->set_header("HTTP/1.0 200 OK");
              @@ -125,10 +125,10 @@

              $this->output->set_header();

              $this->output->set_status_header(code, 'text');

              -

              Permits you to manually set a server status header. Example:

              +

              Permits you to manually set a server status header. Example:

              $this->output->set_status_header('401');
              -// Sets the header as: Unauthorized
              +// Sets the header as: Unauthorized

              See here for a full list of headers.

              @@ -147,14 +147,14 @@

              $this->output->enable_profiler();

              $this->output->set_profiler_sections();

              -

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              +

              Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

              $this->output->cache();

              -

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              +

              The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

              Parsing Execution Variables

              -

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. +

              CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. $this->output->parse_exec_vars = FALSE; diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index a6b9287a..3c366a69 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -72,26 +72,26 @@

              Example

              $this->load->library('pagination');

              $config['base_url'] = 'http://example.com/index.php/test/page/';
              $config['total_rows'] = 200;
              -$config['per_page'] = 20; +$config['per_page'] = 20;

              $this->pagination->initialize($config);

              -echo $this->pagination->create_links();
              +echo $this->pagination->create_links();

              Notes:

              -

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

              +

              The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

                -
              • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can +
              • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
              • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
              • -
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
              • +
              • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

              The create_links() function returns an empty string when there is no pagination to show.

              @@ -100,7 +100,7 @@

              Notes:

              Setting preferences in a config file

              If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called pagination.php, add the $config +Simply create a new file called pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

              @@ -122,9 +122,9 @@

              $config['num_links'] = 2;

              $config['page_query_string'] = TRUE

              By default, the pagination library assume you are using URI Segments, and constructs your links something like

              http://example.com/index.php/test/page/20

              -

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              +

              If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

              http://example.com/index.php?c=test&m=page&per_page=20

              -

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              +

              Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

              Adding Enclosing Markup

              If you would like to surround the entire pagination with some markup you can do it with these two prefs:

              diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 4f04aaf4..cb2f100a 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -83,10 +83,10 @@

              Template Parser Class

              PHP from your templates (view files).

              Note: CodeIgniter does not require you to use this class -since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if they work with designers who they feel would find some confusion working with PHP.

              -

              Also Note: The Template Parser Class is not a +

              Also Note: The Template Parser Class is not a full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

              @@ -102,7 +102,7 @@

              Initializing the Class

              $this->parser->parse()

              -

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

              +

              This method accepts a template name and data array as input, and it generates a parsed version. Example:

              $this->load->library('parser');

              @@ -114,11 +114,11 @@

              $this->parser->parse()

              $this->parser->parse('blog_template', $data);

              The first parameter contains the name of the view file (in this example the file would be called blog_template.php), -and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the template would contain two variables: {blog_title} and {blog_heading}

              -

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically -passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +

              There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can pass TRUE (boolean) to the third parameter:

              $string = $this->parser->parse('blog_template', $data, TRUE); @@ -130,8 +130,8 @@

              $this->parser->parse_string()

              Variable Pairs

              -

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be -repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              +

              The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

              <html>
              <head>
              diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 0cb1d0cb..73518745 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -63,11 +63,11 @@

              Security Class

              XSS Filtering

              CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

              The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

              Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

              @@ -88,7 +88,7 @@

              $this->security->xss_clean()

              Note: If you use the form validation class, it gives you the option of XSS filtering as well.

              -

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              +

              An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

              if ($this->security->xss_clean($file, TRUE) === FALSE)
              {
              @@ -98,7 +98,7 @@

              $this->security->xss_clean()

              $this->security->sanitize_filename()

              -

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              +

              When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

              $filename = $this->security->sanitize_filename($this->input->post('filename')); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index bb8f1fc9..a6f3c601 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -61,7 +61,7 @@

              Session Class

              The Session class permits you maintain a user's "state" and track their activity while they browse your site. The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to use the database option you'll need to create the session table as indicated below.

              @@ -93,8 +93,8 @@

              How do Sessions work?

              If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

              -

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +

              It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

              @@ -106,7 +106,7 @@

              What is Session Data?

            • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
            • The user's IP Address
            • The user's User Agent data (the first 50 characters of the browser data string)
            • -
            • The "last activity" time stamp.
            • +
            • The "last activity" time stamp.

            The above data is stored in a cookie as a serialized array with this prototype:

            @@ -124,7 +124,7 @@

            What is Session Data?

            can be found here, although the Session class will take care of initializing and encrypting the data automatically.

            -

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +

            Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time the cookie was written. This time is configurable by changing the $config['sess_time_to_update'] line in your system/config/config.php file.

            @@ -134,7 +134,7 @@

            Retrieving Session Data

            $this->session->userdata('item'); -

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +

            Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you will do this:

            $session_id = $this->session->userdata('session_id'); @@ -145,7 +145,7 @@

            Retrieving Session Data

            Adding Custom Session Data

            A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

            +Why would you want to do this? Here's one example:

            Let's say a particular user logs into your site. Once authenticated, you could add their username and email address to the session cookie, making that data globally available to you without @@ -155,7 +155,7 @@

            Adding Custom Session Data

            $this->session->set_userdata($array); -

            Where $array is an associative array containing your new data. Here's an example:

            +

            Where $array is an associative array containing your new data. Here's an example:

            $newdata = array(
            @@ -167,7 +167,7 @@

            Adding Custom Session Data

            $this->session->set_userdata($newdata);

            If you want to add userdata one value at a time, set_userdata() also supports this syntax.

            $this->session->set_userdata('some_name', 'some_value');

            -

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +

            Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

            Retrieving All Session Data

            @@ -179,10 +179,10 @@

            Retrieving All Session Data

             Array
             (
            -  [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            -  [ip_address] => 127.0.0.1
            -  [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            -  [last_activity] => 1303142623
            +    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
            +    [ip_address] => 127.0.0.1
            +    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
            +    [last_activity] => 1303142623
             )
             
            @@ -206,20 +206,20 @@

            Flashdata

            $this->session->keep_flashdata('item');

            Saving Session Data to a Database

            While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session could be restored by a user modifying their cookies.

            When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never be updated, they can only be generated when a new session is created.

            -

            In order to store sessions, you must first create a database table for this purpose. Here is the basic +

            In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

            -

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            +

            Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

            The Server

            @@ -381,7 +381,7 @@

            The Server

            $response = array( array( - 'you_said' => $parameters['0'], + 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); @@ -452,7 +452,7 @@

            $this->xmlrpc->request()

            $this->xmlrpc->request($request);

            $this->xmlrpc->send_request()

            -

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            +

            The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

            $this->xmlrpc->set_debug(TRUE);

            Enables debugging, which will display a variety of information and error data helpful during development.

            @@ -463,7 +463,7 @@

            $this->xmlrpc->display_error()

            echo $this->xmlrpc->display_error();

            $this->xmlrpc->display_response()

            -

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            +

            Returns the response from the remote server once request is received. The response will typically be an associative array.

            $this->xmlrpc->display_response();

            $this->xmlrpc->send_error_message()

            diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 2fc5fd81..03112660 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -81,7 +81,7 @@

            Usage Example

            // Write the zip file to a folder on your server. Name it "my_backup.zip"
            $this->zip->archive('/path/to/directory/my_backup.zip');

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');
            @@ -100,7 +100,7 @@

            $this->zip->add_data()

            You are allowed multiple calls to this function in order to -add several files to your archive. Example:

            +add several files to your archive. Example:

            $name = 'mydata1.txt';
            @@ -139,8 +139,8 @@

            $this->zip->add_data()

            $this->zip->add_dir()

            -

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when -using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            +

            Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when +using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

            $this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" @@ -148,49 +148,49 @@

            $this->zip->add_dir()

            $this->zip->read_file()

            -

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will +

            Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the -second parameter. Example:

            +second parameter. Example:

            $path = '/path/to/photo.jpg';

            $this->zip->read_file($path, TRUE);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');
            -

            In the above example, photo.jpg will be placed inside two folders: path/to/

            +

            In the above example, photo.jpg will be placed inside two folders: path/to/

            $this->zip->read_dir()

            -

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the -directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encoded, as will any sub-folders contained within it. Example:

            +

            Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the +supplied path will be encoded, as will any sub-folders contained within it. Example:

            $path = '/path/to/your/directory/';

            $this->zip->read_dir($path);

            - // Download the file to your desktop. Name it "my_backup.zip"
            + // Download the file to your desktop. Name it "my_backup.zip"
            $this->zip->download('my_backup.zip');

            By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored -you can pass FALSE (boolean) in the second parameter. Example:

            +you can pass FALSE (boolean) in the second parameter. Example:

            $path = '/path/to/your/directory/';

            @@ -204,7 +204,7 @@

            $this->zip->read_dir()

            $this->zip->archive()

            -

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the +

            Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (666 or 777 is usually OK). Example:

            $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip @@ -223,7 +223,7 @@

            $this->zip->download()

            $this->zip->get_zip()

            -

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. +

            Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. Example:

            diff --git a/user_guide/license.html b/user_guide/license.html index ecc5b500..8f53851a 100644 --- a/user_guide/license.html +++ b/user_guide/license.html @@ -63,7 +63,7 @@

            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.

            +

            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:

            diff --git a/user_guide/nav/hacks.txt b/user_guide/nav/hacks.txt index 183481b7..8c17f008 100644 --- a/user_guide/nav/hacks.txt +++ b/user_guide/nav/hacks.txt @@ -1,6 +1,6 @@ I did the following hack in moo.fx.js: -At line 79 in the toggle: function() function, I added: +At line 79 in the toggle: function() function, I added: document.getElementById('nav').style.display = 'block'; diff --git a/user_guide/nav/moo.fx.js b/user_guide/nav/moo.fx.js index b21ee20e..256371d1 100755 --- a/user_guide/nav/moo.fx.js +++ b/user_guide/nav/moo.fx.js @@ -25,8 +25,8 @@ fx.Base.prototype = { }, step: function() { - var time = (new Date).getTime(); - var Tpos = (time - this.startTime) / (this.duration); + var time = (new Date).getTime(); + var Tpos = (time - this.startTime) / (this.duration); if (time >= this.duration+this.startTime) { this.now = this.to; clearInterval (this.timer); diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js index 857faae4..e6c36227 100755 --- a/user_guide/nav/prototype.lite.js +++ b/user_guide/nav/prototype.lite.js @@ -1,9 +1,9 @@ -/* Prototype JavaScript framework - * (c) 2005 Sam Stephenson +/* Prototype JavaScript framework + * (c) 2005 Sam Stephenson * - * Prototype is freely distributable under the terms of an MIT-style license. + * Prototype is freely distributable under the terms of an MIT-style license. * - * For details, see the Prototype web site: http://prototype.conio.net/ + * For details, see the Prototype web site: http://prototype.conio.net/ * /*--------------------------------------------------------------------------*/ @@ -11,117 +11,117 @@ //note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net). var Class = { - create: function() { + create: function() { return function() { - this.initialize.apply(this, arguments); + this.initialize.apply(this, arguments); } - } + } } Object.extend = function(destination, source) { - for (property in source) { + for (property in source) { destination[property] = source[property]; - } - return destination; + } + return destination; } Function.prototype.bind = function(object) { - var __method = this; - return function() { + var __method = this; + return function() { return __method.apply(object, arguments); - } + } } function $() { - var elements = new Array(); + var elements = new Array(); - for (var i = 0; i < arguments.length; i++) { + for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') - element = document.getElementById(element); + element = document.getElementById(element); if (arguments.length == 1) - return element; + return element; elements.push(element); - } + } - return elements; + return elements; } //------------------------- document.getElementsByClassName = function(className) { - var children = document.getElementsByTagName('*') || document.all; - var elements = new Array(); + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); - for (var i = 0; i < children.length; i++) { + for (var i = 0; i < children.length; i++) { var child = children[i]; var classNames = child.className.split(' '); for (var j = 0; j < classNames.length; j++) { - if (classNames[j] == className) { + if (classNames[j] == className) { elements.push(child); break; - } + } } - } + } - return elements; + return elements; } //------------------------- if (!window.Element) { - var Element = new Object(); + var Element = new Object(); } Object.extend(Element, { - remove: function(element) { + remove: function(element) { element = $(element); element.parentNode.removeChild(element); - }, + }, - hasClassName: function(element, className) { + hasClassName: function(element, className) { element = $(element); if (!element) - return; + return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] == className) + if (a[i] == className) return true; } return false; - }, + }, - addClassName: function(element, className) { + addClassName: function(element, className) { element = $(element); Element.removeClassName(element, className); element.className += ' ' + className; - }, + }, - removeClassName: function(element, className) { + removeClassName: function(element, className) { element = $(element); if (!element) - return; + return; var newClassName = ''; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { - if (a[i] != className) { + if (a[i] != className) { if (i > 0) - newClassName += ' '; + newClassName += ' '; newClassName += a[i]; - } + } } element.className = newClassName; - }, + }, - // removes whitespace-only text node children - cleanWhitespace: function(element) { + // removes whitespace-only text node children + cleanWhitespace: function(element) { element = $(element); for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node); } - } + } }); \ No newline at end of file diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html index 3b1c42e4..bcbc43ff 100644 --- a/user_guide/overview/appflow.html +++ b/user_guide/overview/appflow.html @@ -67,7 +67,7 @@

            Application Flow Chart

          • The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter.
          • The Router examines the HTTP request to determine what should be done with it.
          • If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
          • -
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • +
          • Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
          • The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
          • The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.
          • diff --git a/user_guide/overview/at_a_glance.html b/user_guide/overview/at_a_glance.html index 1175e7f4..b6b81d76 100644 --- a/user_guide/overview/at_a_glance.html +++ b/user_guide/overview/at_a_glance.html @@ -60,7 +60,7 @@

            CodeIgniter at a Glance

            CodeIgniter is an Application Framework

            -

            CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code +

            CodeIgniter is a toolkit for people who build web applications 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.

            @@ -70,7 +70,7 @@

            CodeIgniter is Free

            For more information please read the license agreement.

            CodeIgniter is Light Weight

            -

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. +

            Truly light weight. The core system requires only a few very small libraries. This is in stark contrast to many frameworks that require significantly more resources. Additional libraries are loaded dynamically upon request, based on your needs for a given process, so the base system is very lean and quite fast.

            @@ -84,7 +84,7 @@

            CodeIgniter Uses M-V-C

            This is particularly good for projects in which designers are working with your template files, as the code these file contain will be minimized. We describe MVC in more detail on its own page.

            CodeIgniter Generates Clean URLs

            -

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" +

            The URLs generated by CodeIgniter are clean and search-engine friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

            example.com/news/article/345 @@ -92,7 +92,7 @@

            CodeIgniter Generates Clean URLs

            Note: By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

            CodeIgniter Packs a Punch

            -

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, +

            CodeIgniter comes with full-range of libraries that enable the most commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

            @@ -104,7 +104,7 @@

            CodeIgniter Does Not Require a Template Engine

            Although CodeIgniter does come with a simple template parser that can be optionally used, it does not force you to use one. Template engines simply can not match the performance of native PHP, and the syntax that must be learned to use a template -engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            +engine is usually only marginally easier than learning the basics of PHP. Consider this block of PHP code:

            <ul>

            @@ -133,7 +133,7 @@

            CodeIgniter Does Not Require a Template Engine

            CodeIgniter is Thoroughly Documented

            -

            Programmers love to code and hate to write documentation. We're no different, of course, but +

            Programmers love to code and hate to write documentation. We're no different, of course, but since documentation is as important as the code itself, we are committed to doing it. Our source code is extremely clean and well commented as well.

            diff --git a/user_guide/overview/features.html b/user_guide/overview/features.html index 4209463b..e20219e0 100644 --- a/user_guide/overview/features.html +++ b/user_guide/overview/features.html @@ -59,10 +59,10 @@

            CodeIgniter Features

            Features in and of themselves are a very poor way to judge an application since they tell you nothing -about the user experience, or how intuitively or intelligently it is designed. Features +about the user experience, or how intuitively or intelligently it is designed. Features don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. Installing -CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            +CodeIgniter is child's play so we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features.

            • Model-View-Controller Based System
            • @@ -73,7 +73,7 @@

              CodeIgniter Features

            • Security and XSS Filtering
            • Session Management
            • Email Sending Class. Supports Attachments, HTML/Text email, multiple protocols (sendmail, SMTP, and Mail) and more.
            • -
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • +
            • Image Manipulation Library (cropping, resizing, rotating, etc.). Supports GD, ImageMagick, and NetPBM
            • File Uploading Class
            • FTP Class
            • Localization
            • diff --git a/user_guide/overview/getting_started.html b/user_guide/overview/getting_started.html index 16833264..f120913f 100644 --- a/user_guide/overview/getting_started.html +++ b/user_guide/overview/getting_started.html @@ -57,7 +57,7 @@

              Getting Started With CodeIgniter

              -

              Any software application requires some effort to learn. We've done our best to minimize the learning +

              Any software application requires some effort to learn. We've done our best to minimize the learning curve while making the process as enjoyable as possible.

              diff --git a/user_guide/overview/goals.html b/user_guide/overview/goals.html index 7f1f7678..754ecaae 100644 --- a/user_guide/overview/goals.html +++ b/user_guide/overview/goals.html @@ -67,9 +67,9 @@

              Design and Architectural Goals

              From a technical and architectural standpoint, CodeIgniter was created with the following objectives:

                -
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • -
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • -
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.
              • +
              • Dynamic Instantiation. In CodeIgniter, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
              • +
              • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
              • +
              • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In CodeIgniter, each class and its functions are highly autonomous in order to allow maximum usefulness.

              CodeIgniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

              diff --git a/user_guide/overview/mvc.html b/user_guide/overview/mvc.html index 9eb327a9..91cf6497 100644 --- a/user_guide/overview/mvc.html +++ b/user_guide/overview/mvc.html @@ -60,12 +60,12 @@

              Model-View-Controller

              CodeIgniter is based on the Model-View-Controller development pattern. -MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              +MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

              • The Model represents your data structures. Typically your model classes will contain functions that help you -retrieve, insert, and update information in your database.
              • -
              • The View is the information that is being presented to a user. A View will normally be a web page, but +retrieve, insert, and update information in your database.
              • +
              • The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
              • The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
              • diff --git a/user_guide/userguide.css b/user_guide/userguide.css index b08f4fb0..f93ff0d7 100644 --- a/user_guide/userguide.css +++ b/user_guide/userguide.css @@ -391,7 +391,7 @@ form { .select { background-color: #fff; - font-size: 11px; + font-size: 11px; font-weight: normal; color: #333; padding: 0; From 26675f6426a288af220669ef88bc37d3392f50eb Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 3 Jul 2011 07:21:47 -0500 Subject: [PATCH 2508/2544] reverted texb.ttf font which had been compromised in 982b43c3590a by another massive whitespace 'cleanup' commit --- system/fonts/texb.ttf | Bin 152992 -> 143830 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/system/fonts/texb.ttf b/system/fonts/texb.ttf index 6792342a33277106ecd28a130476b2aeb0983af2..383c88b86b7c17e2e284732af48b2bfc359647ae 100644 GIT binary patch delta 59402 zcmeFZ2bfjm)i!*d-FrK|_crHD@11Ed%rL+Vy)#M^DS{0}nV|@%5rGF7A=ap12kZqE zBG%Xwqlr4GF^R^O^2Qit_I&FMsLA`Lyzlpa-*x@}b^VhFoIPhh`>AW)>t6TTH{Qwr z{8wC`1z9W>!P0LbEujgM3QJsF$!5567yLK%%;ml3{9@9t&bC+(WwB7g;$;^t+VJ6r zeHII?SqOdCl7+ns-rQV7SqR@z_ZE6+Xez>K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H<)+{#(O-UucY) zM|P`a$O+umnF;fc>ZN8u8F|u{_0)YV0TOussij_vF&2wogMWIm}wR+8*h^bbg{Z+bn+wI#Gk4j z`=Q^Ll#aGfMuQzylYh|1hfTweIViCPzHw}F>%1vhuaXZ3tuO7AT6UXK8OT(5xgcgE zNMQB$S0)w8W76IH-eJ1r@Z>HL)6ubRB_n_U-9RGx^spm6XBXdIv?EZK3K_`~Vn?*h z-0<`b59`19%zK2{qO1=}d^jH)wo`IHYaODc%eDaAckD7I)iQgnE9Kf%B8|Ti0emb7 zNF%{pK)2jO110|AV}4^t%p|u};wD#TG^H!ujfVkAShpZh@cBH?Rw=-iB6HMEo=JB0 zJZRnbt!tOTq{YKtaotPzr+9{#?T9^cxFlS_2yVq$BFpT(uPzs{z6T-=y6NDg*&o%?reh)`xh`Q^5hA}7u6+2<< z?Qk?%=ln+!DnCCR27}fLZ|bb(Jue56ZjI(>pX`vSF)j)i&rKqgaq{KQbvy4W0pc7}4M_dqa1E<-CrDMKfJJZXgUOVrGM{O2a;SDf#rel^DVcYe-~ Hbw>R!N From 9789f321cd52139d36d1479f07fff3897be48107 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 15 Jul 2011 15:14:05 -0600 Subject: [PATCH 2509/2544] Was working on this file so PHP5ified the method visibility scopes. Pointless, but was adding... --- system/database/DB_active_rec.php | 260 ++++++++++++------------------ 1 file changed, 106 insertions(+), 154 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 52bad260..7ddf20d0 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -69,11 +69,10 @@ class CI_DB_active_record extends CI_DB_driver { * * Generates the SELECT portion of the query * - * @access public * @param string * @return object */ - function select($select = '*', $escape = NULL) + public function select($select = '*', $escape = NULL) { if (is_string($select)) { @@ -107,12 +106,11 @@ function select($select = '*', $escape = NULL) * * Generates a SELECT MAX(field) portion of a query * - * @access public * @param string the field * @param string an alias * @return object */ - function select_max($select = '', $alias = '') + public function select_max($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'MAX'); } @@ -124,12 +122,11 @@ function select_max($select = '', $alias = '') * * Generates a SELECT MIN(field) portion of a query * - * @access public * @param string the field * @param string an alias * @return object */ - function select_min($select = '', $alias = '') + public function select_min($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'MIN'); } @@ -141,12 +138,11 @@ function select_min($select = '', $alias = '') * * Generates a SELECT AVG(field) portion of a query * - * @access public * @param string the field * @param string an alias * @return object */ - function select_avg($select = '', $alias = '') + public function select_avg($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'AVG'); } @@ -158,12 +154,11 @@ function select_avg($select = '', $alias = '') * * Generates a SELECT SUM(field) portion of a query * - * @access public * @param string the field * @param string an alias * @return object */ - function select_sum($select = '', $alias = '') + public function select_sum($select = '', $alias = '') { return $this->_max_min_avg_sum($select, $alias, 'SUM'); } @@ -178,12 +173,11 @@ function select_sum($select = '', $alias = '') * select_avg() * select_sum() * - * @access public * @param string the field * @param string an alias * @return object */ - function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') + protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') { if ( ! is_string($select) OR $select == '') { @@ -220,11 +214,10 @@ function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX') /** * Determines the alias name based on the table * - * @access private * @param string * @return string */ - function _create_alias_from_table($item) + protected function _create_alias_from_table($item) { if (strpos($item, '.') !== FALSE) { @@ -241,11 +234,10 @@ function _create_alias_from_table($item) * * Sets a flag which tells the query string compiler to add DISTINCT * - * @access public * @param bool * @return object */ - function distinct($val = TRUE) + public function distinct($val = TRUE) { $this->ar_distinct = (is_bool($val)) ? $val : TRUE; return $this; @@ -258,11 +250,10 @@ function distinct($val = TRUE) * * Generates the FROM portion of the query * - * @access public * @param mixed can be a string or array * @return object */ - function from($from) + public function from($from) { foreach ((array)$from as $val) { @@ -311,13 +302,12 @@ function from($from) * * Generates the JOIN portion of the query * - * @access public * @param string * @param string the join condition * @param string the type of join * @return object */ - function join($table, $cond, $type = '') + public function join($table, $cond, $type = '') { if ($type != '') { @@ -367,12 +357,11 @@ function join($table, $cond, $type = '') * Generates the WHERE portion of the query. Separates * multiple calls with AND * - * @access public * @param mixed * @param mixed * @return object */ - function where($key, $value = NULL, $escape = TRUE) + public function where($key, $value = NULL, $escape = TRUE) { return $this->_where($key, $value, 'AND ', $escape); } @@ -385,12 +374,11 @@ function where($key, $value = NULL, $escape = TRUE) * Generates the WHERE portion of the query. Separates * multiple calls with OR * - * @access public * @param mixed * @param mixed * @return object */ - function or_where($key, $value = NULL, $escape = TRUE) + public function or_where($key, $value = NULL, $escape = TRUE) { return $this->_where($key, $value, 'OR ', $escape); } @@ -400,15 +388,14 @@ function or_where($key, $value = NULL, $escape = TRUE) /** * Where * - * Called by where() or orwhere() + * Called by where() or or_where() * - * @access private * @param mixed * @param mixed * @param string * @return object */ - function _where($key, $value = NULL, $type = 'AND ', $escape = NULL) + protected function _where($key, $value = NULL, $type = 'AND ', $escape = NULL) { if ( ! is_array($key)) { @@ -471,12 +458,11 @@ function _where($key, $value = NULL, $type = 'AND ', $escape = NULL) * Generates a WHERE field IN ('item', 'item') SQL query joined with * AND if appropriate * - * @access public * @param string The field to search * @param array The values searched on * @return object */ - function where_in($key = NULL, $values = NULL) + public function where_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values); } @@ -489,12 +475,11 @@ function where_in($key = NULL, $values = NULL) * Generates a WHERE field IN ('item', 'item') SQL query joined with * OR if appropriate * - * @access public * @param string The field to search * @param array The values searched on * @return object */ - function or_where_in($key = NULL, $values = NULL) + public function or_where_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values, FALSE, 'OR '); } @@ -507,12 +492,11 @@ function or_where_in($key = NULL, $values = NULL) * Generates a WHERE field NOT IN ('item', 'item') SQL query joined * with AND if appropriate * - * @access public * @param string The field to search * @param array The values searched on * @return object */ - function where_not_in($key = NULL, $values = NULL) + public function where_not_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values, TRUE); } @@ -525,12 +509,11 @@ function where_not_in($key = NULL, $values = NULL) * Generates a WHERE field NOT IN ('item', 'item') SQL query joined * with OR if appropriate * - * @access public * @param string The field to search * @param array The values searched on * @return object */ - function or_where_not_in($key = NULL, $values = NULL) + public function or_where_not_in($key = NULL, $values = NULL) { return $this->_where_in($key, $values, TRUE, 'OR '); } @@ -542,14 +525,13 @@ function or_where_not_in($key = NULL, $values = NULL) * * Called by where_in, where_in_or, where_not_in, where_not_in_or * - * @access public * @param string The field to search * @param array The values searched on * @param boolean If the statement would be IN or NOT IN * @param string * @return object */ - function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') + protected function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') { if ($key === NULL OR $values === NULL) { @@ -592,12 +574,11 @@ function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ') * Generates a %LIKE% portion of the query. Separates * multiple calls with AND * - * @access public * @param mixed * @param mixed * @return object */ - function like($field, $match = '', $side = 'both') + public function like($field, $match = '', $side = 'both') { return $this->_like($field, $match, 'AND ', $side); } @@ -610,12 +591,11 @@ function like($field, $match = '', $side = 'both') * Generates a NOT LIKE portion of the query. Separates * multiple calls with AND * - * @access public * @param mixed * @param mixed * @return object */ - function not_like($field, $match = '', $side = 'both') + public function not_like($field, $match = '', $side = 'both') { return $this->_like($field, $match, 'AND ', $side, 'NOT'); } @@ -628,12 +608,11 @@ function not_like($field, $match = '', $side = 'both') * Generates a %LIKE% portion of the query. Separates * multiple calls with OR * - * @access public * @param mixed * @param mixed * @return object */ - function or_like($field, $match = '', $side = 'both') + public function or_like($field, $match = '', $side = 'both') { return $this->_like($field, $match, 'OR ', $side); } @@ -646,12 +625,11 @@ function or_like($field, $match = '', $side = 'both') * Generates a NOT LIKE portion of the query. Separates * multiple calls with OR * - * @access public * @param mixed * @param mixed * @return object */ - function or_not_like($field, $match = '', $side = 'both') + public function or_not_like($field, $match = '', $side = 'both') { return $this->_like($field, $match, 'OR ', $side, 'NOT'); } @@ -663,13 +641,12 @@ function or_not_like($field, $match = '', $side = 'both') * * Called by like() or orlike() * - * @access private * @param mixed * @param mixed * @param string * @return object */ - function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') + protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') { if ( ! is_array($field)) { @@ -719,11 +696,10 @@ function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') /** * GROUP BY * - * @access public * @param string * @return object */ - function group_by($by) + public function group_by($by) { if (is_string($by)) { @@ -755,12 +731,11 @@ function group_by($by) * * Separates multiple calls with AND * - * @access public * @param string * @param string * @return object */ - function having($key, $value = '', $escape = TRUE) + public function having($key, $value = '', $escape = TRUE) { return $this->_having($key, $value, 'AND ', $escape); } @@ -772,12 +747,11 @@ function having($key, $value = '', $escape = TRUE) * * Separates multiple calls with OR * - * @access public * @param string * @param string * @return object */ - function or_having($key, $value = '', $escape = TRUE) + public function or_having($key, $value = '', $escape = TRUE) { return $this->_having($key, $value, 'OR ', $escape); } @@ -789,12 +763,11 @@ function or_having($key, $value = '', $escape = TRUE) * * Called by having() or or_having() * - * @access private * @param string * @param string * @return object */ - function _having($key, $value = '', $type = 'AND ', $escape = TRUE) + protected function _having($key, $value = '', $type = 'AND ', $escape = TRUE) { if ( ! is_array($key)) { @@ -836,12 +809,11 @@ function _having($key, $value = '', $type = 'AND ', $escape = TRUE) /** * Sets the ORDER BY value * - * @access public * @param string * @param string direction: asc or desc * @return object */ - function order_by($orderby, $direction = '') + public function order_by($orderby, $direction = '') { if (strtolower($direction) == 'random') { @@ -892,12 +864,11 @@ function order_by($orderby, $direction = '') /** * Sets the LIMIT value * - * @access public * @param integer the limit value * @param integer the offset value * @return object */ - function limit($value, $offset = '') + public function limit($value, $offset = '') { $this->ar_limit = $value; @@ -914,11 +885,10 @@ function limit($value, $offset = '') /** * Sets the OFFSET value * - * @access public * @param integer the offset value * @return object */ - function offset($offset) + public function offset($offset) { $this->ar_offset = $offset; return $this; @@ -929,13 +899,12 @@ function offset($offset) /** * The "set" function. Allows key/value pairs to be set for inserting or updating * - * @access public * @param mixed * @param string * @param boolean * @return object */ - function set($key, $value = '', $escape = TRUE) + public function set($key, $value = '', $escape = TRUE) { $key = $this->_object_to_array($key); @@ -967,13 +936,12 @@ function set($key, $value = '', $escape = TRUE) * Compiles the select statement based on the other functions called * and runs the query * - * @access public * @param string the table * @param string the limit clause * @param string the offset clause * @return object */ - function get($table = '', $limit = null, $offset = null) + public function get($table = '', $limit = null, $offset = null) { if ($table != '') { @@ -999,11 +967,10 @@ function get($table = '', $limit = null, $offset = null) * Generates a platform-specific query string that counts all records * returned by an Active Record query. * - * @access public * @param string * @return string */ - function count_all_results($table = '') + public function count_all_results($table = '') { if ($table != '') { @@ -1032,13 +999,12 @@ function count_all_results($table = '') * * Allows the where clause, limit and offset to be added directly * - * @access public * @param string the where clause * @param string the limit clause * @param string the offset clause * @return object */ - function get_where($table = '', $where = null, $limit = null, $offset = null) + public function get_where($table = '', $where = null, $limit = null, $offset = null) { if ($table != '') { @@ -1069,12 +1035,11 @@ function get_where($table = '', $where = null, $limit = null, $offset = null) * * Compiles batch insert strings and runs the queries * - * @access public * @param string the table to retrieve the results from * @param array an associative array of insert values * @return object */ - function insert_batch($table = '', $set = NULL) + public function insert_batch($table = '', $set = NULL) { if ( ! is_null($set)) { @@ -1127,14 +1092,12 @@ function insert_batch($table = '', $set = NULL) /** * The "set_insert_batch" function. Allows key/value pairs to be set for batch inserts * - * @access public * @param mixed * @param string * @param boolean * @return object */ - - function set_insert_batch($key, $value = '', $escape = TRUE) + public function set_insert_batch($key, $value = '', $escape = TRUE) { $key = $this->_object_to_array_batch($key); @@ -1189,8 +1152,7 @@ function set_insert_batch($key, $value = '', $escape = TRUE) * * Compiles an insert string and runs the query * - * @access public - * @param string the table to retrieve the results from + * @param string the table to insert data into * @param array an associative array of insert values * @return object */ @@ -1230,7 +1192,18 @@ function insert($table = '', $set = NULL) return $this->query($sql); } - function replace($table = '', $set = NULL) + // -------------------------------------------------------------------- + + /** + * Replace + * + * Compiles an replace into string and runs the query + * + * @param string the table to replace data into + * @param array an associative array of insert values + * @return object + */ + public function replace($table = '', $set = NULL) { if ( ! is_null($set)) { @@ -1273,13 +1246,12 @@ function replace($table = '', $set = NULL) * * Compiles an update string and runs the query * - * @access public * @param string the table to retrieve the results from * @param array an associative array of update values * @param mixed the where clause * @return object */ - function update($table = '', $set = NULL, $where = NULL, $limit = NULL) + public function update($table = '', $set = NULL, $where = NULL, $limit = NULL) { // Combine any cached components with the current statements $this->_merge_cache(); @@ -1336,13 +1308,12 @@ function update($table = '', $set = NULL, $where = NULL, $limit = NULL) * * Compiles an update string and runs the query * - * @access public * @param string the table to retrieve the results from * @param array an associative array of update values * @param string the where key * @return object */ - function update_batch($table = '', $set = NULL, $index = NULL) + public function update_batch($table = '', $set = NULL, $index = NULL) { // Combine any cached components with the current statements $this->_merge_cache(); @@ -1402,14 +1373,12 @@ function update_batch($table = '', $set = NULL, $index = NULL) /** * The "set_update_batch" function. Allows key/value pairs to be set for batch updating * - * @access public * @param array * @param string * @param boolean * @return object */ - - function set_update_batch($key, $index = '', $escape = TRUE) + public function set_update_batch($key, $index = '', $escape = TRUE) { $key = $this->_object_to_array_batch($key); @@ -1462,11 +1431,10 @@ function set_update_batch($key, $index = '', $escape = TRUE) * * Compiles a delete string and runs "DELETE FROM table" * - * @access public * @param string the table to empty * @return object */ - function empty_table($table = '') + public function empty_table($table = '') { if ($table == '') { @@ -1502,11 +1470,10 @@ function empty_table($table = '') * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public * @param string the table to truncate * @return object */ - function truncate($table = '') + public function truncate($table = '') { if ($table == '') { @@ -1540,14 +1507,13 @@ function truncate($table = '') * * Compiles a delete string and runs the query * - * @access public * @param mixed the table(s) to delete from. String or array * @param mixed the where clause * @param mixed the limit clause * @param boolean * @return object */ - function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) + public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) { // Combine any cached components with the current statements $this->_merge_cache(); @@ -1617,11 +1583,10 @@ function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE) * * Prepends a database prefix if one exists in configuration * - * @access public * @param string the table * @return string */ - function dbprefix($table = '') + public function dbprefix($table = '') { if ($table == '') { @@ -1638,11 +1603,10 @@ function dbprefix($table = '') * * Used to track SQL statements written with aliased tables. * - * @access private * @param string The table to inspect * @return string */ - function _track_aliases($table) + protected function _track_aliases($table) { if (is_array($table)) { @@ -1685,10 +1649,9 @@ function _track_aliases($table) * Generates a query string based on which functions were used. * Should not be called directly. The get() function calls it. * - * @access private * @return string */ - function _compile_select($select_override = FALSE) + protected function _compile_select($select_override = FALSE) { // Combine any cached components with the current statements $this->_merge_cache(); @@ -1826,11 +1789,10 @@ function _compile_select($select_override = FALSE) * * Takes an object as input and converts the class variables to array key/vals * - * @access public * @param object * @return array */ - function _object_to_array($object) + public function _object_to_array($object) { if ( ! is_object($object)) { @@ -1857,11 +1819,10 @@ function _object_to_array($object) * * Takes an object as input and converts the class variables to array key/vals * - * @access public * @param object * @return array */ - function _object_to_array_batch($object) + public function _object_to_array_batch($object) { if ( ! is_object($object)) { @@ -1897,10 +1858,9 @@ function _object_to_array_batch($object) * * Starts AR caching * - * @access public * @return void */ - function start_cache() + public function start_cache() { $this->ar_caching = TRUE; } @@ -1912,10 +1872,9 @@ function start_cache() * * Stops AR caching * - * @access public * @return void */ - function stop_cache() + public function stop_cache() { $this->ar_caching = FALSE; } @@ -1930,23 +1889,21 @@ function stop_cache() * @access public * @return void */ - function flush_cache() + public function flush_cache() { - $this->_reset_run( - array( - 'ar_cache_select' => array(), - 'ar_cache_from' => array(), - 'ar_cache_join' => array(), - 'ar_cache_where' => array(), - 'ar_cache_like' => array(), - 'ar_cache_groupby' => array(), - 'ar_cache_having' => array(), - 'ar_cache_orderby' => array(), - 'ar_cache_set' => array(), - 'ar_cache_exists' => array(), - 'ar_cache_no_escape' => array() - ) - ); + $this->_reset_run(array( + 'ar_cache_select' => array(), + 'ar_cache_from' => array(), + 'ar_cache_join' => array(), + 'ar_cache_where' => array(), + 'ar_cache_like' => array(), + 'ar_cache_groupby' => array(), + 'ar_cache_having' => array(), + 'ar_cache_orderby' => array(), + 'ar_cache_set' => array(), + 'ar_cache_exists' => array(), + 'ar_cache_no_escape' => array() + )); } // -------------------------------------------------------------------- @@ -1957,10 +1914,9 @@ function flush_cache() * When called, this function merges any cached AR arrays with * locally called ones. * - * @access private * @return void */ - function _merge_cache() + protected function _merge_cache() { if (count($this->ar_cache_exists) == 0) { @@ -1995,11 +1951,10 @@ function _merge_cache() /** * Resets the active record values. Called by the get() function * - * @access private * @param array An array of fields to reset * @return void */ - function _reset_run($ar_reset_items) + protected function _reset_run($ar_reset_items) { foreach ($ar_reset_items as $item => $default_value) { @@ -2015,28 +1970,27 @@ function _reset_run($ar_reset_items) /** * Resets the active record values. Called by the get() function * - * @access private * @return void */ - function _reset_select() + protected function _reset_select() { $ar_reset_items = array( - 'ar_select' => array(), - 'ar_from' => array(), - 'ar_join' => array(), - 'ar_where' => array(), - 'ar_like' => array(), - 'ar_groupby' => array(), - 'ar_having' => array(), - 'ar_orderby' => array(), - 'ar_wherein' => array(), - 'ar_aliased_tables' => array(), - 'ar_no_escape' => array(), - 'ar_distinct' => FALSE, - 'ar_limit' => FALSE, - 'ar_offset' => FALSE, - 'ar_order' => FALSE, - ); + 'ar_select' => array(), + 'ar_from' => array(), + 'ar_join' => array(), + 'ar_where' => array(), + 'ar_like' => array(), + 'ar_groupby' => array(), + 'ar_having' => array(), + 'ar_orderby' => array(), + 'ar_wherein' => array(), + 'ar_aliased_tables' => array(), + 'ar_no_escape' => array(), + 'ar_distinct' => FALSE, + 'ar_limit' => FALSE, + 'ar_offset' => FALSE, + 'ar_order' => FALSE, + ); $this->_reset_run($ar_reset_items); } @@ -2048,25 +2002,23 @@ function _reset_select() * * Called by the insert() update() insert_batch() update_batch() and delete() functions * - * @access private * @return void */ - function _reset_write() + protected function _reset_write() { $ar_reset_items = array( - 'ar_set' => array(), - 'ar_from' => array(), - 'ar_where' => array(), - 'ar_like' => array(), - 'ar_orderby' => array(), - 'ar_keys' => array(), - 'ar_limit' => FALSE, - 'ar_order' => FALSE - ); + 'ar_set' => array(), + 'ar_from' => array(), + 'ar_where' => array(), + 'ar_like' => array(), + 'ar_orderby' => array(), + 'ar_keys' => array(), + 'ar_limit' => FALSE, + 'ar_order' => FALSE + ); $this->_reset_run($ar_reset_items); } - } /* End of file DB_active_rec.php */ From 8a02247acbac87b3b947d9188ec4f5805f2e1a52 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 15 Jul 2011 15:25:15 -0600 Subject: [PATCH 2510/2544] ... set_dbprefix(). Programatically set the prefix, great for multi-site systems that "namespace" with prefixes. --- system/database/DB_active_rec.php | 15 +++++++++++++++ user_guide/changelog.html | 1 + user_guide/database/queries.html | 9 +++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 7ddf20d0..bc11ff43 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -1598,6 +1598,21 @@ public function dbprefix($table = '') // -------------------------------------------------------------------- + /** + * Set DB Prefix + * + * Set's the DB Prefix to something new without needing to reconnect + * + * @param string the prefix + * @return string + */ + public function set_dbprefix($prefix = '') + { + return $this->dbprefix = $prefix; + } + + // -------------------------------------------------------------------- + /** * Track Aliases * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a841785f..a924edc9 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -86,6 +86,7 @@

                Version 2.0.3

                • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
                • Added is_unique to the Form Validation library.
                • +
                • Added $this->db->set_dbprefix() to the Database Driver.
              diff --git a/user_guide/database/queries.html b/user_guide/database/queries.html index f9f96803..4c1ddfe7 100644 --- a/user_guide/database/queries.html +++ b/user_guide/database/queries.html @@ -80,11 +80,16 @@

              $this->db->simple_query();

              It simply lets you submit a query. Most users will rarely use this function.

              -

              Adding Database prefixes manually

              -

              If you have configured a database prefix and would like to add it in manually for, you can use the following.

              +

              Working with Database prefixes manually

              +

              If you have configured a database prefix and would like to prepend it to a table name for use in a native SQL query for example, then you can use the following:

              $this->db->dbprefix('tablename');
              // outputs prefix_tablename

              +

              If for any reason you would like to change the prefix programatically without needing to create a new connection, you can use this method:

              +

              $this->db->set_dbprefix('newprefix');

              +$this->db->dbprefix('tablename');
              +// outputs newprefix_tablename

              +

              Protecting identifiers

              In many databases it is advisable to protect table and field names - for example with backticks in MySQL. Active Record queries are automatically protected, however if you need to manually protect an identifier you can use:

              From 1b1b67693060ecb6dd399ea6aee4a5503d96adda Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 15 Jul 2011 19:37:31 -0600 Subject: [PATCH 2511/2544] enable use of param in a callback rule, on behalf of marcoscoelho. --- system/libraries/Form_validation.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index d370d75e..fd95d76f 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -488,7 +488,7 @@ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0) if ( ! in_array('required', $rules) AND is_null($postdata)) { // Before we bail out, does the rule contain a callback? - if (preg_match("/(callback_\w+)/", implode(' ', $rules), $match)) + if (preg_match("/(callback_\w+(\[.*?\])?)/", implode(' ', $rules), $match)) { $callback = TRUE; $rules = (array('1' => $match[1])); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a924edc9..8a6fea74 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@

              Version 2.0.3

            • Removed internal usage of the EXT constant.
            • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
            • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
            • +
            • Callback validation rules can now accept parameters like any other validation rule.
          • Helpers From 08a245f0c9d9638f039d12aebcd35bd875d72107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Cox?= Date: Sat, 16 Jul 2011 23:46:49 +0200 Subject: [PATCH 2512/2544] CSRF field is only added when post method is used and action is internal. Closes #165 --- system/helpers/form_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 2925d3c7..5720a06e 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -64,8 +64,8 @@ function form_open($action = '', $attributes = '', $hidden = array()) $form .= '>'; - // CSRF - if ($CI->config->item('csrf_protection') === TRUE) + // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites + if ($CI->config->item('csrf_protection') === TRUE AND ! (strpos($action, $CI->config->site_url()) === FALSE OR strpos($form, 'method="get"'))) { $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } From 31775338757dd6c2eddcdaa265815d002bd7d125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Cox?= Date: Sat, 16 Jul 2011 23:49:16 +0200 Subject: [PATCH 2513/2544] Updated change log --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a924edc9..4c4e6709 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -80,6 +80,7 @@

            Version 2.0.3

          • Helpers
            • Added an optional third parameter to heading() which allows adding html attributes to the rendered heading tag.
            • +
            • form_open() now only adds a hidden (Cross-site Reference Forgery) protection field when the form's action is internal and is set to the post method. (Reactor #165)
          • Libraries From 98b2126f1050f9f29677c7c6236c8039bbfee9ea Mon Sep 17 00:00:00 2001 From: MarcosCoelho Date: Mon, 18 Jul 2011 16:12:47 -0300 Subject: [PATCH 2514/2544] sync total items count and total amount price; by sum of quantity of each item in cart --- system/libraries/Cart.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 7f65b48b..b2eaa9ad 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -374,6 +374,7 @@ function _save_cart() // Lets add up the individual prices and set the cart sub-total $total = 0; + $items = 0; foreach ($this->_cart_contents as $key => $val) { // We make sure the array contains the proper indexes @@ -383,13 +384,14 @@ function _save_cart() } $total += ($val['price'] * $val['qty']); + $items += $val['qty']; // Set the subtotal $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'] = count($this->_cart_contents); + $this->_cart_contents['total_items'] = $items; $this->_cart_contents['cart_total'] = $total; // Is our cart empty? If so we delete it from the session From eecb4392fa95719873201e05d6db91b245f95ed7 Mon Sep 17 00:00:00 2001 From: MarcosCoelho Date: Tue, 19 Jul 2011 14:34:20 -0300 Subject: [PATCH 2515/2544] Log change on method total_items from cart library --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a924edc9..36f3395f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -99,6 +99,7 @@

            Bug fixes for 2.0.3

          • Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes.
          • Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.
          • Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
          • +
          • Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.

          Version 2.0.2

          From 6d2f13a3dd1f44d8b20d61bdde5c77c7d827cfde Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 20 Jul 2011 10:04:52 -0600 Subject: [PATCH 2516/2544] Updated Email class to use protected instead of private: http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor/suggestions/2056113-private-functions-suck --- system/libraries/Email.php | 118 ++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/system/libraries/Email.php b/system/libraries/Email.php index cd89f8f3..9b3bc75e 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -405,12 +405,12 @@ public function attach($filename, $disposition = 'attachment') /** * Add a Header Item * - * @access private + * @access protected * @param string * @param string * @return void */ - private function _set_header($header, $value) + protected function _set_header($header, $value) { $this->_headers[$header] = $value; } @@ -420,11 +420,11 @@ private function _set_header($header, $value) /** * Convert a String to an Array * - * @access private + * @access protected * @param string * @return array */ - private function _str_to_array($email) + protected function _str_to_array($email) { if ( ! is_array($email)) { @@ -577,10 +577,10 @@ public function set_crlf($crlf = "\n") /** * Set Message Boundary * - * @access private + * @access protected * @return void */ - private function _set_boundaries() + protected function _set_boundaries() { $this->_alt_boundary = "B_ALT_".uniqid(''); // multipart/alternative $this->_atc_boundary = "B_ATC_".uniqid(''); // attachment boundary @@ -591,10 +591,10 @@ private function _set_boundaries() /** * Get the Message ID * - * @access private + * @access protected * @return string */ - private function _get_message_id() + protected function _get_message_id() { $from = $this->_headers['Return-Path']; $from = str_replace(">", "", $from); @@ -608,11 +608,11 @@ private function _get_message_id() /** * Get Mail Protocol * - * @access private + * @access protected * @param bool * @return string */ - private function _get_protocol($return = TRUE) + protected function _get_protocol($return = TRUE) { $this->protocol = strtolower($this->protocol); $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol; @@ -628,11 +628,11 @@ private function _get_protocol($return = TRUE) /** * Get Mail Encoding * - * @access private + * @access protected * @param bool * @return string */ - private function _get_encoding($return = TRUE) + protected function _get_encoding($return = TRUE) { $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '8bit' : $this->_encoding; @@ -655,10 +655,10 @@ private function _get_encoding($return = TRUE) /** * Get content type (text/html/attachment) * - * @access private + * @access protected * @return string */ - private function _get_content_type() + protected function _get_content_type() { if ($this->mailtype == 'html' && count($this->_attach_name) == 0) { @@ -683,10 +683,10 @@ private function _get_content_type() /** * Set RFC 822 Date * - * @access private + * @access protected * @return string */ - private function _set_date() + protected function _set_date() { $timezone = date("Z"); $operator = (strncmp($timezone, '-', 1) == 0) ? '-' : '+'; @@ -701,10 +701,10 @@ private function _set_date() /** * Mime message * - * @access private + * @access protected * @return string */ - private function _get_mime_message() + protected function _get_mime_message() { return "This is a multi-part message in MIME format.".$this->newline."Your email application may not support this format."; } @@ -802,10 +802,10 @@ public function clean_email($email) * If the user hasn't specified his own alternative message * it creates one by stripping the HTML * - * @access private + * @access protected * @return string */ - private function _get_alt_message() + protected function _get_alt_message() { if ($this->alt_message != "") { @@ -941,11 +941,11 @@ public function word_wrap($str, $charlim = '') /** * Build final headers * - * @access private + * @access protected * @param string * @return string */ - private function _build_headers() + protected function _build_headers() { $this->_set_header('X-Sender', $this->clean_email($this->_headers['From'])); $this->_set_header('X-Mailer', $this->useragent); @@ -959,10 +959,10 @@ private function _build_headers() /** * Write Headers as a string * - * @access private + * @access protected * @return void */ - private function _write_headers() + protected function _write_headers() { if ($this->protocol == 'mail') { @@ -994,10 +994,10 @@ private function _write_headers() /** * Build Final Body and attachments * - * @access private + * @access protected * @return void */ - private function _build_message() + protected function _build_message() { if ($this->wordwrap === TRUE AND $this->mailtype != 'html') { @@ -1177,12 +1177,12 @@ private function _build_message() * Prepares string for Quoted-Printable Content-Transfer-Encoding * Refer to RFC 2045 http://www.ietf.org/rfc/rfc2045.txt * - * @access private + * @access protected * @param string * @param integer * @return string */ - private function _prep_quoted_printable($str, $charlim = '') + protected function _prep_quoted_printable($str, $charlim = '') { // Set the character limit // Don't allow over 76, as that will make servers and MUAs barf @@ -1275,7 +1275,7 @@ private function _prep_quoted_printable($str, $charlim = '') * @param bool // set to TRUE for processing From: headers * @return str */ - private function _prep_q_encoding($str, $from = FALSE) + protected function _prep_q_encoding($str, $from = FALSE) { $str = str_replace(array("\r", "\n"), array('', ''), $str); @@ -1440,10 +1440,10 @@ public function batch_bcc_send() /** * Unwrap special elements * - * @access private + * @access protected * @return void */ - private function _unwrap_specials() + protected function _unwrap_specials() { $this->_finalbody = preg_replace_callback("/\{unwrap\}(.*?)\{\/unwrap\}/si", array($this, '_remove_nl_callback'), $this->_finalbody); } @@ -1453,10 +1453,10 @@ private function _unwrap_specials() /** * Strip line-breaks via callback * - * @access private + * @access protected * @return string */ - private function _remove_nl_callback($matches) + protected function _remove_nl_callback($matches) { if (strpos($matches[1], "\r") !== FALSE OR strpos($matches[1], "\n") !== FALSE) { @@ -1471,10 +1471,10 @@ private function _remove_nl_callback($matches) /** * Spool mail to the mail server * - * @access private + * @access protected * @return bool */ - private function _spool_email() + protected function _spool_email() { $this->_unwrap_specials(); @@ -1516,10 +1516,10 @@ private function _spool_email() /** * Send using mail() * - * @access private + * @access protected * @return bool */ - private function _send_with_mail() + protected function _send_with_mail() { if ($this->_safe_mode == TRUE) { @@ -1553,10 +1553,10 @@ private function _send_with_mail() /** * Send using Sendmail * - * @access private + * @access protected * @return bool */ - private function _send_with_sendmail() + protected function _send_with_sendmail() { $fp = @popen($this->mailpath . " -oi -f ".$this->clean_email($this->_headers['From'])." -t", 'w'); @@ -1591,10 +1591,10 @@ private function _send_with_sendmail() /** * Send using SMTP * - * @access private + * @access protected * @return bool */ - private function _send_with_smtp() + protected function _send_with_smtp() { if ($this->smtp_host == '') { @@ -1660,11 +1660,11 @@ private function _send_with_smtp() /** * SMTP Connect * - * @access private + * @access protected * @param string * @return string */ - private function _smtp_connect() + protected function _smtp_connect() { $this->_smtp_connect = fsockopen($this->smtp_host, $this->smtp_port, @@ -1687,12 +1687,12 @@ private function _smtp_connect() /** * Send SMTP command * - * @access private + * @access protected * @param string * @param string * @return string */ - private function _send_command($cmd, $data = '') + protected function _send_command($cmd, $data = '') { switch ($cmd) { @@ -1754,10 +1754,10 @@ private function _send_command($cmd, $data = '') /** * SMTP Authenticate * - * @access private + * @access protected * @return bool */ - private function _smtp_authenticate() + protected function _smtp_authenticate() { if ( ! $this->_smtp_auth) { @@ -1808,10 +1808,10 @@ private function _smtp_authenticate() /** * Send SMTP data * - * @access private + * @access protected * @return bool */ - private function _send_data($data) + protected function _send_data($data) { if ( ! fwrite($this->_smtp_connect, $data . $this->newline)) { @@ -1829,10 +1829,10 @@ private function _send_data($data) /** * Get SMTP data * - * @access private + * @access protected * @return string */ - private function _get_smtp_data() + protected function _get_smtp_data() { $data = ""; @@ -1854,10 +1854,10 @@ private function _get_smtp_data() /** * Get Hostname * - * @access private + * @access protected * @return string */ - private function _get_hostname() + protected function _get_hostname() { return (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain'; } @@ -1867,10 +1867,10 @@ private function _get_hostname() /** * Get IP * - * @access private + * @access protected * @return string */ - private function _get_ip() + protected function _get_ip() { if ($this->_IP !== FALSE) { @@ -1933,11 +1933,11 @@ public function print_debugger() /** * Set Message * - * @access private + * @access protected * @param string * @return string */ - private function _set_error_message($msg, $val = '') + protected function _set_error_message($msg, $val = '') { $CI =& get_instance(); $CI->lang->load('email'); @@ -1957,11 +1957,11 @@ private function _set_error_message($msg, $val = '') /** * Mime Types * - * @access private + * @access protected * @param string * @return string */ - private function _mime_types($ext = "") + protected function _mime_types($ext = "") { $mimes = array( 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', From 909105135439ac2ade75a99922f77c038e882fee Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 20 Jul 2011 10:07:40 -0600 Subject: [PATCH 2517/2544] Changed Cart library to return the if inserted successfully. This will be fine for anyone using () == true. http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor/suggestions/2055829-last-rowid-of-cart --- system/libraries/Cart.php | 8 ++++---- user_guide/changelog.html | 1 + user_guide/libraries/cart.html | 25 ++++++++++++------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index b2eaa9ad..ab5a70c9 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -99,7 +99,7 @@ function insert($items = array()) $save_cart = FALSE; if (isset($items['id'])) { - if ($this->_insert($items) == TRUE) + if (($rowid = $this->_insert($items))) { $save_cart = TRUE; } @@ -110,7 +110,7 @@ function insert($items = array()) { if (is_array($val) AND isset($val['id'])) { - if ($this->_insert($val) == TRUE) + if ($this->_insert($val)) { $save_cart = TRUE; } @@ -122,7 +122,7 @@ function insert($items = array()) if ($save_cart == TRUE) { $this->_save_cart(); - return TRUE; + return isset($rowid) ? $rowid : TRUE; } return FALSE; @@ -244,7 +244,7 @@ function _insert($items = array()) } // Woot! - return TRUE; + return $rowid; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 8728299c..e289879a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -89,6 +89,7 @@

          Version 2.0.3

        • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
        • Added is_unique to the Form Validation library.
        • Added $this->db->set_dbprefix() to the Database Driver.
        • +
        • Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
      diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index f084d5dc..81b43e36 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -61,7 +61,7 @@

      Shopping Cart Class

      The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.

      -

      Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

      +

      Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

      Initializing the Shopping Cart Class

      @@ -106,20 +106,19 @@

      Adding an Item to The Cart

    104. qty - The quantity being purchased.
    105. price - The price of the item.
    106. name - The name of the item. -
    107. options - Any additional attributes that are needed to identify the product. These must be passed via an array. +
    108. options - Any additional attributes that are needed to identify the product. These must be passed via an array. -

      In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so -please do NOT use those words as index names when inserting data into the cart.

      +

      In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so please do NOT use those words as index names when inserting data into the cart.

      -

      Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among -all your products in order to make displaying the information in a table easier.

      +

      Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among all your products in order to make displaying the information in a table easier.

      + +

      The insert() method will return the $rowid if you successfully insert a single item.

      Adding Multiple Items to The Cart

      -

      By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow -people to select from among several items on the same page.

      +

      By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow people to select from among several items on the same page.

      @@ -265,11 +264,11 @@

      Updating The Cart

      -

      What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a +

      What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a unique ID is created is so that identical products with different options can be managed by the cart.

      -

      For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be -identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this +

      For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be +identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.

      In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself @@ -311,7 +310,7 @@

      $this->cart->contents();

      $this->cart->has_options(rowid);

      -

      Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

      +

      Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

      $this->cart->product_options(rowid);

      @@ -322,7 +321,7 @@

      $this->cart->product_options(rowid);

      $this->cart->destroy();

      -

      Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

      +

      Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

      From 8731f641de823fcdcb8b2a2fa6034fca8fe4a164 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 22 Jul 2011 16:11:34 -0600 Subject: [PATCH 2518/2544] Added ->load->get_var() to check against ->load->_ci_cached_vars[]. --- system/core/Loader.php | 15 +++++++++++++++ user_guide/changelog.html | 1 + user_guide/libraries/loader.html | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/system/core/Loader.php b/system/core/Loader.php index 721c196c..7c8b298a 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -388,6 +388,21 @@ public function vars($vars = array(), $val = '') // -------------------------------------------------------------------- + /** + * Get Variable + * + * Check if a variable is set and retrieve it. + * + * @param array + * @return void + */ + public function get_var($key) + { + return isset($this->_ci_cached_vars[$key]) ? $this->_ci_cached_vars[$key] : NULL; + } + + // -------------------------------------------------------------------- + /** * Load Helper * diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e289879a..fe5a67dd 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@

      Version 2.0.3

    109. Added is_unique to the Form Validation library.
    110. Added $this->db->set_dbprefix() to the Database Driver.
    111. Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
    112. +
    113. Added $this->load->get_var() to the Loader library to retrieve global vars set with $this->load->view() and $this->load->vars().
    114. diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 1d93af5e..a472730c 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -175,6 +175,12 @@

      $this->load->vars($array)

      +

      $this->load->get_var($key)

      + +

      This function checks the associative array of variables available to your views. This is useful if for any reason a var is set in a library or another controller method using $this->load->vars(). +

      + +

      $this->load->helper('file_name')

      This function loads helper files, where file_name is the name of the file, without the _helper.php extension.

      From 242c258f2bf027e7c13b448131bd7e94bde81027 Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 09:50:34 -0400 Subject: [PATCH 2519/2544] Fixed mysql and mysqli drivers to set NOT NULL as default for creating fields. All other drivers were correct. --- system/database/drivers/mysql/mysql_forge.php | 8 ++++++-- system/database/drivers/mysqli/mysqli_forge.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 529ec980..c1cae136 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -119,9 +119,13 @@ function _process_fields($fields) $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index d5097335..26054945 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -104,9 +104,13 @@ function _process_fields($fields) $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) From 13f6e06684b9adc40d40d48a5f2c752bcc03708e Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 11:53:02 -0400 Subject: [PATCH 2520/2544] Added bug fix to changelog. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index fe5a67dd..283241a1 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -104,6 +104,7 @@

      Bug fixes for 2.0.3

    115. Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.
    116. Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
    117. Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
    118. +
    119. Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
    120. Version 2.0.2

      From e611d8cfb9fb8d056fa75ec40b6e07c12e57dd53 Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 11:45:05 -0400 Subject: [PATCH 2521/2544] Fixed having method to insert quotes. --- system/database/DB_active_rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index bc11ff43..0a25b3cb 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -790,7 +790,7 @@ protected function _having($key, $value = '', $type = 'AND ', $escape = TRUE) if ($v != '') { - $v = ' '.$this->escape_str($v); + $v = ' '.$this->escape($v); } $this->ar_having[] = $prefix.$k.$v; From db3fada432a270e1760731bf08784e8565fa8efb Mon Sep 17 00:00:00 2001 From: Adam Jackett Date: Sat, 23 Jul 2011 14:35:47 -0400 Subject: [PATCH 2522/2544] Added having() fix to changelog. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index fe5a67dd..62321079 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,6 +91,7 @@

      Version 2.0.3

    121. Added $this->db->set_dbprefix() to the Database Driver.
    122. Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
    123. Added $this->load->get_var() to the Loader library to retrieve global vars set with $this->load->view() and $this->load->vars().
    124. +
    125. Changed $this->db->having() to insert quotes using escape() rather than escape_str().
    126. From 2e08794d5de57d727abb2abe752a4479b3ec0242 Mon Sep 17 00:00:00 2001 From: Esen Sagynov Date: Tue, 9 Aug 2011 23:35:01 -0700 Subject: [PATCH 2523/2544] Added CUBRID Database Driver --- system/database/DB_driver.php | 2 +- .../database/drivers/cubrid/cubrid_driver.php | 775 ++++++++++++++++++ .../database/drivers/cubrid/cubrid_forge.php | 284 +++++++ .../database/drivers/cubrid/cubrid_result.php | 201 +++++ .../drivers/cubrid/cubrid_utility.php | 107 +++ system/database/drivers/cubrid/index.html | 10 + 6 files changed, 1378 insertions(+), 1 deletion(-) create mode 100644 system/database/drivers/cubrid/cubrid_driver.php create mode 100644 system/database/drivers/cubrid/cubrid_forge.php create mode 100644 system/database/drivers/cubrid/cubrid_result.php create mode 100644 system/database/drivers/cubrid/cubrid_utility.php create mode 100644 system/database/drivers/cubrid/index.html diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 10e8ed0c..f3e824da 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -218,7 +218,7 @@ function version() // Some DBs have functions that return the version, and don't run special // SQL queries per se. In these instances, just return the result. - $driver_version_exceptions = array('oci8', 'sqlite'); + $driver_version_exceptions = array('oci8', 'sqlite', 'cubrid'); if (in_array($this->dbdriver, $driver_version_exceptions)) { diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php new file mode 100644 index 00000000..ef0b5b45 --- /dev/null +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -0,0 +1,775 @@ +port == '') + { + $this->port = self::DEFAULT_PORT; + } + + $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); + + if ($conn){ + if (isset($this->auto_commit) && !$this->auto_commit){ + cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE); + } + else{ + cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE); + $this->auto_commit = TRUE; + } + } + + return $conn; + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * In CUBRID persistent DB connection is supported natively in CUBRID + * engine which can be configured in the CUBRID Broker configuration + * file by setting the CCI_PCONNECT parameter to ON. In that case, all + * connections established between the client application and the + * server will become persistent. This is calling the same + * @cubrid_connect function will establish persisten connection + * considering that the CCI_PCONNECT is ON. + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return $this->db_connect(); + } + + // -------------------------------------------------------------------- + + /** + * Reconnect + * + * Keep / reestablish the db connection if no queries have been + * sent for a length of time exceeding the server's idle timeout + * + * @access public + * @return void + */ + function reconnect() + { + if (cubrid_ping($this->conn_id) === FALSE) + { + $this->conn_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + // In CUBRID there is no need to select a database as the database + // is chosen at the connection time. + // So, to determine if the database is "selected", all we have to + // do is return the connection identifier which can be later + // checked if it has been established or not. + return cubrid_ping($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Set client character set + * + * @access public + * @param string + * @param string + * @return resource + */ + function db_set_charset($charset, $collation) + { + // In CUBRID, there is no need to set charset or collation. + // This is why returning true will allow the application continue + // its normal process. + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return cubrid_get_server_info($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + $sql = $this->_prep_query($sql); + return @cubrid_query($sql, $this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Begin Transaction + * + * @access public + * @return bool + */ + function trans_begin($test_mode = FALSE) + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + // 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; + + if (cubrid_get_autocommit($this->conn_id)) + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Commit Transaction + * + * @access public + * @return bool + */ + function trans_commit() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + cubrid_commit($this->conn_id); + + if ($this->auto_commit && !cubrid_get_autocommit($this->conn_id)) + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Rollback Transaction + * + * @access public + * @return bool + */ + function trans_rollback() + { + if ( ! $this->trans_enabled) + { + return TRUE; + } + + // When transactions are nested we only begin/commit/rollback the outermost ones + if ($this->_trans_depth > 0) + { + return TRUE; + } + + cubrid_rollback($this->conn_id); + + if ($this->auto_commit && !cubrid_get_autocommit($this->conn_id)) + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); + + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @param bool whether or not the string will be used in a LIKE condition + * @return string + */ + function escape_str($str, $like = FALSE) + { + if (is_array($str)) + { + foreach ($str as $key => $val) + { + $str[$key] = $this->escape_str($val, $like); + } + + return $str; + } + + if (function_exists('cubrid_real_escape_string') AND is_resource($this->conn_id)) + { + $str = cubrid_real_escape_string($str, $this->conn_id); + } + else + { + $str = addslashes($str); + } + + // escape LIKE condition wildcards + if ($like === TRUE) + { + //TODO: check this + $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str); + } + + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @cubrid_affected_rows($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + return @cubrid_insert_id($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified table + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + { + return 0; + } + + $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); + + if ($query->num_rows() == 0) + { + return 0; + } + + $row = $query->row(); + return (int) $row->numrows; + } + + // -------------------------------------------------------------------- + + /** + * List table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @param boolean + * @return string + */ + function _list_tables($prefix_limit = FALSE) + { + $sql = "SHOW TABLES"; + + if ($prefix_limit !== FALSE AND $this->dbprefix != '') + { + $sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%'"; + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SHOW COLUMNS FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE); + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { + return "SELECT * FROM ".$table." LIMIT 1"; + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + return cubrid_error($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + return cubrid_errno($this->conn_id); + } + + // -------------------------------------------------------------------- + + /** + * Escape the SQL Identifiers + * + * This function escapes column and table names + * + * @access private + * @param string + * @return string + */ + function _escape_identifiers($item) + { + if ($this->_escape_char == '') + { + return $item; + } + + foreach ($this->_reserved_identifiers as $id) + { + if (strpos($item, '.'.$id) !== FALSE) + { + $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + } + + if (strpos($item, '.') !== FALSE) + { + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char; + } + else + { + $str = $this->_escape_char.$item.$this->_escape_char; + } + + // remove duplicates if the user already included the escape + return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); + } + + // -------------------------------------------------------------------- + + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if ( ! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * 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 + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + + /** + * 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).")"; + } + + // -------------------------------------------------------------------- + + /** + * Insert_batch statement + * + * 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 + */ + function _insert_batch($table, $keys, $values) + { + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + } + + // -------------------------------------------------------------------- + + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @param array the orderby clause + * @param array the limit clause + * @return string + */ + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + { + foreach ($values as $key => $val) + { + $valstr[] = $key . ' = ' . $val; + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; + + $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); + + $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + $sql .= $orderby.$limit; + + return $sql; + } + + // -------------------------------------------------------------------- + + + /** + * Update_Batch statement + * + * Generates a platform-specific batch update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update_batch($table, $values, $index, $where = NULL) + { + $ids = array(); + $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; + + foreach ($values as $key => $val) + { + $ids[] = $val[$index]; + + foreach (array_keys($val) as $field) + { + if ($field != $index) + { + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; + } + } + } + + $sql = "UPDATE ".$table." SET "; + $cases = ''; + + foreach ($final as $k => $v) + { + $cases .= $k.' = CASE '."\n"; + foreach ($v as $row) + { + $cases .= $row."\n"; + } + + $cases .= 'ELSE '.$k.' END, '; + } + + $sql .= substr($cases, 0, -2); + + $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')'; + + return $sql; + } + + // -------------------------------------------------------------------- + + + /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * If the database does not support the truncate() command + * This function maps to "DELETE FROM table" + * + * @access public + * @param string the table name + * @return string + */ + function _truncate($table) + { + return "TRUNCATE ".$table; + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @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) + { + $conditions = ''; + + if (count($where) > 0 OR count($like) > 0) + { + $conditions = "\nWHERE "; + $conditions .= implode("\n", $this->ar_where); + + if (count($where) > 0 && count($like) > 0) + { + $conditions .= " AND "; + } + $conditions .= implode("\n", $like); + } + + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; + + return "DELETE FROM ".$table.$conditions.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @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) + { + if ($offset == 0) + { + $offset = ''; + } + else + { + $offset .= ", "; + } + + return $sql."LIMIT ".$offset.$limit; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + @cubrid_close($conn_id); + } + +} + + +/* End of file cubrid_driver.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php new file mode 100644 index 00000000..c2c553f2 --- /dev/null +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -0,0 +1,284 @@ +$attributes) + { + // Numeric field names aren't allowed in databases, so if the key is + // numeric, we know it was assigned by PHP and the developer manually + // entered the field information, so we'll simply add it to the list + if (is_numeric($field)) + { + $sql .= "\n\t$attributes"; + } + else + { + $attributes = array_change_key_case($attributes, CASE_UPPER); + + $sql .= "\n\t".$this->db->_protect_identifiers($field); + + if (array_key_exists('NAME', $attributes)) + { + $sql .= ' '.$this->db->_protect_identifiers($attributes['NAME']).' '; + } + + if (array_key_exists('TYPE', $attributes)) + { + $sql .= ' '.$attributes['TYPE']; + + if (array_key_exists('CONSTRAINT', $attributes)) + { + switch ($attributes['TYPE']) + { + case 'decimal': + case 'float': + case 'numeric': + $sql .= '('.implode(',', $attributes['CONSTRAINT']).')'; + break; + case 'enum': // As of version 8.4.0 CUBRID does not support + // enum data type. + break; + case 'set': + $sql .= '("'.implode('","', $attributes['CONSTRAINT']).'")'; + break; + default: + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + } + } + + if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE) + { + //$sql .= ' UNSIGNED'; + // As of version 8.4.0 CUBRID does not support UNSIGNED INTEGER data type. + // Will be supported in the next release as a part of MySQL Compatibility. + } + + if (array_key_exists('DEFAULT', $attributes)) + { + $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; + } + + if (array_key_exists('NULL', $attributes)) + { + $sql .= ($attributes['NULL'] === TRUE) ? '' : ' NOT NULL'; + } + + if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) + { + $sql .= ' AUTO_INCREMENT'; + } + + if (array_key_exists('UNIQUE', $attributes) && $attributes['UNIQUE'] === TRUE) + { + $sql .= ' UNIQUE'; + } + } + + // don't add a comma on the end of the last field + if (++$current_field_count < count($fields)) + { + $sql .= ','; + } + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Create Table + * + * @access private + * @param string the table name + * @param mixed the fields + * @param mixed primary key(s) + * @param mixed key(s) + * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @return bool + */ + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + { + $sql = 'CREATE TABLE '; + + if ($if_not_exists === TRUE) + { + //$sql .= 'IF NOT EXISTS '; + // As of version 8.4.0 CUBRID does not support this SQL syntax. + } + + $sql .= $this->db->_escape_identifiers($table)." ("; + + $sql .= $this->_process_fields($fields); + + // If there is a PK defined + if (count($primary_keys) > 0) + { + $key_name = "pk_" . $table . "_" . + $this->db->_protect_identifiers(implode('_', $primary_keys)); + + $primary_keys = $this->db->_protect_identifiers($primary_keys); + $sql .= ",\n\tCONSTRAINT " . $key_name . " PRIMARY KEY(" . implode(', ', $primary_keys) . ")"; + } + + if (is_array($keys) && count($keys) > 0) + { + foreach ($keys as $key) + { + if (is_array($key)) + { + $key_name = $this->db->_protect_identifiers(implode('_', $key)); + $key = $this->db->_protect_identifiers($key); + } + else + { + $key_name = $this->db->_protect_identifiers($key); + $key = array($key_name); + } + + $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; + } + } + + $sql .= "\n);"; + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Drop Table + * + * @access private + * @return string + */ + function _drop_table($table) + { + return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); + } + + // -------------------------------------------------------------------- + + /** + * Alter table query + * + * Generates a platform-specific query so that a table can be altered + * Called by add_column(), drop_column(), and column_alter(), + * + * @access private + * @param string the ALTER type (ADD, DROP, CHANGE) + * @param string the column name + * @param array fields + * @param string the field after which we should add the new field + * @return object + */ + function _alter_table($alter_type, $table, $fields, $after_field = '') + { + $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table)." $alter_type "; + + // DROP has everything it needs now. + if ($alter_type == 'DROP') + { + return $sql.$this->db->_protect_identifiers($fields); + } + + $sql .= $this->_process_fields($fields); + + if ($after_field != '') + { + $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); + } + + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * Rename a table + * + * Generates a platform-specific query so that a table can be renamed + * + * @access private + * @param string the old table name + * @param string the new table name + * @return string + */ + function _rename_table($table_name, $new_table_name) + { + $sql = 'RENAME TABLE '.$this->db->_protect_identifiers($table_name)." AS ".$this->db->_protect_identifiers($new_table_name); + return $sql; + } + +} + +/* End of file cubrid_forge.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php new file mode 100644 index 00000000..06613e35 --- /dev/null +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -0,0 +1,201 @@ +result_id); + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + return @cubrid_num_fields($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Fetch Field Names + * + * Generates an array of column names + * + * @access public + * @return array + */ + function list_fields() + { + return cubrid_column_names($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + + $tablePrimaryKeys = array(); + + while ($field = cubrid_fetch_field($this->result_id)) + { + $F = new stdClass(); + $F->name = $field->name; + $F->type = $field->type; + $F->default = $field->def; + $F->max_length = $field->max_length; + + // At this moment primary_key property is not returned when + // cubrid_fetch_field is called. The following code will + // provide a patch for it. primary_key property will be added + // in the next release. + + // TODO: later version of CUBRID will provide primary_key + // property. + // When PK is defined in CUBRID, an index is automatically + // created in the db_index system table in the form of + // pk_tblname_fieldname. So the following will count how many + // columns are there which satisfy this format. + // The query will search for exact single columns, thus + // compound PK is not supported. + $res = cubrid_query($this->conn_id, + "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table . + "' AND is_primary_key = 'YES' AND index_name = 'pk_" . + $field->table . "_" . $field->name . "'" + ); + + if ($res) + { + $row = cubrid_fetch_array($res, CUBRID_NUM); + $F->primary_key = ($row[0] > 0 ? 1 : null); + } + else{ + $F->primary_key = null; + } + + if (is_resource($res)) + { + cubrid_close_request($res); + $this->result_id = FALSE; + } + + $retval[] = $F; + } + + return $retval; + } + + // -------------------------------------------------------------------- + + /** + * Free the result + * + * @return null + */ + function free_result() + { + if(is_resource($this->result_id) || + get_resource_type($this->result_id) == "Unknown" && + preg_match('/Resource id #/', strval($this->result_id))) + { + cubrid_close_request($this->result_id); + $this->result_id = FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Data Seek + * + * Moves the internal pointer to the desired offset. We call + * this internally before fetching results to make sure the + * result set starts at zero + * + * @access private + * @return array + */ + function _data_seek($n = 0) + { + return cubrid_data_seek($this->result_id, $n); + } + + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc() + { + return cubrid_fetch_assoc($this->result_id); + } + + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + return cubrid_fetch_object($this->result_id); + } + +} + + +/* End of file cubrid_result.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_result.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php new file mode 100644 index 00000000..9cf8b2ea --- /dev/null +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -0,0 +1,107 @@ +conn_id) + { + return "SELECT '" . $this->database . "'"; + } + else{ + return FALSE; + } + } + + // -------------------------------------------------------------------- + + /** + * Optimize table query + * + * Generates a platform-specific query so that a table can be optimized + * + * @access private + * @param string the table name + * @return object + * @link http://www.cubrid.org/manual/840/en/Optimize%20Database + */ + function _optimize_table($table) + { + // No SQL based support in CUBRID as of version 8.4.0. Database or + // table optimization can be performed using CUBRID Manager + // database administration tool. See the link above for more info. + return FALSE; + } + + // -------------------------------------------------------------------- + + /** + * Repair table query + * + * Generates a platform-specific query so that a table can be repaired + * + * @access private + * @param string the table name + * @return object + * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency + */ + function _repair_table($table) + { + // Not supported in CUBRID as of version 8.4.0. Database or + // table consistency can be checked using CUBRID Manager + // database administration tool. See the link above for more info. + return FALSE; + } + + // -------------------------------------------------------------------- + /** + * CUBRID Export + * + * @access private + * @param array Preferences + * @return mixed + */ + function _backup($params = array()) + { + // No SQL based support in CUBRID as of version 8.4.0. Database or + // table backup can be performed using CUBRID Manager + // database administration tool. + return $this->db->display_error('db_unsuported_feature'); + } +} + +/* End of file cubrid_utility.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/index.html b/system/database/drivers/cubrid/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/system/database/drivers/cubrid/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file From ee3e594893d28ca6370d24d2a4406c1897959175 Mon Sep 17 00:00:00 2001 From: Esen Sagynov Date: Wed, 10 Aug 2011 03:22:58 -0700 Subject: [PATCH 2524/2544] Added field name wrappers (") in insert/update/replace/_process_fields/_create_table functions to avoid reserved word conflicts. --- application/cache/.htaccess | 1 - application/cache/index.html | 10 - application/config/autoload.php | 116 ------ application/config/config.php | 362 ------------------ application/config/constants.php | 41 -- application/config/database.php | 69 ---- application/config/doctypes.php | 15 - application/config/foreign_chars.php | 64 ---- application/config/hooks.php | 16 - application/config/index.html | 10 - application/config/migration.php | 42 -- application/config/mimes.php | 106 ----- application/config/profiler.php | 17 - application/config/routes.php | 46 --- application/config/smileys.php | 66 ---- application/config/user_agents.php | 178 --------- application/controllers/index.html | 10 - application/controllers/welcome.php | 27 -- application/core/index.html | 10 - application/errors/error_404.php | 62 --- application/errors/error_db.php | 62 --- application/errors/error_general.php | 62 --- application/errors/error_php.php | 10 - application/errors/index.html | 10 - application/helpers/index.html | 10 - application/hooks/index.html | 10 - application/index.html | 10 - application/language/english/index.html | 10 - application/libraries/index.html | 10 - application/logs/index.html | 10 - application/models/index.html | 10 - application/third_party/index.html | 10 - application/views/index.html | 10 - application/views/welcome_message.php | 88 ----- .../database/drivers/cubrid/cubrid_driver.php | 8 +- .../database/drivers/cubrid/cubrid_forge.php | 4 +- 36 files changed, 6 insertions(+), 1596 deletions(-) delete mode 100644 application/cache/.htaccess delete mode 100644 application/cache/index.html delete mode 100644 application/config/autoload.php delete mode 100644 application/config/config.php delete mode 100644 application/config/constants.php delete mode 100644 application/config/database.php delete mode 100644 application/config/doctypes.php delete mode 100644 application/config/foreign_chars.php delete mode 100644 application/config/hooks.php delete mode 100644 application/config/index.html delete mode 100644 application/config/migration.php delete mode 100644 application/config/mimes.php delete mode 100644 application/config/profiler.php delete mode 100644 application/config/routes.php delete mode 100644 application/config/smileys.php delete mode 100644 application/config/user_agents.php delete mode 100644 application/controllers/index.html delete mode 100644 application/controllers/welcome.php delete mode 100644 application/core/index.html delete mode 100644 application/errors/error_404.php delete mode 100644 application/errors/error_db.php delete mode 100644 application/errors/error_general.php delete mode 100644 application/errors/error_php.php delete mode 100644 application/errors/index.html delete mode 100644 application/helpers/index.html delete mode 100644 application/hooks/index.html delete mode 100644 application/index.html delete mode 100644 application/language/english/index.html delete mode 100644 application/libraries/index.html delete mode 100644 application/logs/index.html delete mode 100644 application/models/index.html delete mode 100644 application/third_party/index.html delete mode 100644 application/views/index.html delete mode 100644 application/views/welcome_message.php diff --git a/application/cache/.htaccess b/application/cache/.htaccess deleted file mode 100644 index 3418e55a..00000000 --- a/application/cache/.htaccess +++ /dev/null @@ -1 +0,0 @@ -deny from all \ No newline at end of file diff --git a/application/cache/index.html b/application/cache/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/cache/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/config/autoload.php b/application/config/autoload.php deleted file mode 100644 index 53129c9c..00000000 --- a/application/config/autoload.php +++ /dev/null @@ -1,116 +0,0 @@ - '', - 'xhtml1-strict' => '', - 'xhtml1-trans' => '', - 'xhtml1-frame' => '', - 'html5' => '', - 'html4-strict' => '', - 'html4-trans' => '', - 'html4-frame' => '' - ); - -/* End of file doctypes.php */ -/* Location: ./application/config/doctypes.php */ \ No newline at end of file diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php deleted file mode 100644 index 14b0d737..00000000 --- a/application/config/foreign_chars.php +++ /dev/null @@ -1,64 +0,0 @@ - 'ae', - '/ö|Å“/' => 'oe', - '/ü/' => 'ue', - '/Ä/' => 'Ae', - '/Ü/' => 'Ue', - '/Ö/' => 'Oe', - '/À|Ã|Â|Ã|Ä|Ã…|Ǻ|Ä€|Ä‚|Ä„|Ç/' => 'A', - '/à|á|â|ã|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', - '/Ç|Ć|Ĉ|ÄŠ|ÄŒ/' => 'C', - '/ç|ć|ĉ|Ä‹|Ä/' => 'c', - '/Ã|ÄŽ|Ä/' => 'D', - '/ð|Ä|Ä‘/' => 'd', - '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', - '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›/' => 'e', - '/Äœ|Äž|Ä |Ä¢/' => 'G', - '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', - '/Ĥ|Ħ/' => 'H', - '/Ä¥|ħ/' => 'h', - '/ÃŒ|Ã|ÃŽ|Ã|Ĩ|Ī|Ĭ|Ç|Ä®|İ/' => 'I', - '/ì|í|î|ï|Ä©|Ä«|Ä­|Ç|į|ı/' => 'i', - '/Ä´/' => 'J', - '/ĵ/' => 'j', - '/Ķ/' => 'K', - '/Ä·/' => 'k', - '/Ĺ|Ä»|Ľ|Ä¿|Å/' => 'L', - '/ĺ|ļ|ľ|Å€|Å‚/' => 'l', - '/Ñ|Ń|Å…|Ň/' => 'N', - '/ñ|Å„|ņ|ň|ʼn/' => 'n', - '/Ã’|Ó|Ô|Õ|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', - '/ò|ó|ô|õ|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', - '/Å”|Å–|Ř/' => 'R', - '/Å•|Å—|Å™/' => 'r', - '/Åš|Åœ|Åž|Å /' => 'S', - '/Å›|Å|ÅŸ|Å¡|Å¿/' => 's', - '/Å¢|Ť|Ŧ/' => 'T', - '/Å£|Å¥|ŧ/' => 't', - '/Ù|Ú|Û|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', - '/ù|ú|û|Å©|Å«|Å­|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', - '/Ã|Ÿ|Ŷ/' => 'Y', - '/ý|ÿ|Å·/' => 'y', - '/Å´/' => 'W', - '/ŵ/' => 'w', - '/Ź|Å»|Ž/' => 'Z', - '/ź|ż|ž/' => 'z', - '/Æ|Ǽ/' => 'AE', - '/ß/'=> 'ss', - '/IJ/' => 'IJ', - '/ij/' => 'ij', - '/Å’/' => 'OE', - '/Æ’/' => 'f' -); - -/* End of file foreign_chars.php */ -/* Location: ./application/config/foreign_chars.php */ \ No newline at end of file diff --git a/application/config/hooks.php b/application/config/hooks.php deleted file mode 100644 index a4ad2be6..00000000 --- a/application/config/hooks.php +++ /dev/null @@ -1,16 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/config/migration.php b/application/config/migration.php deleted file mode 100644 index 509fd90a..00000000 --- a/application/config/migration.php +++ /dev/null @@ -1,42 +0,0 @@ -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 diff --git a/application/config/mimes.php b/application/config/mimes.php deleted file mode 100644 index 8065794f..00000000 --- a/application/config/mimes.php +++ /dev/null @@ -1,106 +0,0 @@ - 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), - 'bin' => 'application/macbinary', - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => array('application/octet-stream', 'application/x-msdownload'), - 'class' => 'application/octet-stream', - 'psd' => 'application/x-photoshop', - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => array('application/pdf', 'application/x-download'), - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), - 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), - 'wbxml' => 'application/wbxml', - 'wmlc' => 'application/wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'js' => 'application/x-javascript', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), - 'xhtml' => 'application/xhtml+xml', - 'xht' => 'application/xhtml+xml', - 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', - 'wav' => 'audio/x-wav', - 'bmp' => 'image/bmp', - 'gif' => 'image/gif', - 'jpeg' => array('image/jpeg', 'image/pjpeg'), - 'jpg' => array('image/jpeg', 'image/pjpeg'), - 'jpe' => array('image/jpeg', 'image/pjpeg'), - 'png' => array('image/png', 'image/x-png'), - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => array('text/plain', 'text/x-log'), - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'word' => array('application/msword', 'application/octet-stream'), - 'xl' => 'application/excel', - 'eml' => 'message/rfc822', - 'json' => array('application/json', 'text/json') - ); - - -/* End of file mimes.php */ -/* Location: ./application/config/mimes.php */ \ No newline at end of file diff --git a/application/config/profiler.php b/application/config/profiler.php deleted file mode 100644 index f8a5b1a1..00000000 --- a/application/config/profiler.php +++ /dev/null @@ -1,17 +0,0 @@ - array('grin.gif', '19', '19', 'grin'), - ':lol:' => array('lol.gif', '19', '19', 'LOL'), - ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), - ':)' => array('smile.gif', '19', '19', 'smile'), - ';-)' => array('wink.gif', '19', '19', 'wink'), - ';)' => array('wink.gif', '19', '19', 'wink'), - ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), - ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), - ':-S' => array('confused.gif', '19', '19', 'confused'), - ':wow:' => array('surprise.gif', '19', '19', 'surprised'), - ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), - ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), - '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), - ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), - ':P' => array('raspberry.gif', '19', '19', 'raspberry'), - ':blank:' => array('blank.gif', '19', '19', 'blank stare'), - ':long:' => array('longface.gif', '19', '19', 'long face'), - ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), - ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), - ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), - '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), - ':down:' => array('downer.gif', '19', '19', 'downer'), - ':red:' => array('embarrassed.gif', '19', '19', 'red face'), - ':sick:' => array('sick.gif', '19', '19', 'sick'), - ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), - ':-/' => array('hmm.gif', '19', '19', 'hmmm'), - '>:(' => array('mad.gif', '19', '19', 'mad'), - ':mad:' => array('mad.gif', '19', '19', 'mad'), - '>:-(' => array('angry.gif', '19', '19', 'angry'), - ':angry:' => array('angry.gif', '19', '19', 'angry'), - ':zip:' => array('zip.gif', '19', '19', 'zipper'), - ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), - ':ahhh:' => array('shock.gif', '19', '19', 'shock'), - ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), - ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), - ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), - ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), - ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), - ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), - ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), - ':snake:' => array('snake.gif', '19', '19', 'snake'), - ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), - ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item - - ); - -/* End of file smileys.php */ -/* Location: ./application/config/smileys.php */ \ No newline at end of file diff --git a/application/config/user_agents.php b/application/config/user_agents.php deleted file mode 100644 index e2d3c3af..00000000 --- a/application/config/user_agents.php +++ /dev/null @@ -1,178 +0,0 @@ - 'Windows Longhorn', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 5.1' => 'Windows XP', - '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' - ); - -$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' - - // 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", - - // Operating Systems - '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", - - // 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" - ); - -// 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' - ); - -/* End of file user_agents.php */ -/* Location: ./application/config/user_agents.php */ \ No newline at end of file diff --git a/application/controllers/index.html b/application/controllers/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/controllers/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php deleted file mode 100644 index 21bef43d..00000000 --- a/application/controllers/welcome.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @see http://codeigniter.com/user_guide/general/urls.html - */ - public function index() - { - $this->load->view('welcome_message'); - } -} - -/* End of file welcome.php */ -/* Location: ./application/controllers/welcome.php */ \ No newline at end of file diff --git a/application/core/index.html b/application/core/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/core/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/errors/error_404.php b/application/errors/error_404.php deleted file mode 100644 index 792726a6..00000000 --- a/application/errors/error_404.php +++ /dev/null @@ -1,62 +0,0 @@ - - - -404 Page Not Found - - - -
      -

      - -
      - - \ No newline at end of file diff --git a/application/errors/error_db.php b/application/errors/error_db.php deleted file mode 100644 index b396cda9..00000000 --- a/application/errors/error_db.php +++ /dev/null @@ -1,62 +0,0 @@ - - - -Database Error - - - -
      -

      - -
      - - \ No newline at end of file diff --git a/application/errors/error_general.php b/application/errors/error_general.php deleted file mode 100644 index fd63ce2c..00000000 --- a/application/errors/error_general.php +++ /dev/null @@ -1,62 +0,0 @@ - - - -Error - - - -
      -

      - -
      - - \ No newline at end of file diff --git a/application/errors/error_php.php b/application/errors/error_php.php deleted file mode 100644 index f085c203..00000000 --- a/application/errors/error_php.php +++ /dev/null @@ -1,10 +0,0 @@ -
      - -

      A PHP Error was encountered

      - -

      Severity:

      -

      Message:

      -

      Filename:

      -

      Line Number:

      - -
      \ No newline at end of file diff --git a/application/errors/index.html b/application/errors/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/errors/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/helpers/index.html b/application/helpers/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/helpers/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/hooks/index.html b/application/hooks/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/hooks/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/index.html b/application/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/language/english/index.html b/application/language/english/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/language/english/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/libraries/index.html b/application/libraries/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/libraries/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/logs/index.html b/application/logs/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/logs/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/models/index.html b/application/models/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/models/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/third_party/index.html b/application/third_party/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/third_party/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/views/index.html b/application/views/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/views/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - 403 Forbidden - - - -

      Directory access is forbidden.

      - - - \ No newline at end of file diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php deleted file mode 100644 index 0bf5a8d2..00000000 --- a/application/views/welcome_message.php +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Welcome to CodeIgniter - - - - - -
      -

      Welcome to CodeIgniter!

      - -
      -

      The page you are looking at is being generated dynamically by CodeIgniter.

      - -

      If you would like to edit this page you'll find it located at:

      - application/views/welcome_message.php - -

      The corresponding controller for this page is found at:

      - application/controllers/welcome.php - -

      If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

      -
      - - -
      - - - \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index ef0b5b45..9b5d86aa 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -545,7 +545,7 @@ function _from_tables($tables) */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (\"".implode('\", \"', $keys)."\") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -564,7 +564,7 @@ function _insert($table, $keys, $values) */ function _replace($table, $keys, $values) { - return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -582,7 +582,7 @@ function _replace($table, $keys, $values) */ function _insert_batch($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); + return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values); } // -------------------------------------------------------------------- @@ -605,7 +605,7 @@ function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { - $valstr[] = $key . ' = ' . $val; + $valstr[] = sprintf('"%s" = %s', $key, $val); } $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index c2c553f2..1de0db10 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -81,7 +81,7 @@ function _process_fields($fields) { $attributes = array_change_key_case($attributes, CASE_UPPER); - $sql .= "\n\t".$this->db->_protect_identifiers($field); + $sql .= "\n\t\"".$this->db->_protect_identifiers($field) . "\""; if (array_key_exists('NAME', $attributes)) { @@ -203,7 +203,7 @@ function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) $key = array($key_name); } - $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")"; + $sql .= ",\n\tKEY \"{$key_name}\" (" . implode(', ', $key) . ")"; } } From 8f5b35429f4276bdfe715ad3615e376eb1218001 Mon Sep 17 00:00:00 2001 From: "jondavidjohn(work)" Date: Wed, 10 Aug 2011 10:22:07 -0500 Subject: [PATCH 2525/2544] Added "date" Form Validation rule to check date validity and format including documentation --- .../language/english/form_validation_lang.php | 1 + system/libraries/Form_validation.php | 50 +++++++++++++++++++ user_guide/libraries/form_validation.html | 7 +++ 3 files changed, 58 insertions(+) mode change 100644 => 100755 system/libraries/Form_validation.php diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 3418f29a..9f2957d9 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -23,6 +23,7 @@ $lang['decimal'] = "The %s field must contain a decimal number."; $lang['less_than'] = "The %s field must contain a number less than %s."; $lang['greater_than'] = "The %s field must contain a number greater than %s."; +$lang['date'] = "The %s field must contain a valid date, correctly formatted."; /* End of file form_validation_lang.php */ diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php old mode 100644 new mode 100755 index fd95d76f..05a7d360 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1373,6 +1373,56 @@ public function encode_php_tags($str) { return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); } + + + // -------------------------------------------------------------------- + + /** + * Check date format and validity + * + * @access public + * @param string (date) + * @param string (format) + * @return string + * @author jondavidjohn + */ + function date($str,$format) + { + $search = array( + '/[yY]/', + '/[mM]/', + '/[dD]/', + ); + + $replace = array( + '(?P[0-9]{4})', + '(?P[0-9]{1,2})', + '(?P[0-9]{1,2})', + ); + + $pattern = preg_replace($search, $replace, $format); + $pattern = str_replace('/','\/',$pattern); + + if (preg_match('/^' . $pattern . '$/', $str, $match)) + { + $year = $match['year']; + $month = $match['month']; + $day = $match['day']; + + if(checkdate($month,$day,$year)) + { + return TRUE; + } + else + { + return FALSE; + } + } + else + { + return FALSE; + } + } } // END Form Validation Class diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index bba8f507..f32ce695 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -952,6 +952,13 @@

      Rule Reference

      Returns FALSE if the form element is not unique to the table and field name in the parameter. is_unique[table.field] + + + date + Yes + Returns FALSE if the input format does not match the format and check as a valid date, including date delimiters ( . / - ). (format character case has no effect) + date[y-m-d] date[M.Y.D] date[d/M/y] + min_length From 66a3677649db1706c4e59830ffd368320d6327a8 Mon Sep 17 00:00:00 2001 From: "jondavidjohn(work)" Date: Wed, 10 Aug 2011 10:38:06 -0500 Subject: [PATCH 2526/2544] Updated Form Validation set_message() to support arrays similar to set_rules() --- system/libraries/Form_validation.php | 9 +++++++++ user_guide/libraries/form_validation.html | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 05a7d360..ae0f1add 100755 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -168,6 +168,15 @@ public function set_message($lang, $val = '') { $lang = array($lang => $val); } + else + { + $new_lang = array(); + foreach($lang as $l) + { + $new_lang[$l['rule']] = $l['message']; + } + $lang = $new_lang; + } $this->_error_messages = array_merge($this->_error_messages, $lang); diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index f32ce695..35b8a6dc 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -586,6 +586,22 @@

      Setting Error Messages

      $this->form_validation->set_message('required', 'Your custom message here'); +

      You can also set custom messages with arrays, in the same way you set rules. Use the following structure:

      + From 664a9357cd36be2f8e673cae3643318a695de5fb Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Wed, 10 Aug 2011 16:02:32 -0500 Subject: [PATCH 2527/2544] 404_override route now works for missing controllers in subdirectories and functions that fail the security check in CodeIgniter.php --- system/core/CodeIgniter.php | 20 +++++++++++++++++++- system/core/Router.php | 15 ++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 03b25ab9..b4944900 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -267,7 +267,25 @@ function &get_instance() OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) ) { - show_404("{$class}/{$method}"); + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.'.php'); + } + } + else + { + show_404("{$class}/{$method}"); + } } /* diff --git a/system/core/Router.php b/system/core/Router.php index 5e92a04b..668ac095 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -244,7 +244,20 @@ function _validate_request($segments) // Does the requested controller exist in the sub-folder? if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php')) { - show_404($this->fetch_directory().$segments[0]); + if ( ! empty($this->routes['404_override'])) + { + $x = explode('/', $this->routes['404_override']); + + $this->set_directory(''); + $this->set_class($x[0]); + $this->set_method(isset($x[1]) ? $x[1] : 'index'); + + return $x; + } + else + { + show_404($this->fetch_directory().$segments[0]); + } } } else From 6adfe636980da3a7b25e5b87ed8bcd1d008a1243 Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Wed, 10 Aug 2011 16:42:53 -0500 Subject: [PATCH 2528/2544] Reset loaded files arrays in the Loader so the 404_override controller can access autoloaded libraries. If a controller exists but a method is not found the current $CI instance is unset and a new one is created for the 404 override controller. Any autoloaded libraries will not be available to the 404 override controller because the Loader sees them as already have been loaded. To fix this we need to reset the loader. I implemented it via an initialize function that resets the loaded files arrays and then calls the autoloader. This also simplifies things in CI_Controller because it only has to call one loader function instead. --- system/core/Controller.php | 2 +- system/core/Loader.php | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/system/core/Controller.php b/system/core/Controller.php index ec86b792..fddb81e1 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -48,7 +48,7 @@ public function __construct() $this->load =& load_class('Loader', 'core'); - $this->load->set_base_classes()->ci_autoloader(); + $this->load->initialize(); log_message('debug', "Controller Class Initialized"); } diff --git a/system/core/Loader.php b/system/core/Loader.php index 7c8b298a..2b36c1ca 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -62,17 +62,22 @@ public function __construct() // -------------------------------------------------------------------- /** - * Set _base_classes variable + * Initialize the Loader * * This method is called once in CI_Controller. * * @param array * @return object */ - public function set_base_classes() + public function initialize() { + $this->_ci_classes = array(); + $this->_ci_loaded_files = array(); + $this->_ci_models = array(); $this->_base_classes =& is_loaded(); - + + $this->_ci_autoloader(); + return $this; } @@ -1020,23 +1025,19 @@ protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * - * This function is public, as it's used in the CI_Controller class. - * However, there is no reason you should ever needs to use it. - * * @param array * @return void */ - public function ci_autoloader() + private function _ci_autoloader() { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { - include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } else { - include_once(APPPATH.'config/autoload.php'); + include(APPPATH.'config/autoload.php'); } - if ( ! isset($autoload)) { From 3c0801daa812a46b45146c54d905f089d4482976 Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Wed, 10 Aug 2011 20:27:24 -0500 Subject: [PATCH 2529/2544] Adding a note to the changelog about 404_override --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a50ea31a..e0cefc31 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -106,6 +106,7 @@

      Bug fixes for 2.0.3

    127. Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.
    128. Fixed a bug where the method $this->cart->total_items() from Cart Library now returns the sum of the quantity of all items in the cart instead of your total count.
    129. Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.
    130. +
    131. Fixed a bug (Reactor #19) where 1) the 404_override route was being ignored in some cases, and 2) auto-loaded libraries were not available to the 404_override controller when a controller existed but the requested method did not.
    132. Version 2.0.2

      From 2ab2b1e3201a1eca2954ca463df744d5cd2e46cd Mon Sep 17 00:00:00 2001 From: Esen Sagynov Date: Thu, 11 Aug 2011 00:41:16 -0700 Subject: [PATCH 2530/2544] Added back /application/* files (removed in previous commit accidently). Corrected formatting/indenting in CUBRID Driver classes. Added myself as the driver author. Applied the MySQL fix, previously accepted in pull request #29, to CUBRID Driver. --- application/cache/.htaccess | 1 + application/cache/index.html | 10 + application/config/autoload.php | 116 ++++++ application/config/config.php | 362 ++++++++++++++++++ application/config/constants.php | 41 ++ application/config/database.php | 68 ++++ application/config/doctypes.php | 15 + application/config/foreign_chars.php | 64 ++++ application/config/hooks.php | 16 + application/config/index.html | 10 + application/config/mimes.php | 106 +++++ application/config/profiler.php | 17 + application/config/routes.php | 46 +++ application/config/smileys.php | 66 ++++ application/config/user_agents.php | 178 +++++++++ application/controllers/index.html | 10 + application/controllers/welcome.php | 27 ++ application/core/index.html | 10 + application/errors/error_404.php | 62 +++ application/errors/error_db.php | 62 +++ application/errors/error_general.php | 62 +++ application/errors/error_php.php | 10 + application/errors/index.html | 10 + application/helpers/index.html | 10 + application/hooks/index.html | 10 + application/index.html | 10 + application/language/english/index.html | 10 + application/libraries/index.html | 10 + application/logs/index.html | 10 + application/models/index.html | 10 + application/third_party/index.html | 10 + application/views/index.html | 10 + application/views/welcome_message.php | 88 +++++ .../database/drivers/cubrid/cubrid_driver.php | 98 +++-- .../database/drivers/cubrid/cubrid_forge.php | 20 +- .../database/drivers/cubrid/cubrid_result.php | 15 +- .../drivers/cubrid/cubrid_utility.php | 7 +- 37 files changed, 1628 insertions(+), 59 deletions(-) create mode 100644 application/cache/.htaccess create mode 100644 application/cache/index.html create mode 100644 application/config/autoload.php create mode 100644 application/config/config.php create mode 100644 application/config/constants.php create mode 100644 application/config/database.php create mode 100644 application/config/doctypes.php create mode 100644 application/config/foreign_chars.php create mode 100644 application/config/hooks.php create mode 100644 application/config/index.html create mode 100644 application/config/mimes.php create mode 100644 application/config/profiler.php create mode 100644 application/config/routes.php create mode 100644 application/config/smileys.php create mode 100644 application/config/user_agents.php create mode 100644 application/controllers/index.html create mode 100644 application/controllers/welcome.php create mode 100644 application/core/index.html create mode 100644 application/errors/error_404.php create mode 100644 application/errors/error_db.php create mode 100644 application/errors/error_general.php create mode 100644 application/errors/error_php.php create mode 100644 application/errors/index.html create mode 100644 application/helpers/index.html create mode 100644 application/hooks/index.html create mode 100644 application/index.html create mode 100644 application/language/english/index.html create mode 100644 application/libraries/index.html create mode 100644 application/logs/index.html create mode 100644 application/models/index.html create mode 100644 application/third_party/index.html create mode 100644 application/views/index.html create mode 100644 application/views/welcome_message.php diff --git a/application/cache/.htaccess b/application/cache/.htaccess new file mode 100644 index 00000000..3418e55a --- /dev/null +++ b/application/cache/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/application/cache/index.html b/application/cache/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/cache/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/config/autoload.php b/application/config/autoload.php new file mode 100644 index 00000000..53129c9c --- /dev/null +++ b/application/config/autoload.php @@ -0,0 +1,116 @@ + '', + 'xhtml1-strict' => '', + 'xhtml1-trans' => '', + 'xhtml1-frame' => '', + 'html5' => '', + 'html4-strict' => '', + 'html4-trans' => '', + 'html4-frame' => '' + ); + +/* End of file doctypes.php */ +/* Location: ./application/config/doctypes.php */ \ No newline at end of file diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php new file mode 100644 index 00000000..14b0d737 --- /dev/null +++ b/application/config/foreign_chars.php @@ -0,0 +1,64 @@ + 'ae', + '/ö|Å“/' => 'oe', + '/ü/' => 'ue', + '/Ä/' => 'Ae', + '/Ü/' => 'Ue', + '/Ö/' => 'Oe', + '/À|Ã|Â|Ã|Ä|Ã…|Ǻ|Ä€|Ä‚|Ä„|Ç/' => 'A', + '/à|á|â|ã|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', + '/Ç|Ć|Ĉ|ÄŠ|ÄŒ/' => 'C', + '/ç|ć|ĉ|Ä‹|Ä/' => 'c', + '/Ã|ÄŽ|Ä/' => 'D', + '/ð|Ä|Ä‘/' => 'd', + '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', + '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›/' => 'e', + '/Äœ|Äž|Ä |Ä¢/' => 'G', + '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', + '/Ĥ|Ħ/' => 'H', + '/Ä¥|ħ/' => 'h', + '/ÃŒ|Ã|ÃŽ|Ã|Ĩ|Ī|Ĭ|Ç|Ä®|İ/' => 'I', + '/ì|í|î|ï|Ä©|Ä«|Ä­|Ç|į|ı/' => 'i', + '/Ä´/' => 'J', + '/ĵ/' => 'j', + '/Ķ/' => 'K', + '/Ä·/' => 'k', + '/Ĺ|Ä»|Ľ|Ä¿|Å/' => 'L', + '/ĺ|ļ|ľ|Å€|Å‚/' => 'l', + '/Ñ|Ń|Å…|Ň/' => 'N', + '/ñ|Å„|ņ|ň|ʼn/' => 'n', + '/Ã’|Ó|Ô|Õ|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', + '/ò|ó|ô|õ|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', + '/Å”|Å–|Ř/' => 'R', + '/Å•|Å—|Å™/' => 'r', + '/Åš|Åœ|Åž|Å /' => 'S', + '/Å›|Å|ÅŸ|Å¡|Å¿/' => 's', + '/Å¢|Ť|Ŧ/' => 'T', + '/Å£|Å¥|ŧ/' => 't', + '/Ù|Ú|Û|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', + '/ù|ú|û|Å©|Å«|Å­|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', + '/Ã|Ÿ|Ŷ/' => 'Y', + '/ý|ÿ|Å·/' => 'y', + '/Å´/' => 'W', + '/ŵ/' => 'w', + '/Ź|Å»|Ž/' => 'Z', + '/ź|ż|ž/' => 'z', + '/Æ|Ǽ/' => 'AE', + '/ß/'=> 'ss', + '/IJ/' => 'IJ', + '/ij/' => 'ij', + '/Å’/' => 'OE', + '/Æ’/' => 'f' +); + +/* End of file foreign_chars.php */ +/* Location: ./application/config/foreign_chars.php */ \ No newline at end of file diff --git a/application/config/hooks.php b/application/config/hooks.php new file mode 100644 index 00000000..a4ad2be6 --- /dev/null +++ b/application/config/hooks.php @@ -0,0 +1,16 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/config/mimes.php b/application/config/mimes.php new file mode 100644 index 00000000..8065794f --- /dev/null +++ b/application/config/mimes.php @@ -0,0 +1,106 @@ + 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), + 'bin' => 'application/macbinary', + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => array('application/octet-stream', 'application/x-msdownload'), + 'class' => 'application/octet-stream', + 'psd' => 'application/x-photoshop', + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => array('application/pdf', 'application/x-download'), + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), + 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'php' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => 'application/x-javascript', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), + 'aif' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => array('image/jpeg', 'image/pjpeg'), + 'jpg' => array('image/jpeg', 'image/pjpeg'), + 'jpe' => array('image/jpeg', 'image/pjpeg'), + 'png' => array('image/png', 'image/x-png'), + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => array('text/plain', 'text/x-log'), + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'word' => array('application/msword', 'application/octet-stream'), + 'xl' => 'application/excel', + 'eml' => 'message/rfc822', + 'json' => array('application/json', 'text/json') + ); + + +/* End of file mimes.php */ +/* Location: ./application/config/mimes.php */ \ No newline at end of file diff --git a/application/config/profiler.php b/application/config/profiler.php new file mode 100644 index 00000000..f8a5b1a1 --- /dev/null +++ b/application/config/profiler.php @@ -0,0 +1,17 @@ + array('grin.gif', '19', '19', 'grin'), + ':lol:' => array('lol.gif', '19', '19', 'LOL'), + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), + ':)' => array('smile.gif', '19', '19', 'smile'), + ';-)' => array('wink.gif', '19', '19', 'wink'), + ';)' => array('wink.gif', '19', '19', 'wink'), + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), + ':-S' => array('confused.gif', '19', '19', 'confused'), + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), + ':long:' => array('longface.gif', '19', '19', 'long face'), + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), + ':down:' => array('downer.gif', '19', '19', 'downer'), + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), + ':sick:' => array('sick.gif', '19', '19', 'sick'), + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), + '>:(' => array('mad.gif', '19', '19', 'mad'), + ':mad:' => array('mad.gif', '19', '19', 'mad'), + '>:-(' => array('angry.gif', '19', '19', 'angry'), + ':angry:' => array('angry.gif', '19', '19', 'angry'), + ':zip:' => array('zip.gif', '19', '19', 'zipper'), + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), + ':snake:' => array('snake.gif', '19', '19', 'snake'), + ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), + ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item + + ); + +/* End of file smileys.php */ +/* Location: ./application/config/smileys.php */ \ No newline at end of file diff --git a/application/config/user_agents.php b/application/config/user_agents.php new file mode 100644 index 00000000..e2d3c3af --- /dev/null +++ b/application/config/user_agents.php @@ -0,0 +1,178 @@ + 'Windows Longhorn', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 5.1' => 'Windows XP', + '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' + ); + +$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' + + // 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", + + // Operating Systems + '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", + + // 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" + ); + +// 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' + ); + +/* End of file user_agents.php */ +/* Location: ./application/config/user_agents.php */ \ No newline at end of file diff --git a/application/controllers/index.html b/application/controllers/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/controllers/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php new file mode 100644 index 00000000..21bef43d --- /dev/null +++ b/application/controllers/welcome.php @@ -0,0 +1,27 @@ + + * @see http://codeigniter.com/user_guide/general/urls.html + */ + public function index() + { + $this->load->view('welcome_message'); + } +} + +/* End of file welcome.php */ +/* Location: ./application/controllers/welcome.php */ \ No newline at end of file diff --git a/application/core/index.html b/application/core/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/core/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/errors/error_404.php b/application/errors/error_404.php new file mode 100644 index 00000000..792726a6 --- /dev/null +++ b/application/errors/error_404.php @@ -0,0 +1,62 @@ + + + +404 Page Not Found + + + +
      +

      + +
      + + \ No newline at end of file diff --git a/application/errors/error_db.php b/application/errors/error_db.php new file mode 100644 index 00000000..b396cda9 --- /dev/null +++ b/application/errors/error_db.php @@ -0,0 +1,62 @@ + + + +Database Error + + + +
      +

      + +
      + + \ No newline at end of file diff --git a/application/errors/error_general.php b/application/errors/error_general.php new file mode 100644 index 00000000..fd63ce2c --- /dev/null +++ b/application/errors/error_general.php @@ -0,0 +1,62 @@ + + + +Error + + + +
      +

      + +
      + + \ No newline at end of file diff --git a/application/errors/error_php.php b/application/errors/error_php.php new file mode 100644 index 00000000..f085c203 --- /dev/null +++ b/application/errors/error_php.php @@ -0,0 +1,10 @@ +
      + +

      A PHP Error was encountered

      + +

      Severity:

      +

      Message:

      +

      Filename:

      +

      Line Number:

      + +
      \ No newline at end of file diff --git a/application/errors/index.html b/application/errors/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/errors/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/helpers/index.html b/application/helpers/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/helpers/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/hooks/index.html b/application/hooks/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/hooks/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/index.html b/application/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/language/english/index.html b/application/language/english/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/language/english/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/libraries/index.html b/application/libraries/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/libraries/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/logs/index.html b/application/logs/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/logs/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/models/index.html b/application/models/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/models/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/third_party/index.html b/application/third_party/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/third_party/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/index.html b/application/views/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/application/views/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php new file mode 100644 index 00000000..0bf5a8d2 --- /dev/null +++ b/application/views/welcome_message.php @@ -0,0 +1,88 @@ + + + + + Welcome to CodeIgniter + + + + + +
      +

      Welcome to CodeIgniter!

      + +
      +

      The page you are looking at is being generated dynamically by CodeIgniter.

      + +

      If you would like to edit this page you'll find it located at:

      + application/views/welcome_message.php + +

      The corresponding controller for this page is found at:

      + application/controllers/welcome.php + +

      If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

      +
      + + +
      + + + \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 9b5d86aa..3f010924 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -1,4 +1,4 @@ -port == '') { $this->port = self::DEFAULT_PORT; - } - - $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); - - if ($conn){ - if (isset($this->auto_commit) && !$this->auto_commit){ - cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE); - } - else{ - cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE); - $this->auto_commit = TRUE; - } - } - - return $conn; + } + + $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); + + if ($conn) + { + // Check if a user wants to run queries in dry, i.e. run the + // queries but not commit them. + if (isset($this->auto_commit) && ! $this->auto_commit) + { + cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE); + } + else + { + cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE); + $this->auto_commit = TRUE; + } + } + + return $conn; } // -------------------------------------------------------------------- @@ -131,8 +137,7 @@ function db_select() // In CUBRID there is no need to select a database as the database // is chosen at the connection time. // So, to determine if the database is "selected", all we have to - // do is return the connection identifier which can be later - // checked if it has been established or not. + // do is ping the server and return that value. return cubrid_ping($this->conn_id); } @@ -155,7 +160,7 @@ function db_set_charset($charset, $collation) } // -------------------------------------------------------------------- - + /** * Version number query string * @@ -164,6 +169,11 @@ function db_set_charset($charset, $collation) */ function _version() { + // To obtain the CUBRID Server version, no need to run the SQL query. + // CUBRID PHP API provides a function to determin this value. + // This is why we also need to add 'cubrid' value to the list of + // $driver_version_exceptions array in DB_driver class in + // version() function. return cubrid_get_server_info($this->conn_id); } @@ -195,6 +205,7 @@ function _execute($sql) */ function _prep_query($sql) { + // No need to prepare return $sql; } @@ -224,8 +235,10 @@ function trans_begin($test_mode = FALSE) // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; - if (cubrid_get_autocommit($this->conn_id)) - cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); + if (cubrid_get_autocommit($this->conn_id)) + { + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); + } return TRUE; } @@ -253,9 +266,11 @@ function trans_commit() cubrid_commit($this->conn_id); - if ($this->auto_commit && !cubrid_get_autocommit($this->conn_id)) - cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); - + if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) + { + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); + } + return TRUE; } @@ -282,9 +297,11 @@ function trans_rollback() cubrid_rollback($this->conn_id); - if ($this->auto_commit && !cubrid_get_autocommit($this->conn_id)) - cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); - + if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) + { + cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); + } + return TRUE; } @@ -303,12 +320,12 @@ function escape_str($str, $like = FALSE) if (is_array($str)) { foreach ($str as $key => $val) - { + { $str[$key] = $this->escape_str($val, $like); - } + } - return $str; - } + return $str; + } if (function_exists('cubrid_real_escape_string') AND is_resource($this->conn_id)) { @@ -322,7 +339,6 @@ function escape_str($str, $like = FALSE) // escape LIKE condition wildcards if ($like === TRUE) { - //TODO: check this $str = str_replace(array('%', '_'), array('\\%', '\\_'), $str); } @@ -545,7 +561,7 @@ function _from_tables($tables) */ function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (\"".implode('\", \"', $keys)."\") VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -648,7 +664,7 @@ function _update_batch($table, $values, $index, $where = NULL) { if ($field != $index) { - $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; } } } diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 1de0db10..bab03f74 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -1,4 +1,4 @@ -db->_protect_identifiers($field) . "\""; + $sql .= "\n\t\"" . $this->db->_protect_identifiers($field) . "\""; if (array_key_exists('NAME', $attributes)) { @@ -90,7 +90,7 @@ function _process_fields($fields) if (array_key_exists('TYPE', $attributes)) { - $sql .= ' '.$attributes['TYPE']; + $sql .= ' '.$attributes['TYPE']; if (array_key_exists('CONSTRAINT', $attributes)) { @@ -125,17 +125,21 @@ function _process_fields($fields) $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? '' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) { $sql .= ' AUTO_INCREMENT'; } - - if (array_key_exists('UNIQUE', $attributes) && $attributes['UNIQUE'] === TRUE) + + if (array_key_exists('UNIQUE', $attributes) && $attributes['UNIQUE'] === TRUE) { $sql .= ' UNIQUE'; } diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index 06613e35..6f0c2b5f 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -1,4 +1,4 @@ -primary_key = ($row[0] > 0 ? 1 : null); } - else{ + else + { $F->primary_key = null; } @@ -138,9 +139,9 @@ function field_data() */ function free_result() { - if(is_resource($this->result_id) || - get_resource_type($this->result_id) == "Unknown" && - preg_match('/Resource id #/', strval($this->result_id))) + if(is_resource($this->result_id) || + get_resource_type($this->result_id) == "Unknown" && + preg_match('/Resource id #/', strval($this->result_id))) { cubrid_close_request($this->result_id); $this->result_id = FALSE; @@ -152,7 +153,7 @@ function free_result() /** * Data Seek * - * Moves the internal pointer to the desired offset. We call + * Moves the internal pointer to the desired offset. We call * this internally before fetching results to make sure the * result set starts at zero * diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index 9cf8b2ea..cd16d1e1 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -1,4 +1,4 @@ -database . "'"; } - else{ + else + { return FALSE; } } From 84dcf3d595e10dfe768923a88644434fa7bee328 Mon Sep 17 00:00:00 2001 From: "jondavidjohn(work)" Date: Thu, 11 Aug 2011 14:21:24 -0500 Subject: [PATCH 2531/2544] Addressed naming issue and default format in line with html5 date input spec --- system/language/english/form_validation_lang.php | 2 +- system/libraries/Form_validation.php | 2 +- user_guide/libraries/form_validation.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 9f2957d9..259c8661 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -23,7 +23,7 @@ $lang['decimal'] = "The %s field must contain a decimal number."; $lang['less_than'] = "The %s field must contain a number less than %s."; $lang['greater_than'] = "The %s field must contain a number greater than %s."; -$lang['date'] = "The %s field must contain a valid date, correctly formatted."; +$lang['valid_date'] = "The %s field must contain a valid date, correctly formatted."; /* End of file form_validation_lang.php */ diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index ae0f1add..77ff2133 100755 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1395,7 +1395,7 @@ public function encode_php_tags($str) * @return string * @author jondavidjohn */ - function date($str,$format) + function valid_date($str,$format = 'y-m-d') { $search = array( '/[yY]/', diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 35b8a6dc..25242749 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -970,10 +970,10 @@

      Rule Reference

      - date - Yes + valid_date + Optional - default format "y-m-d" Returns FALSE if the input format does not match the format and check as a valid date, including date delimiters ( . / - ). (format character case has no effect) - date[y-m-d] date[M.Y.D] date[d/M/y] + valid_date valid_date[M.Y.D] valid_date[d/M/y] From 22dcf66861259fcb9e30cf445d04e3f8a2468aa3 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Thu, 11 Aug 2011 14:30:45 -0500 Subject: [PATCH 2532/2544] added space to conform to coding standards --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 system/libraries/Form_validation.php diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php old mode 100755 new mode 100644 index 77ff2133..ce7fa135 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1395,7 +1395,7 @@ public function encode_php_tags($str) * @return string * @author jondavidjohn */ - function valid_date($str,$format = 'y-m-d') + function valid_date($str, $format = 'y-m-d') { $search = array( '/[yY]/', From 34c8f9df46ffebae9d9cb6251d146fdc8e7ef422 Mon Sep 17 00:00:00 2001 From: Esen Sagynov Date: Thu, 11 Aug 2011 19:47:46 -0700 Subject: [PATCH 2533/2544] Added back the /application/config/migration.php and updated the /applciation/config/database.php file which was incorrectly replaced in previous commit. --- application/config/database.php | 3 ++- application/config/migration.php | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 application/config/migration.php diff --git a/application/config/database.php b/application/config/database.php index fa541a73..b4b34bf6 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -27,7 +27,8 @@ | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database | NOTE: For MySQL and MySQLi databases, this setting is only used -| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. +| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 +| (and in table creation queries made with DB Forge). | There is an incompatibility in PHP with mysql_real_escape_string() which | can make your site vulnerable to SQL injection if you are using a | multi-byte character set and are running versions lower than these. diff --git a/application/config/migration.php b/application/config/migration.php new file mode 100644 index 00000000..509fd90a --- /dev/null +++ b/application/config/migration.php @@ -0,0 +1,42 @@ +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 From 3696ee0a858b2dbf13ef535decddc8329ab31ef7 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Thu, 11 Aug 2011 23:49:30 -0500 Subject: [PATCH 2534/2544] Another spacing issue. --- system/libraries/Form_validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index ce7fa135..f6987a1b 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1418,7 +1418,7 @@ function valid_date($str, $format = 'y-m-d') $month = $match['month']; $day = $match['day']; - if(checkdate($month,$day,$year)) + if (checkdate($month,$day,$year)) { return TRUE; } From 1d7a2a08fb885379288db168c782a3ba0ab94a12 Mon Sep 17 00:00:00 2001 From: jondavidjohn Date: Thu, 11 Aug 2011 23:52:52 -0500 Subject: [PATCH 2535/2544] fixed lang whitespace mistake --- system/language/english/form_validation_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index 259c8661..5da09e16 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -23,7 +23,7 @@ $lang['decimal'] = "The %s field must contain a decimal number."; $lang['less_than'] = "The %s field must contain a number less than %s."; $lang['greater_than'] = "The %s field must contain a number greater than %s."; -$lang['valid_date'] = "The %s field must contain a valid date, correctly formatted."; +$lang['valid_date'] = "The %s field must contain a valid date, correctly formatted."; /* End of file form_validation_lang.php */ From 42284b6da572282327f5aa7641803c7fa03c5a0a Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Fri, 12 Aug 2011 09:33:34 -0500 Subject: [PATCH 2536/2544] improved date rule description --- user_guide/libraries/form_validation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 25242749..a09a6662 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -972,7 +972,7 @@

      Rule Reference

      valid_date Optional - default format "y-m-d" - Returns FALSE if the input format does not match the format and check as a valid date, including date delimiters ( . / - ). (format character case has no effect) + Returns FALSE if the input format does not match the given format and then also checks that the date entered in the correct format is also valid. Formatting character's [m|y|d] case has no effect. Date formatting does NOT follow http://php.net/date formatting characters and is a simplified single character syntax valid_date valid_date[M.Y.D] valid_date[d/M/y] From b18725e9ee08d808cb9d5f54a3d6544f1965b08c Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Fri, 12 Aug 2011 09:36:52 -0500 Subject: [PATCH 2537/2544] removed redundant wording --- user_guide/libraries/form_validation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index a09a6662..8e5ec1e4 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -972,7 +972,7 @@

      Rule Reference

      valid_date Optional - default format "y-m-d" - Returns FALSE if the input format does not match the given format and then also checks that the date entered in the correct format is also valid. Formatting character's [m|y|d] case has no effect. Date formatting does NOT follow http://php.net/date formatting characters and is a simplified single character syntax + Returns FALSE if the input format does not match the given format and then also checks that the date entered is also valid. Formatting character's [m|y|d] case has no effect. Date formatting does NOT follow http://php.net/date formatting characters and is a simplified single character syntax valid_date valid_date[M.Y.D] valid_date[d/M/y] From 050abb8aa6347cb076153f44b2ea0b5f0da006c0 Mon Sep 17 00:00:00 2001 From: David Behler Date: Sun, 14 Aug 2011 20:30:50 +0200 Subject: [PATCH 2538/2544] Added some docs to CI core files --- system/core/Benchmark.php | 5 +++++ system/core/CodeIgniter.php | 12 ++++++++++++ system/core/Config.php | 15 +++++++++++++++ 3 files changed, 32 insertions(+) mode change 100644 => 100755 system/core/Benchmark.php mode change 100644 => 100755 system/core/CodeIgniter.php mode change 100644 => 100755 system/core/Config.php diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php old mode 100644 new mode 100755 index 515550e9..a200727a --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -29,6 +29,11 @@ */ class CI_Benchmark { + /** + * List of all benchmark markers and when they were added + * + * @var array + */ var $marker = array(); // -------------------------------------------------------------------- diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php old mode 100644 new mode 100755 index b4944900..7b92ddf1 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -32,6 +32,12 @@ * Define the CodeIgniter Version * ------------------------------------------------------ */ + /** + * CodeIgniter Version + * + * @var string + * + */ define('CI_VERSION', '2.0.2'); /* @@ -39,6 +45,12 @@ * Define the CodeIgniter Branch (Core = TRUE, Reactor = FALSE) * ------------------------------------------------------ */ + /** + * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) + * + * @var string + * + */ define('CI_CORE', FALSE); /* diff --git a/system/core/Config.php b/system/core/Config.php old mode 100644 new mode 100755 index 1096a9ea..5cacf867 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -28,8 +28,23 @@ */ class CI_Config { + /** + * List of all loaded config values + * + * @var array + */ var $config = array(); + /** + * List of all loaded config files + * + * @var array + */ var $is_loaded = array(); + /** + * List of paths to search when trying to load a config file + * + * @var array + */ var $_config_paths = array(APPPATH); /** From 9b5df59a6be4da0016b738de8c4fcd3a14d43867 Mon Sep 17 00:00:00 2001 From: David Behler Date: Sun, 14 Aug 2011 21:04:17 +0200 Subject: [PATCH 2539/2544] Added some docs to CI core files --- system/core/Hooks.php | 15 +++++++++++ system/core/Input.php | 62 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 13 deletions(-) mode change 100644 => 100755 system/core/Hooks.php mode change 100644 => 100755 system/core/Input.php diff --git a/system/core/Hooks.php b/system/core/Hooks.php old mode 100644 new mode 100755 index fd6380f0..33f1c034 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -28,8 +28,23 @@ */ class CI_Hooks { + /** + * Determines wether hooks are enabled + * + * @var bool + */ var $enabled = FALSE; + /** + * List of all hooks set in config/hooks.php + * + * @var array + */ var $hooks = array(); + /** + * Determines wether hook is in progress, used to prevent infinte loops + * + * @var bool + */ var $in_progress = FALSE; /** diff --git a/system/core/Input.php b/system/core/Input.php old mode 100644 new mode 100755 index dc7612e6..64d6c360 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -28,15 +28,51 @@ */ class CI_Input { + /** + * IP address of the current user + * + * @var string + */ var $ip_address = FALSE; + /** + * user agent (web browser) being used by the current user + * + * @var string + */ var $user_agent = FALSE; + /** + * If FALSE, then $_GET will be set to an empty array + * + * @var bool + */ var $_allow_get_array = TRUE; + /** + * If TRUE, then newlines are standardized + * + * @var bool + */ var $_standardize_newlines = TRUE; - var $_enable_xss = FALSE; // Set automatically based on config setting - var $_enable_csrf = FALSE; // Set automatically based on config setting - + /** + * Determines whether the XSS filter is always active when GET, POST or COOKIE data is encountered + * Set automatically based on config setting + * + * @var bool + */ + var $_enable_xss = FALSE; + /** + * Enables a CSRF cookie token to be set. + * Set automatically based on config setting + * + * @var bool + */ + var $_enable_csrf = FALSE; + /** + * List of all HTTP request headers + * + * @var array + */ protected $headers = array(); - + /** * Constructor @@ -147,7 +183,7 @@ function post($index = NULL, $xss_clean = FALSE) } return $post; } - + return $this->_fetch_from_array($_POST, $index, $xss_clean); } @@ -402,9 +438,9 @@ function user_agent() function _sanitize_globals() { // It would be "wrong" to unset any of these GLOBALS. - $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', + $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA', - 'system_folder', 'application_folder', 'BM', 'EXT', + 'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN'); // Unset globals for securiy. @@ -523,7 +559,7 @@ function _clean_input_data($str) { $str = $this->uni->clean_string($str); } - + // Remove control characters $str = remove_invisible_characters($str); @@ -579,7 +615,7 @@ function _clean_input_keys($str) /** * Request Headers * - * In Apache, you can simply call apache_request_headers(), however for + * In Apache, you can simply call apache_request_headers(), however for * people running other webservers the function is undefined. * * @return array @@ -609,10 +645,10 @@ public function request_headers($xss_clean = FALSE) { $key = str_replace('_', ' ', strtolower($key)); $key = str_replace(' ', '-', ucwords($key)); - + $this->headers[$key] = $val; } - + return $this->headers; } @@ -633,7 +669,7 @@ public function get_request_header($index, $xss_clean = FALSE) { $this->request_headers(); } - + if ( ! isset($this->headers[$index])) { return FALSE; @@ -644,7 +680,7 @@ public function get_request_header($index, $xss_clean = FALSE) return $this->security->xss_clean($this->headers[$index]); } - return $this->headers[$index]; + return $this->headers[$index]; } // -------------------------------------------------------------------- From 209b2cf0feac54b4e4fd4c3896524cfc65bf8a46 Mon Sep 17 00:00:00 2001 From: David Behler Date: Sun, 14 Aug 2011 23:00:43 +0200 Subject: [PATCH 2540/2544] Added some docs to CI core files --- system/core/Exceptions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) mode change 100644 => 100755 system/core/Exceptions.php diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php old mode 100644 new mode 100755 index bff86a92..6a63ca73 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -30,8 +30,22 @@ class CI_Exceptions { var $message; var $filename; var $line; + + /** + * Nesting level of the output buffering mechanism + * Used to + * + * @var int + * @access public + */ var $ob_level; + /** + * List if available error levels + * + * @var array + * @access public + */ var $levels = array( E_ERROR => 'Error', E_WARNING => 'Warning', From cda768a957172d5da7aa7637337405c39e0f774d Mon Sep 17 00:00:00 2001 From: David Behler Date: Sun, 14 Aug 2011 23:52:48 +0200 Subject: [PATCH 2541/2544] Added some docs to CI core files --- system/core/Exceptions.php | 5 +- system/core/Input.php | 2 + system/core/Lang.php | 13 +++++ system/core/Loader.php | 102 +++++++++++++++++++++++++++++++++---- system/core/Model.php | 1 + 5 files changed, 110 insertions(+), 13 deletions(-) mode change 100644 => 100755 system/core/Lang.php mode change 100644 => 100755 system/core/Loader.php mode change 100644 => 100755 system/core/Model.php diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 6a63ca73..869739a5 100755 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -33,7 +33,6 @@ class CI_Exceptions { /** * Nesting level of the output buffering mechanism - * Used to * * @var int * @access public @@ -98,7 +97,8 @@ function log_exception($severity, $message, $filepath, $line) * 404 Page Not Found Handler * * @access private - * @param string + * @param string the page + * @param bool log error yes/no * @return string */ function show_404($page = '', $log_error = TRUE) @@ -129,6 +129,7 @@ function show_404($page = '', $log_error = TRUE) * @param string the heading * @param string the message * @param string the template name + * @param int the status code * @return string */ function show_error($heading, $message, $template = 'error_general', $status_code = 500) diff --git a/system/core/Input.php b/system/core/Input.php index 64d6c360..bc202b3f 100755 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -618,6 +618,8 @@ function _clean_input_keys($str) * In Apache, you can simply call apache_request_headers(), however for * people running other webservers the function is undefined. * + * @param bool XSS cleaning + * * @return array */ public function request_headers($xss_clean = FALSE) diff --git a/system/core/Lang.php b/system/core/Lang.php old mode 100644 new mode 100755 index 170e6c72..5ac67183 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -26,7 +26,17 @@ */ class CI_Lang { + /** + * List of translations + * + * @var array + */ var $language = array(); + /** + * List of loaded language files + * + * @var array + */ var $is_loaded = array(); /** @@ -47,6 +57,9 @@ function __construct() * @access public * @param mixed the name of the language file to be loaded. Can be an array * @param string the language (english, etc.) + * @param bool return loaded array of translations + * @param bool add suffix to $langfile + * @param string alternative path to look for language file * @return mixed */ function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '') diff --git a/system/core/Loader.php b/system/core/Loader.php old mode 100644 new mode 100755 index 2b36c1ca..019de82c --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -29,18 +29,91 @@ class CI_Loader { // All these are set automatically. Don't mess with them. + /** + * Nesting level of the output buffering mechanism + * + * @var int + * @access protected + */ protected $_ci_ob_level; + /** + * List of paths to load views from + * + * @var array + * @access protected + */ protected $_ci_view_paths = array(); + /** + * List of paths to load libraries from + * + * @var array + * @access protected + */ protected $_ci_library_paths = array(); + /** + * List of paths to load models from + * + * @var array + * @access protected + */ protected $_ci_model_paths = array(); + /** + * List of paths to load helpers from + * + * @var array + * @access protected + */ protected $_ci_helper_paths = array(); + /** + * List of loaded base classes + * Set by the controller class + * + * @var array + * @access protected + */ protected $_base_classes = array(); // Set by the controller class + /** + * List of cached variables + * + * @var array + * @access protected + */ protected $_ci_cached_vars = array(); + /** + * List of loaded classes + * + * @var array + * @access protected + */ protected $_ci_classes = array(); + /** + * List of loaded files + * + * @var array + * @access protected + */ protected $_ci_loaded_files = array(); + /** + * List of loaded models + * + * @var array + * @access protected + */ protected $_ci_models = array(); + /** + * List of loaded helpers + * + * @var array + * @access protected + */ protected $_ci_helpers = array(); - protected $_ci_varmap = array('unit_test' => 'unit', + /** + * List of class name mappings + * + * @var array + * @access protected + */ + protected $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); /** @@ -55,18 +128,18 @@ public function __construct() $this->_ci_helper_paths = array(APPPATH, BASEPATH); $this->_ci_model_paths = array(APPPATH); $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); - + log_message('debug', "Loader Class Initialized"); } // -------------------------------------------------------------------- - + /** * Initialize the Loader * * This method is called once in CI_Controller. * - * @param array + * @param array * @return object */ public function initialize() @@ -101,7 +174,7 @@ public function is_loaded($class) { return $this->_ci_classes[$class]; } - + return FALSE; } @@ -371,6 +444,7 @@ public function file($path, $return = FALSE) * the controller class and its "view" files. * * @param array + * @param string * @return void */ public function vars($vars = array(), $val = '') @@ -512,6 +586,8 @@ public function language($file = array(), $lang = '') * Loads a config file * * @param string + * @param bool + * @param bool * @return void */ public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) @@ -558,13 +634,13 @@ public function driver($library = '', $params = NULL, $object_name = NULL) * Prepends a parent path to the library, model, helper, and config path arrays * * @param string - * @param boolean + * @param boolean * @return void */ public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; - + array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); @@ -600,6 +676,7 @@ public function get_package_paths($include_base = FALSE) * If no path is provided, the most recently added path is removed. * * @param type + * @param bool * @return type */ public function remove_package_path($path = '', $remove_config_path = TRUE) @@ -624,7 +701,7 @@ public function remove_package_path($path = '', $remove_config_path = TRUE) unset($this->{$var}[$key]); } } - + if (isset($this->_ci_view_paths[$path.'views/'])) { unset($this->_ci_view_paths[$path.'views/']); @@ -663,7 +740,7 @@ protected function _ci_load($_ci_data) { $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } - + $file_exists = FALSE; // Set the path to the requested file @@ -685,11 +762,11 @@ protected function _ci_load($_ci_data) $file_exists = TRUE; break; } - + if ( ! $cascade) { break; - } + } } } @@ -918,6 +995,7 @@ protected function _ci_load_class($class, $params = NULL, $object_name = NULL) * * @param string * @param string + * @param bool * @param string an optional object name * @return null */ @@ -1123,6 +1201,7 @@ protected function _ci_object_to_array($object) /** * Get a reference to a specific library or model * + * @param string * @return bool */ protected function &_ci_get_component($component) @@ -1139,6 +1218,7 @@ protected function &_ci_get_component($component) * This function preps the name of various items to make loading them more reliable. * * @param mixed + * @param string * @return array */ protected function _ci_prep_filename($filename, $extension) diff --git a/system/core/Model.php b/system/core/Model.php old mode 100644 new mode 100755 index 8566a0b6..e15ffbeb --- a/system/core/Model.php +++ b/system/core/Model.php @@ -42,6 +42,7 @@ function __construct() * Allows models to access CI's loaded classes using the same * syntax as controllers. * + * @param string * @access private */ function __get($key) From 07b53422f8d61e6b0b7e6479b0de92ad1a1ce05e Mon Sep 17 00:00:00 2001 From: David Behler Date: Mon, 15 Aug 2011 00:25:06 +0200 Subject: [PATCH 2542/2544] Added some docs to CI core files --- system/core/Output.php | 61 +++++++++++++++++- system/core/Router.php | 46 +++++++++++++- system/core/Security.php | 131 ++++++++++++++++++++++++++------------- system/core/URI.php | 31 +++++++++ system/database/DB.php | 4 +- 5 files changed, 224 insertions(+), 49 deletions(-) mode change 100644 => 100755 system/core/Output.php mode change 100644 => 100755 system/core/Router.php mode change 100644 => 100755 system/core/Security.php mode change 100644 => 100755 system/core/URI.php mode change 100644 => 100755 system/database/DB.php diff --git a/system/core/Output.php b/system/core/Output.php old mode 100644 new mode 100755 index 05ace919..ccecafd2 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -28,15 +28,67 @@ */ class CI_Output { + /** + * Current output string + * + * @var string + * @access protected + */ protected $final_output; + /** + * Cache expiration time + * + * @var int + * @access protected + */ protected $cache_expiration = 0; + /** + * List of server headers + * + * @var array + * @access protected + */ protected $headers = array(); - protected $mime_types = array(); + /** + * List of mime types + * + * @var array + * @access protected + */ + protected $mime_types = array(); + /** + * Determines wether profiler is enabled + * + * @var book + * @access protected + */ protected $enable_profiler = FALSE; + /** + * Determines if output compression is enabled + * + * @var bool + * @access protected + */ protected $_zlib_oc = FALSE; + /** + * List of profiler sections + * + * @var array + * @access protected + */ protected $_profiler_sections = array(); - protected $parse_exec_vars = TRUE; // whether or not to parse variables like {elapsed_time} and {memory_usage} + /** + * Whether or not to parse variables like {elapsed_time} and {memory_usage} + * + * @var bool + * @access protected + */ + protected $parse_exec_vars = TRUE; + /** + * Constructor + * + */ function __construct() { $this->_zlib_oc = @ini_get('zlib.output_compression'); @@ -127,6 +179,7 @@ function append_output($output) * * @access public * @param string + * @param bool * @return void */ function set_header($header, $replace = TRUE) @@ -265,6 +318,7 @@ function cache($time) * benchmark timer so the page rendering speed and memory usage can be shown. * * @access public + * @param string * @return mixed */ function _display($output = '') @@ -401,6 +455,7 @@ function _display($output = '') * Write a Cache File * * @access public + * @param string * @return void */ function _write_cache($output) @@ -452,6 +507,8 @@ function _write_cache($output) * Update/serve a cached file * * @access public + * @param object config class + * @param object uri class * @return void */ function _display_cache(&$CFG, &$URI) diff --git a/system/core/Router.php b/system/core/Router.php old mode 100644 new mode 100755 index 668ac095..6da66747 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -28,12 +28,54 @@ */ class CI_Router { + /** + * Config class + * + * @var object + * @access public + */ var $config; + /** + * List of routes + * + * @var array + * @access public + */ var $routes = array(); + /** + * List of error routes + * + * @var array + * @access public + */ var $error_routes = array(); + /** + * Current class name + * + * @var string + * @access public + */ var $class = ''; + /** + * Current method name + * + * @var string + * @access public + */ var $method = 'index'; + /** + * Sub-directory that contains the requested controller class + * + * @var string + * @access public + */ var $directory = ''; + /** + * Default controller (and method if specific) + * + * @var string + * @access public + */ var $default_controller; /** @@ -95,7 +137,7 @@ function _set_routing() { include(APPPATH.'config/routes.php'); } - + $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route; unset($route); @@ -251,7 +293,7 @@ function _validate_request($segments) $this->set_directory(''); $this->set_class($x[0]); $this->set_method(isset($x[1]) ? $x[1] : 'index'); - + return $x; } else diff --git a/system/core/Security.php b/system/core/Security.php old mode 100644 new mode 100755 index 3617cadc..dcc680a1 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -25,14 +25,49 @@ * @link http://codeigniter.com/user_guide/libraries/security.html */ class CI_Security { - + + /** + * Random Hash for protecting URLs + * + * @var string + * @access protected + */ protected $_xss_hash = ''; + /** + * Random Hash for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ protected $_csrf_hash = ''; - protected $_csrf_expire = 7200; // Two hours (in seconds) + /** + * Expiration time for Cross Site Request Forgery Protection Cookie + * Defaults to two hours (in seconds) + * + * @var int + * @access protected + */ + protected $_csrf_expire = 7200; + /** + * Token name for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ protected $_csrf_token_name = 'ci_csrf_token'; + /** + * Cookie name for Cross Site Request Forgery Protection Cookie + * + * @var string + * @access protected + */ protected $_csrf_cookie_name = 'ci_csrf_token'; - - /* never allowed, string replacement */ + /** + * List of never allowed strings + * + * @var array + * @access protected + */ protected $_never_allowed_str = array( 'document.cookie' => '[removed]', 'document.write' => '[removed]', @@ -46,13 +81,19 @@ class CI_Security { ); /* never allowed, regex replacement */ + /** + * List of never allowed regex replacement + * + * @var array + * @access protected + */ protected $_never_allowed_regex = array( "javascript\s*:" => '[removed]', "expression\s*(\(|&\#40;)" => '[removed]', // CSS and IE "vbscript\s*:" => '[removed]', // IE, surprise! "Redirect\s+302" => '[removed]' ); - + /** * Constructor */ @@ -95,7 +136,7 @@ public function csrf_verify() } // Do the tokens exist in both the _POST and _COOKIE arrays? - if ( ! isset($_POST[$this->_csrf_token_name]) OR + if ( ! isset($_POST[$this->_csrf_token_name]) OR ! isset($_COOKIE[$this->_csrf_cookie_name])) { $this->csrf_show_error(); @@ -107,7 +148,7 @@ public function csrf_verify() $this->csrf_show_error(); } - // We kill this since we're done and we don't want to + // We kill this since we're done and we don't want to // polute the _POST array unset($_POST[$this->_csrf_token_name]); @@ -117,7 +158,7 @@ public function csrf_verify() $this->csrf_set_cookie(); log_message('debug', "CSRF token verified "); - + return $this; } @@ -146,7 +187,7 @@ public function csrf_set_cookie() setcookie($this->_csrf_cookie_name, $this->_csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), $secure_cookie); log_message('debug', "CRSF cookie Set"); - + return $this; } @@ -165,9 +206,9 @@ public function csrf_show_error() // -------------------------------------------------------------------- /** - * Get CSRF Hash + * Get CSRF Hash * - * Getter Method + * Getter Method * * @return string self::_csrf_hash */ @@ -215,6 +256,7 @@ public function get_csrf_token_name() * http://ha.ckers.org/xss.html * * @param mixed string or array + * @param bool * @return string */ public function xss_clean($str, $is_image = FALSE) @@ -263,7 +305,7 @@ public function xss_clean($str, $is_image = FALSE) */ $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); /* @@ -276,7 +318,7 @@ public function xss_clean($str, $is_image = FALSE) * * This prevents strings like this: ja vascript * NOTE: we deal with spaces between characters later. - * NOTE: preg_replace was found to be amazingly slow here on + * NOTE: preg_replace was found to be amazingly slow here on * large blocks of data, so we use str_replace. */ @@ -304,8 +346,8 @@ public function xss_clean($str, $is_image = FALSE) */ if ($is_image === TRUE) { - // Images have a tendency to have the PHP short opening and - // closing tags every so often so we skip those and only + // Images have a tendency to have the PHP short opening and + // closing tags every so often so we skip those and only // do the long opening tags. $str = preg_replace('/<\?(php)/i', "<?\\1", $str); } @@ -321,10 +363,10 @@ public function xss_clean($str, $is_image = FALSE) * These words are compacted back to their correct state. */ $words = array( - 'javascript', 'expression', 'vbscript', 'script', + 'javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window' ); - + foreach ($words as $word) { $temp = ''; @@ -341,8 +383,8 @@ public function xss_clean($str, $is_image = FALSE) /* * Remove disallowed Javascript in links or img tags - * We used to do some version comparisons and use of stripos for PHP5, - * but it is dog slow compared to these simplified non-capturing + * We used to do some version comparisons and use of stripos for PHP5, + * but it is dog slow compared to these simplified non-capturing * preg_match(), especially if the pattern exists in the string */ do @@ -405,11 +447,11 @@ public function xss_clean($str, $is_image = FALSE) /* * Images are Handled in a Special Way - * - Essentially, we want to know that after all of the character - * conversion is done whether any unwanted, likely XSS, code was found. + * - Essentially, we want to know that after all of the character + * conversion is done whether any unwanted, likely XSS, code was found. * If not, we return TRUE, as the image is clean. - * However, if the string post-conversion does not matched the - * string post-removal of XSS, then it fails, as there was unwanted XSS + * However, if the string post-conversion does not matched the + * string post-removal of XSS, then it fails, as there was unwanted XSS * code found and removed/changed during processing. */ @@ -478,7 +520,7 @@ public function entity_decode($str, $charset='UTF-8') // correctly. html_entity_decode() does not convert entities without // semicolons, so we are left with our own little solution here. Bummer. - if (function_exists('html_entity_decode') && + if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8')) { $str = html_entity_decode($str, ENT_COMPAT, $charset); @@ -505,6 +547,7 @@ public function entity_decode($str, $charset='UTF-8') * Filename Security * * @param string + * @param bool * @return string */ public function sanitize_filename($str, $relative_path = FALSE) @@ -542,7 +585,7 @@ public function sanitize_filename($str, $relative_path = FALSE) "%3b", // ; "%3d" // = ); - + if ( ! $relative_path) { $bad[] = './'; @@ -570,7 +613,7 @@ protected function _compact_exploded_words($matches) } // -------------------------------------------------------------------- - + /* * Remove Evil HTML Attributes (like evenhandlers and style) * @@ -578,7 +621,7 @@ protected function _compact_exploded_words($matches) * - Everything up until a space * For example, everything between the pipes: * - * - Everything inside the quotes + * - Everything inside the quotes * For example, everything between the pipes: * * @@ -594,12 +637,12 @@ protected function _remove_evil_attributes($str, $is_image) 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", @@ -607,10 +650,10 @@ protected function _remove_evil_attributes($str, $is_image) $str, -1, $count ); } while ($count); - + return $str; } - + // -------------------------------------------------------------------- /** @@ -627,7 +670,7 @@ protected function _sanitize_naughty_html($matches) $str = '<'.$matches[1].$matches[2].$matches[3]; // encode captured opening or closing brace to prevent recursive vectors - $str .= str_replace(array('>', '<'), array('>', '<'), + $str .= str_replace(array('>', '<'), array('>', '<'), $matches[4]); return $str; @@ -649,7 +692,7 @@ protected function _sanitize_naughty_html($matches) protected function _js_link_removal($match) { $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - + return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); - + return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|xss_hash()."\\1=\\2", $str); /* @@ -769,7 +812,7 @@ protected function _validate_entities($str) * Un-Protect GET variables in URLs */ $str = str_replace($this->xss_hash(), '&', $str); - + return $str; } @@ -794,7 +837,7 @@ protected function _do_never_allowed($str) { $str = preg_replace("#".$key."#i", $val, $str); } - + return $str; } @@ -809,16 +852,16 @@ protected function _csrf_set_hash() { if ($this->_csrf_hash == '') { - // If the cookie exists we will use it's value. + // If the cookie exists we will use it's value. // We don't necessarily want to regenerate it with - // each page load since a page could contain embedded + // each page load since a page could contain embedded // sub-pages causing this feature to fail - if (isset($_COOKIE[$this->_csrf_cookie_name]) && + if (isset($_COOKIE[$this->_csrf_cookie_name]) && $_COOKIE[$this->_csrf_cookie_name] != '') { return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name]; } - + return $this->_csrf_hash = md5(uniqid(rand(), TRUE)); } diff --git a/system/core/URI.php b/system/core/URI.php old mode 100644 new mode 100755 index d5654865..10b0b7fa --- a/system/core/URI.php +++ b/system/core/URI.php @@ -28,9 +28,34 @@ */ class CI_URI { + /** + * List of cached uri segments + * + * @var array + * @access public + */ var $keyval = array(); + /** + * Current uri string + * + * @var string + * @access public + */ var $uri_string; + /** + * List of uri segments + * + * @var array + * @access public + */ var $segments = array(); + /** + * Re-indexed list of uri segments + * Starts at 1 instead of 0 + * + * @var array + * @access public + */ var $rsegments = array(); /** @@ -127,6 +152,7 @@ function _fetch_uri_string() * Set the URI String * * @access public + * @param string * @return string */ function _set_uri_string($str) @@ -366,6 +392,11 @@ function uri_to_assoc($n = 3, $default = array()) /** * Identical to above only it uses the re-routed segment array * + * @access public + * @param integer the starting segment number + * @param array an array of default values + * @return array + * */ function ruri_to_assoc($n = 3, $default = array()) { diff --git a/system/database/DB.php b/system/database/DB.php old mode 100644 new mode 100755 index 33207d88..8314d3b9 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -21,6 +21,8 @@ * @category Database * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ + * @param string + * @param bool Determines if active record should be used or not */ function &DB($params = '', $active_record_override = NULL) { @@ -35,7 +37,7 @@ function &DB($params = '', $active_record_override = NULL) show_error('The configuration file database.php does not exist.'); } } - + include($file_path); if ( ! isset($db) OR count($db) == 0) From 3b800cd360411551c6538a7cb8373ba1a6bdc04c Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Mon, 15 Aug 2011 13:57:31 +0200 Subject: [PATCH 2543/2544] Readded redis to valid cache drivers. --- system/libraries/Cache/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index 61e7aa76..fde2f109 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -27,7 +27,7 @@ class CI_Cache extends CI_Driver_Library { protected $valid_drivers = array( - 'cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy' + 'cache_apc', 'cache_file', 'cache_memcached', 'cache_redis', 'cache_dummy' ); protected $_cache_path = NULL; // Path of cache files (if file-based cache) From 893aaddaa0a2e8dca77e80d49093678a837123aa Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Wed, 17 Aug 2011 12:57:08 +0200 Subject: [PATCH 2544/2544] Only call the error_reporting function is it's active and present. --- index.php | 9 +++++++-- system/core/Common.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index f4ac11a7..12618c62 100644 --- a/index.php +++ b/index.php @@ -33,17 +33,22 @@ switch (ENVIRONMENT) { case 'development': - error_reporting(E_ALL); + $error_level = E_ALL; break; case 'testing': case 'production': - error_reporting(0); + $error_level = 0; break; default: exit('The application environment is not set correctly.'); } + + if (isset($error_level) && function_exists('error_reporting')) + { + error_reporting($error_level); + } } /* diff --git a/system/core/Common.php b/system/core/Common.php index db9fbeb9..98b84300 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -482,7 +482,7 @@ function _exception_handler($severity, $message, $filepath, $line) // Should we display the error? We'll get the current error_reporting // level and add its bits with the severity bits to find out. - if (($severity & error_reporting()) == $severity) + if (($severity & (int)ini_get('error_reporting')) == $severity) { $_error->show_php_error($severity, $message, $filepath, $line); }